02-02-2025 11:29 AM
Good afternoon,
I noticed something, that I am trying to find to out if the expected behavior:
I have a pure L2 switch, with I only configured:
And if I perform "show IP route" I have this output, that I am so confused:
I was not expecting:
Remark: There is no "ip routing" command configured
Gateway of last resort is 10.55.158.1 to network 0.0.0.0
S* 0.0.0.0/0 [0/0] via 10.55.158.1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.55.158.0/27 is directly connected, Vlan75
L 10.55.158.9/32 is directly connected, Vlan75
02-02-2025 12:04 PM
Which switch is it? Actually there haven’t been any “pure” L2 Catalysts from Cisco for quite some time.
02-02-2025 12:33 PM
MY-PEJ-01-SWA07#term len 0
MY-PEJ-01-SWA07# show version
Cisco IOS XE Software, Version 17.08.01
Cisco IOS Software [Cupertino], Catalyst L3 Switch Software (CAT9K_LITE_IOSXE), Version 17.8.1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2022 by Cisco Systems, Inc.
Compiled Sat 09-Apr-22 00:34 by mcpre
02-02-2025 01:55 PM - edited 02-02-2025 02:03 PM
This device can definitely do L3. And for example the 9300 IMO does that without needing any “ip routing” command.
EDIT: I just see the “Lite”. Is it the Catalyst 9200? IMO would be powerfully enough as a core switch in a small company.
02-02-2025 02:28 PM
Yes this device can do L3 routing and as such does support the command show ip route. The output posted makes sense to me for a device that is operating only at layer 2. It is configured with ip default-gateway so that creates a default route (for management traffic). So this is expected in the output "Gateway of last resort is 10.55.158.1 to network 0.0.0.0" and that explains why this entry is in the routing table "S* 0.0.0.0/0 [0/0] via 10.55.158.1" This is the default route for management traffic and has nothing to do with forwarding traffic from connected devices.
Vlan 75 is configured with an IP address and is the management interface. So this entry makes some sense "10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks. 2 masks seems reasonable since there is a mask entry for the subnet (/27) and a mask entry for the interface IP (/32). Saying that there are 2 subnets is a bit of a stretch.
And the important point is that everything in the posted output is related to processing the management interface traffic. It has nothing to do with forwarding traffic from connected devices.
02-02-2025 02:35 PM
Let me phrase the last point a bit differently: The show ip route output is there because the switch does do layer 3 processing for management traffic. So the default route, subnet mask and address, host address and mask are appropriate. But they have nothing to do with forwarding traffic from connected devices. So yes, to answer the question in the OP, this is expected behavior.
02-03-2025 04:19 AM
"So yes, to answer the question in the OP, this is expected behavior."
What's possibly confusing, the displayed information is, pretty much, identical to what you would see on a L3 switch. That's because, from a routing perspective, it's, more-or-less, identical. The huge difference is for a L2 switch host, the routing only applies to traffic sourced from the host, where as on a L3 switch (with enabled "routing"), device routing would also apply to transit traffic. Or, on a L3 switch, where "routing" is not enabled, only routing for transit traffic is disabled, making its behavior like a L2 switch.
Syntactically, the other difference on Cisco network devices would be default gateway vs. default route for L2 vs. L3.
02-02-2025 01:42 PM
What @Karsten Iwen is referring to, many of Cisco's low end L2 switches have, for some time now (since about the 2960S?), supported some degree of L3 switching; additional licensing and/or installed IOS dependent too.
Basically, almost any IP based host can route. (Most PCs can.)
So, in principle, pretty much any manageable L2 switch can function as a L3 switch.
The issue is, how quickly can it route?
Without dedicated hardware, and advanced software, its L3 routing performance might even be worse than an entry model ISR doing process switching.
02-02-2025 12:07 PM
Possibly not so surprising as any host usually "routes" its own traffic, chosing between the network(s) it directly connected with, and the networks beyond the connected network(s), often using a gateway.
Where you may see the L2 switch isn't acting as a router, from another host, on a shared connected network, try using the SVI as a gateway, as you might on a L3 switch.
02-02-2025 12:07 PM
Show run all <<- check this see if ip routing is by defualt run or not
MHM
02-02-2025 12:33 PM
No, there is no "ip routing"
02-03-2025 04:08 AM
Shpw ip protocol <<- share this
MHM
02-02-2025 08:48 PM
Hello
That is correct / what would you like to see in the show IP routing command?
The ip default-gateway 10.55.158.1
command is used for Layer 2 switches that do not perform routing.
Even though you haven’t enabled ip routing, the command still works because:
Management IP Behavior:
You assigned an IP to VLAN 75 (10.55.158.9/27), which the switch uses for management.
A Layer 3 interface (SVI) is created, so the switch tracks it in a basic routing table.
Thanks !
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide