首先在shell 下:查看ip地址
ifconfig 或者 ip address可以看到本地网络适配器是:enp0s31f6
其次,修改/etc/network/interfaces 内容编辑器是vim or gedit 都是ok,
sudo vim /etc/network/interfaces 原本里面是这些# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.2.56
netmask 255.255.255.0
gateway 192.168.2.1
iface enp0s31f6 inet6 auto
dns-nameserver 8.8.8.8
最后,重新启动网络:
以上完成是ok 的