Packets can be classified through the use of a BGP community list, an autonomous system (AS) path list, or a standard IP access list.
Traffic coming in to a network can be prioritized according to BGP attributes.
QoS policies can be distributed to remote BGP peers in a network.
NOTE
CEF must be enabled on the router. BGP should also be configured in advance. See Section 7-6 for more information about BGP configuration.
Define a method for policy propagation.
Define a community list:
(global) ip community-list community-list-number { permit deny } community-number
Permit the community numbers that you want to classify.
Define an AS path list:
(global) ip as-path access-list path-list-number { permit deny } as-reg-expression
Permit the matching AS paths that you want to classify.
Define an access list:
(global) access-list acc-list-number { permit deny } source
Use a standard IP access list to permit the source addresses you want to classify.
Use a route map to match and set the IP Precedence.
Define the route map:
(global) route-map route-map-name [ permit deny ] [ sequence ]
Specify a list type for matching:
(route-map) match community-list community-list-number [ exact ]
-OR-
(route-map) match as-path path-list-number
-OR-
(route-map) match ip address acc-list-number
The route map can match against a list you configured in Step 1: a community list, a BGP AS path list, or a standard IP access list.
Set the IP Precedence:
(route-map) set ip precedence [ number name ]
The IP Precedence number or name can be given, to be set on matching packets.
Configure BGP to use the route map:
(global) router bgp as-number (bgp) table-map route-map-name
Enable IP Precedence propagation on an interface:
(interface) bgp-policy ip-prec-map
Packets are classified by using the IP Precedence values.
A router is configured with BGP in AS 22. IP Precedence flash is assigned to traffic with a source network of 128.77.69.0, and critical is assigned to routes with an AS path going through AS 101. All other traffic receives a Precedence value of routine.
access-list 10 permit 128.77.69.0 ip as-path access-list 1 permit _101_ route-map mypolicies permit 10 match ip address 10 set ip precedence flash route-map mypolicies permit 20 match as-path 1 set ip precedence critical route-map mypolicies permit 30 set ip precedence routine router bgp 22 neighbor 17.7.1.45 remote-as 50 table-map precedence-map interface serial 0/1 bgp policy ip-prec-map