

Show ethernet-switching table | match 08: 62: 66:c7:b3: 45 To find the MAC 08: 62: 66: c7: b3: 45 on the Juniper switch, run the following command: I didn’t want to do it all with my hands, sort through all the switches in the loop and determine where uplink was and where not too, so the next solution was born, which I want to share. By logging on to the DS1, we will discover this MAC on the port leading to AS2, going to AS2, we will see that it leads us to AS3, and only on AS3 will we find the specific port to which the device of interest is connected. In any case, the port of the upstream switch contains all the MAC addresses of the devices connected to the downstream switch.įor example, if the device of interest to us is connected to the AS3 switch, then, starting the search with CORE, we will find this address on the port leading to DS1. This rule is not always executed, access switches can be connected in series. If the network design is correct, that is, the root switch CORE, to which distribution switches DS (Distribution Switch) are connected, and, in turn, switches of access level AS (Access Switch). I want to share a small Python script that looks for the desired MAC address on the network and returns the name and port of the switch on which this MAC is registered.Ĭonstructive criticism is welcome.


The problem is solved easily if there are several switches in the network, but when there are more than 30 of them, everything becomes much more complicated. On the local network, you often need to know which switch port the device’s MAC address is on.
