7.39 BGP Communities - Local-AS
• Re-configure R1 and R4 in the same BGP sub-confederation, using the AS# 65014. R6 should be in the sub-confederation 65006.
• Advertise R4’s Loopback0 network in the BGP, but make sure that inside AS 100 only R1 receives it.
----------------------
The well-know community Local-AS or NO_EXPORT_SUBCONFED in IETF RFC terms serves the same purpose as the NO_EXPORT community, but within a sub-confederation boundaries.
That is, prefixes tagged by this community are not advertised to external sub-confederation peers (i.e. peers in other subconfederations) AND to regular eBGP peers.
In effect, the prefix is contained within a single sub-confederation. The use of Local-AS community is the same as of NO_EXPORT community, but only within the single confederation boundaries.
In our example, R4 advertises its local Loopback0 subnet into BGP and tags it with the Local-AS community. This prevents the prefix from leaking out of AS 65014 boundaries.
----------------------------------------
R1:
no router bgp 100
router bgp 65014
bgp confederation identifier 100
bgp confederation peers 65006
neighbor 155.1.13.3 remote-as 200
neighbor 155.1.146.4 remote-as 65014
neighbor 155.1.146.6 remote-as 65006
R4:
route-map SET_COMMUNITY
set community local-as
!
no router bgp 100
router bgp 65014
bgp confederation identifier 100
network 155.1.146.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
neighbor 155.1.45.5 remote-as 200
neighbor 155.1.146.1 remote-as 65014
neighbor 155.1.146.1 send-community
neighbor 204.12.1.254 remote-as 54
network 150.1.4.0 mask 255.255.255.0 route-map SET_COMMUNITY
R6:
no router bgp 100
router bgp 65006
bgp confederation identifier 100
bgp confederation peers 65014
network 155.1.146.0 mask 255.255.255.0
aggregate-address 155.1.0.0 255.255.0.0 summary-only
neighbor 54.1.1.254 remote-as 54
neighbor 155.1.67.7 remote-as 300
neighbor 155.1.146.1 remote-as 65014
--------------------------------------------
Rack1R4#show ip bgp 150.1.4.4
BGP routing table entry for 150.1.4.0/24, version 75
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS)
Advertised to update-groups:
1
Local
0.0.0.0 from 0.0.0.0 (150.1.4.4)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
Community: local-AS
Rack1R4#
Rack1R4#show ip bgp neighbors 204.12.1.254 advertised-routes
BGP table version is 75, local router ID is 150.1.4.4
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
*> 28.119.16.0/24 204.12.1.254 0 0 54 i
*> 28.119.17.0/24 204.12.1.254 0 0 54 i
*> 112.0.0.0 204.12.1.254 0 54 50 60 i
*> 113.0.0.0 204.12.1.254 0 54 50 60 i
*> 114.0.0.0 204.12.1.254 0 54 i
*> 115.0.0.0 204.12.1.254 0 54 i
*> 116.0.0.0 204.12.1.254 0 54 i
*> 117.0.0.0 204.12.1.254 0 54 i
*> 118.0.0.0 204.12.1.254 0 54 i
*> 119.0.0.0 204.12.1.254 0 54 i
*> 155.1.0.0 0.0.0.0 32768 i
Total number of prefixes 11
Rack1R4#
Rack1R4#show ip bgp neighbors 155.1.146.1 advertised-routes
BGP table version is 75, local router ID is 150.1.4.4
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
*> 28.119.16.0/24 204.12.1.254 0 0 54 i
*> 28.119.17.0/24 204.12.1.254 0 0 54 i
*> 112.0.0.0 204.12.1.254 0 54 50 60 i
*> 113.0.0.0 204.12.1.254 0 54 50 60 i
*> 114.0.0.0 204.12.1.254 0 54 i
*> 115.0.0.0 204.12.1.254 0 54 i
*> 116.0.0.0 204.12.1.254 0 54 i
*> 117.0.0.0 204.12.1.254 0 54 i
*> 118.0.0.0 204.12.1.254 0 54 i
*> 119.0.0.0 204.12.1.254 0 54 i
*> 150.1.4.0/24 0.0.0.0 0 32768 i
*> 155.1.0.0 0.0.0.0 32768 i
Total number of prefixes 12
Rack1R4#
Rack1R4#show ip bgp neighbors 155.1.146.6 advertised-routes
BGP table version is 75, local router ID is 150.1.4.4
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
*> 28.119.16.0/24 204.12.1.254 0 0 54 i
*> 28.119.17.0/24 204.12.1.254 0 0 54 i
*> 112.0.0.0 204.12.1.254 0 54 50 60 i
*> 113.0.0.0 204.12.1.254 0 54 50 60 i
*> 114.0.0.0 204.12.1.254 0 54 i
*> 115.0.0.0 204.12.1.254 0 54 i
*> 116.0.0.0 204.12.1.254 0 54 i
*> 117.0.0.0 204.12.1.254 0 54 i
*> 118.0.0.0 204.12.1.254 0 54 i
*> 119.0.0.0 204.12.1.254 0 54 i
*> 155.1.0.0 0.0.0.0 32768 i
Total number of prefixes 11
Rack1R4#
Rack1R4#show ip bgp neighbors 155.1.45.5 advertised-routes
BGP table version is 75, local router ID is 150.1.4.4
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
*> 28.119.16.0/24 204.12.1.254 0 0 54 i
*> 28.119.17.0/24 204.12.1.254 0 0 54 i
*> 112.0.0.0 204.12.1.254 0 54 50 60 i
*> 113.0.0.0 204.12.1.254 0 54 50 60 i
*> 114.0.0.0 204.12.1.254 0 54 i
*> 115.0.0.0 204.12.1.254 0 54 i
*> 116.0.0.0 204.12.1.254 0 54 i
*> 117.0.0.0 204.12.1.254 0 54 i
*> 118.0.0.0 204.12.1.254 0 54 i
*> 119.0.0.0 204.12.1.254 0 54 i
*> 155.1.0.0 0.0.0.0 32768 i
Total number of prefixes 11
Rack1R4#
Rack1R1#show ip bgp 150.1.4.0
BGP routing table entry for 150.1.4.0/24, version 79
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS, RIB-failure(17))
Flag: 0x820
Not advertised to any peer
Local
155.1.146.4 from 155.1.146.4 (150.1.4.4)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best
Community: local-AS
Rack1R1#
Rack1R6#show ip bgp 150.1.4.0
% Network not in table
Rack1R6#
Rack1R3#show ip bgp 150.1.4.0
% Network not in table
Rack1R3#
Rack1R5#show ip bgp 150.1.4.0
% Network not in table
Rack1R5#
沒有留言:
張貼留言