Skip navigation
Login   |   Register
Cisco Learning Home > Certifications > Routing & Switching (CCNA) > Discussions

_Communities

This Question is Not Answered 1 Correct Answer available (4 pts) 1 Helpful Answer available (2 pts)
67515 Views 10 Replies Latest reply: Oct 17, 2014 7:53 AM by Ray G. RSS

Currently Being Moderated

IP default-network vs ip route 0.0.0.0/0

Nov 10, 2010 9:50 AM

Aimen Khudair 25 posts since
Sep 1, 2010

it says here, If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-networkcommand takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default-network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which has a lower administrative distance, takes precedence and is chosen for the gateway of last resort.

 

 

Can some one help me to verify if this is true about the behavior of ip default-network and ip route 0.0.0.0/0 command??

when i tried to apply this in PT, I configured a static route for network 198.10.1.0, and used this network for the ip default-network command, and the gateway of last resort was set as it shown in the show ip route :

 

 

2513(config)#do sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

 

     131.108.0.0/24 is subnetted, 1 subnets

C       131.108.99.0 is directly connected, Serial0/0/0

     161.44.0.0/24 is subnetted, 1 subnets

C       161.44.192.0 is directly connected, FastEthernet0/0

S*   198.10.1.0/24 [1/0] via 161.44.192.2

 

 

 

Then when I am configuring default route using the ip route 0.0.0.0/0 131.108.99.2 command, it takes precedence and chosen for the gateway of last resort. although that the network used for the ip default-network is known statically for the router:

 

 

2513(config)#do sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is 131.108.99.2 to network 0.0.0.0
     131.108.0.0/24 is subnetted, 1 subnets
C       131.108.99.0 is directly connected, Serial0/0/0
     161.44.0.0/24 is subnetted, 1 subnets
C       161.44.192.0 is directly connected, FastEthernet0/0
S*   198.10.1.0/24 [1/0] via 161.44.192.2
S*   0.0.0.0/0 [1/0] via 131.108.99.2

 

 

2513(config)#do sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is 131.108.99.2 to network 0.0.0.0

 

     131.108.0.0/24 is subnetted, 1 subnets

C       131.108.99.0 is directly connected, Serial0/0/0

     161.44.0.0/24 is subnetted, 1 subnets

C       161.44.192.0 is directly connected, FastEthernet0/0

S*   198.10.1.0/24 [1/0] via 161.44.192.2

S*   0.0.0.0/0 [1/0] via 131.108.99.2

 

 

 

Thanks in advance,

 

Aimen

Attachments:
  • Michael Law 571 posts since
    Jun 30, 2008
    Currently Being Moderated
    1. Nov 10, 2010 10:49 AM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    The ip default-network command is used mostly with routing protocols. The ip route command is used with static routing. Both are achieving the same goals but can be used in different scenarios. If you have a routing protocol for a domain, and you would like to advertise to the rest of the routers that a default route, you would implement the ip default-network command. This would cause the routing protocol to carry the candidate for default network in its routing updates to all routers in the domain.

     

    The ip route 0.0.0.0 0.0.0.0 xx is a command that is statically assigned. This is called a default network because the all-zeros syntax means to catch all routes. The ip route command is not automatically carried in routing updates like the ip default-network command is in some routing protocols. You must redistribute the static command into a routing protocol for it to be carried.

     

    In a network where, there are multiple default gateways, you must understand that certain parts of the network will be routed out one direction, and other parts might be routed out another direction. Understand that each router makes it's own forwarding decision even when the network is converged with consistent routing information. This can cause an un-even balance of routing out of default routes.

     

    In this scenario, let's say you typed ip default-network on router 161.144.91.2 (top one) and all routers are converged. This will cause all routers in the domain to see a candidate default network as 192.10.1.0/24. Now, let's say you type ip route 0.0.0.0 0.0.0.0 131.108.99.2 on the middle router. You have just created a routing loop. How? the bottom router sees the candidate default route at the top, and sends all packets that did not match a more specific route to the middle router. The middle router has been configured with IP route back to the lower router because it was statically assigned. It's AD takes precedence over the ip default-network command and packets are sent back down to the bottom router.

     

    Now you ask why do the ADs look the same for both ip route 0.0.0.0 0.0.0.0 and ip default-network? It's because you have configured them on the same router. Go to another router and you will see the 192.10.0/24 network have a different AD. This is because on the local router, you have statically defined both default routes. But, ip default-network command is sent across routing updates and therefore carries the routing protocol's AD instead of a static one.

     

    That is a complicated answer to ur scenario. If you don't understand the answer, make you take away a few ideas: all routers make routing decisions on their own regardless of influences from others. AD dictates a route "believability", the lower the better and lastly, unless you know exactly what you're doing: don't install multiple default routes or routing loops may appear. This happens a lot.

     

    Hope that helps. Good Luck

     

    Mike

    Join this discussion now: Login / Register
  • Michael Law 571 posts since
    Jun 30, 2008
    Currently Being Moderated
    3. Nov 11, 2010 6:21 AM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    Hi Aimen,

     

    What is your confirmation that the router is using the ip default-network command to forward packets to a default network? According to your show ip route command in the first post, it shows both with AD of 1. This implies that both are statically assigned on the router. Like I said both are similar in their goals but are for different scenarios.

    Join this discussion now: Login / Register
  • Izhar Kazmi 4 posts since
    Feb 10, 2010
    Currently Being Moderated
    6. May 23, 2011 5:07 PM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    The ip default-network command is classful

    The ip default-network command is classful.

    This means that if the router has a route to the subnet defined by this command, the router installs the route to the major net. and if the major network is devided into subnets in routing table, no network (subnet) has been flagged as the default network. The ip default-network command must be issued again, using the major net, in order to flag the candidate default route.

     

    By the ip route (static) command, we can use any ip to set it as the gateway of last resort.

     

    izharkazmi@gmail.com

    Join this discussion now: Login / Register
  • Shahryar Ali - CCNA R&S 96 posts since
    Oct 18, 2011
    Currently Being Moderated
    7. Aug 18, 2012 3:40 AM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    The default route configured with IP  default-Network command is NOT a static route.it's administrative distance is identical to the distance of the underlying classful network. This is the reason your static default route takes precedence.

    Join this discussion now: Login / Register
  • Shahryar Ali - CCNA R&S 96 posts since
    Oct 18, 2011
    Currently Being Moderated
    8. Aug 18, 2012 3:59 AM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    In your example the route confgured with IP default- network command should take precedence as the both routes have AD=1. You need to confirm if that route is properly functional.Look for the reverse route issue and any ACL issue which can restrict it to act as a default route.

    Join this discussion now: Login / Register
  • guanbowen 4 posts since
    Mar 21, 2013
    Currently Being Moderated
    9. Aug 12, 2014 11:09 PM (in response to Izhar Kazmi)
    Re: IP default-network vs ip route 0.0.0.0/0

    em.. very interesting topic. I just found this one today, and did some tests based on your theory.

    Pretty much, you have to use classful network after ip default-network command to make it work. however, that classful network must have a route in routing table (subnet routes do not count).

    When you say the command has to be flagged again to make it work, I found it is not all true. What it does is if you issue ip default-network 'subnet' command, the router will create a static route in the routing table for the classful network, but this is only trure if the 'subnet' you used also has a route in the routing table. For example, you try to make 20.20.20.0 as your last resort network, so you put 'ip default-network 20.20.20.0' in the router. Now, if you have a route in the routing table for network such as 20.20.20.0/24 or 20.20.20.0/30 or something similar which can cover 20.20.20.0, it will then creat a static route for network 20.0.0.0/8 with next hop ip 20.20.20.0. so if you issue 'ip default-network 20.0.0.0', it will give you the last escort network as 20.0.0.0 through next hop 20.20.20.0.

    This also works with ip add 20.20.20.1/2/3 as well as it is covered in the routing table.

     

    what I have also found is if the classful ip routes in routing table has next hop as an interface, ip default-network wont work. for example, you have a static route in the routing table saying '20.0.0.0/8 is directly connected, FastEthernet1/0', whatever you do, ip default-network cannot use 20.0.0.0/8 as a default gateway network, it has to be an next hop ip address in the routing table.

     

    hope it makes some sense to you, and I only did this through GNS3.

     

    Cheers.

    Join this discussion now: Login / Register
  • Ray G. 19 posts since
    Jun 13, 2013
    Currently Being Moderated
    10. Oct 17, 2014 7:53 AM (in response to Aimen Khudair)
    Re: IP default-network vs ip route 0.0.0.0/0

    Although it's very unlikely this issue is still ongoing from the date of the posts, but,

     

    Why are you trying to compare an ip default-network for a defined network vs an ip route to 0.0.0.0?

     

    You have to remember that the gateway of last resort is the one route to be used when no other routes for that network exist.

     

    By doing ip default-network 198.10.1.0 alone, that could be easily overriden by even an ip default-network of 198.10.0.0, because of the latter being advertised for the major network.

     

    By adding the ip route 0.0.0.0/0, your previous ip default-network is no longer preferred as a destination to the biggest major network, and a route to the 198.10.1.0 is known and placed in the routing table.

     

    If you want to test ip default-network taking precedence over ip route, I would suggest implementing and comparing them both using the same classful network. Otherwise, it would almost be the equivalent of comparing routes preferred based on AD.

     

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

    Join this discussion now: Login / Register

Actions

More Like This

  • Retrieving data ...

Incoming Links

Bookmarked By (2)