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.
kaman
Staff
Staff
Article Id 363369
Description

 

This article describes how to use the FortiGate Sniffer when space exists between VLAN names.

 

Scope

 

FortiGate.

 

Solution

 

The sniffer command requires the use of the backslash '\' character to separate words in the VLAN name. For example when the VLAN name is 'switch Mgmt', the correct input would be 'switch\ Mgmt'. This format is valid for IPSEC tunnel interfaces as well.


For example:

 

diagnose sniffer packet switch\ Mgmt ' port 67 or port 68 ' 4 0 l


sniffer-1.png
The below error occurs when a backslash ('\') is missing between VLAN names in the sniffer command.

sniffer-2.png

 

Another way to run the sniffer command without any errors with spaces is by using single quotes ('switch Mgmt') or double quotes ("switch Mgmt") around the word containing the space as demonstrated below:

 

diagnose sniffer packet "switch Mgmt" ' port 67 or port 68 ' 4 0 l

 

diagnose sniffer packet 'switch Mgmt' ' port 67 or port 68 ' 4 0 l

 

sniffer-with-space.PNG

 

Note:

The best practice is to never use spaces for objects on FortiOS. It is possible to use underscore ('_') or hash characters ('-') to separate two or more words, but spaces should always be avoided.

 

Another way is to use the Diagnostics from GUI and select the VLAN interface:

 

Screenshot 2025-03-05 151531.png