Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
DTNappo
New Contributor

Displaying the MAC address of a Switchport in CLI

How do I display a MAC Address on a port in CLI - Currently have OS 7.4.2.  This should be very simple but cannot find any documentation.   Also, in the GUI, how do I clear the MAC and IP info when a new device is plugged into the port.  It shows the old MAC and IP even if I bounce the port.

9 REPLIES 9
tokidsam
New Contributor

The instructions I provided are the generally accepted means of accessing the CLI on most UniFi network switches, but there may be models that don't expose a CLI at all. I can confirm it works as described on my 24 port PoE switch at home https://mobdro.bio/ .

DTNappo

Not seeing any instructions

 

ozkanaltas
Contributor III

Hello @DTNappo ,

 

You can see the Mac address table with this command. 

 

diagnose switch mac-address list

 

And also, you can find cli commands for FortiSwitches in this link.

 

https://docs.fortinet.com/document/fortiswitch/7.4.3/fortiswitchos-cli-reference/452179/diagnose#dia...

 

If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
DTNappo

Went though all the commands and can't seem to find what I am looking for,  I'm an old Cisco guy and still learning the Fortinet.  SO what I am looking for is to see a Certain MAC address coming off a Certain Interface on a switchport.  

 

ozkanaltas

You can use this command with "grep". For example; 

 

diagnose switch mac-address list | grep "aa:bb:cc:dd:ee"
 
If you have found a solution, please like and accept it to make it easily accessible to others.
NSE 4-5-6-7 OT Sec - ENT FW
If you have found a solution, please like and accept it to make it easily accessible to others.NSE 4-5-6-7 OT Sec - ENT FW
Toshi_Esumi

FortiswitchOS doesn't support "grep".

 

Toshi

Toshi_Esumi

or does it?
Looks like does it. Sorry.

Toshi

Toshi_Esumi
SuperUser
SuperUser

I don't have a FSW managed by a FGT to test. But it seems to be "diag switch-controller mac-host-switch-port" at least 6 years ago according to this reddit post. I seems to show all switches' all ports though.
https://www.reddit.com/r/fortinet/comments/7vglnk/fortiswitches_managed_by_a_fortigate_question/

Toshi

Toshi_Esumi

Sorry. Looks like you're looking for FSW CLI, not managed by FGT.

Toshi

Labels
Top Kudoed Authors