7.40 BGP Communities - Deleting
• Configure R2 to tag prefixes received from AS 254 with the community values “254:100”, “200:254” and “200:123”.
• Configure AS 300 to add the community value 300:200 to the list of communities and send them to AS 100.
• Configure AS 300 to remove any communities attached by AS 200, i.e. community starting with “200:” when sending prefixes to AS 100.
------------------------------------------
R2從AS254所學到的prefixs要加上community 254:100,200:254,200:123
當然要send-community to R3,R5
R2,R3,R5需要ip bgp-community new-format
R3當然要send-community給SW1 , SW1需要ip bgp-community new-format
SW1當然要send-community給R6 , R6需要ip bgp-community new-format
AS300的SW1要附加community 300:200後轉送AS100
set community 300:200 additive
AS300的SW1要刪除community開頭為"200:"後轉送AS100
set comm-list AS200 delete
ip community-list expanded AS200 permit 200:[0-9]+_
by matching “200:[0-9]+_” you will erase any community set in AS 200.
Then, you create a route-map to delete the communities using the following syntax: set comm-list {<NAME>|<NUMBER>} delete. You may set your own communities while deleting the other.
In our scenario, SW1 is configured to remove any communities matching the pattern “200:[0-9]+” and attach its own community “300:200”. This is performed using a single route-map entry.
------------------------------------------
R2:
route-map SET_COMMUNITY permit 10
no set community
set community 200:254 254:200 200:123
!
router bgp 200
neighbor 155.1.23.3 send-community
neighbor 155.1.0.5 send-community
neighbor 192.10.1.254 route-map SET_COMMUNITY in
!
ip bgp-community new-format
R3:
router bgp 200
neighbor 155.1.37.7 send-community
!
ip bgp-community new-format
SW1:
ip community-list expanded AS200 permit 200:[0-9]+_
!
route-map RESET_COMMUNITY permit 10
set community 300:200 additive
set comm-list AS200 delete
!
router bgp 300
neighbor 155.1.67.6 send-community
neighbor 155.1.37.3 route-map RESET_COMMUNITY in
!
ip bgp-community new-format
R6:
ip bgp-community new-format
------------------------------------------
變更前R2->R3->SW1->R6
Rack1R3#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 129
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2 3 4
254
192.10.1.254 (metric 2560512256) from 155.1.0.5 (150.1.5.5)
Origin incomplete, metric 0, localpref 100, valid, internal
Originator: 150.1.2.2, Cluster list: 150.1.5.5
254, (Received from a RR-client)
192.10.1.254 (metric 2560512256) from 155.1.23.2 (150.1.2.2)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Community: 200:123 200:254 254:100
Rack1R3#
Rack1SW1#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 74
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x8A0
Advertised to update-groups:
1 2
100 200 254
155.1.67.6 from 155.1.67.6 (150.1.6.6)
Origin incomplete, localpref 100, valid, external
200 254
155.1.37.3 from 155.1.37.3 (150.1.3.3)
Origin incomplete, localpref 100, valid, external, best
Community: 200:123 200:254 254:100
Rack1SW1#
Rack1R6#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 32
Paths: (3 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 2
300 200 254
155.1.67.7 from 155.1.67.7 (150.1.7.7)
Origin incomplete, localpref 100, valid, external
Community: 200:123 200:254 254:100
(65014) 200 254
155.1.13.3 (metric 27260160) from 155.1.146.1 (150.1.1.1)
Origin incomplete, metric 0, localpref 100, valid, confed-external, best
(65014) 200 254
155.1.45.5 (metric 27260160) from 155.1.146.4 (150.1.4.4)
Origin incomplete, metric 0, localpref 100, valid, confed-external
Rack1R6#
變更後R2->R3->SW1->R6
Rack1R3#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 129
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2 3 4
254
192.10.1.254 (metric 2560512256) from 155.1.0.5 (150.1.5.5)
Origin incomplete, metric 0, localpref 100, valid, internal
Originator: 150.1.2.2, Cluster list: 150.1.5.5
254, (Received from a RR-client)
192.10.1.254 (metric 2560512256) from 155.1.23.2 (150.1.2.2)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Community: 200:123 200:254 254:100
Rack1R3#
Rack1SW1#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 77
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
2 3
100 200 254
155.1.67.6 from 155.1.67.6 (150.1.6.6)
Origin incomplete, localpref 100, valid, external
200 254
155.1.37.3 from 155.1.37.3 (150.1.3.3)
Origin incomplete, localpref 100, valid, external, best
Community: 254:100 300:200
Rack1SW1#
Rack1R6#show ip bgp 222.22.2.0
BGP routing table entry for 222.22.2.0/24, version 32
Paths: (3 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 2
300 200 254
155.1.67.7 from 155.1.67.7 (150.1.7.7)
Origin incomplete, localpref 100, valid, external
Community: 254:100 300:200
(65014) 200 254
155.1.13.3 (metric 27260160) from 155.1.146.1 (150.1.1.1)
Origin incomplete, metric 0, localpref 100, valid, confed-external, best
(65014) 200 254
155.1.45.5 (metric 27260160) from 155.1.146.4 (150.1.4.4)
Origin incomplete, metric 0, localpref 100, valid, confed-external
Rack1R6#
沒有留言:
張貼留言