cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2562
Views
25
Helpful
9
Replies

ip default-network command

snarayanaraju
Level 4
Level 4

Hi experts,

For a long time, I am scratching my head to understand, what for the command “ip default-network” is used. Please refer the link by CISCO which describes the concept. But I feel it is not explained with example.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094374.shtml

I tested this in lab environment also to understand the use of this command over static route.

Please educate me what for it is used and how it is working compared to static route to the destination

Thanks and I will be looking for your help on this

1 Accepted Solution

Accepted Solutions

As the ASCII diagram implies, that's a directly connected interface on R2.

View solution in original post

9 Replies 9

Edison Ortiz
Hall of Fame
Hall of Fame

I think the command documentation explains its use very clearly

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_pi1.html#wp1012319

Please take a look and come back if you still have any questions.

HTH,

__

Edison.

Hi Edison,

Thanks for providing this information. In fact before writing here I have gone through most of the docs in CISCO site including the link you mentioned.

As a last resort, I sought your expertised assistance to understand this. Let me brief my understanding. Please correct me where ever i am deviating from the concept.

when

ip route 10.0.0.0 255.0.0.0 10.108.3.4

ip default-network 10.0.0.0

command is configured, does it means that to reach any subnet of 10.0.0.0/8 go to 10.108.3.4 ?

If that is the case, then what the command "ip route 10.0.0.0 255.0.0.0 10.108.3.4" is doing?

This may be a fundamental logic which i am finding difficult to understand from the begining.

Please help

Sairam

Per the link I posted:

Command Default

If the router has a directly connected interface onto the specified network, the dynamic routing protocols running on that router will generate (or source) a default route. For Router Information Protocol (RIP), this is flagged as the pseudonetwork 0.0.0.0.

On my Lab

[R1](192.168.12.1)<---->(192.168.12.2)[R2](192.168.23.2)<--->(192.168.23.3)[R3]

R1 and R2 are running RIP on 192.168.12.0/24 and I want to advertise a Quad 0 from R2 to R1.

R2(config)#ip default-network 192.168.23.0

On R1 log:

00:11:56: RIP: received v2 update from 192.168.12.2 on FastEthernet0/0

00:11:56: 0.0.0.0/0 via 0.0.0.0 in 1 hops

R1#sh ip route rip

R* 0.0.0.0/0 [120/1] via 192.168.12.2, 00:00:23, FastEthernet0/0

HTH,

__

Edison.

Hi edison,

Its good. But do we use "ip default-network" only for dynamic routing protocols.

How it is useful when used in static routing. Can you please take some more time as I am worried why I am not able to get basic idea on this

Also please make comment on my earlier reply

Sairam

As the documentation indicates, this is used in conjunction with dynamic routing protocols.

The static routing is used to provide the reachability information on the source router to generate the default route.

For instance, same scenario as above but now I have:

R2(config)#ip route 10.0.0.0 255.0.0.0 192.168.23.3

R2(config)#ip default-net 10.0.0.0

00:22:58: RIP: received v2 update from 192.168.12.2 on FastEthernet0/0

00:22:58: 0.0.0.0/0 via 0.0.0.0 in 1 hops

R1#sh ip route rip

R* 0.0.0.0/0 [120/1] via 192.168.12.2, 00:00:07, FastEthernet0/0

BTW, I've taken my time to explain the concept and how this command works. Building a lab to explain the concept for you took some time and effort, don't you think?

Hi edison,

In continuing to the previous reply, you configured

R2(config)#ip default-network 192.168.23.0

R1#sh ip route rip

R* 0.0.0.0/0 [120/1] via 192.168.12.2, 00:00:23, FastEthernet0/0

But where is this 192.168.23.0 appearing in the route-table

Sairam

As the ASCII diagram implies, that's a directly connected interface on R2.

Hello Edison,

I would like to know your opinion on the "ip default-network". In my opinion, there are various counterintuitive facts about it and the entire command bears too much annoying cruft and dependencies from the ages of classful routing protocols like RIPv1 and IGRP for which it was originally designed. Its behavior is quite complicated, classful-address oriented and dependent on the contents of the routing table in the moment of its use.

Assume that you enter the command

ip default-network A.B.C.D

where A.B.C.D is an arbitrary IP address. Now, a couple of different scenarios exists.

1.) If the routing table does not contain a classful network (I will call it major network) of the A.B.C.D nor any of that major network's subnets when issuing that command, it will be added to the configuration exactly as entered. For example, if the routing table does not contain the network 1.0.0.0/8 nor any subnets thereof, the command

ip default-network 1.2.3.4

will be added to the configuration as shown here. Note that it references a network that the router does not know about (that was the premise in this case). However, as soon as the network 1.0.0.0/8 or any of its subnets appears in the routing table, the router will automatically remove this command from the running configuration and replace it with a placeholder static route as explained in the case 2.) - see below.

2.) If the routing table contains a major network of the A.B.C.D or any of that major network's subnets, the command will not be added to the configuration. Instead, a placeholder static routing entry will be created in the form

ip route MAJOR_NET(A.B.C.D) CLASSFUL_MASK(A.B.C.D) A.B.C.D

The command "ip default-network A.B.C.D" in this case will be accepted without creating that placeholder static route if and only if the A.B.C.D is itself a major network.

For example, if there is a network 1.1.1.0/24 in the routing table, issuing the command

ip default-network 1.1.1.0

will cause that a different command is added to the configuration:

ip route 1.0.0.0 255.0.0.0 1.1.1.0

The command "ip default-network" will be accepted only if written in the form:

ip default-network 1.0.0.0

That static "ip route" command is created because of limitations of original IGRP. The IGRP does not support the default route in the form of 0.0.0.0/0. It can only flag a specific network as a candidate for default route. The creation of that placeholder static route provided a network entry in the routing table that had to be redistributed into IGRP (note that it is classful) and only then flagged as candidate for the default route.

3.) Any supernets that would cover the IP address A.B.C.D are ignored and the command "ip default-network A.B.C.D" behaves identically as in the case 1.)

So the "ip default-network" is a heavily classful-oriented command which makes it kind of difficult to use in today's intensively subnetted networks. Moreover, OSPF and IS-IS ignore this command. From my viewpoint, it was only required for IGRP that had no other means of conveying a default route. For all other routing protocols, there are other (and in my opinion, better) means to inject a default route. Its operation is too cumbersome and I have the feeling that it is a remainder of a past that is more confusing than helpful.

Best regards,

Peter

Peter,

I fully agree with everything you said and often this questions pop-up on these forums due to CCNA/CCNP study material.

If you stay long enough, you will see the pattern.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card