Thursday, 28 June 2012

BGP: Attribute-map configuration and verification

BGP: Attribute-map configuration and verification

·         Whenever BGP summarizes along with AS-SET key-word, the summarized route inherits the properties of individual routes.
·         Example: If any of the individual route has community value, the summarized route inherits this community value
·         If it is a special community value like no-export, it affects the propagation of the summarized route.
·         We can use ATTRIBUTE-MAP to change the properties (attributes) of the summarized route).

·         Let me take a small topology to configure this:

R1----------------------R2--------------------R3

·         R1: AS 100
·         R2: AS 200
·         R3: AS 300

·         Configure 5 loopbacks 10.1.1.1, 10.1.2.1, 10.1.3.1, 10.1.4.1, 10.1.5.1 in R1 and advertise them into BGP
·         Configure 10.1.1.1 with no-export community
·         Configure aggregate-address in R2 and see the properties of summarized route.
·         Then we will see how to configure ATTRIBUTE-MAP to change this inherited properties

R1(config-router)#do show run | begin router bgp
router bgp 100
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 network 10.1.1.1 mask 255.255.255.255
 network 10.1.2.1 mask 255.255.255.255
 network 10.1.3.1 mask 255.255.255.255
 network 10.1.4.1 mask 255.255.255.255
 network 10.1.5.1 mask 255.255.255.255
 neighbor 100.1.12.2 remote-as 200
 neighbor 100.1.12.2 send-community
 neighbor 100.1.12.2 route-map EXPORT out
 no auto-summary
!
!
ip prefix-list 10 seq 5 permit 10.1.1.1/32
!
route-map EXPORT permit 10
 match ip address prefix-list 10
 set community no-export
!
route-map EXPORT permit 100
!
R1(config-router)#!

R2(config-router)#do show run | begin router bgp 200
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 10.1.0.0 255.255.0.0
 neighbor 100.1.12.1 remote-as 100
 neighbor 100.1.23.3 remote-as 300
 neighbor 100.1.23.3 send-community
 no auto-summary
!

R2#show ip bgp
BGP table version is 23, local router ID is 2.2.2.2
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.1.0.0/16      0.0.0.0                            32768 i
*> 10.1.1.1/32      100.1.12.1               0             0 100 i
*> 10.1.2.1/32      100.1.12.1               0             0 100 i
*> 10.1.3.1/32      100.1.12.1               0             0 100 i
*> 10.1.4.1/32      100.1.12.1               0             0 100 i
*> 10.1.5.1/32      100.1.12.1               0             0 100 i
R2#
R2#show ip bgp 10.1.1.1
BGP routing table entry for 10.1.1.1/32, version 22
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
  Not advertised to any peer
  100
    100.1.12.1 from 100.1.12.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
      Community: no-export
R2#
R2#show ip bgp 10.1.0.0/16
BGP routing table entry for 10.1.0.0/16, version 23
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1          2
  Local, (aggregated by 200 2.2.2.2)
    0.0.0.0 from 0.0.0.0 (2.2.2.2)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, atomic-aggregate, best
R2#

Observations:

·         I have not configured AS-SET key-word while configuring the aggregate-address
·         So, I don’t see the summarized route inheriting the community no-export that is configured for 10.1.1.1

·         Let me configure AS-SET key-word while configuring the aggregate-address:

R2(config-router)#aggregate-address 10.1.0.0 255.255.0.0 as-set
R2(config-router)#do clear ip bgp *
R2(config-router)#
*Jun 28 09:58:09.627: %BGP-5-ADJCHANGE: neighbor 100.1.12.1 Down User reset
*Jun 28 09:58:09.631: %BGP-5-ADJCHANGE: neighbor 100.1.23.3 Down User reset
R2(config-router)#
*Jun 28 09:58:10.827: %BGP-5-ADJCHANGE: neighbor 100.1.12.1 Up
*Jun 28 09:58:10.915: %BGP-5-ADJCHANGE: neighbor 100.1.23.3 Up
R2(config-router)#end
R2#show i
*Jun 28 10:37:40.207: %SYS-5-CONFIG_I: Configured from console by console
R2#show ip bgp 10.1.0.0/16
BGP routing table entry for 10.1.0.0/16, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
  Not advertised to any peer
  100, (aggregated by 200 2.2.2.2)
    0.0.0.0 from 0.0.0.0 (2.2.2.2)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
      Community: no-export
R2#

R3#show ip bgp
BGP table version is 41, local router ID is 3.3.3.3
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.1.2.1/32      100.1.23.2                             0 200 100 i
*> 10.1.3.1/32      100.1.23.2                             0 200 100 i
*> 10.1.4.1/32      100.1.23.2                             0 200 100 i
*> 10.1.5.1/32      100.1.23.2                             0 200 100 i
R3#

Observations:

·         If I configure the aggregate-address with AS-SET key-word, then the summarized route inherited the properties of 10.1.1.1, no-export community.
·         That is the reason why R2 didn’t advertise this summarized route to R3.

·         Configuring the ATTRIBUTE-MAP while configuring the aggregate-address to change the community value:

R2(config)#route-map ATTRIB
R2(config-route-map)#set community none
R2(config-route-map)#router bgp 200
R2(config-router)#aggregate-address 10.1.0.0 255.255.0.0 as-set attribute-map ATTRIB
R2(config-router)#DO CLEAR IP BGP *
R2(config-router)#
*Jun 28 14:06:31.566: %BGP-5-ADJCHANGE: neighbor 100.1.12.1 Down User reset
*Jun 28 14:06:31.570: %BGP-5-ADJCHANGE: neighbor 100.1.23.3 Down User reset
R2(config-router)#
*Jun 28 14:06:32.774: %BGP-5-ADJCHANGE: neighbor 100.1.23.3 Up
*Jun 28 14:06:33.118: %BGP-5-ADJCHANGE: neighbor 100.1.12.1 Up
R2(config-router)#

R2#show ip bgp 10.1.0.0/16
BGP routing table entry for 10.1.0.0/16, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1          2
  100, (aggregated by 200 2.2.2.2)
    0.0.0.0 from 0.0.0.0 (2.2.2.2)
      Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
R2#

R3#show ip bgp
BGP table version is 52, local router ID is 3.3.3.3
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.1.0.0/16      100.1.23.2               0             0 200 100 i
*> 10.1.2.1/32      100.1.23.2                             0 200 100 i
*> 10.1.3.1/32      100.1.23.2                             0 200 100 i
*> 10.1.4.1/32      100.1.23.2                             0 200 100 i
*> 10.1.5.1/32      100.1.23.2                             0 200 100 i
R3#

Observation:

·         I have set the community value to none using the ATTRIBUTE-MAP
·         That’s why R2 has advertised this route to R3 now.

No comments:

Post a Comment