FortiGate - Windows 10 Native/Always-on VPN
FortiGate - Windows 10 Native/Always-on VPN
This is an alternative to using FortiClient with GINA Logon process or a user-initiated VPN.
Specifically it will require the intermediary CA and the root CA certificate that signed it.
In the image above the important certificate names are CA_Cert_1 and CA_Cert_2 we will
need these when we configure client authentication
Then apply the following block modifying it as necessary to support your use case:
1 config user peer
2 edit "sslvpncertuser"
3 set ca "CA_Cert_1"
4 next
5 end
NOTES
1. The user created will be added to a peergrp. This “user” represents all users with
certificates signed by the CA used in set CA as you can see from 4.1 this would be the
intermediate CA for shwoogle.com (a test domain belonging to D. Fligel)
2. User the CA that you will be signing your Win 10 Machine certificates with.
Now we will add this “User” to a PKI Group for user in the Phase-Interface
NOTES
Then apply the following block modifying it as necessary to support your use case:
NOTES
1. The set peergrp function is used to allow authentication only to machine certificates
signed by our CA
2. The set certificate function is used to define the certificate that the IPSEC tunnel will
serve to the client. This MUST match the FQDN configured as the server in the client.
3. The set ipv4-split-include function is used to specify the range of traffic that will be
permitted over the tunnel. All other traffic should be routed by the client’s default route.
This setting requires further experimentation.
4. The security setting for proposal and DH Group are the strongest possible security
settings supported by the W10 Native IKEv2 Client.
5. Do not amend settings unless absolutely necessary and only after verifying functionality
using the “client tunnel”
4.5 Configure Phase2-Interface
Log on to your FortiGate using an SSH client of your choice with an admin user.
Then apply the following block modifying it as necessary to support your use case:
NOTES
1. The security settings used are the strongest possible security settings supported by the
W10 Native IKEv2 Client - do not amend unless absolutley necessary.
Then apply the following block modifying it as necessary to support your use case:
NOTES
As we will be using Machine Certificates we need to install the CA and Intermediate certs in the Machine Certificate Stores.
WINDOWS KEY–> TYPE MMC –> RIGHT CLICK –> RUN AS ADMINISTRATOR
Note: Although not explicitly stated you can import .pem certificates. No requirement to convert to .pfx
The certificate must also use a ECDH_P384 Private Key. If this is not used DH Groups selected will result in failed IKE negotiations. As the Windows
Native VPN dos not support very large or secure RSA keys for DH groups I advise using Elliptic Curve
Failure to meet all of these requirement will result in a certain failure and extremely difficult troubleshooting.
When generating the CSR for the CA to sign follow these steps as closely as possible:
Copy your HOSTNAME to clipboard you will be using it in step 4,5,6 etc.
5.2.1
5.2.2
5.2.3
5.2.4
5.2.5
5.2.6
5.2.7
It is critical that the EKU setting are enabled as displayed I would hasten to add that IP Security and IKE Intermediate Option may also be added
depending on your use case. In my testing I added it.
5.2.8
5.2.9
CORRECTION Use Software Provider not Smart Card Provider if you do not wish to store the machine certificate on a smart card.
5.2.10
Get your CA to Sign Certificate. This will be the certificate used by the VPN profile created in 5.3
And run
1 .\vpn1.ps1 -xmlFilePath ProfileXML-UserTunnel.xml -ProfileName UserTunnel
If you cannot run the script you may need to set execution policy as follows:
Now we must apply the necessary IPSEC Security Parameteres to the newly created VPN as follows:
1 Set-VpnConnectionIPsecConfiguration -ConnectionName UserTunnel -EncryptionMethod AES256 -CipherTransformConstants AES256 -IntegrityCheckMethod SHA256,SHA384 -PfsGroup ECP256,ECP25
5.3.2 - Verify the VPN entry has been correctly created and is working
and:
If everything has been created correctly you can connect to the VPN using the Win10 GUI or from Powershell command line by typing:
1 rasdial.exe UserTunnel
As the FortiGate is the receiver it is the ideal place to troubleshoot these types of connections from an SSH session to the FortiGate run the following
commands:
You can also run a packet sniff with very specific criteria to verify the packets are hitting the FortiGate such as:
As with IPSEC connectivity issues the use of diag sniffer packet is usually best to see if the packets are attempting to enter the FortiGate. Failure to
traverse the FortiGate will be either a policy or a routing issue. First confirm there is a route on the FortiGate with:
1 route print
And run
1 PsExec -i -s Powershell
This will open a Powershell session in the SYSTEM contect you can verify this by running:
1 whoami
You can now verify the tunnel has been created by running
1 Get-VpnConnection -AllUserConnection
and
If everything is showing correctly. The VPN should now automatically establish and stay up whenever it is available. You now have an always on VPN
tunnel to the FortiGate.
NOTE The tunnel will not appear under rasdial.exe or in the User session under VPNs NOTE You can if you wish create a User VPN tunnel to different
destination. W10 will support one device tunnel and one user tunnel simultaneously
Index