Policy commands
Use these M4500 CLI commands to create DiffServ policy maps that queue, drop, mirror, redirect, mark, or police classified traffic.
The 'policy' command set is used in DiffServ to define:
Traffic Classification Specify traffic conditioning actions (policing, marking, shaping) to apply to traffic classes.
Service Provisioning Specify bandwidth and queue depth management requirements of service levels (EF, AF, etc.).
The policy commands are used to associate a traffic class, which was defined by the class command set, with one or more QoS policy attributes. This association is then assigned to an interface in a particular direction to form a service. The user specifies the policy name when the policy is created.
The DiffServ CLI does not necessarily require that users associate only one traffic class to one policy. In fact, multiple traffic classes can be associated with a single policy, each defining a particular treatment for packets that match the class definition. When a packet satisfies the conditions of more than one class, preference is based on the order in which the classes were added to the policy, with the foremost class taking highest precedence.
This set of commands consists of policy creation/deletion, class addition/removal, and individual policy attributes. Note that the only way to remove an individual policy attribute from a class instance within a policy is to remove the class instance and re-add it to the policy. The values associated with an existing policy attribute can be changed without removing the class instance.
The CLI command root is policy-map.
assign-queue
This command modifies the queue id to which the associated traffic stream is assigned. The queueid is an integer from 0 to n-1, where n is the number of egress queues supported by the device.
| Default | None |
| Format | assign-queue <0-7> |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop |
| Parameter | Description |
|---|---|
| <0-7> | Queue ID . |
drop
This command specifies that all packets for the associated traffic stream are to be dropped at ingress.
| Default | None |
| Format | drop |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Assign Queue, Mark (all forms), Mirror, Police, Redirect |
mirror
This command specifies that all incoming packets for the associated traffic stream are copied to a specific egress interface (physical port or LAG).
| Default | None |
| Format | mirror {<slot/port> | port-channel <port-channel-intf-num>} |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Redirect |
| Parameter | Description |
|---|---|
| <slot/port> | Specifies the physical interface where the mirrored packet send to . |
| <port-channel-intf-num> | Specifies the port-channel interface where the mirrorred packet send to. The range of the port-channel ID is 1 to 64. |
redirect
This command specifies that all incoming packets for the associated traffic stream are redirected to a specific egress interface (physical port or port-channel).
| Default | None |
| Format | redirect {<slot/port> | port-channel <port-channel-intf-num>} |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mirror |
| Parameter | Description |
|---|---|
| <slot/port> | Specifies which physical interface that traffic stream are redirected to. |
| <port-channel-intf-num> | Specifies which port-channel interface that traffic stream are directed to. The range of the port-channel ID is 1 to 64. |
conform-color
This command is used to enable color-aware traffic policing and define the conform-color class maps used. Used in conjunction with the police command where the fields for the conform level (for simple, single-rate, and two-rate policing) are specified. The <class-map-name> parameter is the name of an existing Diffserv class map, where different ones must be used for the conform and exceed colors.
| Default | None |
| Format | conform-color <class-map-name> exceed-color <class-map-name> |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mirror |
| Parameter | Description |
|---|---|
| <class-map-name> | Name of an existing Diffserv class map, where different ones must be used for the conform colors. |
mark cos
This command marks all packets for the associated traffic stream with the specified class of service value in the priority field of the 802.1p header. If the packet does not already contain this header, one is inserted. The CoS value is an integer from 0 to 7.
| Default | None |
| Format | mark cos <0-7> |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark IP DSCP, IP Precedence, Police |
| Parameter | Description |
|---|---|
| <0-7> | The range of COS value is 0 to 7. |
mark cos-as-sec-cos
This command marks outer VLAN tag priority bits of all packets as the inner VLAN tag priority, marking CoS as Secondary CoS. This essentially means that the inner VLAN tag CoS is copied to the outer VLAN tag CoS.
| Default | None |
| Format | mark cos-as-sec-cos |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark IP DSCP, IP Precedence, Police |
class
This command creates an instance of a class definition within the specified policy for the purpose of defining treatment of the traffic class through subsequent policy attribute statements.
| Default | None |
| Format | class <classname> |
| Mode | Policy-Map Config |
| Parameter | Description |
|---|---|
| <classname> | The name of an existing DiffServ class. Note that this command causes the specified policy to create a reference to the class definition. |
no class
This command deletes the instance of a particular class and its defined treatment from the specified policy.
| Default | None |
| Format | no class <classname> |
| Mode | Policy-Map Config |
| Parameter | Description |
|---|---|
| <classname> | The name of an existing DiffServ class. Note that this command removes the reference to the class definition for the specified policy. |
mark ip-dscp
This command marks all packets for the associated traffic stream with the specified IP DSCP value.
| Default | None |
| Format | mark ip-dscp <value> |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark CoS, Mark IP Precedence, Police |
| Parameter | Description |
|---|---|
| <value> | Specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef. |
mark ip-precedence
This command marks all packets for the associated traffic stream with the specified IP Precedence value. The IP Precedence value is an integer from 0 to 7.
| Default | None |
| Format | mark ip-precedence <0-7> |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark (all forms) |
| Parameter | Description |
|---|---|
| <0-7> | IP precedence value in the range of 0 to 7 |
police-simple
This command is used to establish the traffic policing style for the specified class. The simple form of the police command uses a single data rate and burst size, resulting in two outcomes: conform and violate. The conforming data rate is specified in kilobits-per-second (Kbps) and is an integer from 1 to 4294967295. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128.
For each outcome, the only possible actions are drop, set-cos-transmit, set-dscp-transmit, setprec-transmit, or transmit. In this simple form of the police command, the conform action defaults to transmit and the violate action defaults to drop.
For set-dscp-transmit, a <dscpval> value is required and is specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23,af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef.
For set-prec-transmit, an IP Precedence value is required and is specified as an integer from 0-7.
For set-cos-transmit an 802.1p priority value is required and is specified as an integer from 0-7.
| Format | police-simple {<1-4294967295> <1-128> conform-action {drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit} [violate-action { drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit }]} |
The simple form of the police command uses a single data rate and burst size, resulting in two outcomes:
| Parameter | Description |
|---|---|
| <conform-action & violate-action> | The conforming data rate is specified in kilobits-per-second (Kbps) and is an integer from 1 to 4294967295. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128. For each outcome, the only possible actions are drop, set-dscp-transmit, set-prec-transmit, or set-cos-transmit. In this simple form of the police command, the conform action defaults to transmit and the violate action defaults to drop. These actions can be set with this command once the style has been configured. Beside, the set-cos-transmit is to combine only with drop between the conform-action and the violate-action. |
| <set-cos-transmit> | Priority value is required and is specified as an integer from 0-7. |
| <set-dscp-transmit> | Required and specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef. |
| <set-prec-transmit> | IP Precedence value is required and is specified as an integer from 0-7 |
| Default | None |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark (all forms) |
police-single-rate
This command is the single-rate form of the police command and is used to establish the traffic policing style for the specified class. For each outcome, the only possible actions are drop, set-cos-as-sec-cos, set-cos-transmit, set-sec-cos-transmit, set-dscp-transmit, set-prec-transmit, or transmit. In this single-rate form of the police command, the conform action defaults to send, the exceed action defaults to drop, and the violate action defaults to drop. These actions can be set with this command once the style has been configured.
| Default | None |
| Format | police-single-rate {<1-4294967295> <1-128> <1-128> conform-action {drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit} exceed-action { drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit} [violate-action { drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit }]} |
| Mode | Policy-Class-Map Config |
| Parameter | Description |
|---|---|
| <conform-action & violate-action & exceed-action> | The conforming data rate is specified in kilobits-per-second (Kbps) and is an integer from 1 to 4294967295. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128. For each outcome, the only possible actions are drop, set-cos-as-sec-cos , set-dscp-transmit, set-prec-transmit, or set-cos-transmit. In this simple form of the police command, the conform action defaults to transmit and the violate action defaults to drop. These actions can be set with this command once the style has been configured. Beside, the set-cos-transmit is to combine only with drop between the conform-action and the violate-action. |
| <set-cos-transmit> | Priority value is required and is specified as an integer from 0-7. |
| <set-dscp-transmit> | Required and specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef. |
| <set-prec-transmit> | IP Precedence value is required and is specified as an integer from 0-7 |
police-two-rate
This command is the two-rate form of the police command and is used to establish the traffic policing style for the specified class. For each outcome, the only possible actions are drop, set-cos-as-sec-cos, set-cos-transmit, set-sec-cos-transmit, set-dscp-transmit, set-prec-transmit, or transmit. In this two-rate form of the police command, the conform action defaults to send, the exceed action defaults to drop, and the violate action defaults to drop. These actions can be set with this command once the style has been configured.
| Default | None |
| Format | police-two-rate {<1-4294967295> <1-128> <1-4294967295> <1-128> conform-action {drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit} exceed-action { drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit } [violate-action { drop | set-cos-as-sec-cos | set-cos-transmit <0-7> | set-dscp-transmit <value> | set-prec-transmit <0-7> | transmit}]} |
| Mode | Policy-Class-Map Config |
| Parameter | Description |
|---|---|
| <conform-action & violate-action & exceed-action> | The conforming data rate is specified in kilobits-per-second (Kbps) and is an integer from 1 to 4294967295. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128. For each outcome, the only possible actions are drop, set-cos-as-sec-cos , set-dscp-transmit, set-prec-transmit, or set-cos-transmit. In this simple form of the police command, the conform action defaults to transmit and the violate action defaults to drop. These actions can be set with this command once the style has been configured. Beside, the set-cos-transmit is to combine only with drop between the conform-action and the violate-action. |
| <set-cos-transmit> | Priority value is required and is specified as an integer from 0-7. |
| <set-dscp-transmit> | Required and specified as either an integer from 0 to 63, or symbolically through one of the following keywords: af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, be, cs0, cs1, cs2, cs3, cs4, cs5, cs6, cs7, ef. |
| <set-prec-transmit> | IP Precedence value is required and is specified as an integer from 0-7 |
policy-map
This command establishes a new DiffServ policy. The <policyname> parameter is a case-sensitive alphanumeric string from 1 to 31 characters uniquely identifying the policy. The type of policy is specific to the inbound traffic direction as indicated by the in parameter.
| Default | None |
| Format |
|
| Mode | Global Config |
| Parameter | Description |
|---|---|
| <policyname> | Policy name up to 31 alphanumeric characters. |
| no | Delete this policy |
policy-map rename
This command changes the name of a DiffServ policy. The <policyname> is the name of an existing DiffServ class. The <newpolicyname> parameter is a case-sensitive alphanumeric string from 1 to 31 characters uniquely identifying the policy.
| Default | None |
| Format | policy-map rename <policyname> <newpolicyname> |
| Mode | Global Config |
| Parameter | Description |
|---|---|
| <policyname> | Old Policy name. |
| <newpolicyname> | New policy name. |