打开一个终端,在终端中输入
sudo vim /etc/network/interfaces
把自带的都注释或者删除只留下下面两行
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
如果需要固定IP:
新开一个终端,在终端里输入
查看你的网卡名是什么
一般是 eth0
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.166
netmask 255.255.255.0
# dns-nameserver 8.8.8.8
dns-nameserver 8.8.8.8
重启