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?
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,
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
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
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.