cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3774
Views
25
Helpful
6
Replies

EIGRP and Default Routes

Joshua Engels
Level 1
Level 1

Hey guys,

I know there are several ways to skin a cat but wanted to get some thoughts on the solution below:

I wanted to get some of your takes on if this is a legitimate way to advertise a default route into EIGRP.  I have seen many folks do different varations but after some testing I landed on the following.  It seems to work in my lab.  I am using a default route to Null0 on my core router so that EIGRP will advertise network 0.0.0.0. 

CoreRouter Config

router eigrp 1

network 10.0.1.0 0.0.0.3

network 172.25.1.0 0.0.0.3

network 172.30.1.0 0.0.0.3

network 192.168.1.0

network 0.0.0.0

no auto-summary

!

ip forward-protocol nd

ip route 0.0.0.0 0.0.0.0 Null0

ip route 0.0.0.0 0.0.0.0 10.0.1.1

My understanding:           

Null0's Administrative Distance is 255 so it is never used for routing in this case as the 10.0.1.1 route is an AD of 1.  The Null0 route is only used to fool EIGRP into advertising the 0.0.0.0 network.  This is so that I don't have to specify and interface on my next hop for 10.0.1.1.  I prefer to use the IP so that in the event of a failure, my standby ASA will take over IP 10.0.1.1. 

My thought process:

I prefer not to "redistribute static" due to some other static routes that I do not want to redistribute for some VPN stuff which I won't go into here.  The other option was to use a route-map in the redistribute statement but being the Null0 setup was so easy and seems to work I wanted to see if this is a legitimate way to install a default-route.  (I also am aware and familiar with the "default-network" command but wanted to try this first before adding another subnet to the mix)

Your thoughts are greatly appreciated.

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hi Joshua,

Advertising a default route in EIGRP has always been a source of considerable confusion. I am glad you ask. Let me go over the individual lines in your post and comment on them.

network 0.0.0.0

This command does not do what it seems to. Most importantly, this command is not directly related to originating a default route into EIGRP (though I've seen textbooks even from Cisco Press that think otherwise!). What the network 0.0.0.0 command really does is adding all directly connected networks into EIGRP, i.e. all your interfaces along with their IP networks are going to be added to EIGRP.

The reason this command appears to originate a default route is thanks to the way you have defined one of your default route entries: the ip route 0.0.0.0 0.0.0.0 Null0 command adds a route that, while statically defined, is specified using its egress interface only. The routing table will show this routing entry as being directly connected, e.g.:

Router(config)#ip route 0.0.0.0 0.0.0.0 n0

Router(config)#do show ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 0.0.0.0 to network 0.0.0.0

S*   0.0.0.0/0 is directly connected, Null0

Notice here that while the route is statically configured, it is nevertheless claimed to be directly connected. And now the counterintuitive gotcha: RIP and EIGRP treat these static routes defined using only their egress interface as directly connected networks that can be included into RIP/EIGRP using the network command just like any other directly connected network! In other words, this instance of default route is considered as being a directly connected network, so the network 0.0.0.0 command also applies to it - hence it gets injected into EIGRP in your case!

Notice that if the default route was defined using a next hop interface, it would be considered purely static, not directly connected:

Router(config)#do sh ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 10.0.0.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.0.0.0 is directly connected, Serial1/0

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

Here the default route is simply treated as static, not as directly connected, and hence, the network command in RIP or EIGRP does not apply to it.

Using the network 0.0.0.0 in RIP or EIGRP is almost always a very bad idea. It does not do what you expect, i.e. inject a default route under all circumstances. Instead, it adds all your interfaces to EIGRP, starts advertising all your true directly connected networks, allows any of your interfaces to process EIGRP packets sent by routers in any directly connected network, talk to any directly connected EIGRP neighbor, and just by accident, if any static route is defined using just its egress interface, it will also redistribute that static network into EIGRP. With respect to default route, this command will inject a default route into EIGRP only if the default route is defined via an egress interface - not a routine way of defining default routes. I can not stress this enough: do not use network 0.0.0.0 unless you are absolutely sure what you are doing and you want all the effects described above.

Sadly, there is no default-information originate command in EIGRP similar to all other routing protocols supported in IOS (RIP, OSPF, IS-IS, even BGP). So the only recommended way of injecting a default route into EIGRP is to simply redistribute it into EIGRP.

Null0's Administrative Distance is 255 so it is never used for routing in this case as the 10.0.1.1 route is an AD of 1.

This is not true. Both static default routes as shown in your configuration are static routes with the default AD of 1. It does not matter that one of the routes uses the Null0 as the egress interface - that has no impact on the AD of the route whatsoever. See for yourself:

Router(config)#do show run int s1/0

Building configuration...

Current configuration : 100 bytes

!

interface Serial1/0

ip address 10.0.0.2 255.255.255.0

no keepalive

serial restart-delay 0

end

Router(config)#do show run | i ip route

ip route 0.0.0.0 0.0.0.0 10.0.0.1

ip route 0.0.0.0 0.0.0.0 Null0

Router(config)#do show ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 10.0.0.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.0.0.0 is directly connected, Serial1/0

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

               is directly connected, Null0

Notice how the default route is shown here having two equal paths - one via 10.0.0.1, the other via Null0. Thatnks to this setup, statistically, 50% of packets routed via the default route entry will end up in the Null0, being permanently discarded. And as soon as you remove the Null0 route, the network 0.0.0.0 won't apply to the default route defined via the next hop IP.

The Null0 route is only used to fool EIGRP into advertising the 0.0.0.0 network.

This is not true. If the route was not installed into the routing table and considered a directly connected network, it would not be injected into EIGRP thanks to network 0.0.0.0 at all.

This is so that I don't have to specify and interface on my next hop for 10.0.1.1.

I do not understand the point of this statement. When injecting a default route into EIGRP, you do not care about that route's next hop. In distance vector routing protocols, the next hop for any advertised route is simply the neighboring router advertising the route with the least total cost.

I prefer not to "redistribute static" due to some other static routes that I do not want to redistribute

Sadly, the redistribution of default route into EIGRP is the only universal and legitimate way of injecting a default route into EIGRP. There is an easy way of controlling routes which are redistributed into EIGRP - simply use a route-map to select only a default route, e.g.:

ip prefix-list DefRoute permit 0.0.0.0/0

!

route-map Static2EIGRP permit 10

match ip address prefix-list DefRoute

!

router eigrp 1

redistribute static route-map Static2EIGRP

I wanted to see if this is a legitimate way to install a default-route.

Personally, I consider this to be highly improper and illegitimate way of injecting a default route into EIGRP.

I also am aware and familiar with the "default-network" command but  wanted to try this first before adding another subnet to the mix

Oh, the ip default-network - don't even start thinking of using that command. That one is a history long, long past.

Feel welcome to ask further!

Best regards,

Peter

View solution in original post

6 Replies 6

Peter Paluch
Cisco Employee
Cisco Employee

Hi Joshua,

Advertising a default route in EIGRP has always been a source of considerable confusion. I am glad you ask. Let me go over the individual lines in your post and comment on them.

network 0.0.0.0

This command does not do what it seems to. Most importantly, this command is not directly related to originating a default route into EIGRP (though I've seen textbooks even from Cisco Press that think otherwise!). What the network 0.0.0.0 command really does is adding all directly connected networks into EIGRP, i.e. all your interfaces along with their IP networks are going to be added to EIGRP.

The reason this command appears to originate a default route is thanks to the way you have defined one of your default route entries: the ip route 0.0.0.0 0.0.0.0 Null0 command adds a route that, while statically defined, is specified using its egress interface only. The routing table will show this routing entry as being directly connected, e.g.:

Router(config)#ip route 0.0.0.0 0.0.0.0 n0

Router(config)#do show ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 0.0.0.0 to network 0.0.0.0

S*   0.0.0.0/0 is directly connected, Null0

Notice here that while the route is statically configured, it is nevertheless claimed to be directly connected. And now the counterintuitive gotcha: RIP and EIGRP treat these static routes defined using only their egress interface as directly connected networks that can be included into RIP/EIGRP using the network command just like any other directly connected network! In other words, this instance of default route is considered as being a directly connected network, so the network 0.0.0.0 command also applies to it - hence it gets injected into EIGRP in your case!

Notice that if the default route was defined using a next hop interface, it would be considered purely static, not directly connected:

Router(config)#do sh ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 10.0.0.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.0.0.0 is directly connected, Serial1/0

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

Here the default route is simply treated as static, not as directly connected, and hence, the network command in RIP or EIGRP does not apply to it.

Using the network 0.0.0.0 in RIP or EIGRP is almost always a very bad idea. It does not do what you expect, i.e. inject a default route under all circumstances. Instead, it adds all your interfaces to EIGRP, starts advertising all your true directly connected networks, allows any of your interfaces to process EIGRP packets sent by routers in any directly connected network, talk to any directly connected EIGRP neighbor, and just by accident, if any static route is defined using just its egress interface, it will also redistribute that static network into EIGRP. With respect to default route, this command will inject a default route into EIGRP only if the default route is defined via an egress interface - not a routine way of defining default routes. I can not stress this enough: do not use network 0.0.0.0 unless you are absolutely sure what you are doing and you want all the effects described above.

Sadly, there is no default-information originate command in EIGRP similar to all other routing protocols supported in IOS (RIP, OSPF, IS-IS, even BGP). So the only recommended way of injecting a default route into EIGRP is to simply redistribute it into EIGRP.

Null0's Administrative Distance is 255 so it is never used for routing in this case as the 10.0.1.1 route is an AD of 1.

This is not true. Both static default routes as shown in your configuration are static routes with the default AD of 1. It does not matter that one of the routes uses the Null0 as the egress interface - that has no impact on the AD of the route whatsoever. See for yourself:

Router(config)#do show run int s1/0

Building configuration...

Current configuration : 100 bytes

!

interface Serial1/0

ip address 10.0.0.2 255.255.255.0

no keepalive

serial restart-delay 0

end

Router(config)#do show run | i ip route

ip route 0.0.0.0 0.0.0.0 10.0.0.1

ip route 0.0.0.0 0.0.0.0 Null0

Router(config)#do show ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 10.0.0.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.0.0.0 is directly connected, Serial1/0

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

               is directly connected, Null0

Notice how the default route is shown here having two equal paths - one via 10.0.0.1, the other via Null0. Thatnks to this setup, statistically, 50% of packets routed via the default route entry will end up in the Null0, being permanently discarded. And as soon as you remove the Null0 route, the network 0.0.0.0 won't apply to the default route defined via the next hop IP.

The Null0 route is only used to fool EIGRP into advertising the 0.0.0.0 network.

This is not true. If the route was not installed into the routing table and considered a directly connected network, it would not be injected into EIGRP thanks to network 0.0.0.0 at all.

This is so that I don't have to specify and interface on my next hop for 10.0.1.1.

I do not understand the point of this statement. When injecting a default route into EIGRP, you do not care about that route's next hop. In distance vector routing protocols, the next hop for any advertised route is simply the neighboring router advertising the route with the least total cost.

I prefer not to "redistribute static" due to some other static routes that I do not want to redistribute

Sadly, the redistribution of default route into EIGRP is the only universal and legitimate way of injecting a default route into EIGRP. There is an easy way of controlling routes which are redistributed into EIGRP - simply use a route-map to select only a default route, e.g.:

ip prefix-list DefRoute permit 0.0.0.0/0

!

route-map Static2EIGRP permit 10

match ip address prefix-list DefRoute

!

router eigrp 1

redistribute static route-map Static2EIGRP

I wanted to see if this is a legitimate way to install a default-route.

Personally, I consider this to be highly improper and illegitimate way of injecting a default route into EIGRP.

I also am aware and familiar with the "default-network" command but  wanted to try this first before adding another subnet to the mix

Oh, the ip default-network - don't even start thinking of using that command. That one is a history long, long past.

Feel welcome to ask further!

Best regards,

Peter

Hey Peter, thanks for taking the time to write such thorough response!  Learned a lot from the read and definitley makes sense.

Redistribute Static with route-map looks to be the way to go 100%.

Funny as I got the idea of advertising 0.0.0.0 and ip default-network (not the Null0 idea however) from a Ciscopress book.  (CCNP Route 642-902 Official Cert Guide, Wendell Odom)

(Very good point about the 50% loss of packets routed to null0) 

Thanks again!

acampbell
VIP Alumni
VIP Alumni

Hi,

Have a read at this link:-

http://www.cisco.com/en/US/partner/tech/tk365/technologies_white_paper09186a0080094cb7.shtml#defaultrouting

and this for ip default-network

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

Regards,
Alex.
Please rate useful posts.

Regards, Alex. Please rate useful posts.

Will do Alex.  Do you concur with Peter's thoughts as well? 

Joshua,

YES -- His example is a great way to control which static routes you inject into EIGRP. (+5 Peter )

Regards,
Alex.
Please rate useful posts.

Regards, Alex. Please rate useful posts.

Joshua, Alex, Rick,

Thank you all!

Best regards,

Peter

Review Cisco Networking products for a $25 gift card