Technical Tip: How to configure IPsec remote access with a full tunnel
Description
This article describes how to configure a remote access VPN with a full tunnel when it is required that the remote VPN user's internet traffic go through an IPsec VPN tunnel.
Scope
FortiGate (FortiOS v6.4, v7.0, v7.2, v7.4, v7.6)/FortiClient v7.0/v7.2/v7.4 (Windows/macOS).
Solution

To create a new firewall address, go to Policy & Objects -> Addresses and select 'Create New'. Set Category to address and enter a Name. Set type to 'Subnet' under Subnet/IP Range to the local subnet, and Interface to 'lan'.
Configuring the IPsec VPN.
To create the VPN, go to VPN -> IPsec Wizard and create a new tunnel using a pre-existing template.
Name the VPN.
The tunnel name cannot include any spaces or exceed 13 characters.
Enter a pre-shared key.
Enter a 'Client Address Range' for VPN users.
The IP range entered here prompts FortiOS to create a new firewall object for the VPN tunnel using the name of the tunnel, followed by the '_range' suffix (in the example, IPsec-FCT_range).
Make sure Enable IPv4 Split Tunnel is not selected, so that all Internet traffic will go through the FortiGate.
If Enable Split Tunneling is selected, traffic not intended for the corporate network will not flow through the FortiGate or be subject to the corporate security profiles.



Select 'Convert To Custom Tunnel'.
In the Authentication section, select 'Edit'.
Under 'Peer Options', set 'Accept Types' to 'Specific peer ID'.
In the 'Peer ID' field, enter a unique ID, such as 'dialup1'.
Select 'OK'.
To view the VPN interface created by the wizard, go to Network -> Interfaces.



- Set a policy name that will identify what this policy is used for (in the example, IPsec-VPN-Internet).
- Set the Incoming Interface to the tunnel interface and the Outgoing Interface to WAN1.
- Set Source to the IPsec client address range, Destination Address to all, Service to ALL, and enable NAT.

For more details, refer to the FortiGate Administration Guide: Using single or multiple user groups for user authentication.
Note Public Cloud: For FortiGate HA deployments on the cloud, it is required to manually set the same IP on the tunnel interface on the secondary unit. The cluster will be out of sync until this action is performed. This only occurs if the IP on the IPsec tunnel is configured.
- Config through the member 'FGT-A' as stated above.
- Copy the interface tunnel settings to the secondary member 'FGT-B'.
- The cluster will be in sync again.
To add the VPN connection, open FortiClient, go to Remote Access, and select 'Add a new connection'.
- Set the VPN to 'IPsec VPN' and 'Remote Gateway' to the 'FortiGate IP address'.
- Set 'Authentication Method' to' Pre-Shared Key' and enter the key below.

When using full-tunnel, there will be an instance when access to the local network of the remote user is not possible. To avoid this, in the FortiClient, enable the option 'Enable Local LAN':
Expand the 'Phase2' on FortiClient routes to ensure 0.0.0.0/0 from the client goes into the tunnel.


Note:
Make sure there is no VIP configured for port 500 and port 4500 on the WAN interface that is being used for the IPsec dial-up connection. Otherwise, the connection to the IPsec dial-up cannot be established successfully.
Note:
If the DH value in phase1 and phase2 are set to 5, there are chances to get connection failures after upgrading to the 7.6.5 version of FortiOS. Because the default DH value has been changed from 5 and 14 to 14,20, and 21. To not make any disruption for the users, better to update DH groups to 14, 20 or 21.
Debugging:
diagnose debug disable
diagnose debug reset
diagnose vpn ike log-filter dst-addr4 <ip.of.remote.peer>
diagnose debug application ike -1
diagnose debug console timestamp enable
diagnose debug enable
Starting from v7.4.1, the 'diagnose vpn ike log-filter dst-addr4' command has been changed to 'diagnose vpn ike log filter rem-addr4'.
If it is already configured, follow the below option to disable the EMS SN verification option:
- FortiClient v7.4.4 does not support IPsec VPN IKEv1. Configure IPsec VPN IKEv2 if using FortiClient v7.4.4. To download a different version of FortiClient, log in to the support portal and download the required version. Refer to this article: Technical Tip How to download different or old versions FortiClient.
- FortiClient v7.4.4 does not include a free VPN-only agent. Users can continue to use the FortiClient v7.4.3 free VPN-only agent.
FortiClient feature comparison: 7.4.4 - SAML-based authentication is now supported for FortiClient remote access dial-up IPsec VPN clients.
Key details:
-
Requires FortiClient v7.2.4 or later.
-
Supports IKEv2 only (IKEv1 is not supported).
-
Compatible with two-factor authentication (2FA) using FortiToken Push.
Related documents:
Technical Tip: How to configure IPsec remote access with full tunneling
Technical Tip: FortiGate IPsec VPN Resource List
Technical Tip: FortiGate Resource Lists
Technical Tip: Restrict SSL VPN and Dial-up IPsec to only devices with FortiClient connected to FortiClient EMS Server
Technical Tip: Unable to Access Local Lan Resources When Connected to IPsec Dial Up Full Tunnel
Technical Tip: Procedure to add multiple user group in XAUTH in dial-up IPsec VPN configuration
Technical Tip: Using group based firewall policy for Dial-Up VPN to restrict network access
Technical Tip: FortiGate settings compatible with default FortiClient IPsec settings
Technical Tip: FortiClient Dialup IPsec VPN (Split Tunneling)
Troubleshooting Tip: Connected to Dialup IPsec tunnel but traffic hitting implicit Deny Policy
Troubleshooting Tip: SAML Authentication fails after firmware upgrade to v7.2.12, v7.4.9 or v7.6.4
Technical Tip: Full and Split Dialup IKEv1 IPsec tunnel with FortiToken 2FA
