Monday, July 7, 2008

EIGRP - ip default-network command

I hate this command, I think it's unbelievably ....... But here we go. I am going to show some outputs of each router's route table along the way.

[R4]====[R5]

R4 and R5 have two links between each other.
R5 has a loopback 155.1.5.5 being advertised to R4

Before:

R5# show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
D 155.1.4.0 [90/2297856] via 155.1.45.4, 00:00:04, Serial1/1
[90/2297856] via 10.0.0.4, 00:00:04, Serial1/0
C 155.1.5.0 is directly connected, Loopback0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:07:36, Serial1/1
[90/2297856] via 10.0.0.5, 00:07:36, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Now on R5 we enter:

R5(config)#ip default-network 155.1.5.0

Notice what this does to R5's route-table. It modifies the first line to read 155.1.0.0/16 and puts a static route with admin distance of 1 pointing to network 155.1.5.0. However this is not enough to pass the default route to R4.

R5# show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
S 155.1.0.0/16 [1/0] via 155.1.5.0
D 155.1.4.0/24 [90/2297856] via 155.1.45.4, 00:01:17, Serial1/1
[90/2297856] via 10.0.0.4, 00:01:17, Serial1/0
C 155.1.5.0/24 is directly connected, Loopback0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0

R5#show run | inc ip route
ip route 155.1.0.0 255.255.0.0 155.1.5.0
R5#


R4 is the same:

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:10:44, Serial1/1
[90/2297856] via 10.0.0.5, 00:10:44, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Now we enter another default-network command on R5, this time pointing to a classful network. Notice that the static route now has * next to it which means it is a candidate default route. In fact, the gateway of last resort is now set.

R5# show ip route | begin Gateway
Gateway of last resort is 155.1.5.0 to network 155.1.0.0

* 155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
S* 155.1.0.0/16 [1/0] via 155.1.5.0
D 155.1.4.0/24 [90/2297856] via 155.1.45.4, 00:03:40, Serial1/1
[90/2297856] via 10.0.0.4, 00:03:40, Serial1/0
C 155.1.5.0/24 is directly connected, Loopback0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


This command shows up as default network

R5#show run
(output omitted)
ip default-network 155.1.0.0
ip route 155.1.0.0 255.255.0.0 155.1.5.0


R4 is still the same:

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:13:07, Serial1/1
[90/2297856] via 10.0.0.5, 00:13:07, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Let's get that puppy over to R4:

R5(config-router)#redistribute static

R4#show ip route | begin Gateway
Gateway of last resort is 155.1.45.5 to network 155.1.0.0

155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
D*EX 155.1.0.0/16 [170/2297856] via 155.1.45.5, 00:05:01, Serial1/1
[170/2297856] via 10.0.0.5, 00:05:01, Serial1/0
C 155.1.4.0/24 is directly connected, Loopback0
D 155.1.5.0/24 [90/2297856] via 155.1.45.5, 00:22:36, Serial1/1
[90/2297856] via 10.0.0.5, 00:22:36, Serial1/0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0
R4#


Basically you need to remember that the default-network needs a classful address in order to mark the route as a candidate default. Then you must redistribute it in order to advertise it.

I don't understand why you would want to use this command. Maybe someone else can chime in?

2 comments:

  1. I think this is a function carried over from the IGRP days. IGRP did not understand a route to 0.0.0.0, so you could not propagate a default route using ip route 0.0.0.0 0.0.0.0. You had to use ip default-network to create a default route.

    That said, EIGRP will propagate a route to network 0.0.0.0, but you must redistribute the static route.

    I've quoted this from a Cisco document which I think is a clear answer why you would use this command. - "The ip default-network command allows you to configure robustness into the selection of a gateway of last resort. Rather than configuring static routes to specific next-hops, you can have the router choose a default route to a particular network by checking in the routing table."

    ReplyDelete
  2. For the ip default-network command to work, you have to consider the folowing conditions:

    - the ip default-network command has a classful network as argument;

    - the same router has to have in routing table at least a subnet of the classful network mentioned in the command;

    - the other eigrp neighbors will receive that network flagged as default only if they have the same classful network in their routing table, and not some subnet component. (that means that the router that propagates that default network should have autosumarization on, or it should manually summarize that network to the other neighbors)

    ReplyDelete

Note: Only a member of this blog may post a comment.