赞
踩
首先在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
最后,重新启动网络:
- sudo /etc/init.d/networking restart
-
- 或者
-
- sudo ifdown enp0s31f6 & sudo ifup enp0s31f6
以上完成是ok 的
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。