按照本指南,我在CentOS 6 (PPTP)上build立了一个VPN服务器。
服务器端
使用ifconfig
ppp0 Link encap:Point-to-Point Protocol inet addr:192.168.1.15 PtP:192.168.1.200 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1 RX packets:5005 errors:0 dropped:0 overruns:0 frame:0 TX packets:4486 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:560341 (547.2 KiB) TX bytes:2200506 (2.0 MiB) ppp1 Link encap:Point-to-Point Protocol inet addr:192.168.1.15 PtP:192.168.1.201 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1 RX packets:478 errors:0 dropped:0 overruns:0 frame:0 TX packets:472 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:30799 (30.0 KiB) TX bytes:60845 (59.4 KiB)
路线-n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.201 0.0.0.0 255.255.255.255 UH 0 0 0 ppp1 192.168.1.200 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
我有两个客户端成功连接到隧道,一个是运行CentOS的Linux机器,另一个是android设备,分别指派ips 192.168.1.201和192.168.1.200 。
现在从我的CentOS客户端(192.168.1.201),我无法ping安卓设备(192.168.1.200),添加路由IP路由添加192.168.1.0networking掩码255.255.255.255 dev ppp0
也没有帮助…
也plz指导如何路由我所有的CentOS客户端stream量通过隧道,因为当我检查我的公共IP它显示客户端的路线相同的IP前后连接到VPN服务器
CentOS客户端
使用ifconfig
ppp0 Link encap:Point-to-Point Protocol inet addr:192.168.1.201 PtP:192.168.1.15 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1 RX packets:239 errors:0 dropped:0 overruns:0 frame:0 TX packets:239 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:19632 (19.1 KiB) TX bytes:19638 (19.1 KiB)
路线-n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 122.121.34.333 192.168.1.1 255.255.255.255 UGH 0 0 0 wlan0 192.168.1.15 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
其中122.121.34.333是vpn服务器的公共ip
问候。