设置静态IP:
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameserver 114.114.114.114
设置动态IP:
auto eth0
iface eth0 inet dhcp
使用
/etc/init.d/networking restart
重启网络服务