找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8184|回复: 1

[vpn] 用ROS2.9.6做VPN中转,只能连接一个客户端IP?

[复制链接]
发表于 2008-4-29 16:35:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
   各位高人大大看过来!有做过VPN中转的兄弟们请伸出热情的双手!没有做的过也可以尝试和共同探讨!

    我在A城市用Win2003建立了一个VPN(PPTP)服务器,在B城市用ros 2.9.6通过PPPoE拨号建立了一个VPN中转服务器,在C城市有若干个VPN客户(XP,来自不同的IP)。


VPN客户端<--(Internet)-->ROS中转服务器<--(Internet)-->VPN服务器
(动态IP)                        221.170.246.8                                67.213.79.130

    在中转的ROS上,我建立了如下的规则:

/ ip firewall nat
add chain=srcnat action=masquerade comment="" disabled=no
add chain=dstnat protocol=tcp dst-port=1723 \
action=dst-nat to-addresses=67.213.79.130 to-ports=1723 comment="" \
disabled=no
add chain=dstnat protocol=gre action=dst-nat \
to-addresses=67.213.79.130 to-ports=0-65535 comment="" disabled=no
add chain=srcnat protocol=gre connection-type=gre action=masquerade comment="" \
disabled=no

    实际测试发现一个奇怪的问题,第一个客户端可以通过中转拨通VPN服务器,在ROS上看到成功地建立了一条从客户端IP到ROS的gre连接通道,当第二个客户端(另一条ADSL)拨入中转时,TCP 1723连接顺利中转到VPN服务器上,但是无法建立第二条GRE连接通道(从第二个客户端IP到ROS中转服务器),在VPN拨号客户端上报告的是721号错误,在Win2003服务器上报告的错误如下:
Event Type: Warning
Event Source: Rasman
Event Category: None
Event ID: 20209
Description:
A connection between the VPN server and the VPN client 221.170.246.8 has been established, but the VPN connection cannot be completed. The most common cause for this is that a firewall or router between the VPN server and the VPN client is not configured to allow Generic Routing Encapsulation (GRE) packets (protocol 47). Verify that the firewalls and routers between your VPN server and the Internet allow GRE packets. Make sure the firewalls and routers on the user's network are also configured to allow GRE packets. If the problem persists, have the user contact the Internet service provider (ISP) to determine whether the ISP might be blocking GRE packets.

    两个客户端拨入顺序对调一下结果是一样的,第一个接通,第二个不通!请教大家如何解决?
    我后来又在一个外国网友的提示下增加了如下规则测试:
/ip firewall nat
add chain=srcnat action=masquerade comment="" disabled=yes
add chain=dstnat in-interface=ether1 dst-address=221.170.246.8 \
protocol=tcp dst-port=1723 action=dst-nat to-addresses=67.213.79.130 \
to-ports=1723 comment="" disabled=no
add chain=dstnat in-interface=ether1 dst-address=221.170.246.8 \
protocol=gre action=dst-nat to-addresses=67.213.79.130 to-ports=0 \
comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=67.213.79.130 \
protocol=gre connection-type=gre action=src-nat \
to-addresses=221.170.246.8 to-ports=0-65535 comment="" disabled=no
add chain=srcnat out-interface=ether1 src-address=67.213.79.130 \
protocol=tcp src-port=1723 action=src-nat to-addresses=221.170.246.8 \
to-ports=1723 comment="" disabled=no
    结果更惨!这次根本一个都连不上了,报告的客户端错误是800,无法连接VPN服务器!再加一条:
add chain=srcnat src-address=67.213.79.130 action=masquerade comment="" disabled=no
还是不成!无奈!只好恢复到初始状态,只能一个客户端连接!
请大家帮帮忙呀,我的VPN客户端有好几十个呢,只能一个连接不就玩完了?
对了,声明一下,如果不通过ROS中转,每个VPN客户端都能够顺利连接到服务器上,只不过是网速非常慢,这个ROS中转就是起到加速作用的,可以提升连接速度一倍左右。
routeros
 楼主| 发表于 2008-5-2 16:07:50 | 显示全部楼层
居然没有人能够回答呀?
哈哈!我自己已经解决了!
这是ROS 2.9.x版本的BUG!俺现在已经升级到ROS3.7虚拟机版以后就解决了!
可是又出现一个新问题:
在Firewall Connection里面看到,都已经断开好几天的GRE的连接居然都还坚强地存在!如何识别出已经断开的VPN连接与对应的GRE连接,把相应的连接给自动删除掉?
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-6-15 13:17 , Processed in 0.046443 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表