Hello dear readers, in this article we will show you how to find the ports installed on Cisco Switch network products with their MAC addresses.
On Cisco switches, we can easily query which port the device whose MAC address we have learned is connected to. For this process, we need to use the show mac-address-table command via enable mode. Now let's learn how to use this command in detail;
Before showing this process, in what situations can we use it?
On Cisco switches, we can easily query which port the device whose MAC address we have learned is connected to. For this process, we need to use the show mac-address-table command via enable mode. Now let's learn how to use this command in detail;
- The cabling in today's system rooms can be very complicated. You can see where the cable coming from patching is not plugged into the switch. For this reason, you can use it and find the port it is directly plugged into.
- You can observe a local attack on the IDS, IPS devices or your SIEM product on the network. Based on this situation, you can quickly find the connected port and shutdown it.
- You can observe which port your directly connected servers are connected to in a complex configuration and progress your work accordingly.
I can multiply the examples above. But in general terms, based on these reasons, you can find the MAC address on your Cisco Switches. Now that we know the situation, we can move on to examples.
We will be doing our examples via Cisco Packet Tracer. To give an example, let's have an edge switch configuration like the one below. Let's assume that there is a 2960 Cisco switch and a connected PC, Notebook and IP Phone in our environment.
enable
show mac-address-table
When we apply these commands, the MAC addresses of all devices connected to our switch and the ports they are connected to will be displayed in detail.
If we want to find out the MAC address of the device connected to a specific port, we need to use the following code structure;
enable
show mac-address-table interfaces fast0/1
Here we learned the MAC address of the device connected to the FastEthernet0/1 port on our switch.
In addition to these operations, we can find out which port a device whose MAC address we know is connected to on the switch. The command structure we need to use for this process is as follows:
show mac-address-table address 111.111.111
Here, the value 111.111.111 is the MAC address of our device. To find out the computer's MAC address, we need to use the ipconfig /all command from the cmd screen in Windows operating systems. In Linux operating systems, the ifconfig command will be sufficient.

In the example here, let's find out where our device, which is Suat-PC3, is plugged into the Cisco 2960 switch. First, let's find out the MAC address of our device, which is a PC.

As we see, our MAC address is 0060.5CD7.C492. From now on, we will be doing our next transaction via the switch. That's why we connect to the console or SSH screen of our Cisco 2960 switch.
MAC Address : 00:60:5C:D7:C4:92
MAC Address : 0060.5CD7.C492
First of all, we need to exit “User Mode” via our switch device and switch to enable, that is, Privileged Mode. Our code works on Priveleged Mode.
To switch to Privileged Mode, it will be enough to type "enable". If you see the # sign, it means you are in Privileged Mode, that is, enabled mode. Then, if we write "sh mac address-table", it brings us all the MAC Addresses on the Ports Connected to the Switch.
enable
sh mac address-table

As we saw above, it brought us all the MAC addresses connected to the ports. In this way, we can observe which port the MAC address we are looking for is plugged into. Although there is no specific search in the Cisco Switch 2960 Model, we can also perform a specific search in some IOS versions.