首先在strongswan的官网下载安装包并进行解压,得到的文件通过WinScp拷贝到centos下
进入strongswan-4.5.3文件夹,首先安装如下必要的库
基于centos,使用yum进行安装
yum update yum install build-essential yum install autoconf yum install libgmp-dev yum install gperf yum install flex yum install bison
执行./configure,如果出现如下错误configure: error: GNU Multi Precision library gmp not found,则执行sudo yum install gmp-devel
执行make install,如果出现如下错误
: *** [charon] 错误 1 make[3]: 离开目录“/home/strongswan-4.5.3/src/charon” make[2]: *** [all-recursive] 错误 1 make[2]: 离开目录“/home/strongswan-4.5.3/src” make[1]: *** [all-recursive] 错误 1 make[1]: 离开目录“/home/strongswan-4.5.3”
则检查依赖库是否安装完成是否有遗漏,yum update更新一下软件以及库,然后执行
make clean清除之前的生成文件,重新加上权限 sudo make install进行编译
编译后的文件如下所示
. ├── etc │ ├── ipsec.conf │ ├── ipsec.d │ │ ├── aacerts │ │ ├── acerts │ │ ├── cacerts │ │ ├── certs │ │ ├── crls │ │ ├── ocspcerts │ │ ├── private │ │ └── reqs │ └── strongswan.conf ├── lib │ └── ipsec │ ├── libcharon.a │ ├── libcharon.la │ ├── libhydra.a │ ├── libhydra.la │ ├── libstrongswan.a │ ├── libstrongswan.la │ └── plugins │ ├── libstrongswan-aes.a │ ├── libstrongswan-aes.la │ ├── libstrongswan-attr.a │ ├── libstrongswan-attr.la │ ├── libstrongswan-constraints.a │ ├── libstrongswan-constraints.la │ ├── libstrongswan-des.a │ ├── libstrongswan-des.la │ ├── libstrongswan-dnskey.a │ ├── libstrongswan-dnskey.la │ ├── libstrongswan-fips-prf.a │ ├── libstrongswan-fips-prf.la │ ├── libstrongswan-gmp.a │ ├── libstrongswan-gmp.la │ ├── libstrongswan-hmac.a │ ├── libstrongswan-hmac.la │ ├── libstrongswan-kernel-netlink.a │ ├── libstrongswan-kernel-netlink.la │ ├── libstrongswan-md5.a │ ├── libstrongswan-md5.la │ ├── libstrongswan-pem.a │ ├── libstrongswan-pem.la │ ├── libstrongswan-pgp.a │ ├── libstrongswan-pgp.la │ ├── libstrongswan-pkcs1.a │ ├── libstrongswan-pkcs1.la │ ├── libstrongswan-pubkey.a │ ├── libstrongswan-pubkey.la │ ├── libstrongswan-random.a │ ├── libstrongswan-random.la │ ├── libstrongswan-resolve.a │ ├── libstrongswan-resolve.la │ ├── libstrongswan-revocation.a │ ├── libstrongswan-revocation.la │ ├── libstrongswan-sha1.a │ ├── libstrongswan-sha1.la │ ├── libstrongswan-sha2.a │ ├── libstrongswan-sha2.la │ ├── libstrongswan-socket-raw.a │ ├── libstrongswan-socket-raw.la │ ├── libstrongswan-stroke.a │ ├── libstrongswan-stroke.la │ ├── libstrongswan-updown.a │ ├── libstrongswan-updown.la │ ├── libstrongswan-x509.a │ ├── libstrongswan-x509.la │ ├── libstrongswan-xauth.a │ ├── libstrongswan-xauth.la │ ├── libstrongswan-xcbc.a │ └── libstrongswan-xcbc.la ├── libexec │ └── ipsec │ ├── _copyright │ ├── pluto │ ├── _pluto_adns │ ├── starter │ └── whack ├── sbin │ └── ipsec └── share └── man ├── man3 │ ├── anyaddr.3 │ ├── atoaddr.3 │ ├── atoasr.3 │ ├── atoul.3 │ ├── goodmask.3 │ ├── initaddr.3 │ ├── initsubnet.3 │ ├── portof.3 │ ├── rangetosubnet.3 │ ├── sameaddr.3 │ ├── subnetof.3 │ ├── ttoaddr.3 │ ├── ttodata.3 │ ├── ttosa.3 │ └── ttoul.3 └── man8 ├── ipsec.8 └── pluto.8