Guide · updated

How to find which switch port a Windows PC is connected toWhich port am I on?

Most managed switches announce themselves out of every port with LLDP or Cisco's CDP. Listen for one of those frames and it tells you the switch's name and the exact port you are plugged into, with no console cable and no switch login.

The short answer

Capture one LLDP or CDP frame on the PC's wired adapter and read two fields: the system name (which switch) and the port ID (which port). Switches send LLDP every 30 seconds and CDP every 60 seconds by default, so a one-minute capture is usually enough. There are three ways to do it on Windows.

Method 1: Windows' built-in Pktmon (free, no install)

Windows 10 (1809 and later) and Windows 11 include pktmon, a packet capture tool. Open PowerShell as administrator and filter for the two discovery protocols. LLDP uses EtherType 0x88CC; CDP is sent to the multicast MAC address 01-00-0C-CC-CC-CC.

pktmon filter remove
pktmon filter add LLDP -d 0x88CC
pktmon filter add CDP -m 01-00-0C-CC-CC-CC
pktmon start -c --comp nics -p 0
# wait about 60 seconds
pktmon stop
pktmon etl2txt PktMon.etl

Open the text file and look for the LLDP System Name and Port ID, or the CDP Device ID and Port ID. If your version of pktmon rejects a value, pktmon filter add help lists the formats it accepts. To read the frames in Wireshark instead, convert the log with pktmon etl2pcap PktMon.etl.

No frames after a minute usually means LLDP and CDP are disabled on that switch or port, the port is a dumb switch or wall jack behind an unmanaged device, or you captured on the Wi-Fi adapter instead of the wired one.

Method 2: from the switch's MAC address table

If you can log in to the switch, find the PC's MAC address first: run getmac /v or ipconfig /all on the PC. Then, on a Cisco IOS switch, look it up (Cisco writes MAC addresses as three dot-separated groups):

show mac address-table address 0011.2233.4455

The output names the VLAN and the interface. If that interface is an uplink to another switch, follow it with show cdp neighbors or show lldp neighbors and repeat on the next switch. Other vendors have equivalents; read-only SNMP can return the same MAC-to-port table without a login (BRIDGE-MIB).

Method 3: one click in Packet Echo (free edition)

Packet Echo's Discovery view listens for LLDP and CDP and names the neighbouring switch and the exact port this machine is on. It works through Windows' built-in Pktmon, so it needs to run as administrator but needs no Npcap install (Npcap is optional). Discovery is part of the free edition.

From there, Pro's read-only SNMP switch workspace shows the port's errors and discards, the MAC table and spanning tree, so you can tell whether the port you found is also the problem.

Packet Echo · SNMP · Port healthReal capture
Actual application · device names redacted

Checkout could not open.

Something went wrong opening checkout, and nothing has been charged. Try again in a moment, or email us and we will sort it out.

Contact support