Description | This article demonstrates FortiGate configuration for combining client certificate authentication with RADIUS or LDAP user authentication for IPsec VPN. |
Scope |
FortiOS v7.4.2 and later, FortiClient v7.2. For LDAP authentication with IKEv2, FortiClient v7.4.3 and later. |
Solution |
Similar to SSL VPN, FortiOS IKEv2 IPsec VPN supports client authentication using certificate in conjunction with user/password-based authentication.
Configuration: Import the certificate of the CA which is signing user certificates to the FortiGate as a new remote CA certificate. See the CA certificate. The CA certificate will have an automatically generated name. It is recommended to rename the certificate after import for ease of administration.
config vpn certificate ca Configure a user peer referencing the remote CA. Optionally add a subject match to search the user certificate common name for a particular string. config user peer edit "peer_admin-ou" set ca "root-g1.users.example.com" set subject "OU=ADMIN" <-- optional next end Import a trusted local certificate to the FortiGate. If the firewall already has a trusted SSL certificate, for example one used for SSL VPN server, this step can be skipped and the existing certificate applied to the IPsec VPN.
The certificate is named automatically when created, but can be renamed. This is for administrative purposes only and does not affect certificate operation. config vpn certificate local Configure an IKEv2 dialup tunnel referencing the local certificate. config vpn ipsec phase1-interface edit "RA_VPN_ADMIN" set type dynamic next end
config vpn ipsec phase2-interface edit "p2_RA_VPN_ADMIN" set phase1name "RA_VPN_ADMIN" next end Configure users and user group(s) based on the user authentication method. RADIUS users: RADIUS and LDAP user groups should not be configured on the same VPN tunnel.
config user radius edit "RADIUS" set server "10.250.0.21" next end
config user group edit "VPN User Group" set member "RADIUS" config match <-- optional. By default checks Vendor 12356, VSA 26. edit 1 set server-name "FAC" set group-name "General Access Group" next end next end
config user ldap edit "LDAP" set server "10.250.0.21" next end
edit "VPN User Group" set member "LDAP" config match <-- optional edit 1 set server-name "LDAP" set group-name "cn=General Access Group,ou=test_users,dc=example,dc=com" next end next end
Note: Using LDAP with IKEv2 IPsec VPN requires FortiClient v7.4.3 and later, as well as advanced FortiClient configuration. See the article Technical Tip: How to enable EAP-TTLS for IPSec IKEv2 tunnels in VPN-only (unlicenced) FortiClient
Local users:
config user local edit "jsmorth" set type password set passwd <password> next edit "mdijk" set type password set passwd <password> next end
config user group edit "VPN User Group" set member "jsmorth" "mdijk" next end Configure one or more firewall policies referencing an IPsec tunnel and a user group. config firewall policy edit <index> set name "RA_VPN_ADMIN General Access" set groups "VPN User Group" next end
Provision certificates on the VPN client. For domain-joined endpoints, this may be done automatically via GPO. For an example of how to manually import a certificate using Windows, see Importing user certificate into Windows 10
config vpn ipsec phase1-interface edit "RA_VPN_ADMIN" set certificate "2025_vpn.sitea.example.com" next end
Configure FortiClient Remote Access connection.
It is strongly recommended to configure the remote gateway using an FQDN resolving to the FortiGate's external IP address and enable cert_subjcheck in XML configuration, see IKE settings. Without this configuration, FortiClient will accept any trusted publicly signed certificate as valid for the Remote Gateway, regardless of the CN or SAN of the certificate.
Related documents: IPsec IKEv2 VPN 2FA with EAP and certificate authentication Using single or multiple user groups for user authentication |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.