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
The below error occurs when a backslash ('\') is missing between VLAN names in the sniffer command.
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
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: