cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
67649
Views
10
Helpful
5
Replies

How to find which device is connected to the switch port using mac address?

ahmad.jalal7
Level 1
Level 1

I have a problem in configuring the ports to different vlans, I have more than 200 IP cameras and also access points and more than 500 data port for PC and IP phone. The problem is that I have to put the Cameras and also the access points to their vlans, the problem I have is that none of the ports on the switch have been labeled so it is very hard and time consuming to disconnect the cameras and access points from the ceiling in order to find which port they are connected to on the switch, so there should be a way to find the devices on the switch with the mac address. I have used the show mac address-table, but it didn't help it showed the trunk, i wanted to be like this 

Example

mac addrees                    interface on the swithc 

00:00:00:00:00:00.            G1/0/10               so that way in find the port and i can put it in the vlan easily 

2 Accepted Solutions

Accepted Solutions

Marlon AJ
Level 1
Level 1

Hi @ahmad.jalal7 ,

 

Have you tried using ouput modifiers?. For example:

 

sw# show mac address-table | include Gi1/0/10

 

 VLAN           Mac Addresss             Type                Ports

   15           1234.5678.9012        DYNAMIC         Gi1/0/10

 

Note: Remember that output modifiers are case-sensitive.

 

Example:

sw# show mac address-table | include Gi1/0/10

 

 VLAN           Mac Addresss             Type                Ports

   15             1234.5678.9012        DYNAMIC         Gi1/0/10

 

sw# show mac address-table | include gi1/0/10 <----- lowercase

   (Without ouput)

 

sw# show mac address-table | include G1/0/10    ,<----- G1/0/10 doesn't have the "i" correct: Gi1/0/10

   (Without ouput)

 

Also, if you have the mac address you can use traceroute:

 

sw#traceroute mac 1234.5678.9012 1234.5678.9012

Source 1234.5678.9012 found on Switch_2
1 sw_sal_2 (10.100.6.2) : Gi1/0/31 => Gi1/0/31
Destination 1234.5678.9012 found on Switch_2
Layer 2 trace completed

 

Also, using the sw#terminal monitor command, you can check the logs shown in the CLI once you disconnect either the camera or the cable connected to the switch port (To know in which switch port is connected the camera).

 

Output example:

 

Disconnection:

Mar 9 20:46:53.580 SV: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/44, changed state to down

Mar 9 20:46:54.594 SV: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/44, changed state to down

Connection:

Mar 9 20:47:02.311 SV: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/44, changed state to up
Mar 9 20:47:03.311 SV: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/44, changed state to up

 

Regards.

 

View solution in original post

Hi @ahmad.jalal7 ,

 

Here is a TCL to check the mac table in order.  I attached 2 files, one with the script to use it as a TCL, and another one with indications if you dont know how to work with TCL files (doesn't explain how to run a TCL but indicates how to apply the script in the TCL mode).

 

Hope this helps!

View solution in original post

5 Replies 5

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

If you are seeing multiple MAC address on a trunk port this is a clear indicator that there is another switch/ hub connected at the other end.

You will need to run the sh mac address command at the very edge of your network on the access switches.

 

cheers,

Seb.

Marlon AJ
Level 1
Level 1

Hi @ahmad.jalal7 ,

 

Have you tried using ouput modifiers?. For example:

 

sw# show mac address-table | include Gi1/0/10

 

 VLAN           Mac Addresss             Type                Ports

   15           1234.5678.9012        DYNAMIC         Gi1/0/10

 

Note: Remember that output modifiers are case-sensitive.

 

Example:

sw# show mac address-table | include Gi1/0/10

 

 VLAN           Mac Addresss             Type                Ports

   15             1234.5678.9012        DYNAMIC         Gi1/0/10

 

sw# show mac address-table | include gi1/0/10 <----- lowercase

   (Without ouput)

 

sw# show mac address-table | include G1/0/10    ,<----- G1/0/10 doesn't have the "i" correct: Gi1/0/10

   (Without ouput)

 

Also, if you have the mac address you can use traceroute:

 

sw#traceroute mac 1234.5678.9012 1234.5678.9012

Source 1234.5678.9012 found on Switch_2
1 sw_sal_2 (10.100.6.2) : Gi1/0/31 => Gi1/0/31
Destination 1234.5678.9012 found on Switch_2
Layer 2 trace completed

 

Also, using the sw#terminal monitor command, you can check the logs shown in the CLI once you disconnect either the camera or the cable connected to the switch port (To know in which switch port is connected the camera).

 

Output example:

 

Disconnection:

Mar 9 20:46:53.580 SV: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/44, changed state to down

Mar 9 20:46:54.594 SV: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/44, changed state to down

Connection:

Mar 9 20:47:02.311 SV: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/44, changed state to up
Mar 9 20:47:03.311 SV: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/44, changed state to up

 

Regards.

 

Thank you very kuch for your reply and it is helpful for me but is the another way to see all the ports with their mac addresses cus that way i dont have to check all the ports one by one on a switch 

Hi @ahmad.jalal7 ,

 

Here is a TCL to check the mac table in order.  I attached 2 files, one with the script to use it as a TCL, and another one with indications if you dont know how to work with TCL files (doesn't explain how to run a TCL but indicates how to apply the script in the TCL mode).

 

Hope this helps!

Thanks alot man you the best
Review Cisco Networking for a $25 gift card