6

Is it possible to find the switch is Layer3 or Layer2 in (Switch)CLI? Is there any command to check whether the switch Layer(Layer 3 or 2) in CLI?

2
  • 2
    Note that this question is subtly different from asking whether the switch can do L3 in hardware. Many Catalyst switches could do IP routing, but only in software (2900s), or IPv4 routing in hardware but IPv6 only in software (3560). Commented Dec 7, 2020 at 18:31
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Commented Jan 4, 2021 at 22:23

2 Answers 2

7

In addition to @Zac67 answer, in the Catalyst product line, layer 3 capabilities are often unlocked by licenses.

So a given switch can be layer 3 capable but, depending on the installed license, may have none, a few, or a complete set of, layer 3 features.

The switch is shipped by default with the LAN BASE license (formally LAN lite), but can be either ordered with a higher licence level (often "Enterprise"), or a license can be added later.

To check what you license is the CLI command is, quite logically, show license

the output looks like:

show license
Index 1 Feature: lanlite
    Period left: 0  minute  0  second
Index 2 Feature: lanbase
    Period left: Life time
    License Type: Permanent
    License State: Active, In Use
    License Priority: Medium
    License Count: Non-Counted
5

Normally, an L3 switch can be configured to work as a router (forward traffic between IP subnets) or not, e.g. ip routing / no ip routing. Some models/series have routing activated by default, some have it deactivated. Additionally, the IP status (show ip) should show its routing status.

IP Routing : Enabled

On an L2 switch you won't see this option or status.

Apart from CLI, the CDP and LLDP frames sent out should show its capabilities (bridge, router) whether active or not. You should be able to display the local CDP info using something along show cdp tlv - look out for Capabilities: Router.

And of course, you can display the device model (show system) and look up its features. If applicable, check the license as JFL has pointed out.

8
  • 1
    That's not entirely accurate. Managed layer 2 switches would have an IP address for management access and for monitoring.
    – Jesse P.
    Commented Dec 7, 2020 at 13:45
  • 1
    Managed L2 switches do have configured IP addresses but they don't display a routing status.
    – Zac67
    Commented Dec 7, 2020 at 14:53
  • I've tried to make a better distinction in the answer. VRF in a layer-2 switch? Are you sure?
    – Zac67
    Commented Dec 7, 2020 at 15:14
  • 1
    I removed the previous comment so it doesn't add to the confusion.
    – Jesse P.
    Commented Dec 7, 2020 at 16:13
  • 2
    Some Cisco L2 switches don't allow routes -- ip route isn't available. As far as I've ever seen, in L2 mode, one, and only one, L3 interface can be enabled for management. (if you no shut a second SVI, the first will be shutdown.) I've heard of "L2" switches needing a VRF defined for management, but they were L3 switches without a license for L3 features.
    – Ricky
    Commented Dec 7, 2020 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.