Cisco Discovery Protocol or CDP as I have discovered is a lifesaver.
I wanted to connect my switch to another. The customer has no idea what is the hostname. So I just cascaded my switch off an empty port and typed the following:
show CDP neighbour
STL-5CL-WH-L2-SW2#cdp Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID Local Intrfce Holdtme Capability Platform Port ID ac17c999e999 Gig 1/0/1 178 R S Meraki MR Port 0 ac17c999e998 Gig 1/0/3 152 R S Meraki MR Port 0 SW1 Gig 1/0/48 179 S I WS-C3650- Gig 1/0/48 SW3 Gig 1/0/47 165 S I WS-C3650- Gig 1/0/47 ac17c999e997 Gig 1/0/4 169 R S Meraki MR Port 0 ac17c999e996 Gig 1/0/2 135 R S Meraki MR Port 0
Total cdp entries displayed : 6 SW2#
CDP showed the hostname of the switch I was connected to. No messing around with VLAN required. The command
show CDP entry <hostname>
SW2#sh cdp entry SW1 -------------------- Device ID: SW2 Entry address(es): IP address: 18.104.22.168 Platform: cisco WS-C3650-48PS, Capabilities: Switch IGMP Interface: GigabitEthernet1/0/48, Port ID (outgoing port): GigabitEthernet1/0/48 Holdtime : 153 sec
Cisco IOS Software [Fuji], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.9.4, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Thu 22-Aug-19 17:33 by mcpre
advertisement version: 2 VTP Management Domain: '' Native VLAN: 1 Duplex: full Management address(es): IP address: 22.214.171.124
It displays the management IP and additional information. This really saves me the hassle of scheduling a password recovery.