
Clearing session Fortigate sessions with FortiOS can be a bit tricky, but don't worry, it's a straightforward process.
To start, you need to access the FortiOS web interface and log in with your admin credentials.
Once you're logged in, navigate to the "System" tab and select "Session" from the drop-down menu.
From here, you can view all active sessions on your Fortigate device, which is useful for troubleshooting or identifying issues.
To clear a session, simply click on the "Clear Sessions" button at the top of the page.
Discover more: Google Cloud Next Sessions
FortiGate Troubleshooting
When troubleshooting FortiGate firewalls, understanding packet captures is crucial. Being able to analyze a packet capture is paramount in troubleshooting anything involving networking.
You can use the dia sniffer packet and dia debug flow commands in FortiOS to troubleshoot issues. Another useful command is the dia sys session, which allows you to look at the session table.
Stateful inspection is a firewall technology that keeps track of active connections and allows reverse traffic through the firewall. This is particularly useful for controlling traffic and preventing security threats.
Worth a look: How to Stop Bot Traffic on Website
Here are some common protocol numbers:
- ICMP: 1
- TCP: 6
- UDP: 17
It's worth noting that ICMP protocol always has a proto_state of 00 since the packet is non-stateful by default.
To clear sessions on a FortiGate, you can use the diagnose sys session filter command. This command allows you to set up a session filter to clear sessions matching specific criteria.
Here are some common options for the diagnose sys session filter command:
- vd: Index of virtual domain. -1 matches all.
- vd-name: Name of virtual domain. -1 or "any" matches all.
- sintf: Source interface.
- dintf: Destination interface.
- src: Source IP address.
- nsrc: NAT'd source ip address
- dst: Destination IP address.
- proto: Protocol number.
- sport: Source port.
- nport: NAT'd source port
- dport: Destination port.
- policy: Policy ID.
- expire: expire
- duration: duration
- proto-state: Protocol state.
- session-state1: Session state1.
- session-state2: Session state2.
- ext-src: Add a source address to the extended match list.
- ext-dst: Add a destination address to the extended match list.
- ext-src-negate: Add a source address to the negated extended match list.
- ext-dst-negate: Add a destination address to the negated extended match list.
- clear: Clear session filter.
- negate: Inverse filter.
When creating a filter, it's essential to use the filter option to avoid overflowing the session table. This will show only the sessions that match your filter criteria.
Additional reading: What Is Call Filter plus on Verizon
Here's an example of how to create a filter to match a source IP and a destination port:
diagnose sys session filter src 10.160.0.1
diagnose sys session filter dport 80
diagnose sys session filter
To clear the sessions matching the filter, use the diagnose sys session clear command.
Remember to always issue the diagnose sys session filter clear command after clearing sessions to avoid any unexpected behavior.
On a similar theme: Azure Ad Revoke Sessions
Clearing Sessions
To clear sessions on a FortiGate firewall, you can use the "diagnose sys session clear" command. This will delete all sessions currently opened on the FortiGate unit, so use it with caution.
You can also use the "diagnose sys session filter" command to narrow down the sessions you want to clear. For example, you can filter sessions that are sourcing from a specific IP address, such as 192.168.1.10.
To filter sessions, you can use various options such as "src" for source IP address, "dport" for destination port, and "vd" for virtual domain index. For instance, to filter sessions that are sourcing from 10.160.0.1 and have a destination port of 80, you can use the following commands: FGT# diagnose sys session filter src 10.160.0.1 dport 80.
Broaden your view: Revoke Sessions Azure
Here are some common options you can use with the "diagnose sys session filter" command:
After applying the filter, you can use the "diagnose sys session list" command to view the filtered sessions. This will display the list of sessions that match your specified filtering criteria.
Featured Images: pexels.com


