Strongswan configuration
StrongSwan is an IPsec-base VPN solution, focus on strong authentication mechanisms using X.509 public key certificates and optional secure storage of private keys and certificates on smartcards through a standardized PKCS#11 interface and on TPM 2.0.
Configuration Concept
Basic configuration files are as below:
/home/oper/strongswan/strongswan.conf: Central configuration file
/home/oper/strongswan/ipsec.conf: Tunnel definitions
/home/oper/strongswan/ipsec.secrets: List of preshared keys
/home/oper/strongswan/ipsec.d: Folder for certificates
For further detail, please refer to docs.strongswan.org.
Example:
ENM(Client) connect to Proton VPN(Site)
> vim /home/oper/strongswan/ipsec.conf
conn test
left=%defaultroute
leftsourceip=%config
leftauth=eap-mschapv2
eap_identity=hKVSu61QiraPAXDY7nLWFrehB6PWTqWc
right=nl-free-03.protonvpn.net
rightsubnet=0.0.0.0/0
rightauth=pubkey
rightid=%nl-free-03.protonvpn.net
rightca=/home/oper/strongswan/ipsec.d/cacerts/protonvpn.der
keyexchange=ikev2
type=tunnel
auto=add
> vim /home/oper/strongswan/ipsec.secrets
hKVSu61QiraPAXDY7nLWFrehB6PWTqWc : EAP "5DmS79J3xrvPCi5OAV7xBM5QMytNrHip"
> cp protonvpn.der /home/oper/strongswan/ipsec.d/cacerts/
> sudo /etc/init.d/ipsec restart
> sudo ipsec up test