vmware能够ping通内网,上不了外网的解决方法

时间:2022-01-10 05:45:38

一般这是由于里面的路由域名服务器没有配置好。

issta@ubuntu:~$ ping www.baidu.com 
ping: unknown host www.baidu.com 

先看一下地址解析器:

issta@ubuntu:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) 
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN 
nameserver 127.0.0.1

发现只是解析内网循环的。

所以添加google的域名服务器

issta@ubuntu:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) 
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN 
nameserver 127.0.0.1 
nameserver 202.98.96.68 
nameserver 61.139.2.69

 

加了这两个一般就可以了。后续雄起。。哈哈。

issta@ubuntu:~$ ping www.baidu.com 
PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data. 
64 bytes from 115.239.210.27: icmp_req=1 ttl=48 time=8.43 ms 
64 bytes from 115.239.210.27: icmp_req=2 ttl=48 time=7.95 ms 
^C64 bytes from 115.239.210.27: icmp_req=3 ttl=48 time=8.05 ms

--- www.a.shifen.com ping statistics --- 
3 packets transmitted, 3 received, 0% packet loss, time 10134ms 
rtt min/avg/max/mdev = 7.957/8.147/8.434/0.219 ms