静态ip设置:
(1)步骤一:
(2)步骤二:
(3)步骤三: 设置ip地址
cat /etc/network/interfaces
interfaces(5) file used by ifup(8) and ifdown(8)
#auto lo
#iface lo inet loopback
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.30.191
gateway 192.168.30.1
gateway 192.168.5.1
route add default gw 192.168.30.1
netmask 255.255.255.0
(4)步骤4: ping 192.168.30.192
发现能通 但是ping www.baidu.com ping 不通
reboot
(5)不能ping通外网解决:
cat /etc/resolvconf/resolv.conf.d/base
nameserver 114.114.114.114
ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.