ubuntu静态ip设置和能ping通局域网但不能ping通外网解决
静态ip设置:(1)步骤一:(2)步骤二:(3)步骤三:设置ip地址cat /etc/network/interfacesinterfaces(5) file used by ifup(8) and ifdown(8)#auto lo#iface lo inet loopbackauto loiface lo inet loopbackauto ens33iface ens33 inet stat
静态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
.解决方法: 步骤一:(1)vi /etc/resolv.conf
步骤二:(2)nameserver 114.114.114.114
解决方法3:
vim /etc/systemd/resolved.conf
添加
DNS=8.8.8.8 114.114.114.114
保存 重启生效
更多推荐
所有评论(0)