Ubuntu18.04下strongSwan配置

1、官网下载strongswan

strongswan-5.8.4.tar.gz

2020/03/29, size 7'282'749 bytes, pgp-signature,
md5d97e8eeb4fc0223f0d6fb331c4d2bcce

链接:https://www.strongswan.org/download.html

2、编译和安装

tar -zxvf strongswan-5.8.4.tar.gz
./configure --prefix=/usr/ --sysconfdir=/etc/
make
make install

3、配置

以下官网链接有各种配置方案。

https://www.strongswan.org/testing/testresults/swanctl/index.html

可以依据自己需求,在两台ubuntu机器内分别选择一种方案进行配置即可。需要额外注意的是,将配置中的IP改成两台机器对应的IP。、

我在两台ubuntu内配置了/etc/swanctl/swanctl.conf。

4、测试

配置完毕后,在两台机器均执行:

sudo swanctl --load-all

若失败,报错如下:

connecting to 'unix:///var/run/charon.vici' failed: No such file or directory
Error: connecting to 'default' URI failed: No such file or directory

则,执行如下指令:

sudo /usr/libexec/ipsec/charon &
sudo systemctl enable strongswan.service

从一台机器发起协商,h2h与配置内名称相对应:

sudo ipsec up h2h

 参考链接:

1、https://zhuanlan.zhihu.com/p/100535851

2、https://stackoverflow.com/questions/46691341/strongswan-var-run-charon-vici-file-does-not-exist-issue

3、https://www.youcl.com/info/8542

posted @ 2020-07-10 14:01  夜半弯  阅读(2821)  评论(0编辑  收藏  举报