Aggregate-address and attribute-list for BGP



We sometimes use summary route of BGP, for example, for HQ site's CE router of IP-VPN since it has lots of prefixes. Some IP-VPN carrieres often implements restriction of prefix number per site..


For example, CE router speak OSPF on their LAN interface and it receives routes below prefix.


10.0.1.0/24
  ・
  ・
10.0.20.0/24

In such a case, for Cisco configuration

 --------

router bgp 65000
redistribute ospf 10
aggregate-address 10.0.0.0 255.0.0.0 summary-only
 --------

Above is just one example for this kind of case.

But when HQ CE router receives subnet of this summary route like 10.0.100.0/24, it might be a bit troublesome..

Because if there's some outage on LAN side and CE router cannot receive any 10.0.x.0/24, the CE router still advertise summary route 10.0.0.0/8 to BGP because summary route is still created from 10.0.100.0/24!

For example, in case of redundant topoloy (2CE and 2 circuit), what will be happen in case of LAN interface is down. Main CE will keep announcing summary route and failover we expected will NOT happen.


############## Test ##############

 (Topology)

R1 -- R2

(Configuration)

R1

interface GigabitEthernet1/0
ip address 192.168.0.1 255.255.255.252
!
router bgp 65000
no synchronization
bgp log-neighbor-changes
aggregate-address 10.0.0.0 255.0.0.0
neighbor 192.168.0.2 remote-as 65001
no auto-summary
!

------
R2

interface Loopback0
ip address 10.0.1.1 255.255.255.0
!
interface GigabitEthernet1/0
ip address 192.168.0.2 255.255.255.252
!
router bgp 65001
no synchronization
bgp log-neighbor-changes
network 10.0.1.0 mask 255.255.255.0
neighbor 192.168.0.1 remote-as 65000
no auto-summary
!


(Result)

R1#sh ip route

== snip ==
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 10.0.0.0/8 [200/0] via 0.0.0.0, 00:08:55, Null0
B 10.0.1.0/24 [20/0] via 192.168.0.2, 00:08:55
192.168.0.0/30 is subnetted, 1 subnets
C 192.168.0.0 is directly connected, GigabitEthernet1/0

---------

R2#sh ip route

== snip ==
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 10.0.0.0/8 [20/0] via 192.168.0.1, 00:09:50
C 10.0.1.0/24 is directly connected, Loopback0
192.168.0.0/30 is subnetted, 1 subnets
C 192.168.0.0 is directly connected, GigabitEthernet1/0

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

There's no source of summary route except 10.0.1.0/24 which R1 receives from R2. 

And that summary router 10.0.0.0/8 is announced to R2.

Next, when shutdown the loopback of R2

------
R1#sh ip route

== snip ==
192.168.0.0/30 is subnetted, 1 subnets
C 192.168.0.0 is directly connected, GigabitEthernet1/0

-----------
R2#sh ip route
== snip ==

C 192.168.0.0 is directly connected, GigabitEthernet1/0
-----------



Announcement of summary router from R1 is also stopped


1. To originate summary route only from local route
2. Not to originate summary route from

To satisfy above two requirements, actually I found attribute-list can be used.

Normally, attribute-list is used to filter the route of whose attribute the summary route takes over. But it can be used for workaround of above issue.

Below is the sample configuration. Route-map will match the routes which is originated locally.


--------------------------------
router bgp 65000
aggregate-address 10.0.0.0 255.0.0.0 advertise-map MAP
!
ip as-path access-list 1 permit ^$
!
route-map MAP permit 10
match as-path 1
--------------------------------

Then, summary route is not originated..



--------------------
R1#sh ip bgp
BGP table version is 12, local router ID is 192.168.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 10.0.1.0/24 192.168.0.2 0 0 65001 i
--------------------

Then creates loopback0 (10.0.20.1/24) and  add followingconfiguration to BGP.


network 10.0.20.0 mask 255.255.255.0

So see, summary route is originated again..
Please see below..

---------------------------
R1#sh ip bgp


== snip ==


Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0 0.0.0.0 32768 i
*> 10.0.1.0/24 192.168.0.2 0 0 65001 i
*> 10.0.20.0/24 0.0.0.0 0 32768 i

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

You can see summary route on R2 coming from R1

---------------------------
R2#sh ip bgp

== snip ==


Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0 192.168.0.1 0 0 65000 i
*> 10.0.1.0/24 0.0.0.0 0 32768 i
*> 10.0.20.0/24 192.168.0.1 0 0 65000 i
---------------------------

コメント