Created on ‎11-24-2021 11:47 AM Edited on ‎11-13-2024 06:56 AM By Jean-Philippe_P
Description | This article describes how to resolve ESP traffic being dropped due to a PBA leak. |
Scope | FortiOS. |
Solution |
In some situations, when clear text or ESP packets in IPsec sessions may have large amounts of layer 2 padding, the NP6 IPsec engine may not be able to process them and the session may be blocked. In such cases, check if the enc/dec counters in 'diagnose vpn tunnel list <name>' command:
dec:pkts/bytes=1/60, enc:pkts/bytes=1234/150754
Generate traffic across the tunnel and run this command multiple times. Confirm if these counters increment.
It is also best practice to run packet captures on the remote peer for ESP traffic. Confirm if the peer is sending the ESP traffic to its ISP gateway. Run packet capture for ESP traffic on the local peer’s wan interface. Using Wireshark confirm if the traffic from a remote peer was received successfully.
More information on decrypting ESP traffic using Wireshark can be found in the below link:
To confirm if the issue is actually with NP, try to disable asic-offloading. Below are the commands to disable NPU offloading: config vpn ipsec phase1-interface edit phase-1-name set npu-offload disable end
Ensure that the firewall policies created for the VPN tunnels have auto-asic offloading disabled.
config firewall policy edit <policy_id> set auto-asic-offload disable end
Note that disabling NP will cause the tunnel to flap. If the traffic across the tunnel is critical it is better to make these changes during the maintenance window. Now after disabling NP, if the traffic flow is working as expected then enable auto-asic offload and collect the NP debug logs. NP6 debug logs are mentioned below:
diagnose npu np6 port-list diag npu np6 dce <id> diag npu np6 pdq <id> diag npu np6 register <id> diag npu np6 sse-stats <id>
** id = 0-3 depending on the hardware model. Run the above command multiple times and make sure to run it during the issuing state.
To confirm if there is a PBA leak:
diagnose npu np6 sse-stats 2 Counters SSE0 SSE1 Total --------------- --------------- --------------- --------------- active 6684 6631 13315 insert-total 1020723648 1019924808 2040648456 insert-success 1020723648 1019924808 2040648456 delete-total 1020716964 1019918177 2040635141 delete-success 1020716963 1019918176 2040635139 purge-total 0 0 0 purge-success 0 0 0 search-total 1177004741 2620746558 3797751299 search-hit 1481226345 3765280856 5246507201 mcast-tx 0 0 0 --------------- --------------- --------------- --------------- pht-size 8421376 8421376 oft-size 8355840 8355840 oftfree 8355837 8355837 PBA 3002 drv-drift 0
This value should be less than or equal to 3001.
LAB1 # diagnose npu np6 dce 0 LAB1 # diagnose npu np6 dce 0 LAB1 # diagnose npu np6 dce 0 LAB1 # diagnose npu np6 dce 0 LAB1 # diagnose npu np6 dce 0
Once the IPSec engine cannot process the traffic, and perform the encryption the session is discarded by the engine raising the counter for IPSEC1_ENGINBx.
Enable the following settings to fix the issue.
config system npu set strip-esp-padding enable set strip-clear-text-padding enable end
After this, reboot the unit. Note that if there is an HA cluster then ensure to reboot all the units in the HA clusters.
Workaround for this issue:
The issue might be related to offloading. Verify if there are drops in NP6 packets using the following debugs:
diagnose npu np6 dce <id>
This command displays the number of dropped packets for the selected NP6 processor.
If there are drops, verify by disabling NPU offload. Note disabling NPU will cause the tunnel to flap. If the traffic across the tunnel is critical, it is best to make these changes during the maintenance window or after hours.
config firewall policy <----- For internal to VPN an VPN to internal firewall policies.
config vpn ipsec phase1-interface
After disabling offload, if the traffic flow is working as expected, enable offload and collect NP debug logs for further investigation and attach them to a TAC ticket.
diagnose npu np6 port-list
If still issues, it is possible to the run following command on originating FortiGate using Putty while doing a large file transfer, for example using SMB, enable logging for Putty, and create a FortiCare ticket:
Attach also results of iPerf tests as per the following useful KB article: Technical Tip: Use cases for the diagnose traffictest command |
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 2024 Fortinet, Inc. All Rights Reserved.