如何为Openswan和RouterOS之间的IPSEC隧道configuration路由

我试图在运行openswanshorewall (主机A ,服务子网10.10.0.0/16)的Linux路由器和运行RouterOS 6.3 (主机B ,服务192.168.88.0/24)的MikroTek RouterBoard之间创build站点到站点VPN )。

主持人A说:IPSEC隧道本身似乎是起来的,

 # service ipsec status IPsec running - pluto pid: 4292 pluto pid 4292 1 tunnels up some eroutes exist 

和:

 #ipsec auto --status <SNIP> 000 #2: "office-connect":500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 27422s; newest IPSEC; eroute owner; isakmp#1; idle; import:admin initiate 000 #2: "office-connect" esp.65bcd1d@<REDACTED> esp.c8d18ebd@<REDACTED> tun.0@<REDACTED> tun.0@<REDACTED> ref=0 refhim=4294901761 000 #1: "office-connect":500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 2348s; newest ISAKMP; lastdpd=72s(seq in:0 out:0); idle; import:admin initiate 

而在主机B上

 /ip ipsec remote-peers print 0 local-address=<REDACTED> remote-address=<REDACTED> state=established side=responder established=11m26s 

和:

 /ip ipsec policy print Flags: T - template, X - disabled, D - dynamic, I - inactive 0 src-address=192.168.88.0/24 src-port=any dst-address=10.10.0.0/16 dst-port=any protocol=all action=encrypt level=require ipsec-protocols=esp tunnel=yes sa-src-address=<REDACTED> sa-dst-address=<REDACTED> proposal=Office-Connect priority=0 

我按照http://www.shorewall.net/IPSEC-2.6.html上的shorewall来configurationshorewall和http://wiki.mikrotik.com/wiki/Manual:IP/IPsec来设置NAT Bypass规则。

但是,我实际上无法通过隧道获得任何数据包,在A

 # ping -c4 192.168.88.1 PING 192.168.88.1 (192.168.88.1) 56(84) bytes of data. --- 192.168.88.1 ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3016ms 

B

 /ping count=4 10.10.0.1 HOST SIZE TTL TIME STATUS 10.10.0.1 timeout 10.10.0.1 timeout 10.10.0.1 timeout 10.10.0.1 timeout sent=4 received=0 packet-loss=100% 

我有点不知所措,我的networking经验不是太好。 所以我会有所帮助,甚至只是如何debugging这个问题。 如果需要,我会很乐意提供额外的configuration示例或日志输出。 非常感谢!

这里的解决scheme,如果有其他人有同样的问题…问题是,我有另一个VPN安装在shorewall框,这是一个L2TP道路战士设置称为vpn (站点到站点的VPN名为ovpn )所以,我的/etc/shorewall/zones文件看起来像这样:

 #ZONE TYPE OPTIONS IN OUT # OPTIONS OPTIONS <SNIP> vpn ipsec l2tp ipv4 ovpn ipv4 

和我的/etc/shorewall/hosts是这样的:

 #ZONE HOST(S) OPTIONS vpn eth0:0.0.0.0/0 ovpn eth0:192.168.88.0/24,<REDACTED> ipsec 

事实certificate区域文件中区域声明的顺序是重要的(但不在hosts文件中) – 对于每个连接, shorewallselect匹配的第一个区域。 由于vpn区域具有与每个远程主机相匹配的主机条目,因此所有ovpn连接都将与vpn区域匹配,然后路由到xl2tpd ,这当然不起作用。

所以我颠倒了vpnovpn的区域条目,一切正常。