Strongswan VPNbuild立,但没有路由的数据包

我正在使用strongSwan在Amazon EC2实例上的Linux实例和通过其思科集中器的远程networking之间build立一个VPN。 我需要将来自Linux实例本身的数据包路由到远程子网中的一台机器。

连接build立成功,但没有数据包被路由。

我想我需要设置一些特定的路由规则,我该怎么做呢?

软件

  • Linux内核3.5.0-41,
  • Ubuntu 12.10,
  • strongSwan 5.1.1(从源码build立)
  • iptables – 没有规则。

networking

本地

  • 亚马逊弹性IP:56.xxx
  • 面向公众的IP:172.xxx
  • 本地虚拟子网:10.254.0.0/16
  • 本地虚拟IP:10.254.5.174

远程

  • 思科集中器的公网IP:62.xxx
  • 远程子网:10.192.0.0/12

组态

ipsec.conf文件

config setup conn %default keyexchange = ikev1 type = tunnel ikelifetime = 86400 keylife = 28800 keyingtries = %forever esp = 3des-sha ike = 3des-md5-modp1024 forceencaps = yes leftauth = psk rightauth = psk conn myconnection left = 172.xxx leftsubnet = 10.254.0.0/16 leftsourceip = 10.254.5.174 leftfirewall = yes right = 62.xxx rightsubnet = 10.192.0.0/12 auto = route include /var/lib/strongswan/ipsec.conf.inc 

strongswan.conf

 charon { cisco_unity = yes install_routes = yes install_virtual_ip = yes threads = 16 plugins { sql { loglevel = -1 } } filelog { /var/log/charon.log { time_format = %b %e %T default = 3 flush_line = yes } } } pluto { } libstrongswan { } 

ipsec状态

 # ipsec statusall Status of IKE charon daemon (strongSwan 5.1.1, Linux 3.5.0-41-generic, x86_64): uptime: 4 days, since Jan 22 14:24:08 2014 malloc: sbrk 270336, mmap 0, used 222672, free 47664 worker threads: 11 of 16 idle, 5/0/0/0 working, job queue: 0/0/0/0, scheduled: 3445 loaded plugins: charon aes des rc2 sha1 sha2 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem fips-prf gmp xcbc cmac hmac attr kernel-netlink resolve socket-default stroke updown xauth-generic Listening IP addresses: 172.xxx 54.xxx Connections: smsbrick: 172.xxx..62.xxx IKEv1 smsbrick: local: [172.xxx] uses pre-shared key authentication smsbrick: remote: [62.xxx] uses pre-shared key authentication smsbrick: child: 10.254.0.0/16 === 10.192.0.0/12 TUNNEL Routed Connections: smsbrick{1}: ROUTED, TUNNEL smsbrick{1}: 10.254.0.0/16 === 10.192.0.0/12 Security Associations (1 up, 0 connecting): smsbrick[8150]: ESTABLISHED 1 second ago, 172.xxx[172.xxx]...62.xxx[62.xxx] smsbrick[8150]: IKEv1 SPIs: xxxxxxxxxxxxxx_i* xxxxxxxxxxxxx_r, pre-shared key reauthentication in 23 hours smsbrick[8150]: IKE proposal: 3DES_CBC/HMAC_MD5_96/PRF_HMAC_MD5/MODP_1024 smsbrick[8150]: Tasks queued: QUICK_MODE smsbrick[8150]: Tasks active: MODE_CONFIG 

ip xfrm

 # ip xfrm policy src 10.192.0.0/12 dst 10.254.0.0/16 dir fwd priority 3987 tmpl src 62.xxx dst 172.xxx proto esp reqid 1 mode tunnel src 10.192.0.0/12 dst 10.254.0.0/16 dir in priority 3987 tmpl src 62.xxx dst 172.xxx proto esp reqid 1 mode tunnel src 10.254.0.0/16 dst 10.192.0.0/12 dir out priority 3987 tmpl src 172.xxx dst 62.xxx proto esp reqid 1 mode tunnel src 0.0.0.0/0 dst 0.0.0.0/0 socket in priority 0 src 0.0.0.0/0 dst 0.0.0.0/0 socket out priority 0 src 0.0.0.0/0 dst 0.0.0.0/0 socket in priority 0 src 0.0.0.0/0 dst 0.0.0.0/0 socket out priority 0 src ::/0 dst ::/0 socket in priority 0 src ::/0 dst ::/0 socket out priority 0 src ::/0 dst ::/0 socket in priority 0 src ::/0 dst ::/0 socket out priority 0 

很抱歉,对于这个话题,在这个特定configuration的故障排除方面没有太多的信息。

我的configuration:

  • AWS:Strongswan 5.1.3
  • 公司:思科ASA5520 8.4(4)1

症状:

  1. 始终可以启动从Cisco ASA专用LAN到AWS专用LAN的隧道和ping。
  2. 在隧道超时/重新启动后,我无法从AWS启动或ping通Cisco ASA,除非/直到从Cisco ASA端生成stream量。 IPSEC STATUSALL透露

     Tasks active: MODE_CONFIG Tasks queued: QUICK_MODE 

我发现,使用modeconfig=pushleftsourceip=两个configuration,它都卡在:

 Tasks active: MODE_CONFIG Tasks queued: QUICK_MODE 

删除modeconfig=push左侧卡住在:

 Tasks active: MODE_CONFIG 

删除leftsourceip=做的伎俩,一切都稳定和稳定的两种方式。

我认为PIX需要这两个,也许是ASA的一些旧版本,但不是这个。