openwrt路由器连不上vpn的解决办法
上次换了glint路由后一切都不错,不再被各种所谓的智能路由器监控,唯一的不足是使用mac连vpn时总是报被断通信设备断开连接(您已被通信设备断开连接。请尝试重新连接。如果仍然有问题,请验证您的设置。),连不上vpn。
网上查了不少资料,有人说时运营商限制,可是换一个路由器就可以连接成功,说明问题出现在openwrt身上。
mac的完整的报错日志如下:
Sun Oct 11 12:15:56 2015 : publish_entry SCDSet() failed: Success!
Sun Oct 11 12:15:56 2015 : publish_entry SCDSet() failed: Success!
Sun Oct 11 12:15:56 2015 : pptp_get_router_address
Sun Oct 11 12:15:56 2015 : pptp_get_router_address 192.168.1.1 from dict 1
Sun Oct 11 12:15:56 2015 : PPTP connecting to server '198.74.125.206' (198.74.125.206)...
Sun Oct 11 12:16:07 2015 : PPTP connect errno = 51 Network is unreachable
Sun Oct 11 12:31:17 2015 : publish_entry SCDSet() failed: Success!
Sun Oct 11 12:31:17 2015 : publish_entry SCDSet() failed: Success!
Sun Oct 11 12:31:17 2015 : pptp_get_router_address
Sun Oct 11 12:31:17 2015 : pptp_get_router_address 192.168.1.1 from dict 1
Sun Oct 11 12:31:17 2015 : PPTP connecting to server '198.74.125.206' (198.74.125.206)...
Sun Oct 11 12:31:18 2015 : PPTP connection established.
Sun Oct 11 12:31:18 2015 : PPTP set port-mapping for en0, interface: 4, protocol: 0, privatePort: 0
Sun Oct 11 12:31:18 2015 : Using interface ppp0
Sun Oct 11 12:31:18 2015 : Connect: ppp0 <--> socket[34:17]
Sun Oct 11 12:31:18 2015 : PPTP error when reading socket : EOF
Sun Oct 11 12:31:18 2015 : PPTP error when reading header : read -1, expected 12 bytes
Sun Oct 11 12:31:18 2015 : PPTP hangup
Sun Oct 11 12:31:18 2015 : Connection terminated.
Sun Oct 11 12:31:18 2015 : PPTP clearing port-mapping for en0
Sun Oct 11 12:31:18 2015 : PPTP disconnecting...
Sun Oct 11 12:31:18 2015 : PPTP disconnected
起初以为是iptable端口没开,开了1723端口不好用,全部清初规则也不好用。
最后没办法,想用openwrt自带的vpn客户端来上网,找到pptp包:
安装 ppp-mod-pptp 2.4.7-2 This package contains a PPtP plugin for ppp.
安装过程中报错了,kmod-gre模块配置失败。
不过这个时候奇迹出现了,虽然包没安装上,mac上能够连vpn了,分析端口和gre在安装软件的过程中做了某种设置,找到一篇分析,希望对你有用:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 使用openwrt做网关路由器,会存在内网windows客户端 PPTP拨号无法连接外网pptp服务器的问题!错误号:619! PPTP方式的VPN使用了GRE协议,这个协议跟TCP/UDP是同一级的协议。因为GRE协议没有端口的概念,LINUX不能像TCP/UDP那样IP伪装。所以,LINUX网关后面的pptp vpn客户机连接vpn时总会遇见这种那种的问题。 也就是所谓 pptp pass through PPTP VPN协议 NAT穿透性问题! 参考:LINUX网关后面的pptp vpn客户机连接vpn: 参考:http://technet.microsoft.com/zh-cn/library/bb877963.aspx 方法: 1、确保安装以下几个ipk包: kmod-gre kmod-ipt-conntrack-extra kmod-ipt-nat-extra iptables-mod-conntrack-extra 2、防火墙添加以下规则(防火墙默认开放所有端口): vi /etc/firewall.user: iptables -t nat -I PREROUTING -p gre -j DNAT 意思是将所有的GRE包转发到pptp client IP 。注意:这个规则在重启防火墙后要过一段时间(2-3分钟)才起作用! 按照openwrt wiki上说的,安装kmod-ipt-nat-extra,可以解决内网多pptp客户端连接问题,未测试!! |
转载请注明本文地址: https://www.nginx.cn/4184.html
网站不错!