cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
453
Views
0
Helpful
3
Replies

what will "ip default-network" command actually do?

teru-lei
Level 1
Level 1

Hi all,

Can any one explain what will " ip default-network" command actually do? it seems that use "ip default-network x.x.x.x" to make the packet to route to x.x.x.x. But what will the router actually do? Suppose I ping z.z.z.z from router A. what I think is that the router will forward the packet to the next-hop router B that go to network x.x.x.x through one of its connected subnets y.y.y.y, because the source and destination address of the ip packet will not be modified.But if in the next-hop router, there is a route to z.z.z.z, so the packet will not go through the default-network x.x.x.x and so that the ip default-network command can be replaced by a default-route "ip route 0.0.0.0 0.0.0.0 y.y.y.y" and the command "ip default-network" is no longer needed and the command may mislead us some time. Is that right? Anybody can tell me the truth? Thank You!

Best Regards

Teru Lei

1 Accepted Solution

Accepted Solutions

donewald
Level 6
Level 6

Tere,

All your x's y's and z's have me confused. ;) "ip default network" command simply will install a gateway of last resort (default) into your router from where ever it learns this "ip default network". You are correct, if I understood your explaination, that "ip route to 0.0.0.0 0.0.0.0 can replace the function of the default network. Some like this ip default network due to being able to have your gateway of last resort change depending on where you learn your default network from. Static routes to 0/0 seem a bit less dynamic in nature.

Hope this helps you,

Don

View solution in original post

3 Replies 3

donewald
Level 6
Level 6

Tere,

All your x's y's and z's have me confused. ;) "ip default network" command simply will install a gateway of last resort (default) into your router from where ever it learns this "ip default network". You are correct, if I understood your explaination, that "ip route to 0.0.0.0 0.0.0.0 can replace the function of the default network. Some like this ip default network due to being able to have your gateway of last resort change depending on where you learn your default network from. Static routes to 0/0 seem a bit less dynamic in nature.

Hope this helps you,

Don

aladdinyo
Level 1
Level 1

Default-route is used in such a circumstance that there is no explicit route to the destination in the router,.

Every route entry in the route table has such fields "Network Address" and "NetMask", when a packet is received in the roter, an AND operation will be made to the destination address with the "NetMask" field, and then the router will compare the result with the "Network Address" field of every route entry. If there is a entry matches the result, it will be used to forward the packet.

The "Network Address" and "Netmask" of the default-route are both 0.0.0.0, whatever the destination address in the packet is, the result of AND with the default-route will be 0.0.0.0, so this entry will be the best matches if there is no other explicit route to the destination.

So you are right that if there is a route to z.z.z.z in the router, it wil be used to forward the packet than the default-route.

But the "ip default-network" command is not useless, and sometimes

is very useful.

vincent-n
Level 3
Level 3

I just want to add a little bit more information to the information previously posted. Depending on the routing protocols being used (eg RIP), when you issue the command "ip default-network x.x.x.x" on a router, that router will automatically advertise itself as the default gateway for the "x.x.x.x" network to ALL routers in the routing domain (ALL these guys are of course running RIP). Specifying default route as you know will appear only on whichever router the default route configured on.