openswan多个子网路由问题

我试图在CentOS 6.5(最后)上安装一个OpenSwan(2.6.32)来连接Amazon云上的远程VPC网关。 我得到了隧道。 但是,只有来自/到达在leftsubnets中定义的最后一个ip范围的stream量才被路由。 第一个短暂的工作(也许在第二个隧道之前),然后没有更多的路由。 以下是我的configuration。

conn aws-vpc leftsubnets={10.43.4.0/24 10.43.6.0/24} rightsubnet=10.43.7.0/24 auto=start left=206.191.2.xxx right=72.21.209.xxx rightid=72.21.209.xxx leftid=206.191.2.xxx leftsourceip=10.43.6.128 authby=secret ike=aes128-sha1;modp1024 phase2=esp phase2alg=aes128-sha1;modp1024 aggrmode=no ikelifetime=8h salifetime=1h dpddelay=10 dpdtimeout=40 dpdaction=restart type=tunnel forceencaps=yes 

启动IPsec服务后:

 # service ipsec status IPsec running - pluto pid: 8601 pluto pid 8601 2 tunnels up some eroutes exist # ip xfrm policy src 10.43.6.0/24 dst 10.43.7.0/24 dir out priority 2344 ptype main tmpl src 206.191.2.xxx dst 72.21.209.xxx proto esp reqid 16389 mode tunnel src 10.43.7.0/24 dst 10.43.6.0/24 dir fwd priority 2344 ptype main tmpl src 72.21.209.xxx dst 206.191.2.xxx proto esp reqid 16389 mode tunnel src 10.43.7.0/24 dst 10.43.6.0/24 dir in priority 2344 ptype main tmpl src 72.21.209.xxx dst 206.191.2.xxx proto esp reqid 16389 mode tunnel src 10.43.4.0/24 dst 10.43.7.0/24 dir out priority 2344 ptype main tmpl src 206.191.2.xxx dst 72.21.209.xxx proto esp reqid 16385 mode tunnel src 10.43.7.0/24 dst 10.43.4.0/24 dir fwd priority 2344 ptype main tmpl src 72.21.209.xxx dst 206.191.2.xxx proto esp reqid 16385 mode tunnel src 10.43.7.0/24 dst 10.43.4.0/24 dir in priority 2344 ptype main tmpl src 72.21.209.xxx dst 206.191.2.xxx proto esp reqid 16385 mode tunnel 

我不认为防火墙在这里扮演什么angular色,因为我完全closures它只是为了testing连接。 路线也按预期工作。 如果我在左侧单独定义一个单独的networking,在单独的testing连接上定义一个子网。 只有当我定义了左边的时候 ,那么最后到达的任何一个范围才会被路由到最后。 无论哪一个先来,在停止路由之前,都要等一会儿。

我找不到任何人在互联网上有类似的问题…有人请赐教?

干杯,

当你使用leftsubnets ,你必须使用rightsubnets ,而不是rightsubnet 。 正如http://linux.die.net/man/5/ipsec.conf所述 :

如果同时定义了leftsubnets=rightsubnets= ,则将实例化子网隧道的所有组合。

尝试使用:

 leftsubnets={10.43.4.0/24,10.43.6.0/24,} 

代替:

 leftsubnets={10.43.4.0/24 10.43.6.0/24} 

注意:添加两个逗号。 第一次也是最后一次。