These are steps I did -
1. Create CA
/certificate
add common-name=XX.XX.XX.XX name=XX.XX.XX.XX
sign "XX.XX.XX.XX" ca-crl-host=XX.XX.XX.XX
2. Create server certificate
add common-name=XX.XX.XX.XX subject-alt-name=IP:XX.XX.XX.XX key-usage=tls-server name="IKE2 RSA server"
sign "IKE2 RSA server" ca=XX.XX.XX.XX
3. Create client certificate
add common-name=Client name=Client key-usage=tls-client
sign Client ca=XX.XX.XX.XX
4. Export client certificate as PKCS12
export-certificate Client export-passphrase=SuperStrongPass123 type=pkcs12
5. Import certificate to Local Machine store
6. Create new VPN profile
Now, if you have more than one IKE2 RSA VPN's created, you should specify which certificate Windows should use, because Windows is stupid and can't automatically determine the right certificate for each VPN profile.
1. Open Powershell and enter
certlm.msc to open Local Machine Certificate tool
2. Under
Trusted Root Certification.. find your certificate and open it with double click
3. Select
Details and copy
Serial number
4. Go back to Powershell and create new variable with specified serial number
$ca = Get-ChildItem Cert:\LocalMachine\Root\ | ? SerialNumber -EQ <serial number>
5. Check whether variable can find you certificate, it should return something
$ca
6. Add certificate to your created VPN profile
Set-VpnConnection -Name <your VPN profile name> -MachineCertificateIssuerFilter $ca
Be happy now.