Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Tracing of MAC address

Hi,

If i have a MAC address, am i able to tell which port it is connected to on a switch. I hav2 core switch and 10 edge switch.

What are the commands to issue to trace the port?

Thanks

9 REPLIES

Re: Tracing of MAC address

The command is:

show mac-address-table

Regards,

Leo

New Member

Re: Tracing of MAC address

Sorry, i am unable to find the command "show mac-address-table"

Thanks

Silver

Re: Tracing of MAC address

If you are using CatOS you can try

'sh cam '

HTH

Re: Tracing of MAC address

L2trace is another useful CatOS command.

Regards,

Milan

New Member

Re: Tracing of MAC address

I used 'sh cam ' but it does not show me which switch and port it belong to unless i do a 'sh cam ' on the correct switch.

It does show me whcih VLAN. What are you troubleshooting procedure if you are give a MAC address and ask to see which port the system is connected to?

Thanks

Re: Tracing of MAC address

Hi,

AFAIK, there is no tool available which would provide this info by an easy way.

I was using L2trace command but it requires all switches running CatOS and it seems not to work when using different management and user VLAN.

So the only working way is (I suppose you are running CDP in your network):

1) sh cam on a switch

The output will show you a port which is linked to the MAC.

2) sh cdp nei

If there is another switch connected to ,

3) Telnet to the connected switch

4) repeat steps 1) - 3) until sh CDP nei doesn't show a switch connected.

So you are on the final switch now.

You can doublecheck the correct port via

sh cam dyn

The output should show the you are looking for.

You can use similar steps on IOS switches, the commands are

sh mac-address-table address (don't forget a different MAC address format)

sh cdp nei ...

sh mac-address-table dynamic interface ....

Regards,

Milan

New Member

Re: Tracing of MAC address

I used 'sh cam ' but it does not show me which switch and port it belong to unless i do a 'sh cam ' on the correct switch.

It does show me whcih VLAN. What are you troubleshooting procedure if you are give a MAC address and ask to see which port the system is connected to?

Thanks

Purple

Re: Tracing of MAC address

When you do a show cam (mac address)on one of your core switches it should tell you what port if it's on an attached switch , you would then look to see what switch is attched to that port and then go down to the lower switch and do the same sh cam (mac address) and this will give you what port this mac address is attached to .

New Member

Re: Tracing of MAC address

If you have the MAC address, you can issue this command on the switch:

"sh cam xx-xx-xx-xx-xx-xx"

Where xx-xx-xx-xx-xx-xx is your mac address. If the device is on this switch, the port associated with the MAC address will be the output. If the port shown is on the ports that interconnect two switches together, it means that this device resides on its neighbor switch. Telnet to the neighbor switch and issue the same command will give you the port.

Since you have so many switches to search through, it maybe faster if you issue this command instead (provided of course you know at least the VLAN# for this MAC address):

"sh cam dyn <50>"

Where 50 is the VLAN#. The output of this will give you all MAC addresses associated with their ports belong to VLAN 50.

Hope that helps...

286
Views
11
Helpful
9
Replies
CreatePlease to create content