VPN连接后无法访问网络,DNS无法解析

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

Re: VPN连接后无法访问网络,DNS无法解析

#16

帖子 xiaoxioa »

poloshiao 写了:
我使用的 AventailConnect 客户端
# Aventail VPN ConnectionGenerated, to restore copy from /etc/resolv.conf.Sonicwall
看看 這一篇 及其連結文章 能否幫你
http://superuser.com/questions/141834/c ... ux-machine
Connecting to a SonicWall VPN from a Linux machine
感谢回复,您提供的这个地址中的连接我这无法打开。
随后从同事那得到了一个Aventail其他版本的客户端,可以登录成功但无法使用tun0虚拟网卡完成通讯。

Aventail程序目录

代码: 全选

root@xxx:/usr/local/Aventail# ll
total 3348
drwxr-xr-x  6 root root    4096 8月  16 21:09 ./
drwxr-xr-x 14 root root    4096 2月  21 22:08 ../
-rwsr-xr-x  1 root root 3317824 2月  21 22:08 AvConnect*
lrwxrwxrwx  1 root root      14 8月  15 11:05 certs -> /etc/ssl/certs/
-rw-r--r--  1 root root   17593 2月  21 22:08 cttel.pl
drwxr-xr-x  2 root root    4096 2月  21 22:08 help/
drwxr-xr-x  2 root root    4096 2月  21 22:08 lib/
-rw-r--r--  1 root root   11368 2月  21 22:08 logo.png
drwxr-xr-x  2 root root    4096 2月  21 22:08 man/
-rw-r--r--  1 root root   30365 8月  16 21:02 nmdc
drwxr-xr-x  2 root root    4096 2月  21 22:08 nui/
-rwxr-xr-x  1 root root    1911 2月  21 22:08 startct.sh*
-rwxr-xr-x  1 root root    2063 2月  21 22:08 startctui.sh*
-rwxr-xr-x  1 root root    1239 2月  21 22:08 uninstall.sh*
-rw-r--r--  1 root root      10 8月  15 11:05 version
AvConnect负责连通VPN Server,read/writetun0字符设备数据。

后来分析了下Aventail VPN的通讯流程大概如下:

代码: 全选

root@xxx:/home/xxx/Desktop/vpn# netstat -anlp | grep 967
tcp        0      0 10.13.75.151:41596      111.200.23.250:443      ESTABLISHED 967/AvConnect
tcp        0      0 127.0.0.1:34964         127.0.0.1:39980         ESTABLISHED 967/AvConnect


root@xxx:/home/xxx/Desktop/vpn# netstat -anlp | grep 34964
tcp        0      0 127.0.0.1:34964         127.0.0.1:39980         ESTABLISHED 967/AvConnect
tcp6       0      0 127.0.0.1:39980         127.0.0.1:34964         ESTABLISHED 740/java
PID : 740
是VPN客户端,客户端启动Socket server侦听39980端口,Server启动后调起AvConnect 并传出-p39980,
PID : 967
AvConnect进程,连通VPN Server,负责所有与VPN Server的通讯。
AvConnect通过 -p39980连通VPN客户端。AvConnect启动后向VPN Server发送各种指令获取密钥、dns和路由表数据,并传递给VPN客户端39980端口用于日志输出。

代码: 全选

ping 111.13.101.208

数据发送过程:
1、发送ICMP协议,路由到tun0
2、AvConnect通过tun0字符设备读取数据
3、AvConnect做部分数据加工后,通过41596端口发送到VPN Server。

VPN连通后,发现tun0所有的数据包都丢失了。
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.13.15.156 P-t-P:10.13.15.156 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:179 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:52 (52.0 B)

怀疑可能出错的过程:
1、创建tun0部分信息错误;
2、AvConnect无法从tun0设备获取信息;
3、AvConnect read tun0设备数据后无法发送到VPN Server端。(但通过wlps30网卡是能ping通VPN Server,亦能正常获取到dns、route数据,这条也能排除)

AvConnect是个可执行文件,没有想到反编译的办法,不能确定哪儿的问题。AvConnect自带的debug日志非常的少。

代码: 全选

2016-08-17 11:47:40 [0x7f19f38b7780] I - ctssl.cpp:Initialize - Intializing SSL[OpenSSL 1.0.1q 3 Dec 2015] ss[0] rc[/usr/local/Aventail] uc[/root/AventailConnect/library/certificates]
2016-08-17 11:47:40 [0x7f19f38b7780] D - ctssl.cpp:SetupSSLVerifyLocation - using </usr/local/Aventail/certs>(directory) for root certificates
2016-08-17 11:47:40 [0x7f19f38b7780] D - ctssl.cpp:GetPublicCerts - cert count-l<0> count<0>
2016-08-17 11:47:40 [0x7f19f38b7780] I - ctcurl.h:Initialize - Intializing Curl[7.46.0] code[0 - 1]
2016-08-17 11:47:40 [0x7f19f38b7780] D - AventailConnectService.cpp:Intialize - rv<1>
2016-08-17 11:47:40 [0x7f19f38b7780] E - AventailConnectService.cpp:Start - IPC port, undefined
2016-08-17 11:47:40 [0x7f19f38b7780] D - ctcurl.h:UnInitialize - inited<1>
2016-08-17 11:47:40 [0x7f19f38b7780] D - ctssl.cpp:UnInitialize - UnIntializing count<0>
2016-08-17 11:47:40 [0x7f19f38b7780] D - ctssl.cpp:UnInitialize -  SSL UnIntialization done.
2016-08-17 11:47:40 [0x7f19f38b7780] D - AventailConnectService.cpp:Start - rv<22>
2016-08-17 11:47:40 [0x7f19f38b7780] D - Main.cpp:main - AventailConnectService Done<22>
2016-08-17 11:47:40 [0x7f19f38b7780] I - Closing Log

@poloshiao 是否有方法反编译AvConnect可执行文件, 或者监控tun0运作情况(状态、发送的数据、接收的数据)
已加载的和tunnel相关的内核模块信息

代码: 全选

root@xxx:~/AventailConnect/library/logs# lsmod | grep tunnel
xfrm4_mode_tunnel      16384  0
xfrm4_tunnel           16384  0
udp_tunnel             16384  0
mpls_iptunnel          16384  0
mpls_router            24576  1 mpls_iptunnel
tunnel6                16384  0
tunnel4                16384  2 ipip,xfrm4_tunnel

root@xxx:/dev/net# ll
total 0
drwxr-xr-x  2 root root      60 8月  14 16:37 ./
drwxr-xr-x 20 root root    4440 8月  17 11:36 ../
crw-rw-rw-  1 root root 10, 200 8月  14 16:37 tun
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#17

帖子 poloshiao »

是VPN客户端,客户端启动Socket server侦听39980端口,Server启动后调起AvConnect 并传出-p39980,
AvConnect做部分数据加工后,通过41596发送到VPN Server。
你有沒有設定防火牆 ?
測試階段 可以先把 39980端口 / 41596端口 的 tcp / udp / icmp 進出都開放

防火牆
https://help.ubuntu.com/community/UFW # 預裝 需要啟用 只管制進入 是 Iptables 的前端
https://help.ubuntu.com/community/IptablesHowTo # 預裝 需要啟用 進出都管制
inet addr:10.13.15.156 P-t-P:10.13.15.156 Mask:255.255.255.255
還是對這兩個 IPv4 一樣 有意見
P-t-P:10.13.15.156 這個網址 通常是 gateway
兩者一樣 表示 你的 tun 端口 剛好是 gateway ?
請詳細參考提供 VPN 帳號的供應商 的文件 有關 gateway 的描述
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

Re: VPN连接后无法访问网络,DNS无法解析

#18

帖子 xiaoxioa »

poloshiao 写了:
是VPN客户端,客户端启动Socket server侦听39980端口,Server启动后调起AvConnect 并传出-p39980,
AvConnect做部分数据加工后,通过41596发送到VPN Server。
你有沒有設定防火牆 ?
測試階段 可以先把 39980端口 / 41596端口 的 tcp / udp / icmp 進出都開放
查看ufw status,是关闭着的。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#19

帖子 poloshiao »

是否有方法反编译AvConnect可执行文件, 或者监控tun0运作情况(状态、发送的数据、接收的数据)
試試
http://manpages.ubuntu.com/manpages/xen ... ath.8.html
tracepath (for IPv4)
tracepath6 (for IPv6)
可以追蹤經過的路徑的 IP
看看 是停在哪裡
每經過一個 IP 稱為一個 hop
預設 30 個 hops 還沒到目的地 就自動停止
-m 參數可以改變 hops 設定值 可以加大
如果正常 可以顯示出 tunnel 的兩端的 IP (tunnel 中間的 IP 不會顯示)
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

Re: VPN连接后无法访问网络,DNS无法解析

#20

帖子 xiaoxioa »

poloshiao 写了:
是否有方法反编译AvConnect可执行文件, 或者监控tun0运作情况(状态、发送的数据、接收的数据)
試試
http://manpages.ubuntu.com/manpages/xen ... ath.8.html
tracepath (for IPv4)
tracepath6 (for IPv6)
可以追蹤經過的路徑的 IP
看看 是停在哪裡
每經過一個 IP 稱為一個 hop
預設 30 個 hops 還沒到目的地 就自動停止
-m 參數可以改變 hops 設定值 可以加大
如果正常 可以顯示出 tunnel 的兩端的 IP (tunnel 中間的 IP 不會顯示)
tracepath dns

代码: 全选

tracepath 10.13.6.3
1? LOCALHOST    pmtu 1396
1: send failed
1: send faile
Resume:pmtu 1396
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#21

帖子 poloshiao »

tracepath 10.13.6.3
1? LOCALHOST pmtu 1396
1: send failed
1: send faile
Resume:pmtu 1396
表示你連 10.13.15.156 都沒送達
檢查你安裝/設定的 VPN Client 及 route
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

Re: VPN连接后无法访问网络,DNS无法解析

#22

帖子 xiaoxioa »

poloshiao 写了:
tracepath 10.13.6.3
1? LOCALHOST pmtu 1396
1: send failed
1: send faile
Resume:pmtu 1396
表示你連 10.13.15.156 都沒送達
檢查你安裝/設定的 VPN Client 及 route
但我tracepath的时候,tcpdump能看到发送目的地址是dns的udp和tcp数据报文
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#23

帖子 poloshiao »

但我tracepath的时候,tcpdump能看到发送目的地址是dns的udp和tcp数据报文
1. VPN 可以使用 TCP 及 UDP
tcpdump 可以使用 TCP 及 UDP
tracepath 使用 UDP
查證一下 你的 VPN 設定使用 TCP 還是 UDP ?

2. 如果是 TCP 試試 (注意 下述兩個 追蹤的是路由 不是路徑)
2-1. http://manpages.ubuntu.com/manpages/xen ... .db.1.html
traceroute
這個容易受到防火牆阻擋
2-2. http://manpages.ubuntu.com/manpages/xen ... .mt.1.html
tcptraceroute
這個比較不容易受到防火牆阻擋
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#24

帖子 poloshiao »

你有沒有設定防火牆 ?
測試階段 可以先把 39980端口 / 41596端口 的 tcp / udp / icmp 進出都開放
防火牆
https://help.ubuntu.com/community/UFW # 預裝 需要啟用 只管制進入 是 Iptables 的前端
https://help.ubuntu.com/community/IptablesHowTo # 預裝 需要啟用 進出都管制
查看 ufw status,是关闭着的。
iptables -A FORWARD -i wlp3s0 -o tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o wlp3s0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
1. 已經啟用了 iptables
防火牆 wlp3s0 轉發 tun0
防火牆 tun0 轉發 wlp3s0
防火牆 nat 轉向 偽裝
1-1. ufw 只是 iptables 前端程式
已經啟用了 iptables
可以不啟用 ufw
enp0s25 Link encap:Ethernet HWaddr 3c:97:0e:e6:3b:ca
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:20 Memory:f2500000-f2520000
2. 有線網卡 沒有數據包 進出
wlp3s0 Link encap:Ethernet HWaddr 70:18:8b:f7:87:1b
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::cb43:588c:559b:f390/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:485 errors:0 dropped:0 overruns:0 frame:0
TX packets:642 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:189175 (189.1 KB) TX bytes:142808 (142.8 KB)
3. 無線網卡 有數據包 進出

4. 檢查
把下面指令 複製 貼進終端機 執行
4-1. sudo iptables -L -n -v | grep 39980
4-2. sudo iptables -L -n -v | grep 41596
4-3. sudo route -n -v
4-4. sudo tracepath 192.168.1.100
4-5. sudo traceroute 192.168.1.100
把結果全部直接 選取/複製/貼上來
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

Re: VPN连接后无法访问网络,DNS无法解析

#25

帖子 xiaoxioa »

端口是动态的,每次连接端口都会变化。这次vpn客户端的端口是34910,AvConnect的端口是46474,AvConnect与VPN Server的交互端口是47522。

代码: 全选

root@xxx:/home/xxx/Desktop/vpn/20160818# ps -ef | grep sonic
root     11941  1297  0 10:15 ?        00:00:00 /usr/local/Aventail/AvConnect --app-dir=/root/.sonicwall -d -p34910
root     12373 12238  0 10:38 pts/8    00:00:00 grep --color=auto sonic
root@xxx:/home/xxx/Desktop/vpn/20160818# netstat -anlp | grep 11941
tcp        0      0 127.0.0.1:46474         127.0.0.1:34910         ESTABLISHED 11941/AvConnect 
tcp        0      0 10.13.75.151:47522      111.200.23.250:443      ESTABLISHED 11941/AvConnect 
udp        0      0 10.13.75.151:55533      0.0.0.0:*                           11941/AvConnect 
unix  3      [ ]         STREAM     CONNECTED     755952   11941/AvConnect     
unix  3      [ ]         STREAM     CONNECTED     755951   11941/AvConnect     
root@xxx:/home/xxx/Desktop/vpn/20160818# netstat -anlp | grep 46474
tcp        0      0 127.0.0.1:46474         127.0.0.1:34910         ESTABLISHED 11941/AvConnect 
tcp6       0      0 127.0.0.1:34910         127.0.0.1:46474         ESTABLISHED 11902/java 
iptables配置

代码: 全选

root@xxx:/home/xxx/Desktop/vpn/20160818# iptables -L -n -v
Chain INPUT (policy ACCEPT 76 packets, 11687 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  tun0   *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  wlp3s0 tun0    0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  tun0   wlp3s0  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  wlp3s0 tun0    0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  tun0   wlp3s0  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 9427 packets, 642K bytes)
 pkts bytes target     prot opt in     out     source               destination 
无forward数据包。
把下面指令 複製 貼進終端機 執行
4-1. sudo iptables -L -n -v | grep 39980
4-2. sudo iptables -L -n -v | grep 41596
4-3. sudo route -n -v
4-4. sudo tracepath 192.168.1.100
4-5. sudo traceroute 192.168.1.100
无匹配数据,上面iptables配置的是网卡数据转发

代码: 全选

4-1:
root@xxx:/home/xxx/Desktop/vpn/20160818# iptables -L -n -v | grep 46474
4-2:
root@xxx:/home/xxx/Desktop/vpn/20160818# iptables -L -n -v | grep 34910
路由表

代码: 全选

4-3:
root@xxx:/home/xxx/Desktop/vpn/20160818# cat routen 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.13.75.254    0.0.0.0         UG    600    0        0 wlp3s0
1.0.0.0         10.13.15.156    255.0.0.0       UG    0      0        0 tun0
2.0.0.0         10.13.15.156    254.0.0.0       UG    0      0        0 tun0
4.0.0.0         10.13.15.156    252.0.0.0       UG    0      0        0 tun0
8.0.0.0         10.13.15.156    254.0.0.0       UG    0      0        0 tun0
10.0.0.0        10.13.15.156    255.248.0.0     UG    0      0        0 tun0
10.8.0.0        10.13.15.156    255.252.0.0     UG    0      0        0 tun0
10.12.0.0       10.13.15.156    255.255.0.0     UG    0      0        0 tun0
10.13.0.0       10.13.15.156    255.255.248.0   UG    0      0        0 tun0
10.13.6.2       10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
10.13.6.3       10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
10.13.6.21      10.13.75.254    255.255.255.255 UGH   600    0        0 wlp3s0
10.13.8.0       10.13.15.156    255.255.252.0   UG    0      0        0 tun0
10.13.12.0      10.13.15.156    255.255.254.0   UG    0      0        0 tun0
10.13.14.0      10.13.15.156    255.255.255.0   UG    0      0        0 tun0
10.13.15.0      10.13.15.156    255.255.255.128 UG    0      0        0 tun0
10.13.15.128    10.13.15.156    255.255.255.240 UG    0      0        0 tun0
10.13.15.144    10.13.15.156    255.255.255.248 UG    0      0        0 tun0
10.13.15.152    10.13.15.156    255.255.255.252 UG    0      0        0 tun0
10.13.15.157    10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
10.13.15.158    10.13.15.156    255.255.255.254 UG    0      0        0 tun0
10.13.15.160    10.13.15.156    255.255.255.224 UG    0      0        0 tun0
10.13.15.192    10.13.15.156    255.255.255.192 UG    0      0        0 tun0
10.13.16.0      10.13.15.156    255.255.240.0   UG    0      0        0 tun0
10.13.32.0      10.13.15.156    255.255.224.0   UG    0      0        0 tun0
10.13.64.0      10.13.15.156    255.255.248.0   UG    0      0        0 tun0
10.13.72.0      10.13.15.156    255.255.254.0   UG    0      0        0 tun0
10.13.74.0      10.13.15.156    255.255.255.0   UG    0      0        0 tun0
10.13.75.0      10.13.15.156    255.255.255.128 UG    0      0        0 tun0
10.13.75.0      0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0
10.13.75.128    10.13.15.156    255.255.255.240 UG    0      0        0 tun0
10.13.75.144    10.13.15.156    255.255.255.252 UG    0      0        0 tun0
10.13.75.148    10.13.15.156    255.255.255.254 UG    0      0        0 tun0
10.13.75.150    10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
10.13.75.152    10.13.15.156    255.255.255.248 UG    0      0        0 tun0
10.13.75.160    10.13.15.156    255.255.255.224 UG    0      0        0 tun0
10.13.75.192    10.13.15.156    255.255.255.224 UG    0      0        0 tun0
10.13.75.224    10.13.15.156    255.255.255.240 UG    0      0        0 tun0
10.13.75.240    10.13.15.156    255.255.255.248 UG    0      0        0 tun0
10.13.75.248    10.13.15.156    255.255.255.252 UG    0      0        0 tun0
10.13.75.252    10.13.15.156    255.255.255.254 UG    0      0        0 tun0
10.13.75.255    10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
10.13.76.0      10.13.15.156    255.255.252.0   UG    0      0        0 tun0
10.13.80.0      10.13.15.156    255.255.240.0   UG    0      0        0 tun0
10.13.96.0      10.13.15.156    255.255.224.0   UG    0      0        0 tun0
10.13.128.0     10.13.15.156    255.255.128.0   UG    0      0        0 tun0
10.14.0.0       10.13.15.156    255.254.0.0     UG    0      0        0 tun0
10.16.0.0       10.13.15.156    255.240.0.0     UG    0      0        0 tun0
10.32.0.0       10.13.15.156    255.224.0.0     UG    0      0        0 tun0
10.64.0.0       10.13.15.156    255.192.0.0     UG    0      0        0 tun0
10.128.0.0      10.13.15.156    255.128.0.0     UG    0      0        0 tun0
11.0.0.0        10.13.15.156    255.0.0.0       UG    0      0        0 tun0
12.0.0.0        10.13.15.156    252.0.0.0       UG    0      0        0 tun0
16.0.0.0        10.13.15.156    240.0.0.0       UG    0      0        0 tun0
32.0.0.0        10.13.15.156    224.0.0.0       UG    0      0        0 tun0
64.0.0.0        10.13.15.156    224.0.0.0       UG    0      0        0 tun0
96.0.0.0        10.13.15.156    248.0.0.0       UG    0      0        0 tun0
104.0.0.0       10.13.15.156    252.0.0.0       UG    0      0        0 tun0
108.0.0.0       10.13.15.156    254.0.0.0       UG    0      0        0 tun0
110.0.0.0       10.13.15.156    255.0.0.0       UG    0      0        0 tun0
111.0.0.0       10.13.15.156    255.128.0.0     UG    0      0        0 tun0
111.128.0.0     10.13.15.156    255.192.0.0     UG    0      0        0 tun0
111.192.0.0     10.13.15.156    255.248.0.0     UG    0      0        0 tun0
111.200.0.0     10.13.15.156    255.255.240.0   UG    0      0        0 tun0
111.200.16.0    10.13.15.156    255.255.252.0   UG    0      0        0 tun0
111.200.20.0    10.13.15.156    255.255.254.0   UG    0      0        0 tun0
111.200.22.0    10.13.15.156    255.255.255.0   UG    0      0        0 tun0
111.200.23.0    10.13.15.156    255.255.255.128 UG    0      0        0 tun0
111.200.23.128  10.13.15.156    255.255.255.192 UG    0      0        0 tun0
111.200.23.192  10.13.15.156    255.255.255.224 UG    0      0        0 tun0
111.200.23.224  10.13.15.156    255.255.255.240 UG    0      0        0 tun0
111.200.23.240  10.13.15.156    255.255.255.248 UG    0      0        0 tun0
111.200.23.248  10.13.15.156    255.255.255.254 UG    0      0        0 tun0
111.200.23.251  10.13.15.156    255.255.255.255 UGH   0      0        0 tun0
111.200.23.252  10.13.15.156    255.255.255.252 UG    0      0        0 tun0
111.200.24.0    10.13.15.156    255.255.248.0   UG    0      0        0 tun0
111.200.32.0    10.13.15.156    255.255.224.0   UG    0      0        0 tun0
111.200.64.0    10.13.15.156    255.255.192.0   UG    0      0        0 tun0
111.200.128.0   10.13.15.156    255.255.128.0   UG    0      0        0 tun0
111.201.0.0     10.13.15.156    255.255.0.0     UG    0      0        0 tun0
111.202.0.0     10.13.15.156    255.254.0.0     UG    0      0        0 tun0
111.204.0.0     10.13.15.156    255.252.0.0     UG    0      0        0 tun0
111.208.0.0     10.13.15.156    255.240.0.0     UG    0      0        0 tun0
111.224.0.0     10.13.15.156    255.224.0.0     UG    0      0        0 tun0
112.0.0.0       10.13.15.156    240.0.0.0       UG    0      0        0 tun0
128.0.0.0       10.13.15.156    128.0.0.0       UG    0      0        0 tun0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp3s0
ifconfig,使用的是wifi。

代码: 全选

root@xxx:/home/xxx/Desktop/vpn/20160818# ifconfig
enp0s25   Link encap:Ethernet  HWaddr 3c:97:0e:e6:3b:ca  
          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:20 Memory:f2500000-f2520000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:19598 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19598 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:2166532 (2.1 MB)  TX bytes:2166532 (2.1 MB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.13.15.156  P-t-P:10.13.15.156  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1396  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:52 (52.0 B)

wlp3s0    Link encap:Ethernet  HWaddr 70:18:8b:f7:87:1b  
          inet addr:10.13.75.151  Bcast:10.13.75.255  Mask:255.255.255.0
          inet6 addr: fe80::f376:9cf2:87e6:4848/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3892734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3108551 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3502870414 (3.5 GB)  TX bytes:1592976995 (1.5 GB)
ip是10.13.75.151,tracepath、traceroute无响应

代码: 全选

4-4:
root@xxx:/home/xxx/Desktop/vpn/20160818# tracepath 10.13.75.151
 1:  

4-5:
root@xxx:/home/xxx/Desktop/vpn/20160818# traceroute 10.13.75.151 -m 30
traceroute to 10.13.75.151 (10.13.75.151), 30 hops max, 60 byte packets
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: VPN连接后无法访问网络,DNS无法解析

#26

帖子 poloshiao »

cat routen
4-3. sudo route -n -v
試試
sudo route -n -v
iptables -L -n -v
試試
sudo iptables -L -n -v
netstat -anlp | grep 46474
tcp6 0 0 127.0.0.1:34910 127.0.0.1:46474 ESTABLISHED 11902/java

127.0.0.1 不是 IPv6
試試 ::1 或 [::1]

測試期間 可以把 ipv6 關閉
http://tecadmin.net/disable-ipv6-on-linux/
看看 這一篇 及其連結文章 能否幫你
http://superuser.com/questions/141834/c ... ux-machine
Connecting to a SonicWall VPN from a Linux machine
这个地址中的连接我这无法打开。
因為內容很多
找個高手 指導你如何打開
回复