-1

Looking at IOS / IOS XE v15.x+ devices and trying to figure out a command that helps to understand whether it is an L2 or L3 device.

There are various options but those are not the most optimum ones like checking if the device supports vlans or lacp and taking a judgment over it. I am looking for a command that tells me directly about it being an l2/l3 switch/router from Cisco IOS.

1 Answers1

0

May be

aaaaa#sh ver | i uptime

And parse output

Or if you use CDP:

Router#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
sw1              Fas 0/6           178           S I      WS-C3560- Fas 0/9
sw1              Fas 0/1           171           S I      WS-C2960- Fas 0/24
vostbur
  • 243
  • 2
  • 9