cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
16875
Views
0
Helpful
8
Replies

Null0 static route

manuadoor
Level 1
Level 1

Hi,

I have seen static route pointing towards a null0 interface in BGP. Can I know why it is used for?

8 Replies 8

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Manuadoor,

it is a way (the old way) to advertise an aggregate address, the static to null0 allows to use under BGP a network command to advertise the prefix.

the modern way to do this is to use the aggregate-address command under BGP process

example:

ip route 196.196.0.0 255.255.252.0 null0

router bgp myASN

network 196.196.0.0 mask 255.255.252.0

it is also used for stability instead of relying on component routes learned by an IGP like OSPF if the objective is to advertise a block of IP addresses the static to null0 allows to use the corresponding network command to advertise the aggregate

modern way

router bgp myASN

network 196.196.1.0 mask 255.255.255.0

...

aggregate-address 196.196.0.0 255.255.252.0 summary-only

Hope to help

Giuseppe

Is it an old article that used null0 instead of "aggregate-address" command?
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.pdf?dtid=osscdc000283

Only ip route x.x.x.x x.x.x.x null0 with network statement works for me.  When I use the aggregate address command I dont see summary route in route table.  Why?

 

R3#sh run | s bgp
router bgp 65011
no synchronization
bgp log-neighbor-changes
network 172.16.0.0 mask 255.240.0.0
network 192.168.0.0 mask 255.255.0.0
aggregate-address 176.16.0.0 255.240.0.0
aggregate-address 192.168.0.0 255.255.0.0
neighbor 10.254.28.108 remote-as 65011
neighbor 10.254.28.108 update-source FastEthernet0/0
neighbor 10.254.28.108 next-hop-self
no auto-summary

 

R4#sh run | s bgp
router bgp 65011
no synchronization
bgp log-neighbor-changes
neighbor 10.254.28.107 remote-as 65011
neighbor 10.254.28.107 update-source FastEthernet0/0
neighbor 10.254.28.107 next-hop-self
no auto-summary

 

 

 

 

R4#sh version
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T7, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Wed 13-Aug-08 21:36 by prod_rel_team

ROM: ROMMON Emulation Microcode
ROM: 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T7, RELEASE SOFTWARE (fc3)

R4 uptime is 22 minutes
System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19
System image file is "tftp://255.255.255.255/unknown"


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Cisco 3725 (R7000) processor (revision 0.1) with 249856K/12288K bytes of memory.
Processor board ID FTX0945W0MY
R7000 CPU at 240MHz, Implementation 39, Rev 2.1, 256KB L2, 512KB L3 Cache
4 FastEthernet interfaces
DRAM configuration is 64 bits wide with parity enabled.
55K bytes of NVRAM.

Configuration register is 0x2102

 

Mohamed Sobair
Level 7
Level 7

Hi,

The static route to null 0 is needed to advertise networks into BGP,

BGP would advertise Networks using any of the bellow methods:

1- with the Network command set.

2- Redistribution into BGP.

3- Aggregate address command.

All of these methods needs an exact match in the routing table , except for the aggregation which needs at least one route part of the aggregate address exist.

However, the bellow example written by Guiseppe doesnt need the (network command under bgp) as long as the aggregate address along with one part of the aggregate address exist in the IP routing table.

(((

modern way

router bgp myASN

network 196.196.1.0 mask 255.255.255.0

...

aggregate-address 196.196.0.0 255.255.252.0 summary-only ))))

You mean to say,, whenever we advertise some routes to BGP it should be pointed to a null0 interface..!! Cannot digest

Most of the time I have seen that the null0 route is for a /22 network, why it is so?

Hello Mohamed,

>> oesnt need the (network command under bgp) as long as the aggregate address along with one part of the aggregate address exist in the IP routing table.

I wrote the example in this way for clarity it is easier to compare the two methods in this way

a) ip route to null0 + network command for the aggregate route

b) aggregate-address + network command for component routes (at least one) or other way to inject a component route in BGP table (for example redistribution or route learned by another BGP peer)

it is a way to create an aggregate = a summary route

Hope to help

Giuseppe

Mohamed Sobair
Level 7
Level 7

Hi,

No, what I meant is that you might not have the Network advertised by BGP in the routing table as static or connected, so you might need to advertis them using Nul0 static into BGP.  Now regarding the /22, this doesnt have to be , it could be any subnet redistributed into bgp without specifically saying /22.

HTH

Mohamed

ok...

1. Even if the IGP route is down, because of this null route, the traffic will reach this router(I read that null0 is having the least preference), so that trouble shooting also will be easier, right??

2. I think we can use null0 for privisioning also..right?

3. I clarrified with some of my collegue they are using /22 because there is a HUB router having 3 spokes, so they summerise the spokes with /22

Review Cisco Networking products for a $25 gift card