Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Linux >> How to configure default gateway and DNS servers for static IP

e.g. for interface eth0

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
IPADDR=x.x.x.x
NETMASK=x.x.x.x
GATEWAY=x.x.x.x
DNS1=x.x.x.x
DNS2=x.x.x.x

... if the gateway is the default gateway, also add following line
DEFROUTE=yes

restart networking

# /etc/rc.d/init.d/network stop

# /etc/rc.d/init.d/network start

you will notice that the file /etc/resolv.conf will then have the entry

nameserver x.x.x.x

 

 

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]