show or find out switches routers and hubs direclty connected to a switch

Managing bunch of undocumented switches, routers and hubs can some times be difficulty if you don’t know the handy dandy commands that vendors program on their product for this purpose.

The command show cdp neighbors is a handy command that would list all your connected switches, hubs, and routers.

For this example we are using this command on a HP switch that have multiple other switches and a router connected to.

HPSwitch# show cdp neighbors

CDP neighbors information

Port Device ID | Platform Capability
—- —————————– + —————————- ———–
B2 99 1d b3 89 46 c9 | ProCurve J9022A Switch 28… S
B4 99 25 61 ee cc 29 | HP ProCurve 1810G – 24 G… S
B5 cisco-switch5 | Cisco IOS Software, C2960… S
C6 Cisco_Router | Cisco IOS Software, C2600… R S
D7 00 18 0a 31 29 bb | Meraki MR16 Cloud Managed AP
E1 00 25 90 6f a1 c6 | armv5tejl/Linux 2.6.17.WB…
F3 00 26 f1 58 e9 f8 | ProCurve J9022A Switch 28… S
F6 00 18 0a 31 29 89 | Meraki MR16 Cloud Managed AP
F5 cloud1 | Cisco IOS Software, C3750… S
F5 cloud1 | Cisco IOS Software, C3750… S

HPSwitch#

Notice above that we have enough information to determine what switch or router connected to what port of this switch. The capability column indicates the device type, S for switch, R for router, S R for level switch.

If you require more information about the connected switch or router. You can use the show cdp neighbors detail command. This command will display device IP if any, port it’s connected on the other end, device model, software version, etc. See below


HPSwitch# show cdp neighbors detail
CDP neighbors information
Port : F5
Device ID : Cloud1
Address Type : IP
Address : 192.168.1.22
Platform : Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-…
Capability : Switch
Device Port : GigabitEthernet1/0/47
Version : Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-…

Publisher: abdirahman isse

Share this post