cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
New Contributor

Conflict between "ip routing" and "ip default-gateway" on 1500/1600 Series Switches?

Hi There,

I've read that having ip routing enabled AND having a specified ip default-gateway is a bad idea, but this is mostly in reference to Cisco documentation, and in reference to classful subnetting scenarios (which obviously I never use).

I noticed that the new 1500/1600s series switches, which have some L3 capabilities, all appear to have ip routing enabled out of the box. Will this cause issues if I am using a config that specifies an ip default-gateway? We've had strange issues and I am wondering if this needs to be corrected.

Thanks,

Labels (2)
0 Kudos
3 Replies
Highlighted
New Contributor

Re: Conflict between "ip routing" and "ip default-gateway" on 1500/1600 Series Switches?

Specifically, here's the part of the config I am asking about. Does the gateway statement conflict with the routing statement?

ip subnet-zero

ip classless

ip default-gateway 10.124.50.1

ip routing

name-server 10.96.30.47 10.10.31.245

!

!

ip route-cache express

Highlighted
New Contributor

Re: Conflict between "ip routing" and "ip default-gateway" on 1500/1600 Series Switches?

Ahh Man, what's Tim gotta do to get some love around here?! Tim! Tim! Tim!

Highlighted
Honored Contributor
Honored Contributor

Re: Conflict between "ip routing" and "ip default-gateway" on 1500/1600 Series Switches?

IP default gateway is primarily used when the switch is operating in layer 2 mode, with IP routing disabled. It is similar to the gateway command when setting up a computer interface.

If you use the "ip default-gateway" command, and there is only one interface (typically a VLAN interface) assigned an IP address, it really doesn't matter if you have IP routing enabled or not. The egress point is unambiguous whether you use "ip default-gateway" or "ip route 0.0.0.0 0.0.0.0". "IP default-gateway" defines the dsfault whether or not routing is enabled. "ip route 0.0.0.0 0.0.0.0", however, requires routing to be enabled to work.

Where it gets confusing is if you have more than one IP-enabled interface. Here, the "ip default-gateway" command may not reliably work to route subnets not including the gateway address to the default if IP routing is enabled.

General rule is that when IP routing is enabled, use the all-zeros ip route command to specify the default route. If IP routing is not enabled, use the ip default-gateway command.

If you have IP routing enabled, one IP-enabled interface, and you specify both a default-gateway and an all-zeros route to different destinations, I don't know where the off-net packets will go. I'd bet on the all-zeros taking priority. But that's just a guess, so please don't do that unless you are doing it in the name of science.