Created on
08-10-2022
09:13 AM
Edited on
10-29-2025
02:09 AM
By
Jean-Philippe_P
| Description | This article describes how to add Multiple Destination or Source addresses to the Session Filter. |
| Scope | FortiGate. |
| Solution |
While troubleshooting, the session filter command is used in FortiGate to check the DNAT/SNAT, policy, gateway, etc, for a particular source towards a particular destination IP. This KB article explains how to add multiple source and destination IPs to the filter so that the details for the specified IPs (sources and destinations) can be checked at the same time.
Example used here, IP: 1.1.1.1 and 8.8.8.8 as destinations
diagnose sys session filter ext-dst 1.1.1.1 diagnose sys session filter ext-dst 8.8.8.8
To verify if the filter has been set:
diagnose sys session filter
session filter:
To view the output:
diagnose sys session list
Example output:
session info: proto=1 proto_state=00 duration=7 expire=493 timeout=500 flags=00000000 socktype=0 sockport=0 av_idx=0 use=3
session info: proto=1 proto_state=00 duration=5 expire=495 timeout=500 flags=00000000 socktype=0 sockport=0 av_idx=0 use=3
Similarly, one can also set to define multiple source IPs using the command below:
diagnose sys session filter ext-src x.x.x.x diagnose sys session filter ext-src y.y.y.y
Note: Keep the 'src' filter or 'dst' filter unset when using session filters to list sessions from multiple sources and/or destinations using the extended match list options 'ext-src' and 'ext-dst', which otherwise may not pull up all the matching sessions.
For example, while using both the dst filter and the ext-dst filter, expected sessions are not filtered.
FortiGate-300E # diagnose sys session filter dst 8.8.4.4 FortiGate-300E # diagnose sys session filter ext-dst 4.2.2.4 FortiGate-300E # diagnose sys session filter FortiGate-300E # diagnose sys session list FortiGate-300E # diagnose sys session filter dst 0.0.0.0 <--- Unset dst filter. FortiGate-300E # diagnose sys session filter ext-dst 8.8.4.4 FortiGate-300E # diagnose sys session filter
Session Filter reference: Technical Tip: Using filters to clear sessions on a FortiGate in the CLI |
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.