Skip to main content
Vichu_94
Staff
Staff
May 16, 2022 5:14 AM UTC

Technical Tip: IPsec site to site IKEv2 VPN between FortiGate and third-party vendor is down with error 'INVALID_SYNTAX'

Description


This article describes how to troubleshoot the issue when the IPsec IKEv2 tunnel between FortiGate and any third-party goes down and shows the error 'INVALID_SYNTAX'.

 

Scope

 

FortiGate.

 

Solution

 

Considering FortiGate to be the initiator and any third-party vendor to be the responder in the setup.

  

IKEv2 has two phases, IKE_SA_INIT Exchange and IKE_AUTH Exchange.

During the IKE_AUTH Exchange second message, if the notify message (Payload: Notify (41) - INVALID_SYNTAX.), it indicates that it is a Phase 2 selector mismatch.

 

This can be verified with the IKE debugs as well:


diagnose debug application ike -1
diagnose debug console timestamp enable
diagnose debug enable


When running the IKE debug, it shows this error as shown below.


kb 12.PNG

 

When a packet capture is run, it shows the result as shown in the packet capture below:

 

pcap.png

 

To fix the issue, match the Phase 2 selectors on both units. 

 

Note: It is recommended that an IPsec VPN with third-party devices have individual Phase 2 selectors for different subnets instead of using an address group. This is because FortiGate builds a single Security Association (SA) that shares one SPI (Security Parameter Index) for all subnets, while third-party firewalls use a separate SPI value for each subnet. FortiGate creates different SPIs for multiple Phase-2 selectors.

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024