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
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)