C:\\Users\\Administrator>ping www.google.com
正在 Ping www.google.com [216.58.197.100] 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。
配置好pptp ***客户端后发现ping谷歌只得到一个IP,但并没有ping通,此时需要加路由。谷歌是216.58.0.0/16网段的,加的时候这样加:
先route print看到接口列表里“××× 连接”的设备接口号为14
C:\\Users\\Administrator>route print
===========================================================================
接口列表
14...........................××× 连接
12...52 54 00 34 23 f4 ......Red Hat VirtIO Ethernet Adapter
1...........................Software Loopback Interface 1
13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
11...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
20...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
然后添加路由时if后面跟14(if即interface,后面跟14即指定设备号为刚才看到的“××× 连接”)
C:\\Users\\Administrator>route add 216.58.0.0/16 0.0.0.0 if 14
操作完成!
C:\\Users\\Administrator>ping www.google.com
正在 Ping www.google.com [216.58.197.100] 具有 32 字节的数据:
来自 216.58.197.100 的回复: 字节=32 时间=455ms TTL=48
来自 216.58.197.100 的回复: 字节=32 时间=453ms TTL=48
来自 216.58.197.100 的回复: 字节=32 时间=445ms TTL=48
来自 216.58.197.100 的回复: 字节=32 时间=411ms TTL=48
然后再打开浏览器访问谷歌,发现OK了。
CentOS下的操作如下,原理跟Windows下的一样,也是加路由。
#yum install ppp pptp pptp-setup
#pptpsetup --create my*** --server ***serverip --username user1 --password pwd1 --encrypt --start
[root@VM_41_171_centos ~]# ping -c 4 www.google.com
PING www.google.com (216.58.221.100) 56(84) bytes of data.
--- www.google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
#route add -net 216.58.0.0/16 dev ppp0
[root@VM_41_171_centos ~]# ping -c 4 www.google.com
PING www.google.com (216.58.197.100) 56(84) bytes of data.
64 bytes from hkg12s01-in-f4.1e100.net (216.58.197.100): icmp_seq=1 ttl=48 time=410 ms
64 bytes from hkg12s01-in-f4.1e100.net (216.58.197.100): icmp_seq=2 ttl=48 time=412 ms
64 bytes from hkg12s01-in-f4.1e100.net (216.58.197.100): icmp_seq=3 ttl=48 time=432 ms
64 bytes from hkg12s01-in-f4.1e100.net (216.58.197.100): icmp_seq=4 ttl=48 time=427 ms
#route del -net 216.58.0.0/16 dev ppp0
[root@VM_41_171_centos ~]# ping -c 4 www.google.com
PING www.google.com (216.58.221.100) 56(84) bytes of data.
--- www.google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
下面这句是恢复最初的默认路由,所有的路由都通过默认网关。
#ip route add default via 默认网关