Summary Routes To Null0


I don’t know about you but to me in the past the idea of a route to Null0 did not really clicked if I may say so until honestly few weeks back. I remember sitting in the office with my of my colleagues from work Diego Hernandez (CCIE) who threw at me many perfect examples regarding this feature which I’ve decided to talk about this evening cause in the end why on earth would you want to use the route to Null0 ???

When summarizing routes with different routing protocols Im sure you’ve noticed have noticed that some of them always add the summary route that is advertised downstream to the local routing table and this is good but what is confusing at first that this local summary route is given a next-hop of Null0

For instance , with EIGRP you configure a summary route let’s say ip summary-address eigrp 1 10.10.0.0 255.255.0.0 on an interface of that router and immediately you will see a route inserted into the routing table for 10.10.0.0/16 pointing to null0.

We’ve all seen it happened but understanding WHY it happens is the important thing and that is why I’ve decided to create this post. After we understand why , we will look at how this works (or doesn’t work) with RIP, EIGRP, OSPF and BGP.

We can sum up this feature exists in two words:  Loop prevention.
Unfortunately, that is where many people simply stop caring.  Believe it or not but they never ask the question “why”.
Let’s look at our topology:

Summary Routes To Null0

So we have en extremely simple setup.  R1 is advertising a default-route to R2.  R2 has 6 loopback addresses.  Instead of sending 6 individual routes, we will configure a summarization on R2

…so why do routing protocols insert a summary route to null0 on the local router when doing route summarization?  well imagine what happens if R1 wants to send a packet to 2.2.2.7.  The summary route advertised from R2 is 2.2.2.0/29, which means that the summary covers the range 2.2.2.1 – 2.2.2.7.  However, R2 does not have a route for 2.2.2.7 however it does have a default-route it learned from R1 .  What you have there is perfect example of a routing loop.  R1 will send the packet to R2.  R2 won’t have a route for 2.2.2.7 and will default route it back to R1.  This will continue until the IP TTL expires.

If we were running a routing protocol that implements the summary route to null0 , we would not have that problem cause if R2 generated the summary to 2.2.2.0/29 it would also add a route to the routing table: 2.2.2.0/29 via NULL0.  Now think about the same process.  R1 wants to reach 2.2.2.7.  It has a summary route for 2.2.2.0/29 it learned from R2 so it sends the packet to R2.  R2 still doesn’t have a specific route for 2.2.2.7, but it DOES have a more general route for 2.2.2.0/29 that matches.  Because of that, R2 routes the packet to a black hole we call null0 and the packet is dropped instead of causing a routing loop! so let’s start from

EIGRP

R1(config)#router eigrp 1
R1(config-router)#no auto-summary
R1(config-router)#passive-interface default
R1(config-router)#no passive-interface fa0/0
R1(config-router)#network 12.0.0.0

R2(config)#router eigrp 1
R2(config-router)#no auto-summary
R2(config-router)#passive-interface default
R2(config-router)#no passive-interface fa0/0
R2(config-router)#network 12.0.0.0
R2(config-router)#network 2.0.0.0 0.0.0.255
R2(config-router)#exi

R2(config)#interface fa0/0
R2(config-if)#ip summary-address eigrp 1 2.2.2.0 255.255.255.248

R1(config-router)#do sh ip route ei
2.0.0.0/29 is subnetted, 1 subnets
D       2.2.2.0 [90/409600] via 12.12.12.2, 00:02:06, FastEthernet0/0

R2(config-router)#do sh ip route ei
2.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
D       2.2.2.0/29 is a summary, 00:00:22, Null0

Now let’s get rid og the summary route:

R2(config-if)#ip summary-address eigrp 1 2.2.2.0 255.255.255.248 255

R1(config-router)#do sh ip route ei
2.0.0.0/29 is subnetted, 1 subnets
D       2.2.2.0 [90/409600] via 12.12.12.2, 00:02:06, FastEthernet0/0

it’s gone and we can still reach all loopbacks on R2

R1(config-router)#do ping 2.2.2.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/37/52 ms

 

OSPF

REMEBER with OSPF we can only summarize on an ABR or ASBR in OSPF we will go ahead and make R2 and ABR with all the loopbacks in a different area then the backbone.

R1(config)#router ospf 1
R1(config-router)#passive-interface default
R1(config-router)#no passive-interface fa0/0
R1(config-router)#network 12.12.12.1 0.0.0.0 area 0

R2(config)#no router eigrp 1
R2(config)#router ospf 1
R2(config-router)#passive-interface default
R2(config-router)#no passive-interface fa0/0
R2(config-router)#network 12.12.12.2 0.0.0.0 area 0
R2(config-router)#network 2.2.2.0 0.0.0.255 area 1
R2(config-router)#area 1 range 2.2.2.0 255.255.255.248 0

R1#sh ip route ospf
2.0.0.0/29 is subnetted, 1 subnets
O IA    2.2.2.0 [110/2] via 12.12.12.2, 00:00:40, FastEthernet0/0

R2(config-router)#do sh ip route os
2.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O       2.2.2.0/29 is a summary, 00:00:12, Null0

We can simply use the no discard-route command under the OSPF process. If we are summarizing on an ABR as is the case here we would use
no discard-route internal
If we were summarizing external routes on an ASBR we could use
no discard-route external
Finally, if we simply want to change the AD of the discard route to null0 we can do that with
discard-route [internal|external] [AD]
The last option gives us the ability to use the same tactic we did in EIGRP to get rid of the null0 route if we want by getting the AD up to 255.

BGP

R1(config)#router bgp 1
R1(config-router)#no auto
R1(config-router)#no sync
R1(config-router)#neighbor 12.12.12.2 remote-as 1

R2(config)#router bgp 1
R2(config-router)#no auto
R2(config-router)#no sync
R2(config-router)#neighbor 12.12.12.1 remote-as 1
R2(config-router)#network 2.2.2.1
R2(config-router)#network 2.2.2.1 mask 255.255.255.255
R2(config-router)#aggregate-address 2.2.2.0 255.255.255.248 summary-only

R1(config-router)#do sh ip rou bgp
2.0.0.0/29 is subnetted, 1 subnets
B       2.2.2.0 [200/0] via 12.12.12.2, 00:01:45

R2(config-router)#do sh ip route bgp
2.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
B       2.2.2.0/24 [200/0] via 0.0.0.0, 00:00:36, Null0

R2(config-router)#distance bgp 20 200 255

 

R2(config-router)#do sh ip route bgp

 

RIP

RIP does not implement this feature at all!  Why?  Well for starters we don’t have to know how to disable it but, what if we actually want RIP to prevent the routing loop ?  Well, we can simply do it ourselves! We can simply add our own summary route on R2

ip route 2.2.2.0 255.255.255.248 null0

 

Conclusion

When doing manual summarization the router will add a local summary route to null 0.This feature is in place to prevent routing loops. Each routing protocol that implements the feature does so similarly, but each has some unique ways of preventing the discard route from entering the routing table.

Enjoy!

Tom

 

 

Advertisements

About ccie4all
Hello, and welcome to the first post of my CCIE blog This blog has got one simple goal and that is to improve our skills in Cisco Networking field so we can become best engineers on a job market. Wordpress Blog https://ccie4all.wordpress.com/ information about the changes made to Gns3 BGP , MPLS and R&S CCIE labs. In order to access and download all provided materials and receive important updates from Gns3 BGP , MPLS and R&S CCIE labs under GNS3 tab in the main header please go ahead and subscribe to https://ccie4all.wordpress.com/ ! All other posts have not been affected and can be accessed at any given time. Enjoy ! Tom

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: