我无法使我的VPN客户端打开工作。 实际的VPN连接工作正常,我能够从路由器访问远程networking,但是当我的VPN活动它closures我的互联网连接。 它似乎试图通过VPN路由所有stream量。 现在我尝试使用“route_noexec”这个选项,它具有我无法再访问远程networking的效果。 到目前为止,我没有手动添加VPN路由。
这是我的VPN客户端configuration:
config openvpn 'sample_client' option client '1' option dev 'tun' option resolv_retry 'infinite' option nobind '1' option persist_key '1' option persist_tun '1' option comp_lzo 'yes' option verb '3' option remote '*******.com 1194' option cipher 'AES-128-CBC' option reneg_sec '3600' option enabled '1' option proto 'tcp' option auth 'SHA1' option pkcs12 '/lib/uci/upload/cbid.openvpn.sample_client.pkcs12' option route_noexec '1'
ifconfig tun0:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:192.168.254.7 PtP:192.168.254.7 Mask:255.255.255.0 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
另外我build立了一个VPN接口:
config interface 'VPN' option ifname 'tun0' option _orig_ifname 'tun0' option _orig_bridge 'false' option proto 'none' config route option interface 'VPN' option target '10.0.0.1' option netmask '255.255.255.0' option gateway '192.168.254.1'
…和防火墙configuration:
config forwarding option dest 'VPN' option src 'lan' config forwarding option dest 'wan' option src 'lan' config forwarding option dest 'lan' option src 'VPN' config forwarding option dest 'lan' option src 'wan'
我相信我的主要问题是路由部分,但我不确定是否诚实。
任何意见是极大的赞赏!
更新1:
我现在手动添加路由:
route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.168.254.1
现在,我可以从路由器上ping VPN,但其余networking仍然无法访问它。
我的路由表如下所示:
root@OpenWrt:~# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10.2.0.1 0.0.0.0 UG 0 0 0 eth1 10.0.0.0 192.168.254.1 255.255.255.0 UG 0 0 0 tun0 10.1.0.0 * 255.255.255.0 U 0 0 0 br-lan 10.2.0.0 * 255.255.255.0 U 0 0 0 eth1 10.2.0.1 * 255.255.255.255 UH 0 0 0 eth1 192.168.254.0 * 255.255.255.0 U 0 0 0 tun0
我想你可以做到这一点通过使用路由表更改默认网关,只要你想要的路由ips你想要的VPNnetworking
我想这个链接将帮助你: http : //www.cyberciti.biz/faq/howto-linux-configuring-default-route-with-ipcommand/
我find了解决scheme。 我不得不将防火墙configuration更新到拒绝从LAN到VPN转发的地方,并且还允许伪装和MSSlocking。