Technical Tip: How to configure IPsec VPN Tunnel using IKE v2
Description | This article describes how to configure an IPsec VPN Tunnel using IKE v2 in FortiClient. |
Scope | FortiClient, FortiGate. |
Solution | The FortiGate IPsec tunnels can be configured using IKEv2. ![]()
This document provides an example of configuring IPsec VPN connectivity using a local user defined on the FortiGate device. For detailed instructions on creating local users, remote users, or user groups, refer to the following Fortinet documentation:
Summary of the FortiGate GUI configuration:
![]()
The following commands need to be applied manually via CLI; these are needed for IKEv2 user authentication:
Starting from FortiOS 7.6.1, enabling EAP and specifying the User group within the IPsec VPN tunnel can be configured directly via the Graphical User Interface (GUI). These options are available under VPN -> VPN Tunnels -> Edit Tunnel Settings -> Authentication. ![]() If the IKEv2 IPsec tunnel is intended for use by multiple user groups, unset the 'authusrgrp' setting. When this option is unset, user groups must instead be specified in the source field of the firewall policy. The behavior is similar to the 'Inherit from policy' XAUTH option used for IKEv1 IPsec tunnels.
For more information about configuring single or multiple user groups for IPsec see the documentation: Using single or multiple user groups for user authentication | FortiOS Administration Guide
The final configuration looks like the following:
If more than one IPsec tunnel is configured, it is necessary to configure a 'Peer ID' (and 'Local ID' when it is IKEv2) following the article, Technical Tip: How to use Peer IDs to select an IPsec dialup tunnel on a FortiGate configured with multiple dialup tunnels.
Note:
Once the tunnel VPN is created, create a firewall policy to allow traffic from the 'Dial-up' VPN interface to the internal network (for example, port5) as shown below:
![]()
Note: When setting up a dial-up IPsec VPN, user groups should be configured either in Phase 1 or in the firewall policy for the tunnel, together with the source address or address group. They should not be configured in both places at the same time. This is an example of how to configure the firewall policy with the user group: Replace <Policy_ID>, the interface names, and 'Test' with the values applicable to the environment. For more details, refer to the FortiGate Administration Guide: Using single or multiple user groups for user authentication | FortiOS Administration Guide.
![]()
Example of a successful VPN connection on FortiClient: ![]()
To stop the debugging, run the following commands:
The last message, 'sending SNMP tunnel UP trap', indicates that the tunnel is up and running.
DNS Suffixes for IPsec tunnels with IKEv2 IPsec VPN are supported on FortiOS v7.6.4 and later, FortiClient v7.4.4 and later.
Users connecting to an IKEv2 dial-up VPN will need to access resources by the full FQDN (for example, hostname.domain.tld) instead of just the hostname. This feature is scheduled to be added in v7.6.4 and FortiClient v7.4.4.
Notes:
Related articles: Technical Tip: IKEv2 Dialup IPsec tunnel with Radius and FortiToken MFA. Troubleshooting Tip: Troubleshooting IPsec Site-to-Site Tunnel Connectivity Technical Tip: How to configure VPN Site to Site between FortiGates (Using VPN Setup Wizard) Troubleshooting Tip: IPsec VPNs tunnels Technical Tip: Setting multiple DNS server for IPSec dial-up VPN Technical Tip: NAT-traversal comparison between site-to-site and dial-up” dynamic” tunnels Technical Tip: FortiGate Hub with multiple IPSec Dial-up phase1 using IKEv2 and PSK authentication Technical Tip : How to configure multiple VPN tunnels from the same ISP to the same remote peer ISP. Technical Tip: IPSec dial-up full tunnel with FortiClient Technical Tip: Differences between Aggressive and Main mode in IPSec VPN configurations Technical Tip: Dynamic routing (BGP) over IPsec tunnel Technical Tip: OSPF with IPSec VPN for network redundancy Technical Tip: Dynamic dial-up VPN with OSPF Technical Tip: Fortinet Auto Discovery VPN (ADVPN) Technical Tip: 'set net-device' new route-based IPsec logic Technical Tip: Simple OCVPN deployment Technical Tip: SD-WAN integration with OCVPN Technical Tip: Configure IPsec VPN with SD-WAN Technical Tip: SD-WAN with DDNS type IPsec Technical Tip: SD-WAN primary and backup ipsec tunnel Scenario Troubleshooting Tip: IPsec VPN Phase 1 Process - Aggressive Mode Technical Tip: Hard timeout for Dialup IPSEC VPN Tunnel Technical Tip: How to set DNS suffix for VPN SSL and IPsec in the FortiGate configuration |






