What is the difference between the ip default-gateway, ip default-network, and ip route 0.0.0.0/0 commands?

Question: What is the difference between the ip default-gateway, ip default-network, and ip route 0.0.0.0/0 commands?

A. The ip default-gateway command is used when IP routing is disabled on the router. This command serves non-routing network device that need to reach any network outside its own subnet or outside of its local network. The command is to function when the network device is not in routing mode.When the ip routing is disabled, the router becomes merely a host, similar to regular PC. To reach any network outside its own subnet or outside of its local network, the device needs to have a default-gateway.

However, ip default-network and ip route 0.0.0.0/0 are effective when IP routing is enabled on the router and they are used to route any packets which do not have an exact route match in the routing table. 

Configuration Commands

Default Gateway 

#ip default-gateway x.x.x.x

Default Network 

#ip default-network a.b.c.d

Gateway of Last Resort 

#ip route 0.0.0.0 0.0.0.0 (next-hop-ip/exit-interface)

1 comment:

  1. I think it's important to note that flexibility of the default network command vs the default route. With the default network command no next hop is designated so as long as there is a route to the network specified the default will remain and change accordingly during topology changes.

    ReplyDelete