Layer 2 topology discovery [closed]

Do you want to truly know? Access the management interface on each switch, and look through the running configuration. Mark down trunk ports in particular, then trace those cables. Rinse and repeat as necessary until you have analyzed all the switches. LLDP or CDP are helpful in figuring out adjacencies, but are far from foolproof.

No bit of software will do this 100% correctly, despite what they claim. Sometimes you just have to get your hands dirty.


If you are willing to put in the time, the linkd functionality of OpenNMS does work as long as you have supported switches. It does pickup the links and devices if everything on the network is SNMP or CDP capable.


If you use a program such as Spiceworks, it will give you the MAC address of most devices on your network.

A good switch will also have a table on the management interface correlating MAC addresses with ports. If there's only one device on a port, that means it's directly connected to the switch. If there's multiple devices listed for that port, there's a switch or other extended network segment on that port (and you'll have to do further tracing). This is as close as you can get to "automatic" without getting your hands dirty and doing some manual tracing.