Jan
15

Commonly people run into issues with the ip default-network command putting static routes in their configuration when they select a network that can not be considered as the candidate default network. I’ll show the two common mistakes with this command that causes this to happen.

In the scenario below R4 is receiving a subnet of the 10.0.0.0/8 network (10.1.1.0/24) and has the 172.16.1.0/24 network directly attached to it’s E0/0 interface. We can also see that the router does not have any static routes configured.

Rack4R4(config)#do show ip route rip
10.0.0.0/24 is subnetted, 1 subnets
R       10.1.1.0 [120/1] via 172.16.1.7, 00:00:10, Ethernet0/0
Rack4R4(config)#
Rack4R4(config)#do show ip interface brief | exclude unassigned
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                172.16.1.4      YES manual up                    up
Rack4R4(config)#
Rack4R4(config)#do show run | include ip route
Rack4R4(config)#

Now I’ll set the default network to a network that I have a connected route for.

Rack4R4(config)#ip default-network 172.16.1.0
Rack4R4(config)#do show run | include ip default-network
Rack4R4(config)#
Rack4R4(config)#do show run | include ip route
ip route 172.16.0.0 255.255.0.0 172.16.1.0
Rack4R4(config)#

We can see that the ip default-network command put a static route in the configuration since the network I tried to mark as default was directly connected. Now I’ll try to remove it.

Rack4R4(config)#no ip route 172.16.0.0 255.255.0.0 172.16.1.0
%No matching route to delete

And as we can see from the error message the static route wasn’t removed. To remove the static route just do a “no” on the ip default-network command.

Rack4R4(config)#no ip default-network 172.16.1.0
Rack4R4(config)#do show run | include ip route
Rack4R4(config)#

Now we’ll try to set the default network to a subnet of a classful network that we have a route for in the routing table (see above)

Rack4R4(config)#ip default-network 10.1.1.0
Rack4R4(config)#do show run | include ip default-network
Rack4R4(config)#
Rack4R4(config)#do show run | include ip route
ip route 10.0.0.0 255.0.0.0 10.1.1.0
Rack4R4(config)#

Once again a static route was added and I’ll need to remove it.

Rack4R4(config)#no ip default-network 10.1.1.0

In order for the ip default-network command to actually work I’ll need to select a classful network. To do this I summarized the 10.1.1.124/30 to 10.0.0.0/8 on the router that was advertising the /30 to R4.

Rack4R4(config)#do show ip route rip
R    10.0.0.0/8 [120/1] via 172.16.1.7, 00:00:01, Ethernet0/0
Rack4R4(config)#
Rack4R4(config)#ip default-network 10.0.0.0
Rack4R4(config)#do show run | include ip default-network
ip default-network 10.0.0.0
Rack4R4(config)#
Rack4R4(config)#do show run | include ip route
Rack4R4(config)#
Rack4R4(config)#do show ip route | include \*
ia - IS-IS inter area, * - candidate default, U - per-user static route
R*   10.0.0.0/8 [120/1] via 172.16.1.7, 00:00:02, Ethernet0/0
Rack4R4(config)#

As we can see now the 10.0.0.0/8 is flagged as our candidate default network.

About Brian Dennis, CCIE #2210:

Brian Dennis has been in the networking industry for more than 22 years, with a focus on Cisco networking for the past 16 years. Brian achieved his first CCIE in Routing & Switching in 1996, and is currently the only ten year CCIE that holds five CCIE certifications. Prior to working with INE, Brian taught and developed CCIE preparation courses for various well known training organizations. Brian not only brings his years of teaching experience to the classroom, but also years of real world enterprise and service provider experience.

Find all posts by Brian Dennis, CCIE #2210 | Visit Website


You can leave a response, or trackback from your own site.

10 Responses to “Issues with the “ip default-network” Command”

 
  1. Dan K says:

    Excellent! I was just complaining about this command… Many thanks!

  2. Dara says:

    Hmmmmm !!!!

    During the time of class full routing protocols, a CCIE guy by his observations proved the behaviour of the routing table to be itself acting in a classfull manner, and thereafter the comand ”Ipclassless” cameup for making it work in a classless manner.

    We are again observing the likewise case here!!!

    Thanks a lot,
    Great contribution

  3. IP says:

    Thank you for your article. I should bookmark this page.

  4. Michal says:

    Could anybody explain what is the reason for such behavior of ip default-network command when subnetwork is specified?

  5. erhan says:

    thx great explanation ;)

  6. feed says:

    Yeah… never thinking before. I think, I should try to looking for. Good and informative article. Thanks

  7. Mohamed says:

    i raise my hat to you sir :)
    i was doing the tech lab for eigrp now and i got stuck with this command

    Thanks

  8. saima says:

    yea excellent and very esay to understand abt default nettwok command behaviour.
    i hghly apprecaite for that

  9. Andrei says:

    What if we have a route which looks like auto generated by ip default-network, but even after removing ip default-network line, that route is till there.

    no ip default-network 136.18.210.0
    do show run | i ip route
    ip route 136.18.0.0 255.255.0.0 136.18.210.0

  10. Francisco says:

    I recommend the cisco document “Configuring a gateway of last resort” for taking a deep understanding of the way IOS works when you issue the “ip default-network” command.

    I resume it by saying that:
    - “ip default-network” is a classful command
    - when you type the command with a subnet argument, the result is that the IOS installs the associated major network subnet route with the directly connected subnet as the next-hop (see example with subnet 172.16.1.0
    )
    - In order to reach the desired result, you have to type the “ip default-command” once again with the major network as the argument. Then the last route will be flagged as a candidate of last resort

 

Leave a Reply

Categories

CCIE Bloggers