我有一个 WiFi 适配器,其中有三个接口wlan0
(默认路由)、uvpn0
(VPN 接口)和usb0
(主机和适配器之间的接口)。
usb0 Link encap:Ethernet HWaddr DA:CE:84:EA:A3:E3
inet addr:10.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::d8ce:84ff:feea:a3e3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49190 errors:0 dropped:0 overruns:0 frame:0
TX packets:123259 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8718640 (8.3 MiB) TX bytes:150323744 (143.3 MiB)
uvpn0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.87.0.3 P-t-P:10.87.0.3 Mask:255.255.0.0
UP POINTOPOINT RUNNING MTU:1420 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:368 (368.0 B) TX bytes:1552 (1.5 KiB)
wlan0 Link encap:Ethernet HWaddr D0:17:69:EC:A2:E4
inet addr:10.117.176.210 Bcast:10.117.176.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:121589 errors:0 dropped:0 overruns:0 frame:0
TX packets:43659 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:143066201 (136.4 MiB) TX bytes:6608011 (6.3 MiB)
目前,互联网流量是通过该wlan0
接口进行的。我希望互联网流量通过 VPN 服务器10.87.0.1
。我尝试了以下操作
- 通过添加以下命令更改默认路由
ip route add default via 10.87.0.1 dev uvpn0
当我添加上面的命令时。我无法从加密狗 ping 到 VPN 服务器。
- 我还添加了IP规则
iptables -t nat -A POSTROUTING -s 10.117.176.0/24 -o uvpn0 -j MASQUERADE
我在这里缺少什么?