Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

BGP ip route null

Posted on 2012-03-24
11
Medium Priority
?
1,843 Views
Last Modified: 2012-04-12
I am reviewing a BGP configuration and it has the "ip route 205.x.x.0 255.255.255.0 Null0", can you shed some light on this static route. Do we always need it in bgp? Thx
0
Comment
Question by:biggynet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 15

Assisted Solution

by:Nayyar HH (CCIE RS)
Nayyar HH (CCIE RS) earned 1000 total points
ID: 37763410
This is used/created when the router is summarizing certain prefixes/subnets - it is needed for loop prevention.

Technically what this route does is to "catch" packet destined for subnets NOT part of what was originally summarized and then drop them!
0
 
LVL 29

Assisted Solution

by:Jan Springer
Jan Springer earned 1000 total points
ID: 37763461
This is used to inject a route into the routing table so that it may be announced via BGP or it may be used to drop packets from a known bad subnet.
0
 

Author Comment

by:biggynet
ID: 37763475
The bgp advertises network 205.1.2.0 255.255.255.0 and it also has ip route 205.1.2.0 255.255.255.0 Null0. It is said that the static route is used for loop prevention. But I don't sget it. I advertise my 205.1.2.0/24 to my bgp neighbor and at the same time I route it to a null0.
0
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 
LVL 29

Accepted Solution

by:
Jan Springer earned 1000 total points
ID: 37763486
For a route to be advertised via BGP, it must first exist in the routing table via a directly connected interface, a static route, ospf, isis, etc.  

Typically, supernets are nailed down in the routing table via a Null0 static route.  

Since this is only a /24, I would expect that it's already in the routing table via one of the options above.  If this is one of several subnets and you want to make sure that the prefix isn't dropped via BGP, leaving it Null routed is fine but I typically put weights are Null routed statics when using them for inejction into the routing table, i.e.,

    ip route 205.1.2.0 255.255.255.0 Null0 250

When you look at your running configuration, is this entire subnet already being routed or connected?

  sh run | i 205.1.2

gives you what output?
0
 

Author Comment

by:biggynet
ID: 37763768
I have "network 205.1.2.0 mask 255.255.255.0"
0
 
LVL 15

Assisted Solution

by:Nayyar HH (CCIE RS)
Nayyar HH (CCIE RS) earned 1000 total points
ID: 37763802
because of the above statement exist then it means the null route is being used for route injection

BGP advertisement condition

"Before BGP advertised its network, it checks the forwarding table for an exact match of network number and mask on router’s routing table."

 so considering the above the Null route is used to fulfill this requirement by all means a loopback interface could also be used (not recommended)  



Loop prevention
http://www.cisco.com/en/US/tech/tk364/technologies_tech_note09186a00801c9a6e.shtml
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 37765800
No, you wouldn't put an entire /24 on a loopback interface just to inject it into the routing table.  That would be a complete waste.

Biggynet:  If you do have not a downstream device propagating that route via OSPF, IS-IS or EIGRP, then that Null static route will take care of the problem.  However, you would be better served to weight that route (put 250 after the 'null0').
0
 
LVL 28

Expert Comment

by:mikebernhardt
ID: 37766940
Presumably you are using pieces of this /24 in your network. As previusly mentioned, you need to have an exact match in your IGP routing table in order for BGP to advertise that network. The static route to null0 provides it.

Remember that your router will always route to the most specific route, so if you already have a route to some subnet of the /24, the router still follows it. You don't have to worry about changing the AD (I think the previous poster actually meant AD, not weight) of the /24 route to null0 because it will only be used for addresses in that /24 for which there is no other route.
0
 

Author Comment

by:biggynet
ID: 37767517
So if I understand correctly, When I do:
"router bgp 9999
network 201.1.1.0 mask 255.255.255.0
neighbor 205.1.1.1 remote as 1111"

Nothing will be advertised to my peer if I don't have a route in my routing table. But if I use ip route 201.1.1.0 255.255.255.0 null0. My router will then advertise the network 205.1.1.0 to my peer. Correct?
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 37767558
This is correct.
0
 
LVL 32

Expert Comment

by:harbor235
ID: 37768021
Adding on what Mike said, the null 0 route is used to advertise a supernet or parent block, in this case it is a /24. This prefix(/24) is not used or assigned to any network but the smaller parts of the subnet are used, or the /24 was subnetted.  Like Mike said, this works because traffic is routed to your site because of the /24 advertisement but once it is routed to the advertising router the router has a more specific route to the other portions of that subnet that were subnetted, maybe 16 /28s (16 /28s = 1 /24). If there are more than one route for a network the longest match is the preferred route.

Why is this done? to keep the global routing table as small as possible and to minimize the number of route advertisements network engineer has to make, otherwise instead of advertising the one route (/24) we potentially would need to advertise 16 /28s, you see how this could dramatically increase the routing tables of internet routers?

It is for efficient global routing table management as well as a best current practice.


harbor235 ;}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question