08-18-2021 09:25 AM
I am working on mapping layer 2 devices by parsing the output from "show LLDP neighbors detail". The network contains only Cisco devices. To properly create the maps, I require the following fields:
- Local Intf (source interface)
- Chassis ID (target mac address)
- Port ID (abbreviated name and identifying number of port)
- Port Description (information regarding the connection)
However, on some devices, the local interface is not advertised, and, because the architecture contains LAGs, there isn't a reliable way to guess based on the target chassis ID and port ID. Speaking of port ID, although usually reported in a manner similar to "gi1/0/1" or "fa01", sometimes the port ID is reported in an odd format, such as port-002-00000. This can occur even if the same port ID was properly reported on the local interface of the source device.
Is there a way to force "show lldp neighbors detail" to display the local interface and format port IDs as "[a-z]{2}\d+.*"?
Thanks for reading
03-29-2022 09:31 PM - edited 03-29-2022 09:31 PM
I had the same problem on a WS-C2960X-24TS-L running 15.2(2)E3. I upgraded to 15.2(7)E5 and rebooted.
It's working now, but I'm not sure what fixed my problem: the reboot or the new firmware. I haven't changed anything in the config.
03-30-2022 12:33 AM
Hello,
I wonder if you could use an XML spec file to format the output...
show lldp neighbors detail | format
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide