AWS和重叠子网中的Strongswan VPN

时间:2019-12-14 16:19:13

标签: amazon-web-services vpn iptables ipsec strongswan

在这种情况下,我需要将一个站点上的两个站点连接到站点ipsec隧道。同行之一(我无权访问另一端)是带有Strongswan(Ubuntu 16.04)的EC2实例。我可以使用以下配置连接两个站点:

 type=tunnel
 authby=secret
 left=10.1.0.124 (private ip address assigned by AWS to our EC2 instance)
 leftid=18.21.xxx.xxx (public Elastic ip)
 leftsubnet=10.153.94.0/24 (this is a requirement from the other side, I don't manage this)
 right=45.17.xxx.xxx (public peer ip)
 rightsubnet=10.153.105.0/24 (private subnet of peer side)
 keyexchange=ikev1
 ike=aes256-sha1-modp1024!
 ikelifetime=86400s
 esp=aes256-sha1-modp1024!
 keylife=3600s
 auto=start
 rekey=yes
 keyingtries=%forever
 aggressive=no
 dpdaction=restart
 dpdtimeout=120

问题出在对等方所需的远程子网(leftsubnet)上。我们的vpc中没有该子网,对等方也无法将其更改为他们的密码映射。我该如何解决?我需要在EC2实例中创建某种虚拟IP(例如10.153.94.2),还是在NAT iptables规则中创建这两者?我无法添加具有任意地址的第二个物理接口,并且尝试创建子接口(例如ens5:0)失败。只有设置了“真实”的左侧ip(10.1.0.124),隧道才能打开。预先感谢!

0 个答案:

没有答案