9/24/2015

BGP AS Path Access-list / filtering

AS Path Access-list / filtering
    permit .....
    deny ....
    permit ....
    permit .*  ===permit all at the end.

Example 1:

conf t
    ip as-path access-list 1 deny ^300_   -- match everything from 300 most recently. or _300_ anywhere there's 300, deny.

    ip as-path access-list 1 permit .*   === need this, else there's a implicit deny all.

    route-map FILTER_300 permit 10
        match as-path 1  ===if want "or" 1 2 3 4: match as-path 1 or 2 or 3 or 4.

    router bgp 500
        neighbor 1.1.1.1 route-map FILTER_300 out

Example 2: 
    match as-path 500 and set weight 1000, so prefer that route from that neighbor.
   
    ip as-path access-list 10 permit _500_
    route-map INFLUENCE
        match as-path 10
        set weight 1000
    router bgp 200
        neighbor 199.9.9.2 route-map INFLUENCE in
  == Routes from that neighbor pass to the route map and set weight to 1000...so, routes outbound will prefer path to the neighbor.


No comments:

Post a Comment