Let me start off with some background. We have a number of layer 2 switches that sit behind a router in a router-on-a-stick configuration. There are two routed VLANs. One (VLAN1) is fa 0/0, and one (VLAN1000) is fa 0/0.1000. VLAN 1000 is the management VLAN, and each of the switches has an IP in VLAN1000. VLAN 1 is the user subnet.
I have noticed that on many of the switches there is no default-gateway configured. However, I can still connect to the switch on its management interface from a workstation in the user subnet.
I am trying to figure out how this is possible if the layer 2 switch does not have a default-gateway configured. How does the switch know how to route back to the workstation that is in a different subnet?
Now, I also tested this out with a layer 3 switch acting as the router, with multiple layer 2 switches behind it. The layer 3 switch had SVIs configured for each of the routed VLANs. In this scenario, I HAD to have a default gateway configured on the switch in order to ping to the user subnet.
Anyway, sorry for the novel, but I wanted to provide as much information as possible. So, does anyone know why it is that I do NOT need a default-gateway when using the router-on-a-stick configuration?
Oh, on a side note. With the router on a stick setup, if I do set a default gateway, it does not matter what IP I set it to, it always routes correctly. However, if I set the default gateway to an IP on the management subnet that is NOT the router IP, then it does not route at all, and I cannot reach my VLAN 1 subnet.