BUILD LOG

Turn LLDP or CDP output into a network diagram, in the browser, free

We built a free browser tool that turns show lldp neighbors or show cdp neighbors output into a rendered Mermaid topology diagram. It handles the brief tables and the detail forms, merges duplicate links, and nothing you paste leaves the page. Here is how it handles inconsistent neighbor output, what the diagram cannot show, and what to keep after the first run.

Reading this, you will:
  • Generate a topology diagram from neighbor output you already have, in under a minute.
  • Know what the generator normalizes, what it merges, and what it does not add.
  • Fit the generated diagram into a collect, version, regenerate process you can repeat after every change.

Paste show lldp neighbors or show cdp neighbors output into the network diagram generator. The page returns a rendered topology diagram and the Mermaid source. The tool is free, needs no account, and runs the parser in your browser, so nothing you paste leaves the page.

The details below explain how the generator handles inconsistent neighbor output, what the diagram cannot show, and what to keep after the first run.

What the generator does with the output

Neighbor output is less consistent than the brief tables suggest. The generator normalizes four parts of the output before it draws the diagram.

It accepts four formats in the same paste. Brief output from show lldp neighbors and show cdp neighbors works, and the two detail formats work too. You can paste a brief table from one switch and detail output from another into the same box. Include the prompt line, such as acc-sw01#show lldp neighbors, and the generator attributes each block to the device that produced it.

It normalizes device names. CDP detail can report a full domain name, so the same switch may appear as core-sw01 in one block and core-sw01.corp.example.com in another. NX-OS can append the chassis serial to the system name. The generator removes both additions so reports from the same device produce one node. A device that identifies itself with an IP address is left unchanged.

It merges reports of the same cable. When you collect neighbor output from both ends, the same cable appears twice. The generator matches those reports and draws one edge, including when one side used brief CDP output and the other used LLDP detail output.

It uses an interface name for wireless neighbors when one is available. A wireless controller or access point may advertise its MAC address as the LLDP port id. When that happens, the generator uses the interface from the Port Description field, so the edge label says Gi0/0/1 instead of 84b8.02aa.0c11.

The table below shows each rule applied to the tool’s own sample paste.

The neighbor output says The diagram shows The rule applied
core-sw01.corp.example.com core-sw01 Domain removed, so both reports of the device share one node
DC-SPINE-1(FDO12345ABC) DC-SPINE-1 NX-OS chassis serial removed
Port id: 84b8.02aa.0c11 Gi0/0/1 Port Description used because the port id is a MAC address
Ten 1/1/1 and TenGigabitEthernet1/1/1 one edge The same cable reported in brief CDP and CDP detail, merged

This is the diagram the sample paste on the tool page generates. Output from four devices in four formats produces six nodes and six edges, with every duplicate merged.

Generated from the sample paste
Rendering diagram…
View diagram source - it's just text (Mermaid). Diagrams-as-code is how modern network docs work; the flagship course has a free module on it.
flowchart TD
  acc_sw01["acc-sw01"]
  core_sw01["core-sw01"]
  core_sw02["core-sw02"]
  ap_2f_01["ap-2f-01"]
  edge_rtr01["edge-rtr01"]
  wlc_01["wlc-01"]
  acc_sw01 ---|"Gi1/0/48 to Gi1/0/1"| core_sw01
  acc_sw01 ---|"Gi1/0/47 to Gi1/0/1"| core_sw02
  acc_sw01 ---|"Gi1/0/12 to GigabitEthernet0"| ap_2f_01
  core_sw01 ---|"Ten1/1/1 to Gig0/0/0"| edge_rtr01
  core_sw01 ---|"Po1 to Po1"| core_sw02
  core_sw02 ---|"Gi1/0/10 to Gi0/0/1"| wlc_01
Generated from the sample paste

What the generator does not add

The generator draws only what neighbor discovery reported. If LLDP is off on a link, that link cannot appear. The generator does not know which device you consider the core or where each rack sits, and it cannot add a firewall that does not speak LLDP. The page shows the parsed link table before the diagram. Check that table against your own records because a diagram with no errors is not proof that the links are correct.

This limit is intentional. You can inspect the link table, compare it with your records, correct the input, and regenerate the diagram. Adding links that the neighbor output does not support would make that review less reliable.

Keep the Mermaid source and regenerate the diagram

The rendered diagram documents the topology you collected today. The Mermaid source lets you repeat the work after the network changes. Save it as topology.mmd in a git repository. GitHub, GitLab, Obsidian, and VS Code can render the file, and each topology change appears as a readable diff.

Collect the neighbor output again after a change, regenerate the file, and review the diff. Network teams use the same process to generate configs from a source of truth, build validation checks from expected state, and record the before-and-after state for a change. Generating a diagram does not change a device, so you can practice the process without a maintenance window or a network change. Forward deployed engineers use it too. They walk into an environment, collect the current state, and turn it into an artifact the customer can regenerate without them. The forward deployed engineering work article covers that work in more detail.

Where to go from here

Use the network diagram generator with output you already have in a terminal buffer.

To build the generator yourself, read the LLDP parsing walkthrough for the parsing cases the tool handles. The diagrams as code reference covers Mermaid grammar and common campus patterns.

The paid course’s Mermaid lesson is free with an account. It includes a graded lab that tests your generator functions and reports the cases your code does not handle yet.