How to Config A NIC under Linux

Sep 14, 2010 00:00

...or any Unix, also MacOS X, etc.

Here the IP address is 192.168.1.65 with gateway/DNS server on 192.168.1.254.

ifconfig eth0 192.168.1.65 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth0 up [optional - activates the interface if it is off]
route add -net 192.168.1.0 netmask 255.255.255.0 - add the basic route
route add default gw 192.168.1.254 - gateway

In etc/resolv.conf - the great mystery!

search localhost.localdomain [replace with the box's hostname, or it won't work]
nameserver 192.168.1.254
nameserver someotherDNSserver

linux, systems administration

Previous post Next post
Up