I have three HP Procruve switches and have been trying to find out which switchport my computer is connected to. I issued the following command on each switch:

show mac-address my_mac_address

And the results of the command:

Switch 1: Address Table: my_mac_address Port: 28

Switch 2: Address Table: my_mac_address Port: 11

Switch 3: Address Table: my_mac_address Port: 47

How can I tell which switch port is the correct one?

  • Use the link lights to determine which port you are in. Oct 6, 2016 at 1:05

2 Answers 2


2 of those 3 ports are ports that connect to another switch. If you don't know which ones, I don't know HP command syntax but there is probably a command like show mac port xx, if that show multiple mac addresses then it is (most likely) an inter-switch link; if it has only one then it is your PC. There can be variations e.g. if your pc connects to a phone and the phone to a switch then you may see 2 mac addresses, phone and pc.

  • 2
    You could also show lldp neighbors (not exact command syntax) if it is enabled. This will tell you which ports have switches attached.
    – Mark
    Oct 9, 2016 at 8:32
  • the command for that is "show lldp info remote"
    – mich732
    Oct 19, 2016 at 11:24

If you now the mac addresses of your switches you can issue the command show mac switchmacaddress to determine which port that switch is on.

A response with the same port you received with show mac-address my_mac_address indicates that you can rule that port out as a switch connecting port rather than your port.

After ruling out the switch connections the one remaining for show mac-address my_mac_address is your port.

If you only know the IP addresses of the switches you could disconnect and reconnect the cable from your system and check the logs with log switchipaddress and look for port yourport is now offline followed by port yourport is now online. Assuming that no one else is running around disconnecting and reconnecting patch cables this should identify your port as being on that switch as none of the switch connecting cables should have gone offline.




  • So you are assuming that the "system near yours" is connected to the same switch as you?
    – hertitu
    Oct 6, 2016 at 7:15
  • @hertitu You are correct. Pardon the over simplistic approach. Edited answer
    – Elder Geek
    Oct 6, 2016 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.