Created on
05-25-2021
01:08 AM
Edited on
05-12-2025
11:47 PM
By
Anthony_E
Description
This article describes how to assign the client IP address for ikev2 dialup clients using a DHCP proxy.
Scope
FortiGate.
Solution
Enable the global option DHCP proxy and add the DHCP server IP:
config system settings
set dhcp-proxy enable
set dhcp-server-ip "10.220.0.107"
end
Create User group:
show user group
edit "vpn-usergroup"
set member "vpn-user"
next
end
Setup VPN:
config vpn ipsec phase1-interface
edit "VPN-v2"
set type dynamic
set interface "port1"
set ike-version 2
set local-gw 10.109.21.41
set peertype any
set net-device disable
set mode-cfg enable
set proposal aes128-sha256 aes256-sha256 aes128gcm-prfsha256 aes256gcm-prfsha384 chacha20poly1305-prfsha256
set eap enable
set eap-identity send-request
set wizard-type dialup-forticlient
set authusrgrp "vpn-usergroup"
set assign-ip-from dhcp
set dhcp-ra-giaddr <the gateway IP address (giaddr) can be defined on a DHCP relay agent>
set dns-mode auto
set ipv4-split-include "VPN-v2_split"
set save-password enable
set psksecret ENC s0I3cSRvAeypQSHwIXZEOoj8Sln1xCG+CbFU/oC75IVGn+nbAdZTUIamZcqhohoFuCcvLHF2KT3htvcEOugblCZnPs/XnewPHTN66Y27Rw0dNH7zphxj1ZIhIEH05OVG6qHOZe9Jo2ZOnuOEWOKs0HuKbGMyYJ4bC0xd7NXG9Tn7bwOk1wYg==
next
end
config vpn ipsec phase2-interface
edit "VPN-v2"
set phase1name "VPN-v2"
set proposal aes128-sha1 aes256-sha1 aes128-sha256 aes256-sha256 aes128gcm aes256gcm chacha20poly1305
next
end
Create policies for Internal LAN:
config firewall policy
edit 1
set name "vpn_VPN-v2_remote_0"
set srcintf "VPN-v2"
set dstintf "internal"
set srcaddr "all"
set dstaddr ""VPN-v2_split"
set action accept
set schedule "always"
set service "ALL"
set nat enable
next
end
Configuration on FortiClient is basically as per phase1 and phase2 settings on the FortiGate. Make sure not to use the 'DHCP over IPsec' option.
This is a legacy option, only for use with DHCP relaying with IKEv1. Use the 'Mode config option as defined in the phase1-interface settings (mode-cfg enable).
Related articles:
Technical Tip: Configuring DHCP relay over IPSec VPN with overlapping subnets
Defining gateway IP addresses in IPsec with mode-config and DHCP
Technical Tip: IPsec IKEv2 with mode-config and DHCP using the gateway IP address
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.