Setting up network in Linux
Let's say:
ip Address : 111.222.111.222 (myhost.dswkim.org)
netmask : 255.255.255.0
gateway : 111.222.111.1
DNS server : 123.123.123.2
1) Network interface
# ifconfig eth0 111.222.111.222 netmask 255.255.255.0 up
2) Name Resolver
# vi /etc/resolv.conf
domain dswkim.org
search dswkim.org
nameserver 123.123.123.2
# vi /etc/host.conf
order host,bind
multi on
# vi /etc/hosts
127.0.0.1 localhost loopback
111.222.111.222 myhost myhost.dswkim.org
- Execute the following command:
# ifconfig lo 127.0.0.1
# route add -host 127.0.0.1 lo
To recap:
# ifconfig eth0 down
# ifconfig eth0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255 up
# ifconfig add -net 10.0.1.0 dev eth0
# route add default gw 10.0.1.1 dev eth0