Creating Policy Lists
You can create a policy list with an unlimited number of classifier groups, each containing an unlimited number of rules. These rules can reference up to 512 classifier entries.
You can create policy lists for Frame Relay, IP, IPv6, GRE tunnels, L2TP, MPLS, and VLANs.
Creating a Policy List for IP
The following example creates an IP policy list named routeForABCCorp. For information about creating the CLACLs and rate-limit profile used in this example, see the previous sections.
- Create the policy list routeForABCCorp.
host1(config)#ip policy-list routeForABCCorphost1(config-policy-list)#- Create the classification group for the CLACL named ipCLACL10 and assign the precedence to the classification group.
host1(config-policy-list)#classifier-group ipCLACL10 precedence 75host1(config-policy-list-classifier-group)#- Add a rule that specifies a group of forwarding solutions based on classifier list ipCLACL10.
host1(config-policy-list-classifier-group)#forward next-hop 192.0.2.12 order 10host1(config-policy-list-classifier-group)#forward next-hop 192.0.100.109 order 20host1(config-policy-list-classifier-group)#forward next-hop 192.120.17.5 order 30host1(config-policy-list-classifier-group)#forward interface ip 3/1 order 40- Add a rule that sets a ToS byte value of 125 for packets based on classifier list ipCLACL10.
host1(config-policy-list-classifier-group)#mark tos 125- Add a rule that uses rate-limit profile ipRLP25.
host1(config-policy-list-classifier-group)#rate-limit-profile ipRLP25- Exit Classifier Group Configuration mode for ipCLACL10, then create a new classification group for classifier list ipCLACL20. Add a rule that filters packets based on classifier list ipCLACL20.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#classifier-group ipCLACL20 precedence 125host1(config-policy-list-classifier-group)#filter- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeForABCCorpPolicy Table------ -----IP Policy routeForABCCorpAdministrative state: enableReference count: 0Classifier control list: ipCLACL10, precedence 75forwardVirtual-router: defaultList:next-hop 192.0.2.12, order 10, rule 2 (active)next-hop 192.0.100.109, order 20, rule 3 (reachable)next-hop 192.120.17.5, order 30, rule 4 (reachable)interface ip3/1, order 40, rule 5mark tos 125rate-limit-profile ipRLP25Classifier control list: ipCLACL20, precedence 125filter
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for IPv6
The following example creates an IPv6 policy list named routeForIPv6. For information about creating the CLACL used in this example, see the previous sections.
- Create the policy list routeForIPv6.
host1(config)#ipv6 policy-list routeForIPv6host1(config-policy-list)#- Create the classification group for the CLACL named ipv6tc67 and assign the precedence to the classification group.
host1(config-policy-list)#classifier-group ipv6tc67 precedence 75host1(config-policy-list-classifier-group)#- Add a rule to color packets as red, and a second rule that sets the traffic class field of the packets to 7.
host1(config-policy-list-classifier-group)#color redhost1(config-policy-list-classifier-group)#mark tcfield 7- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeForIPv6Policy Table------ -----IPv6 Policy routeForIPv6Administrative state: enableReference count: 0Classifier control list: ipv6tc67, precedence 75color redmark tc-precedence 7
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for Frame Relay
The following example creates a Frame Relay policy that on egress marks the DE bit to 1, and on ingress colors frames with a DE bit of 1 as red.
- Create the policy list used to mark egress traffic, then create the classifier group for packets conforming to CLACL frMatchDeSet. Add a rule that marks the DE bit as 1.
host1(config)#frame-relay policy-list frOutputPolicyhost1(config-policy-list)#classifier-group frMatchDeSethost1(config-policy-list-classifier-group)#mark-de 1host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exit- Create the policy list used for the ingress traffic. and create the classifier group conforming to CLACL frMatchDeSet. Add a rule that colors the ingress traffic.
host1(config)#frame-relay policy-list frInputPolicyhost1(config-policy-list)#classifier-group frGroupAhost1(config-policy-list-classifier-group)#color redhost1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exit- Apply the policy lists.
host1(config)#interface serial 5/0:1/1.1host1(config-subif)#frame-relay policy output frOutputPolicy statistics enabledhost1(config-subif)#ip address 10.0.0.1 255.255.255.0host1(config-subif)#exithost1(config)#interface serial 5/1:1/1.1host1(config-subif)#frame-relay policy input frInputPolicy statistics enabledhost1(config-subif)#exit- Display interface information to view the applied policies.
host1#show frame-relay subinterfaceFrame relay sub-interface SERIAL5/0:1/1.1, status is upNumber of sub-interface down transitions is 0Time since last status change 03:04:59No baseline has been setIn bytes: 660 Out bytes: 660In frames: 5 Out frames: 5In errors: 0 Out errors: 0In discards: 0 Out discards: 0In unknown protos: 0Frame relay policy output frOutputPolicyclassifier-group frGroupA entry 15 packets, 640 bytesmark-de 1Frame relay sub-interface SERIAL5/1:1/1.1, status is upNumber of sub-interface down transitions is 0Time since last status change 03:05:09No baseline has been setIn bytes: 660 Out bytes: 660In frames: 5 Out frames: 5In errors: 0 Out errors: 0In discards: 0 Out discards: 0In unknown protos: 0Frame relay policy input frInputPolicyclassifier-group frMatchDeSet entry 15 packets, 660 bytescolor red- Display the classifier list.
host1#show classifier-list detailedClassifier Control List Table---------- ------- ---- -----Frame relay Classifier Control List frMatchDeSetReference count: 1Entry count: 1Classifier-List frMatchDeSet Entry 1DE Bit: 1- Display the policy lists.
host1#show policy-listPolicy Table------ -----Frame relay Policy frOutputPolicyAdministrative state: enableReference count: 0Classifier control list: frMatchDeSet, precedence 100mark-de 1Frame relay Policy frInputPolicyAdministrative state: enableReference count: 0Classifier control list: frGroupA, precedence 100color red
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for GRE Tunnels
The following example creates a GRE tunnel policy list named routeGre50. For information about creating the CLACL used in this example, see the previous sections.
- Create the policy list routeGre50.
host1(config)#gre-tunnel policy-list routeGre50- Create the classification group for the CLACL named gre8 and assign a precedence of 150 to it.
host1(config-policy-list)#classifier-group gre8 precedence 150host1(config-policy-list-classifier-group)#- Add two rules for traffic based on the CLACL named gre8: one rule to color packets as red, and a second rule that specifies the ToS DS field value to be assigned to the packets.
host1(config-policy-list-classifier-group)#color redhost1(config-policy-list-classifier-group)#mark dsfield 20host1(config-policy-list-classifier-group)#- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeGre50Policy Table------ -----GRE Tunnel Policy routeGre50Administrative state: enableReference count: 0Classifier control list: gre8, precedence 150color redmark dsfield 20
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for L2TP
The following example creates an L2TP policy list.
- Create the policy list routeForl2tp.
host1(config)#l2tp policy-list routeForl2tphost1(config-policy-list)#- Create the classification group to match all packets.
host1(config-policy-list)#classifier-group *host1(config-policy-list-classifier-group)#- Add a rule to color packets as red, and a second rule that uses the rate-limit profile l2tpRLP10.
host1(config-policy-list-classifier-group)#color redhost1(config-policy-list-classifier-group)#rate-limit-profile l2tpRLP10- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeForl2tpPolicy Table------ -----L2TP Policy routeForl2tpAdministrative state: enableReference count: 0Classifier control list: *, precedence 100color redrate-limit-profile l2tpRLP20
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for MPLS
The following example creates an MPLS policy list.
- Create the policy list routeForMpls.
host1(config)#mpls policy-list routeForMplshost1(config-policy-list)#- Create the classification group.
host1(config-policy-list)#classifier-group * precedence 200host1(config-policy-list-classifier-group)#- Add one rule that sets the EXP bits for all packets to 2, and a second rule that uses the rate-limit profile mplsRLP5.
host1(config-policy-list-classifier-group)#mark-exp 2host1(config-policy-list-classifier-group)#rate-limit-profile mplsRLP5- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeForMplsPolicy Table------ -----MPLS Policy routeForMplsAdministrative state: enableReference count: 0Classifier control list: *, precedence 200mark-exp 2 mask 7rate-limit-profile mplsRLP5
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
Creating a Policy List for VLANs
The following example creates a VLAN policy list named routeForVlan. The classifier group lowLatencyLowDrop uses the default precedence of 100.
- Create the policy list routeForVlan.
host1(config)#vlan policy-list routeForVlanhost1(config-policy-list)#- Create the classification group.
host1(config-policy-list)#classifier-group lowLatencyLowDrophost1(config-policy-list-classifier-group)#- Create a rule that adds the lowLatencyLowDrop traffic class for all packets that fall into the lowLatencyLowDrop classification.
host1(config-policy-list-classifier-group)#traffic-class lowLatencyLowDrop- Add a rule that sets the drop precedence for all packets that fall into the lowLatencyLowDrop classification to green.
host1(config-policy-list-classifier-group)#color green- Add a rule that sets the user-priority bits for all packets that fall into the lowLatencyLowDrop classification to 7.
host1(config-policy-list-classifier-group)#mark-user-priority 7- Exit to Policy List Configuration mode, then add traffic class rules for packets that conform to different CLACLs.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#classifier-group lowLatencyhost1(config-policy-list-classifier-group)#traffic-class lowLatencyhost1(config-policy-list-classifier-group)#exithost1(config-policy-list)#classifier-group excellentEfforthost1(config-policy-list-classifier-group)#traffic-class excellentEfforthost1(config-policy-list-classifier-group)#exithost1(config-policy-list)#classifier-group bestEfforthost1(config-policy-list-classifier-group)#traffic-class bestEffort- Exit Policy List Configuration mode to save the configuration.
host1(config-policy-list-classifier-group)#exithost1(config-policy-list)#exithost1(config)#- Display the policy list.
host1#show policy-list routeForVlanPolicy Table------ -----VLAN Policy routeForVlanAdministrative state: enableReference count: 0Classifier control list: lowLatencyLowDrop, precedence 100traffic-class lowLatencyLowDropcolor greenmark-user-priority 7Classifier control list: lowLatency, precedence 100traffic-class lowLatencyClassifier control list: excellentEffort, precedence 100traffic-class excellentEffortClassifier control list: bestEffort, precedence 100traffic-class bestEffort
NOTE: Commands that you issue in Policy Configuration mode do not take effect until you exit from that mode.
frame-relay policy-list
gre-tunnel policy-list
ip policy-list
ipv6 policy-list
l2tp policy-list
mpls policy-list
vlan policy-list
- Use to create or modify a policy list and to enter Policy List Configuration mode.
- If you enter a policy-list command and then enter exit, the router creates a policy list with no rules. If the router does not find any rules in a policy, it inserts a default filter rule. Attaching this policy list to an interface filters all packets on that interface.
NOTE: If you do not specify one of the frame-relay, gre-tunnel, ip, ipv6, l2tp, mpls, or vlan keywords, the router creates an IP policy list.
- Example
host1(config)#ip policy-list routeForXYZCorphost1(config-policy-list)#Use the no version to remove a policy list.