
Regarding attribute-map in BGP
R1 AS100--------L2SWITCH---------R4 AS100
|
|
|
R1( AS100)
|
|
|
R3 (AS200)
-------R4 is sending to R1 via ibgp
112.0.0.0/8 with "No-export" comm
113.0.0.0/8 No eommunity
R1#sh ip bgp 112.0.0.0/8
BGP routing table entry for 112.0.0.0/8, version 5
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer, Advertisements suppressed by an aggregate.)
Flag: 0x820
Not advertised to any peer
Local, (Received from a RR-client)
155.1.146.4 from 155.1.146.4 (113.0.0.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
Community: no-export <-----------------------------------------
Router R1 is generating summary route 112.0.0.0 248.0.0.0
router bgp 100
no synchronization
bgp log-neighbor-changes
aggregate-address 112.0.0.0 248.0.0.0 as-set summary-only
neighbor 155.1.13.3 remote-as 200
neighbor 155.1.13.3 send-community both
neighbor 155.1.146.4 remote-as 100
neighbor 155.1.146.4 route-reflector-client
neighbor 155.1.146.4 send-community both
R1#sh ip bgp 112.0.0.0/5
BGP routing table entry for 112.0.0.0/5, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
Flag: 0x820
Advertised to update-groups:
1 2
Local, (aggregated by 100 155.1.146.1)
0.0.0.0 from 0.0.0.0 (155.1.146.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
Community: no-export<------------------------------Community attached to summary route as specific route is carrying the same community
Now i want to remove the "no-export" community from the summary route 112.0.0.0/5.
so i used attribute-map to remove the "no-export" community
router bgp 100
no synchronization
bgp log-neighbor-changes
aggregate-address 112.0.0.0 248.0.0.0 as-set summary-only attribute-map ATT
sh route-map ATT
route-map ATT, permit, sequence 10
Match clauses:--------------------------> No match statement.
Set clauses:
community none
Policy routing matches: 0 packets, 0 bytes
R1#sh ip bgp 112.0.0.0/5
BGP routing table entry for 112.0.0.0/5, version 13
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x880
Advertised to update-groups:
1 2
Local, (aggregated by 100 155.1.146.1)
0.0.0.0 from 0.0.0.0 (155.1.146.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best <----Commnity removed
Till here everything is looking fine.
Now if i match the prefix 112.0.0.0/5 in attribute-map its not removing the community of the route.
R1#sh route-map ATT
route-map ATT, permit, sequence 10
Match clauses:
ip address prefix-lists: ATT
Set clauses:
community none
Policy routing matches: 0 packets, 0 bytes
route-map ATT, permit, sequence 20
Match clauses:
Set clauses:
Policy routing matches: 0 packets, 0 bytes
R1#sh ip prefix-list ATT
ip prefix-list ATT: 1 entries
seq 5 permit 112.0.0.0/5
router bgp 100
no synchronization
bgp log-neighbor-changes
aggregate-address 112.0.0.0 248.0.0.0 as-set summary-only attribute-map ATT
neighbor 155.1.13.3 remote-as 200
neighbor 155.1.13.3 send-community both
neighbor 155.1.146.4 remote-as 100
neighbor 155.1.146.4 route-reflector-client
neighbor 155.1.146.4 send-community both
R1#sh ip bgp 112.0.0.0/5
BGP routing table entry for 112.0.0.0/5, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
Advertised to update-groups:
1
Local, (aggregated by 100 155.1.146.1)
0.0.0.0 from 0.0.0.0 (155.1.146.1)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
Community: no-export <------------------------------Community present in route
Want to know is matching crateria is not allowed OR not working in the senario.
This just to identify the reason.
Please suggest.
/Ganapt
Comments
When we apply this commad "aggregate-address 112.0.0.0 248.0.0.0 as-set summary-only attribute-map ATT" router is going to generate the summary prefix but at the same time you have a route-map which is matching that prefix that is yet to be generated by this command so route-map in this case will never even applied to the aggregate address therefore you have no-export community as an attribute for the summary as if you have not applied the attribute-map with the aggregate command.
I agree with dcancerian. You need to be careful when using the attribute-map feature with a route-map as it may turn out on undesired results. There are some weird scenarios and in which this is very useful.
Just my 2 cents.