Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

default gtwy VS gtwy of last resort

If used together, on a 3750, do default gateway and gateway of last resort perform seperate functions.

For example

default-gateway 192.168.138.3

ip route 0.0.0.0 0.0.0.0 192.168.138.3

Would both of these statements perform same function ? Should these statements be used together for any reason ?

Thanks

4 REPLIES
Bronze

Re: default gtwy VS gtwy of last resort

Good Q'

The command you use depends on the ip routing status. If Ip routing is enabled use the ip route 0.0.0.0 command; if ip routing is disabled use ip default-gateway command.

When configured with ip routing disabled and a management IP address, the 3750 is an IP host on the network. In this case the default-gateway command is necessary.

If “ip routing” were enabled the routing information base would be consulted to route external subnet traffic. A gateway of last resort or default route would need to be configured.

The default-gateway command specifies a gateway for a non-ip routing switch management IP address.

The default route specifies a gateway of last resort in the routing table for all external subnet switch traffic.

If the switch wasn’t configured for ip routing and both commands were entered, the ip route 0.0.0.0 wouldn’t have any effect (I’m not sure the switch would even accept the command). If ip routing were enabled, I’m really not sure what would happen, but I think the ip route statement would supersede the default-gateway. Only one way to find out!

HTH,

Ryan

Hall of Fame Super Gold

Re: default gtwy VS gtwy of last resort

I would not talk about the ip route statement supersede the default-gateway. They are quite different concepts (as you explained) and are used in quite different circumstances.

As you explained it the device is thinking and functioning as a "router" it makes decisions about how to forward packets based on lookup in its routing table which would reflect all connected interfaces, any remote networks and subnets that it had learned and possibly a default route (gateway of last resort).

If the device is functioning as an IP host then it does not consult any routing table and will forward packets whose destination is remote by forwarding to its default-gateway. As you explained configuring "no ip routing" is one way to get it to function as an IP host. Another way it can happen is to do a rom boot. If the router is running the special operating system is is functioning as an IP host not as a router.

HTH

Rick

Bronze

Re: default gtwy VS gtwy of last resort

Your right, supersede was the wrong word to use.

He asked the questions if both commands were configured what would happen. What I was trying to say is the ip route table would be consulted even if the ip default-gateway command were configured.

I didn't even consider the rommon mode. Thanks for further clarification.

Hall of Fame Super Gold

Re: default gtwy VS gtwy of last resort

Ryan

I believe we agree on the essentials and differ only slightly in the way that we explain it. Both commands coexist - at least when the router is operating in router mode.

If both commands are configured they will both be present in the config. Which one will be used will depend on which mode the rotuer is operating in: if in router mode the gateway of last resort (ip route 0.0.0.0) if in host mode the default-gateway. There are two things I know of that put the router is host mode: no ip routing and rommon/recovery IOS.

Even though a router will not need it and not use it probably 99 percent of the time, I usually configure routers with a default-gateway just as insurance for those few times when it might be needed.

HTH

Rick

152
Views
4
Helpful
4
Replies
CreatePlease to create content