Created on
‎02-03-2023
01:21 AM
Edited on
‎11-28-2025
02:07 AM
By
Jean-Philippe_P
| Description | This article describes how to troubleshoot IPsec error 22: Invalid argument. |
| Scope | FortiGate. |
| Solution |
FG-A: [IPSec_local]. IPSec_local_subnet_1: 10.251.0.0/20. IPSec_local_subnet_2: 10.251.0.0/24. [IPSec_remote]. IPSec_remote_subnet_1: 10.120.0.0/20.
FG-B: [IPSec_local]. IPSec_local_subnet_1: 10.120.0.0/20. [IPSec_remote]. IPSec_remote_subnet_1: 10.251.0.0/20. IPSec_remote_subnet_2: 10.251.0.0/24.
diagnose vpn ike log-filter dst-addr4 <remote_IP> diagnose debug application ike -1 diagnose debug enable
Note: Starting from FortiOS v7.4.1, the 'diagnose vpn ike log-filter dst-addr4' command has been changed to 'diagnose vpn ike log filter rem-addr4'.
To stop the debugging, run the following commands:
diagnose debug disable diagnose debug reset
It was also observed from FG-A that the SA_DONE operation failed with error 2: No such file or directory:
FG-A:
FG-B:
Removing 10.251.0.0/24 from the address group on both FortiGates would prevent the IPsec tunnel issue regardless of whether FG-A or FG-B becomes the initiator.
Note: Additionally, the command 'diagnose vpn tunnel list name <name>' can be used to quickly identify overlapping subnets within the phase-2 settings. This output provides a detailed breakdown of all source and destination ranges associated with the tunnel.
Example output:
proxyid=IPSec-Tunnel proto=0 sa=0 auto-negotiate dst: 0:172.25.0.0-172.25.255.255:0
It is visible that the '172.25.0.0/16' subnet overlaps with '172.25.x.x' addresses. |
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.