我需要将 Ubuntu 14.04 (64) 服务器连接到 Windows VPN。
我已经安装了SSTP 客户端 sstp-client (1.0.10)
与 lib,设置/etc/ppp/chap-secrets
和/etc/ppp/peers/mypeer
看起来,sudo pon mypeer
服务器上连接到了VPN。
$ sudo plog
Jun 8 04:20:08 sg2 pppd[61835]: local IP address 10.10.99.24
Jun 8 04:20:08 sg2 pppd[61835]: remote IP address 10.10.99.1
Jun 8 04:20:08 sg2 pppd[61835]: primary DNS address 10.10.10.9
Jun 8 04:20:08 sg2 pppd[61835]: secondary DNS address 10.10.10.10
Jun 8 04:20:08 sg2 pppd[61835]: Script /etc/ppp/ip-up started (pid 62219)
Jun 8 04:20:08 sg2 pppd[61835]: Script /etc/ppp/ip-up finished (pid 62219), status = 0x0
Jun 8 04:20:10 sg2 pppd[61835]: sent [CCP ConfReq id=0xb]
Jun 8 04:20:10 sg2 pppd[61835]: rcvd [CCP TermAck id=0xb]
Jun 8 04:20:10 sg2 pppd[61835]: sent [CCP TermReq id=0xc"No compression negotiated"]
Jun 8 04:20:10 sg2 pppd[61835]: rcvd [CCP TermAck id=0xc"No compression negotiated"]
转机前的路线:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.3 0.0.0.0 UG 0 0 0 eth0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
连接后的路线:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.3 0.0.0.0 UG 0 0 0 eth0
10.10.99.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
区别在于:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.99.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
据我了解,这定义了通过 ppp0 接口到主机 10.10.99.1 的路由
我无法解决的问题
1.我无法 ping 该主机,尽管我可以从连接到同一 VPN 的 Windows 工作站 ping 它。如何让它工作?
2.另外,如果我手动定义一条新路线:
$ sudo route add -net 10.10.0.0 netmask 255.255.0.0 gw 10.10.99.1
我看到了新路线:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 10.10.99.1 255.255.0.0 UG 0 0 0 ppp0
但我仍然无法访问 VPN 中的任何主机。我的路由有什么问题?
更新-ping
$ ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=2.92 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=59 time=2.60 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=59 time=2.99 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 2.603/2.839/2.994/0.169 ms
$ ping -c 3 -I ppp0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.10.99.2 ppp0: 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
更新-版本
也尝试过,sstp client (1.0.9)
但没有成功
答案1
使用命令行或 VPN 连接设置添加此路由:
route add -net 10.10.99.24 netmask 255.255.255.255 metric 1 gw 192.168.0.3