我有一个Ubuntu盒子上的bash脚本,它search最快的openvpn服务器,连接并绑定一个程序到tun0接口。 不幸的是,所有的stream量正在通过VPN传递。 有人知道发生了什么事吗?
相关的路线如下:
openvpn --daemon --config $cfile --auth-user-pass ipvanish.pass --status openvpn-status.log
当我inputsudo iptables --list时,似乎没有iptables中的任何条目。
configuration文件看起来像这样:
client dev tun proto tcp remote nyc-a04.ipvanish.com 443 resolv-retry infinite nobind persist-key persist-tun persist-remote-ip ca ca.ipvanish.com.crt tls-remote nyc-a04.ipvanish.com auth-user-pass comp-lzo verb 3 auth SHA256 cipher AES-256-CBC keysize 256 tls-cipher DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA
那里没有任何东西可以通过tun0来引导所有的东西,所以也许这是Ubuntu的新变种? 我不记得过去发生的事情。
编辑:这是ip r ls :
0.0.0.0/1 via 172.20.24.1 dev tun0 default via 192.168.0.1 dev eth1 proto static 128.0.0.0/1 via 172.20.24.1 dev tun0 172.20.24.0/22 dev tun0 proto kernel scope link src 172.20.27.20 192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.10 metric 1 216.151.180.2 via 192.168.0.1 dev eth1
ifconfig和一些混淆:
[$] <> ifconfig eth0 Link encap:Ethernet HWaddr *:*:*:*:*:* UP BROADCAST 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 Memory:fdbc0000-fdbe0000 eth1 Link encap:Ethernet HWaddr *:*:*:*:*:* inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: 2604:*:*:*:*:*:*:*/64 Scope:Global inet6 addr: fe80::223:54ff:fe07:6555/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:19923223 errors:0 dropped:1 overruns:0 frame:0 TX packets:35568399 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4692090933 (4.6 GB) TX bytes:56325183667 (56.3 GB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:77741 errors:0 dropped:0 overruns:0 frame:0 TX packets:77741 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:19058271 (19.0 MB) TX bytes:19058271 (19.0 MB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.20.27.20 PtP:172.20.27.20 Mask:255.255.252.0 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:15810638 errors:0 dropped:0 overruns:0 frame:0 TX packets:36553479 errors:0 dropped:146946 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:872811046 (872.8 MB) TX bytes:49841453877 (49.8 GB)
您可以在.ovpnconfiguration文件中使用类似于以下内容的configuration来在客户端中configuration拆分隧道:
route-nopull route 172.20.24.0 255.255.252.0 vpn_gateway
第一行禁用路由。 第二行添加静态路由。
你可能会更好地解决这个问题,但我假设你正在寻找一个客户端解决scheme。
它看起来像服务器被configuration为推送路由到客户端的东西
push "redirect-gateway"
你让一个客户端忽略所有的路由
route-nopull
指令在客户端configuration文件。