我尝试使用办公室 LAN 连接到 VPN,我可以连接到 VPN,但无法访问互联网。当我连接到其他网络时,情况也一样,我也可以连接到 VPN 和互联网。
我的配置如下:-
操作系统:Ubuntu 16.04 VPN:Open VPN
ifconfig 输出 连接到 VPN 之前
enp0s25 Link encap:Ethernet HWaddr 2c:44:fd:63:df:83
inet addr:10.0.0.93 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::f5d9:ee22:b489:d2ba/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:181232 errors:0 dropped:1 overruns:0 frame:0
TX packets:61406 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:154438878 (154.4 MB) TX bytes:6621250 (6.6 MB)
Interrupt:17 Memory:d4700000-d4720000
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:23789 errors:0 dropped:0 overruns:0 frame:0
TX packets:23789 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2224629 (2.2 MB) TX bytes:2224629 (2.2 MB)
wlo1 Link encap:Ethernet HWaddr 3c:a9:f4:3b:7b:10
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:4549 errors:0 dropped:0 overruns:0 frame:0
TX packets:4846 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3299450 (3.2 MB) TX bytes:1170732 (1.1 MB)
连接到 VPN 后的 ifconfig 输出
enp0s25 Link encap:Ethernet HWaddr 2c:44:fd:63:df:83
**inet addr:10.0.0.93 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::f5d9:ee22:b489:d2ba/64 Scope:Link**
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:156443 errors:0 dropped:1 overruns:0 frame:0
TX packets:54451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:144931751 (144.9 MB) TX bytes:5617217 (5.6 MB)
Interrupt:17 Memory:d4700000-d4720000
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:21766 errors:0 dropped:0 overruns:0 frame:0
TX packets:21766 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2004164 (2.0 MB) TX bytes:2004164 (2.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.27.232.54 P-t-P:172.27.232.54 Mask:255.255.248.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:3452 (3.4 KB)
wlo1 Link encap:Ethernet HWaddr 3c:a9:f4:3b:7b:10
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:4549 errors:0 dropped:0 overruns:0 frame:0
TX packets:4846 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3299450 (3.2 MB) TX bytes:1170732 (1.1 MB)
使用其他网络连接到 VPN 后的 ifconfig 输出
enp0s25 Link encap:Ethernet HWaddr 2c:44:fd:63:df:83
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:154946 errors:0 dropped:1 overruns:0 frame:0
TX packets:53291 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:144230899 (144.2 MB) TX bytes:5401318 (5.4 MB)
Interrupt:17 Memory:d4700000-d4720000
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:18830 errors:0 dropped:0 overruns:0 frame:0
TX packets:18830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:1789433 (1.7 MB) TX bytes:1789433 (1.7 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.27.232.53 P-t-P:172.27.232.53 Mask:255.255.248.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:145 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:14874 (14.8 KB) TX bytes:19139 (19.1 KB)
wlo1 Link encap:Ethernet HWaddr 3c:a9:f4:3b:7b:10
inet addr:192.168.43.123 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::24f8:b818:fb99:64dc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3572 errors:0 dropped:0 overruns:0 frame:0
TX packets:3776 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2547720 (2.5 MB) TX bytes:884524 (884.5 KB)
答案1
检查 openvpn 配置并添加route-nopull
指令以防止通过 VPN 转发所有流量。