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

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

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

#1

帖子 xiaoxioa » 2016-08-09 0:10

小弟有些小白,真诚求教,先道谢!
我使用的AventailConnect客户端,连接VPN后无法连接内网、外网,后发现DNS无法解析。
连接后的DNS配置:

代码: 全选

# Aventail VPN ConnectionGenerated, to restore copy from /etc/resolv.conf.Sonicwall
nameserver 10.13.6.2
nameserver 10.13.6.3
NGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
网络端口信息:

代码: 全选

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
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:408 errors:0 dropped:0 overruns:0 frame:0
          TX packets:408 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:39964 (39.9 KB)  TX bytes:39964 (39.9 KB)

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.105  P-t-P:10.13.15.105  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1452  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:324 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: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)
IP转发已启用( /etc/sysctl.conf)

代码: 全选

net.ipv4.ip_forward=1
iptables配置

代码: 全选

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

代码: 全选

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 
以上配置完成后,仍无法解析域名

代码: 全选

xxx@xxx:~$ ping baidu.com


之前使用过fedora,也有类似的问题,但联系重启几次后就可以了。请大大们帮忙分析下原因,谢谢!
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

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

#2

帖子 xiaoxioa » 2016-08-09 10:25

:Cry 咋没有回复呢
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

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

#3

帖子 poloshiao » 2016-08-09 11:31

ping baidu.com
試試
1. ping -c 3 127.0.0.1
2. ping -c 10.13.15.105
3. ping -c 3 10.13.6.2
4. ping -c 3 192.168.1.100
5. ping -c 3 198.71.84.64
6. ping -c 3 forum.ubuntu.org.cn
把回應訊息複製貼上來
xiaoxioa
帖子: 16
注册时间: 2011-05-09 0:07

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

#4

帖子 xiaoxioa » 2016-08-09 13:25

poloshiao 写了:
ping baidu.com
試試
1. ping -c 3 127.0.0.1
2. ping -c 10.13.15.105
3. ping -c 3 10.13.6.2
4. ping -c 3 192.168.1.100
5. ping -c 3 198.71.84.64
6. ping -c 3 forum.ubuntu.org.cn
把回應訊息複製貼上來
感谢回复!
按照您提示的内容操作如下,127.0.0.1和tun0端口ip是通的,其他ip不通、forum.ubuntu.org.cn域名无法解析

代码: 全选

root@xxx:/home/xxx# ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.052 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.039/0.047/0.052/0.005 ms
root@xxx:/home/xxx# ping -c 3 10.13.15.105
PING 10.13.15.105 (10.13.15.105) 56(84) bytes of data.
64 bytes from 10.13.15.105: icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from 10.13.15.105: icmp_seq=2 ttl=64 time=0.047 ms
64 bytes from 10.13.15.105: icmp_seq=3 ttl=64 time=0.048 ms

--- 10.13.15.105 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.037/0.044/0.048/0.005 ms
root@xxx:/home/xxx# ping -c 3 10.13.6.2
PING 10.13.6.2 (10.13.6.2) 56(84) bytes of data.


^C
--- 10.13.6.2 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2016ms

root@xxx:/home/xxx# ping 198.71.84.64
PING 198.71.84.64 (198.71.84.64) 56(84) bytes of data.


^C
--- 198.71.84.64 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3023ms

root@xxx:/home/xxx# ping -c 3 forum.ubuntu.org.cn

poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

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

#5

帖子 poloshiao » 2016-08-09 16:18

回复