Sunday, June 10, 2012

JUNOS – Finding the connected ethernet port via console with a known MAC address

This is a short guide for administrators of Juniper EX switches to trace a network device to port on an EX series switch. This will help to identify the port which a networked device is connected to without going through physical network cabling. The best practice however, is to always label your structured cabling ports at both ends with up to date documentation.

  • You are using Juniper EX series of switches
  • You have a messy "structured" cabling (e.g. Network cable management done wrong)
  • To trace that network point to switch will require you to walk/climb/bash/dig for up to 80 meters
  • You do not have a documentation of the patch panels or the cable goes direct to your switch
  • You know the network point does not cascade to a hub
  • Finally, your boss wants you to execute a port setting change immediately on the specific network point to the the switch to

What you need
  1. You should have console access to the switch (telnet/ssh/physical)
  2. MAC address of the network device (use any network device if the port is unused)
What to do
There are 2 possible scenarios you need to consider.
  • You know exactly which switch the networked device is connected to:
    1. Console to the switch.
    2. Run the command: show ethernet-switching table | find {mac address}
    3. The column "Interfaces" will provide you the port on the switch.
  • You do not know which switch the networked device is connected to:
    1. Console to core switch of the environment.
    2. Run the command: show ethernet-switching mac-learning-log | find {mac address}3. If the MAC address can be found, the result will be like "{mac address} was learned" or "{mac address} was added" or "{mac address} was deleted". The result will also include which port it was learned/added/deleted.
    4. If the port is an trunk port, you can issue a command to determine the neighbour switch: show lldp neighbors.
    5. Once you done that, repeat step 3 to find the port again or use the first scenario.
(This post is not applicable for Junos 10 and below. Junos 11 and above has not been tested)
(This post will be improved with screenshots in the near future)

No comments:

Post a Comment