使用strongswan搭建ipsec隧道

警告
本文最后更新于 2022-07-04 11:32,文中内容可能已过时。

https://www.tecmint.com/setup-ipsec-vpn-with-strongswan-on-debian-ubuntu/

1
yum install -y strongswan

修改/etc/strongswan/ipsec.conf

left

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
conn atou
 left=172.30.1.140
 leftsubnet=172.30.0.1/23
 right=对端公网ip
 rightsubnet=10.23.40.0/24
 leftid=ali
 rightid=ucloud
 esp=3des-sha
 type=tunnel
 leftauth=psk
 rightauth=psk
 keyexchange=ikev2
 auto=start

right

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
conn utoa
 left=10.23.40.38
 leftsubnet=10.23.40.0/24
 right=对端公网ip
 rightsubnet=172.30.0.1/23
 leftid=ucloud
 rightid=ali
 esp=3des-sha
 type=tunnel
 leftauth=psk
 rightauth=psk
 keyexchange=ikev2
 auto=start

/etc/strongswan/ipsec.secrets

1
ucloud ali : PSK "123@123"
请我喝杯水
SoulChild 微信号 微信号
SoulChild 微信打赏 微信打赏
0%