Skip to main content
peter-supply
New Member
Aug 22, 2025 12:45 PM UTC
Solved

CLI Command to view MAC on a specific managed switch port

We have multiple Fortiswitches managed by a Fortigate.  I need a command to see the MAC addresses on a specific port on a managed switch.  For example, I need to see the MAC addresses on port 1 of switch "1234." 

 

I can use this command to see "port1":

 

diagnose switch-controller switch-info mac-table | grep port1

 

But this command lists all the port 1s for all the managed switches.

 

I need a command that let's me specify which managed switch I want to view.

 

Thanks.

ozkanaltas
Valued Contributor III
Aug 22, 2025 12:58 PM UTC

Hello @peter-supply ,

 

Can you try like that?

 

diagnose switch-controller switch-info mac-table <SW_Serial_Number> | grep port1

3 replies

ozkanaltas
Valued Contributor III
Aug 22, 2025 12:58 PM UTC

Hello @peter-supply ,

 

Can you try like that?

 

diagnose switch-controller switch-info mac-table <SW_Serial_Number> | grep port1
peter-supply
New Member
Aug 22, 2025 1:02 PM UTC

Thank you!  That works!  Should have tried that before I posted.  I greatly appreciate your help.

ozkanaltas
Valued Contributor III
Aug 22, 2025 1:18 PM UTC

Hello @peter-supply ,

 

I'm happy that it worked. 

 

If you mark as solution to my answer, they can easily find a solution who face with same issue. 

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT