2013/11/18

WB1 7.36 BGP Communities

7.36 BGP Communities
• Configure AS200 to set local-preference attribute to 200 for eBGP prefixes tagged with community value 200:200
• Configure R1 in AS100 to signal AS200 to prefer path to the prefixes originated in AS 60 via R3.

 
--------------------------------------------------------------
 
設定AS200的Router R3,R5當接受外部的eBGP prefixs有包含communiry 200:200時,將設定local-preference為200
 
設定AS100裡的R1, 告訴AS200的R3, 源自於AS60的prefixs community為200:200
 
--------------------------------------------------------------
 
R1:
no ip as-path access-list 1
ip as-path access-list 1 permit 60$
!
route-map SET_COMMUNITY permit 10
match as-path 1
set community 200:200
!
route-map SET_COMMUNITY permit 100
router bgp 100
neighbor 155.1.13.3 send-community
neighbor 155.1.13.3 route-map SET_COMMUNITY out


 
R3:
ip bgp-community new-format
ip community-list standard 200:200 permit 200:200
!
route-map SET_LOCAL_PREFERENCE permit 10
match community 200:200
set local-preference 200
!
route-map SET_LOCAL_PREFERENCE permit 100
!
router bgp 200
neighbor 155.1.13.1 route-map SET_LOCAL_PREFERENCE in

R5:
ip bgp-community new-format
ip community-list standard 200:200 permit 200:200
!
route-map SET_LOCAL_PREFERENCE permit 10
match community 200:200
set local-preference 200
!
route-map SET_LOCAL_PREFERENCE permit 100
!
router bgp 200
neighbor 155.1.45.4 route-map SET_LOCAL_PREFERENCE in

 
----------------------------------------------------------------------
 
Rack1R3#show ip bgp regexp 60$
BGP table version is 55, local router ID is 150.1.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
*  112.0.0.0        155.1.37.7                             0 300 100 54 50 60 i
*>                  155.1.13.1                    200      0 100 54 50 60 i
*  113.0.0.0        155.1.37.7                             0 300 100 54 50 60 i
*>                  155.1.13.1                    200      0 100 54 50 60 i
Rack1R3#


Rack1R3#show ip bgp 112.0.0.0
BGP routing table entry for 112.0.0.0/8, version 40
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    2    3
  300 100 54 50 60
    155.1.37.7 from 155.1.37.7 (150.1.7.7)
      Origin IGP, localpref 100, valid, external
  100 54 50 60
    155.1.13.1 from 155.1.13.1 (150.1.1.1)
      Origin IGP, localpref 200, valid, external, best
      Community: 200:200

Rack1R3#


R5是透過內部iBGP(R3)所學到外部AS60的prefix localpref為200

Rack1R5#show ip bgp 112.0.0.0
BGP routing table entry for 112.0.0.0/8, version 16
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
        1    3
  100 54 50 60
    155.1.13.1 (metric 27769600) from 155.1.23.3 (150.1.3.3)
      Origin IGP, metric 0, localpref 200, valid, internal, best
  100 54 50 60
    155.1.45.4 from 155.1.45.4 (150.1.4.4)
      Origin IGP, localpref 100, valid, external
Rack1R5#

沒有留言:

張貼留言