![无法连接到 mt PPTP VPN 服务器](https://linux22.com/image/681112/%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%20mt%20PPTP%20VPN%20%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
我关注这教程用于在我的 centos 6 VPS 和 fedora 22 工作站之间配置 pptp 连接。我所做的与该教程只有一件事不同:我从 epel 存储库安装了 pptpd,而不是从提供的链接安装。
我按照教程在我的 iptables 中添加了以下规则:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
iptables --append FORWARD --in-interface eth0 -j ACCEPT
我还添加了以下规则以确保我的防火墙不会阻止我的连接请求:
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT
其中 XXX.XXX.XXX.XXX 是我的工作站公共固定 ipv4。
当我跑步时:
pppd call pptpserver
ip route add 10.0.0.0/8 dev ppp0
我RTNETLINK answers: Network is down
尝试了几次才成功Cannot find device "ppp0"
。
从journalctl -f
我得到:
pppd[7632]: pppd 2.4.5 started by user, uid 0
pppd[7632]: Using interface ppp0
pppd[7632]: Connect: ppp0 <--> /dev/pts/5
NetworkManager[1186]: <info> (ppp0): new Generic device (driver: 'unknown' ifindex: 15)
NetworkManager[1186]: <info> (ppp0): exported as /org/freedesktop/NetworkManager/Devices/14
pptp[7633]: anon log[main:pptp.c:333]: The synchronous pptp option is NOT activated
NetworkManager[1186]: <info> (ppp0): No existing connection detected.
pptp[7640]: anon log[ctrlp_rep:pptp_ctrl.c:258]: Sent control packet type is 1 'Start-Control-Connecti...equest'
pptp[7640]: anon log[ctrlp_disp:pptp_ctrl.c:758]: Received Start Control Connection Reply
pptp[7640]: anon log[ctrlp_disp:pptp_ctrl.c:792]: Client connection established.
pptp[7640]: anon log[ctrlp_rep:pptp_ctrl.c:258]: Sent control packet type is 7 'Outgoing-Call-Request'
pptp[7640]: anon log[ctrlp_disp:pptp_ctrl.c:877]: Received Outgoing Call Reply.
pptp[7640]: anon log[ctrlp_disp:pptp_ctrl.c:916]: Outgoing call established (call ID 0, peer's call ID 256).
几秒钟后:
pppd[7632]: LCP: timeout sending Config-Requests
pppd[7632]: Connection terminated.
avahi-daemon[874]: Withdrawing workstation service for ppp0.
gnome-session[2254]: Gjs-Message: JS LOG: Removing a network device that was not added
pppd[7632]: Modem hangup
pptp[7633]: anon warn[decaps_hdlc:pptp_gre.c:220]: short read (-1): Input/output error
pptp[7633]: anon warn[decaps_hdlc:pptp_gre.c:232]: pppd may have shutdown, see pppd log
pppd[7632]: Exit.
pptp[7640]: anon log[callmgr_main:pptp_callmgr.c:245]: Closing connection (unhandled)
pptp[7640]: anon log[ctrlp_rep:pptp_ctrl.c:258]: Sent control packet type is 12 'Call-Clear-Request'
pptp[7640]: anon log[call_callback:pptp_callmgr.c:84]: Closing connection (call state)
有人知道我的连接出了什么问题吗?是在我的工作站还是在服务器上?
谢谢
答案1
关闭并清除 iptables 并执行连接测试。如果成功,则很可能您无需进行正确的 iptables 配置即可使 pptp 正常工作。
如果它在清除和禁用 iptables 的情况下有效,那么你应该阅读以下内容:PPTP IPTables 路由问题