ubuntu 静态ip配置

sudo vi /etc/network/interfaces

1
2
3
4
5
6
auto eth0
iface eth0 inet static
address 192.168.8.100    
netmask 255.255.255.0
gateway 192.168.8.2
dns-nameserver 114.114.114.114

重启网络:sudo /etc/init.d/networking restart