Base docker image to run a strongSwan IKEv2 VPN (PSK and certs) server.
Prepare configuration file according to Quericy Eden*, then place the files in a folder like the following directory structure.
If you do not need to verify by certificate, you can ignore the three certificate directories.
.
├── ipsec.conf
│
├── ipsec.secrets
│
├── strongswan.conf
│
├── cacerts
│ └── ca.cert.pem
│
├── certs
│ ├── client.cert.pem
│ └── server.cert.pem
│
└── private
├── client.pem
└── server.pem
Running this particular Docker container typically requires
running with elevated privileges --privileged
. It will have permission to
modify your Docker host's sysctl and iptables configuration.
Ensure the config folder is in your current directory ($PWD) and run:
docker build -t strongswan https://github.com/Zimong/docker-strongswan
docker run -d \
--restart always \
--privileged \
-p 500:500/udp \
-p 4500:4500/udp \
-v $PWD:/etc/ipsec.d \
--name=strongswan \
strongswan
Useful resources: