Description | This article describes issues that can arise when running diagnostic commands across FortiGate Cluster members where Virtual Domains are configured. |
Scope | FortiGate Cluster with Virtual Domains Configured. |
Solution |
Virtual Domains are assigned a numerical ID as well as an Alphanumeric Name. It could be assumed that the Virtual Domain numerical ID when viewed across cluster members would be the same, however, this is not always the case. As a consequence, when using diagnostic commands that can accept a Virtual Domain numerical ID or Virtual Domain Name, it is advisable to validate the numerical ID or to utilize the Virtual Domain Name.
The below example shows diagnostic command outputs from a FortiGate cluster with two members, FW1 and FW2. There are several Virtual Domains defined, but we focus on the CORE1 Virtual Domain. As we can see using the command 'diagnose system vd list' the Numerical ID differs across the Firewalls, but the Alphanumeric Name is consistent.
FW1 (global) # diagnose sys vd list | grep CORE1 name=CORE1/CORE1 index=1 enabled fib_ver=35 rpdb_ver=0 use=348 rt_num=62 asym_rt=0 sip_helper=0, sip_nat_trace=1, mc_fwd=0, mc_ttl_nc=0, tpmc_sk_pl=0
FW2 (global) # diagnose sys vd list | grep CORE1 name=CORE1/CORE1 index=2 enabled fib_ver=148 rpdb_ver=0 use=297 rt_num=12 asym_rt=0 sip_helper=0, sip_nat_trace=1, mc_fwd=0, mc_ttl_nc=0, tpmc_sk_pl=0
This behavior is important to take into account when utilizing commands such as 'diag sys session list' as it is possible to pass a filter that relies on the Numerical ID, or the Alphanumeric name, using the latter can result in incorrect conclusions that a session for example is not synchronized across nodes.
In the following example, there is an SSH session traversing the CORE1 virtual domain, terminating on the Server with IP address 192.168.251.254 on port 22. The administrator has already checked the VDOM ID on FW1, which is '1' and uses the same commands on each cluster member to filter sessions using the following filter settings:
FW1 (global) # diagnose sys session filter
When the command 'diag sys session list' is run on FW1, the expected session is visible:
FW1 (global) # diagnose sys session list session info: proto=6 proto_state=11 duration=11 expire=3588 timeout=3600 flags=00000000 socktype=0 sockport=0 av_idx=0 use=5
However, when setting the same filters, and run the command 'diagnose sys session list' on FW2, no sessions are visible:
FW2 (global) # diagnose sys session filter
FW2 (global) # diagnose sys session list
The reason for this is that the assumption was made initially that the Virtual Domain numerical ID is the same across the cluster members, but that is not true in this case. If adjusting the session filter on FW2 to reference the Virtual Domain ID '2', the session is present:
FW2 (global) # diagnose sys session filter vd 2 FW2 (global) # diagnose sys session list session info: proto=6 proto_state=11 duration=221 expire=3378 timeout=3600 flags=00000000 socktype=0 sockport=0 av_idx=0 use=4
If the Virtual Domain Name is used as opposed to the Virtual Domain ID, it is possible to see that when the session filter is set, the firewall resolves the Virtual Domain name to the correct Virtual Domain Numerical ID:
FW1 (global) # diagnose sys session filter vd-name CORE1
FW2 (global) # diagnose sys session filter vd-name CORE1
Care should be taken when working with Virtual Domains, and assuming that their numerical ID is consistent across cluster members, as demonstrated in this example. This is not always the case. Particular caution should be exercised when utilizing destructive commands e.g. 'diag sys session clear', if the wrong Virtual Domain Numerical ID is used across cluster members, clear the wrong Virtual Domain session table.
Related Articles Technical Tip: How it is possible to use 'filter' with 'diagnose sys session list' command to get th...Technical Tip: Using filters to clear sessions on a FortiGate Troubleshooting Tip: FortiGate session table information |
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.