IKEv2 Server in Debian (EAP-MSCHAPv2 only)
IKev2 Server using StrongSwan
The most secure setup using IKev2 is IKEv2 Mutual RSA + MSCHAPv2 However, I'm not setting it here right now, as I have only set it in OPNsense (Have no time to test linux server) Maybe I will update if I have time to figure out the value of rightauth2
1. Install StrongSwan to Debian
Get superuser
Install StrongSwan packages
2. Generate certificates
Create folders to store certs and keys, then mod the permission of access
Generate CA key
Generate CA certificate from key "VPN root CA" can be changed to any name you like for your CA cert
Generate server key
Generate server cert Note: you need to change a.bname.com to your own ddns name
Copy all generated certificates to ipsec.d folder
3. Configure IPSec server
remove default ipsec config and create new one
Config ipsec.conf as follow (Advised to copy to notepad first) Remember to change the following values: a.bname.com : the DDNS you are using 192.168.212.0 : the subnet you want to assign to IPSec 1.1.1.1 : The DNS server you want to use
Configure ipsec.secrets (your login name and password)
Configure the file as follow: Remember to change username and password
Restart IPSec server to apply modifications
save your CA-cert for you to connect Copy from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE----- (For android, you need to save it in .crt format)
Then open UDP 500 and UDP 4500 for your server
4. Example of IPSec in Android (StrongSwan app)
CA cert need to install via Phone setting

Last updated
Was this helpful?