我在 aws 和本地之间使用 ipsec 和 strongswan,以下是 strongswan 配置
config setup
uniqueids = no
charondebug="ike 1, knl 1, cfg 0"
conn %default
ikelifetime=14400
keylife=3600
keyexchange=ikev2
dpdaction=clear
rekey=no
dpddelay = 300s
dpdtimeout = 30
conn AWS-VPN-1
authby=secret
auto=start
type=tunnel
leftauth=psk
rightauth=psk
left = xxx.xxx.xxx.xxx # On-Premise IP Address
right = xxx.xxx.xxx.xxx # AWS VPN Tunnel 1 IP Address
leftsubnet = 172.17.200.200/32 # On-Premise CIDR
rightsubnet = 10.0.0.0/8 # AWS VPC CIDR
ike=aes256-sha256-modp2048
esp=aes256-sha256-modp2048
conn AWS-VPN-2
authby=secret
auto=start
type=tunnel
leftauth=psk
rightauth=psk
left = xxx.xxx.xxx.xxx # On-Premise IP Address
right = xxx.xxx.xxx.xxx # AWS VPN Tunnel 1 IP Address
leftsubnet = 172.17.200.200/32 # On-Premise CIDR
rightsubnet = 10.0.0.0/8 # AWS VPC CIDR
ike=aes256-sha256-modp2048
esp=aes256-sha256-modp2048
连接初始化后,vpn 连接运行良好。-> 右子网上的“A”服务器可以连接到左子网上的“B”服务器。
但随着时间的推移,vpn 连接不再起作用。-> rightsubnet 上的“A”服务器无法连接到左子网上的“B”服务器