DiffServ Policy Commands
Use these commands to specify traffic conditioning actions, such as policing and marking, to apply to DiffServ traffic classes.
Use the DiffServ policy commands to specify traffic conditioning actions, such as policing and marking, to apply to traffic classes.
Use the policy commands to associate a traffic class that you define by using the class command set with one or more QoS policy attributes. Assign the class/policy association to an interface to form a service. Specify the policy name when you create the policy.
Each traffic class defines a particular treatment for packets that match the class definition. You can associate multiple traffic classes with a single policy. When a packet satisfies the conditions of more than one class, preference is based on the order in which you add the classes to the policy. The first class you add has the highest precedence.
This set of commands consists of policy creation and deletion, class addition and removal, and setting individual policy attributes.
The CLI command root is policy-map.
policy-map
M4250
M4350
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, or the outbound traffic direction as indicated by the out parameter, respectively.
| Format | policy-map policyname {in | out} |
| Mode | Global Config |
no policy-map
This command removes an existing DiffServ policy. The policyname parameter is the name of an existing DiffServ policy. If the policy is currently referenced by one or more interface service attachments, you cannot remove the policy map.
| Format | no policy-map policyname |
| Mode | Global Config |
policy-map rename
M4250
M4350
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.
| Format | policy-map rename policyname newpolicyname |
| Mode | Global Config |
class
M4250
M4350
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. The classname argument must be the name of an existing DiffServ class.
| Format | class classname |
| Mode | Policy-Map Config |
no class
This command deletes the instance of a particular class and its defined treatment from the specified policy. The classname argument is the name of an existing DiffServ class.
| Format | no class classname |
| Mode | Policy-Map Config |
assign-queue
M4250
M4350
This command modifies the queue ID to which the associated traffic stream is assigned. The queueid is an integer from 0 to n-1, in which n is the number of egress queues supported by the switch. The range is from 0 to 7.
| Format | assign-queue queueid |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop |
drop
M4250
M4350
This command specifies that all packets for the associated traffic stream must be dropped at ingress.
| Format | drop |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Assign Queue, Mark (all forms), Mirror, Police, Redirect |
mirror
M4250
M4350
This command specifies that all incoming packets for the associated traffic stream are copied to a specific egress interface (physical port or LAG).
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | mirror {unit/slot/port | lag lag-intf-num} |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Redirect |
redirect
M4250
M4350
This command specifies that all incoming packets for the associated traffic stream are redirected to a specific egress interface (physical port or port-channel).
| Format | redirect {unit/slot/port | lag lag-intf-num} |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mirror |
conform-color
M4250
M4350
Use this command to enable color-aware traffic policing and define the conform-color class map and the color exceed mode.
Use this command in conjunction with the police command where the fields for the conform level are specified. The class-map-name argument is the name of an existing DiffServ class map.
| Format | conform-color class-map-name [exceed-color class-map-name] |
| Mode | Policy-Class-Map Config |
mark cos
M4250
M4350
This command marks all packets for the associated traffic stream with the specified class of service (CoS) value in the priority field of the 802.1p header (the only tag in a single tagged packet or the first or outer 802.1Q tag of a double VLAN tagged packet). If the packet does not already contain this header, one is inserted. The CoS value argument is an integer from 0 to 7.
| Default | 1 |
| Format | mark-cos value |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark IP DSCP, IP Precedence, Police |
mark ip-dscp
M4250
M4350
This command marks all packets for the associated traffic stream with the specified IP DSCP value. The dscpval value 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, or ef.
| Format | mark ip-dscp dscpval |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark CoS, Mark IP Precedence, Police |
mark ip-precedence
M4250
M4350
This command marks all packets for the associated traffic stream with the specified IP Precedence value. The IP Precedence value argument is an integer from 0 to 7.
| Format | mark ip-precedence value |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark CoS, Mark IP Precedence, Police |
| Policy Type | In |
police-simple
M4250
M4350
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) as an integer from 1 to 4294967295 or a percentage from 1 to 100. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128.
You must set the conform action and violate action. For each outcome, the only possible actions are drop, set-cos-transmit, set-dscp-transmit, set-prec-transmit, or 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 after you configure the style:
- For set-cos-transmit an 802.1p priority value is required and is specified as an integer from 0-7.
- For set-dscp-transmit, a 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, or ef.
- For set-prec-transmit, an IP Precedence value is required and is specified as an integer from 0-7.
| Format | police-simple {rate-kbps 1-4294967295 1-128 | rate-percent 1-100 1-128} {conform-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} {violate-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} |
| Mode | Policy-Class-Map Config |
| Incompatibilities | Drop, Mark (all forms) |
Command example:
(NETGEAR Switch) (Config-policy-classmap)#police-simple 1 128 conform-action transmit
violate-action drop
police-single-rate
M4250
M4350
This command is the single-rate form of the police command and is used to establish the traffic policing style for the specified class.
The conforming data rate is specified in kilobits-per-second (Kbps) as an integer from 1 to 4294967295 or a percentage from 1 to 100. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128. Unlike for the police-simple command, for the police-single-rate command, you must also set the excess burst size, which is specified in kilobytes (KB) and is an integer from 1 to 128.
You must set the conform action, exceed action, and violate action. For each outcome, the only possible actions are drop, set-cos-transmit, set-dscp-transmit, set-prec-transmit, or 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 after you configure the style:
- For set-cos-transmit an 802.1p priority value is required and is specified as an integer from 0-7.
- For set-dscp-transmit, a 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, or ef.
- For set-prec-transmit, an IP Precedence value is required and is specified as an integer from 0-7.
| Format | police-single-rate {rate-kbps 1-4294967295 1-128 1-128 | rate-percent 1-100 1-128 1-128} {conform-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} {exceed-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} {violate-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} |
| Mode | Policy-Class-Map Config |
police-two-rate
M4250
M4350
This command is the two-rate form of the police command and is used to establish the traffic policing style for the specified class.
The conforming data rate is specified in kilobits-per-second (Kbps) as an integer from 1 to 4294967295 or a percentage from 1 to 100. The conforming burst size is specified in kilobytes (KB) and is an integer from 1 to 128. Unlike for the police-simple command, for the police-two-rate command, you must also set the peak data rate, which is specified as an integer from 1 to 4294967295 or a percentage from 1 to 100, and you must also set the excess burst size, which is specified in kilobytes (KB) and is an integer from 1 to 128.
You must set the conform action, exceed action, and violate action. For each outcome, the only possible actions are drop, set-cos-transmit, set-dscp-transmit, set-prec-transmit, or 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 after you configure the style:
- For set-cos-transmit an 802.1p priority value is required and is specified as an integer from 0-7.
- For set-dscp-transmit, a 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, or ef.
- For set-prec-transmit, an IP Precedence value is required and is specified as an integer from 0-7.
| Format | police-two-rate {rate-kbps 1-4294967295 1-128 1-4294967295 1-128 | rate-percent 1-100 1-128 1-100 1-128} {conform-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} {exceed-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} {violate-action {drop | set-cos-transmit 0-7 | set-prec-transmit 0-7 | set-dscp-transmit 0-63 | transmit}} |
| Mode | Policy-Class-Map Config |