IP default-gateway vs IP default-network vs default route

IP Default-gateway

The ip default-gateway command differs from the other two commands. It should only be used when ip routing is disabled on the Cisco router.

For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it: This example defines the router on IP address 10.10.0.254 as the default gateway:

ip default-gateway 10.10.0.254


IP Default-network

Unlike the ip default-gateway command, you can use ip default-network when ip routing is enabled on the Cisco router. When you configure ip default-network the router considers routes to that network for installation as the gateway of last resort on the router.

For every network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route.

Note

The ip default-network command is classful. This means that if the router has a route to the subnet indicated by this command, it installs the route to the major net.

ip default-network 198.10.1.0

but, for the command to take effect, a route to the specified network must exist in the routing table.

ip route 0.0.0.0 0.0.0.0

Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default-network command, using the static route to 0.0.0.0 is not dependent on any routing protocols (because the next-hop is specified in the command itself). But still, ip routing must be enabled on the router.

   router-3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4



https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/16448-default.html

Bilel

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x