- vim /etc/network/interfaces
- 修改成如下
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
auto eth0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.8
- 重启系统sudo reboot
图形界面左上application→setting→network connections,删掉除了eth0以外的其他网卡,这时图形界面右上角会显示disconnect,鼠标点上去,可以选择auto ethernet,这个时候就可以用自己的设置上网了.
网友评论