ubuntu9.04 ip配置

来源:互联网 发布:windows arp 老化时间 编辑:程序博客网 时间:2024/05/20 21:22

sudo gedit /etc/network/interfaces 

#设置静态IP 
auto eth0 

iface eth0 inet static 
address 192.168.1.10 
netmask 255.255.255.0 
#broadcast 192.168.1.255 
gateway 192.168.1.1 

#设置动态dhcp 
auto eth0 inet dhcp 

上面两个设置二选一就行了,看哪个适合你。 


sudo gedit /etc/resolv.conf 

#设置DNS server(可以设置多个) 
nameserver 192.168.1.1 

 

#然后,关闭网络设备

#ifconfig eth0 inet down


#重新设置网络 
sudo /etc/init.d/networking restart 

原创粉丝点击