Created on
08-04-2024
11:55 PM
Edited on
11-27-2025
03:33 AM
By
Jean-Philippe_P
| Description | This article describes why an IPSec tunnel flaps after phase 2 rekey. |
| Scope | FortiGate with NP6 chip (NP6 only, NP6XLite, and NP6Lite processors do not have this caching limitation). |
| Solution |
FortiGate NP6 processors offload IPsec sessions in a way that when a new Child SA is created during rekey, the NPU must flush and re-insert the session into its fast-path table. With anti-replay enabled (default), a very small number of in-flight packets can arrive with sequence numbers that the new offloaded SA considers 'already seen', causing a replay-window violation. The NPU silently drops these packets instead of falling back to slow-path/replay-check in software.
If the BGP keepalive or TCP ACK is dropped, the overlay protocol detects a timeout. Tunnel appears to 'flap' from the overlay perspective, even though IKE itself 'thinks' everything is fine.
To identify, the following commands need to be run during the issue:
diagnose npu np6 dce <id> diagnose npu np6 sse-stats <id>
Example:
FGT01 # diagnose npu np6 sse-stats 0 Counters SSE0 SSE1 Total
If the PBA value is more than 3001, refer to this KB article: Technical Tip: VPN (ESP) traffic dropped due to NP6 PBA leak.
In this case, the NPU is not dropping ESP packets as there is no output on diagnose npu np6 dce 0, and the PBA value is lower than 3001, but the tunnel flaps. Further, look at the VPN Events log and the Router Events log.
VPN Phase 2 rekey:
date=2024-05-21 time=15:35:41 eventtime=1719387341790962634 tz="+0800" logid="0101037129" type="event" subtype="vpn" level="notice" vd="root" logdesc="Progress IPsec phase 2" msg="progress IPsec phase 2" action="negotiate" remip=X.X.X.X locip=Y.Y.Y.Y remport=4500 locport=4500 outintf="port5" cookies="ce4eb0c7fbe1adb5/3adc9be4f3d96fdb" user="17.159.100.5" group="N/A" useralt="N/A" xauthuser="N/A" xauthgroup="N/A" assignip=N/A vpntunnel="SA-PJ" status="success" init="remote" exch="CREATE_CHILD" dir="outbound" role="responder" result="DONE" version="IKEv2" advpnsc=0
Router Events showing BGP peer Down:
Notice that within 2 minutes of phase 2 re-key, the BGP peer went down. This could be attributed to the behavior of the NP6 processors' cache inbound IPsec SA. IPsec VPN sessions with anti-replay protection that are terminated by the FortiGate may fail the replay check and be dropped.
To maintain the performance of NPU offloading on the tunnel, it is recommended to disable anti-replay on the tunnel instead:
config vpn ipsec phase2-interface end
Related document: |
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.