Created on
12-21-2022
01:19 AM
Edited on
09-09-2025
12:58 AM
By
Jean-Philippe_P
Description | This article describes how the IPsec Tunnel ID behaves. |
Scope | FortiOS v7.0.1 and above. |
Solution |
In FortiOS v7.0.1 and above, each IPsec tunnel is identified by the tunnel ID. The tunnel ID is automatically assigned with the remote gateway IP address in phase 1 configuration.
For example :
show vpn ipsec phase1-interface
diagnose vpn ike gateway list vd: root/0
If there is any change in the configuration of the remote gateway in phase1, the tunnel ID will remain as first configured.
For example, the gateway of the same tunnel is now changed:
show vpn ipsec phase1-interface
diagnose vpn ike gateway list vd: root/0
Note that tun_id remained as 10.47.2.140. Flushing the tunnel will not make any difference. However, the tunnel should be working as intended, as the tunnel ID is only used as an identifier.
If there is a need to change the tun_id to reflect the new gateway IP, choose one of the following steps:
Note: The remote-gateway IP selected as tunnel-id is only for the normal site-to-site VPN scenario. In the ADVPN hub-and-spoke configuration, the tunnel-id on the hub will be the IPsec tunnel interface IP of each spoke instead of remote-gateway IP once the 'auto-discovery-receiver' is enabled on the spoke. This is to ensure the hub will be able to forward traffic to the correct sub-tunnel in the BGP route. If this option is disabled, the remote-gateway IP will become the tunnel ID of each sub-tunnel on the hub, which will be different from the next-hop IP in the BGP route. In that case, the hub will get confused, and the hub-and-spoke topology will stop working.
Related documents: Technical Tip: IPsec VPN route shows a different gateway IP than a remote IP address |
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.