FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
aahmadbasri
Staff
Staff
Article Id 240429
Description This article describes how is the IPsec Tunnel ID behavior.
Scope FortiOS 7.0.1 and above.
Solution

In FortiOS 7.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
    config vpn ipsec phase1-interface
        edit "ToLotus"
            set interface "port1"
            set peertype any
            set net-device disable
            set proposal aes128-sha256 aes256-sha256 aes128-sha1 aes256-sha1
            set comments "VPN: ToLotus (Created by VPN wizard)"
            set wizard-type static-fortigate
            set remote-gw 10.47.2.140

 

diagnose vpn ike gateway list

vd: root/0
name: ToLotus
version: 1
interface: port1 3
addr: 10.47.1.13:500 -> 10.47.2.140:500
tun_id: 10.47.2.140/::10.47.2.140
remote_location: 0.0.0.0
network-id: 0
created: 298s ago
IKE SA: created 2/2 established 2/2 time 10/4510/9010 ms
IPsec SA: created 1/2 established 1/1 time 20/20/20 ms

 

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
    config vpn ipsec phase1-interface
        edit "ToLotus"
            set interface "port1"
            set peertype any
            set net-device disable
            set proposal aes128-sha256 aes256-sha256 aes128-sha1 aes256-sha1
            set comments "VPN: ToLotus (Created by VPN wizard)"
            set wizard-type static-fortigate
            set remote-gw 10.47.18.140

 

diagnose vpn ike gateway list

vd: root/0
name: ToLotus
version: 1
interface: port1 3
addr: 10.47.1.13:500 -> 10.47.18.140:500
tun_id: 10.47.2.140/::10.47.2.140
remote_location: 0.0.0.0
network-id: 0
created: 64s ago
IKE SA: created 1/1 established 1/1 time 0/0/0 ms
IPsec SA: created 1/1 established 1/1 time 110/110/110 ms

 

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:

 

  1. Reconfigure it, creating a new tunnel.
  2. Reboot the FortiGate.

 

Related article: 

Technical Tip: IPSEC VPN route shows a different gateway IP than a remote IP address