| Description | This article explains the working of the DPD mechanism set to 'on-demand'. |
| Scope | FortiGate. |
| Solution |
When DPD is set to on-demand, this will notify FortiGate to send DPD message to check the liveliness of the remote VPN peer only when the VPN tunnel does not receive any ESP packets from the remote VPN peer for a specific amount of time (dpd-retryinterval). If the VPN tunnel did not receive the DPD R-U-THERE ack from the remote VPN peer for a specific number of seconds (dpd-retrycount * dpd-retryinterval), FortiGate will understand the remote peer is not active and bring down the tunnel.
On-demand will eliminate the regular DPD check and only get triggered when there is no response; the decrypt packet count is not incrementing for DPD retryinterval time.
For example: PC---HO FGT (Tunnel name: SPOKE)---IPSEC tunnel---SPOKE FGT ---SERVER
VPN Tunnel SPOKE is up, and test ICMP traffic is initiated from a client behind HO. However, there is no response from the destination. So in HO FortiGate, one-way communication is happening via the tunnel, which results in only egress of ESP packets from HO to Spoke (tunnel ENC count gets incremented), and there is no ingress of ESP packets from SPOKE to HO (DEC count is stagnant).
FGT1_HO_TLP # diagnose vpn tunnel list proxyid_num=1 child_num=0 refcnt=4 ilast=113 olast=113 ad=/0
ICMP communication is initiated, which results in an increment in enc count; the dec count stays 0 since the ICMP response is blocked at the remote site.
name=SPOKE ver=1 serial=2 10.40.51.6:0->10.40.19.18:0 nexthop=10.40.51.41 tun_id=10.40.19.18 tun_id6=::10.40.19.18 status=up dst_mtu=1500 weight=1 proxyid_num=1 child_num=0 refcnt=4 ilast=0 olast=0 ad=/0 ------------------------------------------------------ proxyid_num=1 child_num=0 refcnt=4 ilast=32 olast=0 ad=/0
As there is no ingress traffic through the VPN tunnel for the DPD retry interval, the DPD probe will get triggered.
FGT1_HO_TLP # diagnose vpn tunnel list2025-03-27 03:25:33.214797 ike V=root:0:SPOKE: link is idle 4 10.40.51.6->10.40.19.18:0 dpd=2 seqno=55 rr=0
FortiGate receives a DPD notify msg response from a remote VPN peer so Tunnel will stay up and working. If there is no response for a number of dpd-retrycount attempts, the tunnel will go down due to DPD failure.
In this example, DPD notified by the initiator is getting a response; this confirms the tunnel is up and stable, but communication is not successful due to some reason.
Once there is an ingress ESP packet matching phase 2 received within the dpd-retryinterval, DPD on demand will not get triggered.
Related articles: |
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.