ubuntu network config

1. config network:

sudo vi /etc/network/interfaces

     the configuration:

auto eth0
iface eth0 inet static
address 172.16.9.144
gateway 172.16.9.254
netmask 255.255.255.0
network 172.16.9.0
broadcast 172.16.9.255
sudo /etc/init.d/networking restart
 

2.  config dns

sudo vi /etc/resolv.conf
nameserver 124.16.136.254

if /etc/resolv.con does not exists, it will be created here.

if vmware is used,set the network adapter to bridged.

3. Dynamically getting IP configuration

Use the default config in /etc/network/interfaces

   auto lo  
   iface lo inet loopback 
 

4. Restart eth0

$ sudo ifdown eth0
 
$ sudo ifup eth0
 

猜你喜欢

转载自kaqi.iteye.com/blog/964036