|
|
This chapter describes the tasks for configuring Policy Propagation via Border Gateway Protocol (BGP) on a router. For a complete description of the commands mentioned in this chapter, refer to the Quality of Service Solutions Command Reference; the commands are listed alphabetically within that guide. To locate documentation of specific commands, use the command reference, master index, or search online.
This feature is supported on these platforms:
The Policy Propagation via BGP feature allows you to classify packets by IP Precedence based on BGP community lists, BGP autonomous system paths, and access lists. After a packet has been classified, you can use other quality of service features such as committed access rate (CAR) and Weighted Random Early Detection (WRED) to specify and enforce policies to fit your business model.
To configure Policy Propagation via BGP, perform the following basic tasks:
This chapter describes how to configure Policy Propagation based on BGP community list, BGP autonomous system path, or access list. It assumes you have already configured BGP and CEF or DCEF. See the next section for the list of tasks covered in this chapter.
The tasks required to configure Policy Propagation via BGP and verify that the information is correct are described in the following sections in this chapter:
For examples of propagating policy using access lists, BGP community lists, and BGP autonomous system paths, see the section "Policy Propagation via BGP Configuration Examples" later in this chapter.
This section describes how to configure Policy Propagation via BGP using community lists. The tasks listed in this section are required unless noted as optional. This section assumes you have already configured CEF/DCEF and BGP on your router.
To configure the router to propagate the IP Precedence based on the community lists, use the following commands beginning in global configuration mode:
| Step | Command | Purpose | ||
|---|---|---|---|---|
| route-map route-map-name [permit | deny | Define a route map to control redistribution and enter route-map configuration mode. | ||
| match community-list | Match a BGP community list. | ||
| set ip precedence [number | name] | Set the IP Precedence field when the community list matches. You can specify either a precedence number or name. | ||
| router bgp autonomous-system | Enter router configuration mode. | ||
| table-map route-map-name | Modify the metric and tag values when the IP routing table is updated with BGP learned routes. | ||
| ip community-list community-list-number | Create a community list for BGP and control access to it. | ||
| interface interface-type interface-number | Specify the interfaces (or subinterface) and enter interface configuration mode. | ||
| bgp-policy ip-prec-map | Classify packets using IP Precedence. | ||
| (Optional) Configure a new community format so that the community number is displayed in the short form. | |||
| end | Exit configuration mode. |
This section describes how to configure Policy Propagation via BGP based on the autonomous system (AS) path. The tasks listed in this section are required unless noted as optional. This section assumes you have already configured CEF/DCEF and BGP on your router.
To configure the router to propagate the IP Precedence based on the autonomous system path attribute, use the following commands beginning in global configuration mode:
| Step | Command | Purpose | ||
|---|---|---|---|---|
| route-map route-map-name [permit | deny | Define a route map to control redistribution and enter route-map configuration mode. | ||
| match as-path path-list-number | Match a BGP autonomous system path access list. | ||
| set ip precedence [number | name] | Set the IP Precedence field when the autonomous system path matches. Specify either a precedence number or name. | ||
| router bgp autonomous-system | Enter router configuration mode. | ||
| table-map route-map-name | Modify the metric and tag values when the IP routing table is updated with BGP learned routes. | ||
| ip as-path access-list access-list-number | Define an autonomous system path access list. | ||
| interface interface-type interface-number | Specify the interfaces (or subinterface) and enter interface configuration mode. | ||
| bgp-policy ip-prec-map | Classify packets using IP Precedence. | ||
| end | Exit configuration mode. |
This section describes how to configure Policy Propagation via BGP based on an access list. The tasks listed in this section are required unless noted as optional. This section assumes you have already configured CEF/DCEF and BGP on your router.
To configure the router to propagate the IP Precedence based on an access list, use the following commands beginning in global configuration mode:
| Step | Command | Purpose | ||
|---|---|---|---|---|
| route-map route-map-name [permit | deny | Define a route map to control redistribution and enter route-map configuration mode. | ||
| match ip address access-list-number | Match an access list. | ||
| set ip precedence [number | name] | Set the IP Precedence field when the autonomous system path matches. | ||
| router bgp autonomous-system | Enter router configuration mode. | ||
| table-map route-map-name | Modify the metric and tag values when the IP routing table is updated with BGP learned routes. | ||
| access-list access-list-number | Define an access list. | ||
| interface interface-type interface-number | Specify the interfaces (or subinterface) and enter interface configuration mode. | ||
| bgp-policy ip-prec-map | Classify packets using IP Precedence. | ||
| end | Exit configuration mode. |
To monitor the Policy Propagation via BGP configuration, use any of the following commands in EXEC mode. The commands listed in this section are optional.
| Command | Purpose |
|---|---|
Show entries in the BGP routing table, to verify the correct community is set on the prefixes. | |
show ip bgp community-list community-list-number | Show routes permitted by the BGP community list, to verify that the correct prefixes are selected. |
show ip cef network | Show entries in the FIB table based on the IP address, to verify that CEF has the correct precedence value for the prefix. |
Show information about the interface. | |
show ip route prefix | Show the current status of the routing table, to verify that the correct precedence values are set on the prefixes. |
The following example shows how to create route maps to match access lists, BGP community lists, and BGP Autonomous System paths, and apply IP Precedence to routes learned from neighbors.
In the following example, Router A learns routes from AS 10 and AS 60. QoS policy is applied to all packets that match the defined route maps. Any packets from Router A to AS 10 or AS 60 are sent the appropriate QoS policy.
router bgp 30 table-map precedence-map neighbor 20.20.20.1 remote-as 10 neighbor 20.20.20.1 send-community neighbor 20.20.20.1 route-map precedence-map out ! ip bgp-community new-format ! ! Match community 1 and set the IP Precedence to priority route-map precedence-map permit 10 match community 1 set ip precedence priority ! ! Match community 2 and set the IP Precedence to immediate route-map precedence-map permit 20 match community 2 set ip precedence immediate ! ! Match community 3 and set the IP Precedence to flash route-map precedence-map permit 30 match community 3 set ip precedence flash ! ! Match community 4 and set the IP Precedence to flash-override route-map precedence-map permit 40 match community 4 set ip precedence flash-override ! ! Match community 5 and set the IP Precedence to critical route-map precedence-map permit 50 match community 5 set ip precedence critical ! ! Match community 6 and set the IP Precedence to internet route-map precedence-map permit 60 match community 6 set ip precedence internet ! ! Match community 7 and set the IP Precedence to network route-map precedence-map permit 70 match community 7 set ip precedence network ! ! Match ip address access list 69 or match AS path 1 ! and set the IP Precedence to critical route-map precedence-map permit 75 match ip address 69 match as-path 1 set ip precedence critical ! ! For everything else, set the IP Precedence to routine route-map precedence-map permit 80 set ip precedence routine ! ! Define the community lists ip community-list 1 permit 60:1 ip community-list 2 permit 60:2 ip community-list 3 permit 60:3 ip community-list 4 permit 60:4 ip community-list 5 permit 60:5 ip community-list 6 permit 60:6 ip community-list 7 permit 60:7 ! ! Define the AS path ip as-path access-list 1 permit ^10_60 ! ! Define the access list access-list 69 permit 69.0.0.0
router bgp 10 neighbor 30.30.30.1 remote-as 30 neighbor 30.30.30.1 send-community neighbor 30.30.30.1 route-map send_community out ! ip bgp-community new-format ! ! Match prefix 10 and set community to 60:1 route-map send_community permit 10 match ip address 10 set community 60:1 ! ! Match prefix 20 and set community to 60:2 route-map send_community permit 20 match ip address 20 set community 60:2 ! ! Match prefix 30 and set community to 60:3 route-map send_community permit 30 match ip address 30 set community 60:3 ! ! Match prefix 40 and set community to 60:4 route-map send_community permit 40 match ip address 40 set community 60:4 ! ! Match prefix 50 and set community to 60:5 route-map send_community permit 50 match ip address 50 set community 60:5 ! ! Match prefix 60 and set community to 60:6 route-map send_community permit 60 match ip address 60 set community 60:6 ! ! Match prefix 70 and set community to 60:7 route-map send_community permit 70 match ip address 70 set community 60:7 ! ! For all others, set community to 60:8 route-map send_community permit 80 set community 60:8 ! ! Define the access lists access-list 10 permit 61.0.0.0 access-list 20 permit 62.0.0.0 access-list 30 permit 63.0.0.0 access-list 40 permit 64.0.0.0 access-list 50 permit 65.0.0.0 access-list 60 permit 66.0.0.0 access-list 70 permit 67.0.0.0
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Thu Jun 3 14:23:10 PDT 1999
Copyright 1989-1999©Cisco Systems Inc.