Setting up a roadwarrior VPN with OpenVPN was a bit tricky for me. Therefore, I have put together some scripts which should make a sensible setup easier.
Feel free to let me know if you encouter any issues with this.
The configs generated by these scripts require OpenVPN version >=2.4.
On some machine which you trust with the PKI:
- Clone this git:
git clone https://github.com/cfra/roadwarrior-vpn.git
- Create a
SETTINGS
file fromSETTINGS.example
. - Initialize the CA:
./init_ca.sh
- Create Server Config:
./new_endpoint.sh server <server-common-name>
- Create Client Config:
./new_endpoint.sh client <client-common-name>
- Install OpenVPN on the server:
apt install openvpn
- Edit the VPN config
- Put the generated config from the PKI system to the machine which should be
the VPN server:
scp servers/vpn.example.com.ovpn vpn.example.com:/etc/openvpn/roadwarrior.conf
- On the server, enable and start the VPN service:
systemctl enable [email protected] systemctl start [email protected]
- Verify its status:
systemctl status [email protected]
- The generated config should just be usable as is
- Call the revocation script:
./revoke_endpoint.sh client <client-common-name>
- Copy the generated CRL from
pki/ca/crl/current.pem
to a place where OpenVPN can read it and reference it like this, updating the path accordingly:crl-verify crl/current.pem