Monday 21 December 2015

BGP Maps

BGP Aggregation - Attribute-Map:
========================

R8#show ip bgp 112.0.0.0 255.0.0.0
BGP routing table entry for 112.0.0.0/8, version 49 Paths: (1 available, best #1, table default,
not advertised to EBGP peer
)
Advertised to update-groups:
5
Refresh Epoch 3
54 50 60
155.1.108.10 from 155.1.108.10 (31.3.0.1)
Origin IGP, localpref 100, valid, external, best Community: no-export
rx pathid: 0, tx pathid: 0x0

R5#aggregate-address 112.0.0.0 248.0.0.0 summary-only as-set
R5#show ip bgp 112.0.0.0 248.0.0.0
BGP routing table entry for 112.0.0.0/5, version 75 Paths: (1 available, best #1, table default,
not advertised to EBGP peer
)
Advertised to update-groups:
21 22
Refresh Epoch 1
{54,50,60}, (aggregated by 200 150.1.5.5)
0.0.0.0 from 0.0.0.0 (150.1.5.5)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best Community: no-export
rx pathid: 0, tx pathid: 0x0


When you use the as-set parameter to the aggregate-address command, the
resulting prefix will inherit “additive” attributes of the specific prefixes. This includes
the AS_PATH attributes, condensed into AS_SET and the community attributes,
which are grouped together from all prefixes. We will explore community signaling in
further detail, but for now remember that any prefix bearing the community attribute
value of “no-export” is not advertised to the adjacent ASs.
In our scenario, we have R8 tagging just one prefix—112.0.0.0/8 with the
community value of “no-export”. However, when R5 aggregates all prefixes into one,
the summary prefix inherits the “no-export” community from one of the specific
routes. In effect, AS 200 speakers will not be able to advertise the summary prefix to
the neighbors.
The solution to this problem is the use of the attribute-map parameter to the
aggregate-address command. This parameter specifies the route-map that sets BGP
attributes for the newly generated prefix. You may set any configuration BGP value,
such as metric, origin, local-preference, and so on. However, in our case we are
interested in setting the community attribute value for the summary. The route-map
applies the set community none command and erases all communities for the new
prefix. Naturally, all routers are configured to propagate communities across AS 200.

R5#route-map ATTR_MAP
set community none
!
router bgp 200
aggregate-address 112.0.0.0 248.0.0.0 summary-only as-set attribute-map ATTR_MAP

R5#show ip bgp 112.0.0.0 248.0.0.0
BGP routing table entry for 112.0.0.0/5, version 76
Paths: (1 available, best #1, table default)
Advertised to update-groups:
20 21 22
Refresh Epoch 1
{54,50,60}, (aggregated by 200 150.1.5.5)
0.0.0.0 from 0.0.0.0 (150.1.5.5)
Origin IGP, localpref 100, weight 32768, valid, aggregated, local, best
rx pathid: 0, tx pathid: 0x0



BGP Aggregation - Advertise Map:
=======================

When using the as-set keyword with BGP aggregation, some of the specific prefix
attributes got mixed together in the new prefix. Specifically, you should watch out for
the resulting AS_SET and list of community attributes. In the previous task, you
learned how to modify some of the aggregated prefix attributes. However, you
cannot manipulate an important attribute such as AS_SET directly. Instead, you
may specify the specific prefixes that will be used to make up the attribute list for the
aggregate prefix. This is accomplished by using the advertise-map parameter to the
aggregate-address command. The route-map used as advertise-map should permit
specific prefixes to be used to compose the aggregate attributes, such as AS_SET.
You can use only access-list, prefix-list, or as-path access-lists to match the specific
prefixes. Information from the prefixes denied by the route-map is not used when
constructing the resulting summary-prefix. You may use this method to remove the
prefixes with unwanted BGP community attributes as well.


In our scenario, the AS_SET attribute for the summary route should be composed of
AS numbers 200, 254, and 300. However, by using the advertise-map parameter,
we filter out prefix originated in AS 300 and thus end up with AS_SET of {200,254}.
This allows AS 300 accepting back the summary prefix.


On R4 before map with just aggregate-address and as-set:
 *>  222.22.0.0/22    0.0.0.0                       100  32768 {200,254,300} ?

R4, R6:
ip prefix-list AS300_PREFIX permit 222.22.3.0/24
!
route-map ADVERTISE_MAP deny 10
match ip address prefix-list AS300_PREFIX
!
route-map ADVERTISE_MAP permit 100
!
router bgp 100
aggregate-address 222.22.0.0 255.255.252.0 summary-only as-set advertise-map ADVERTISE_MAP

After:
fa
*>  222.22.0.0/22    0.0.0.0                       100  32768 {200,254} ?


No comments:

Post a Comment