02-QoS Policy Configuration Commands
Chapters Download (225.16 KB)
Table of Contents
1 QoS Policy Configuration Commands
Traffic Behavior Configuration Commands
QoS Policy Configuration and Application Commands
qos apply policy (interface view, port group view)
qos apply policy (user-profile view)
Syntax
display traffic classifier user-defined [ tcl-name ]
View
Any view
Default Level
1: Monitor level
Parameters
user-defined: Displays user-defined classes.
tcl-name: Name of a class.
Description
Use the display traffic classifier command to display class information.
If no class name is specified, information about all user-defined classes is displayed.
Examples
# Display information about all user-defined classes.
<Sysname> display traffic classifier user-defined
User Defined Classifier Information:
Classifier: USER1
Operator: AND
Rule(s) : if-match ip-precedence 5
Classifier: database
Operator: AND
Rule(s) : if-match acl 3131
Table 1-1 display traffic classifier user-defined command output description
Field |
Description |
User Defined Classifier Information |
User-defined class information |
Classifier |
Class name and its match criteria |
Operator |
Logical relationship between match criteria |
Rule(s) |
Match criteria |
Syntax
if-match match-criteria
undo if-match match-criteria
undo if-match acl [ ipv6 ] { acl-number | name acl-name } [ update acl [ ipv6 ] { acl-number | name acl-name } ]
View
Class view
Default Level
2: System level
Parameters
match-criteria: Match criterion. Table 1-2 shows the available criteria.
acl [ ipv6 ] { acl-number | name acl-name }: Specifies an ACL currently referenced in the class by the ACL name or ACL number
update acl [ ipv6 ] { acl-number | name acl-name }: Specifies a new ACL to replace the specified current ACL by the number or name of the new ACL.
Table 1-2 The keyword and argument combinations for the match-criteria argument
Keyword and argument combination |
Description |
acl { access-list-number | name acl-name } |
Matches an IPv4 ACL specified by its number or name. The access-list-number argument specifies an ACL by its number, which ranges from 2000 to 4999. The name acl-name keyword-argument combination specifies an ACL by its name. In a class configured with the operator and, the logical relationship between rules defined in the referenced IPv4 ACL is or. |
acl ipv6 { access-list-number | name acl-name } |
Matches an IPv6 ACL specified by its number or name. The access-list-number argument specifies an ACL by its number, which ranges from 2000 to 3999. The name acl-name keyword-argument combination specifies an ACL by its name. In a class configured with the operator and, the logical relationship between rules defined in the referenced IPv6 ACL is or. |
any |
Matches all packets |
customer-dot1p 8021p-list |
Matches the 802.1p priority of the customer network. The 8021p-list argument is a list of up to eight 802.1p priority values. An 802.1p priority ranges from 0 to 7. |
customer-vlan-id { vlan-id-list | vlan-id1 to vlan-id2 } |
Matches packets of the VLANs of the customer network. The vlan-id-list argument is a list of up to eight VLAN IDs. The vlan-id1 to vlan-id2 argument specifies a VLAN ID range, where vlan-id1 must be smaller than vlan-id2. A VLAN ID ranges from 1 to 4094. |
destination-mac mac-address |
Matches a destination MAC address |
dscp dscp-list |
Matches DSCP values. The dscp-list is a list of DSCP values. A DSCP value is a number in the range 0 to 63 or a word representing the specific value. |
ip-precedence ip-precedence-list |
Matches IP precedence. The ip-precedence-list argument is a list of up to eight IP precedence values. An IP precedence value ranges from 0 to 7. |
protocol protocol-name |
Matches a protocol. The protocol-name argument can be IP or IPv6. |
qos-local-id local-id-value |
Matches a local QoS ID, which ranges from 1 to 4095. |
service-dot1p 8021p-list |
Matches the 802.1p priority of the service provider network. The 8021p-list argument is a list of up to eight 802.1p priority values. An 802.1p priority ranges from 0 to 7. |
service-vlan-id { vlan-id-list | vlan-id1 to vlan-id2 } |
Matches the packets of the VLANs of the service provider network. The vlan-id-list argument is a list of up to eight VLAN IDs. The vlan-id1 to vlan-id2 argument specifies a VLAN ID range, where vlan-id1 must be smaller than vlan-id2. A VLAN ID ranges from 1 to 4094. |
source-mac mac-address |
Matches a source MAC address |
Suppose the operator of a class is AND. Note the following when using the if-match command to define matching criteria for the class:
l If multiple matching criteria with the acl or acl ipv6 keyword specified are defined for the class, the actual logical relationship between these criteria is OR when a policy referencing the class is applied.
l If multiple match criteria with the customer-vlan-id or service-vlan-id keyword specified are defined for the class, the actual logical relationship between these criteria is OR.
The match criteria listed below must be unique in a class with the operator AND. Even though it is possible, avoid defining multiple if-match clauses for these match criteria or inputting multiple values for a list argument (such as the 8021p-list argument) listed below in a class. Otherwise, the QoS policy referencing the class cannot be successfully applied to interfaces.
l customer-dot1p 8021p-list
l destination-mac mac-address
l dscp dscp-list
l ip-precedence ip-precedence-list
l service-dot1p 8021p-list
l source-mac mac-address
To create multiple if-match clauses or specify multiple values for a list argument for any of the match criteria listed above, ensure that the operator of the class is OR.
A QoS policy referencing a if match customer-dot1p clause cannot be applied to outgoing traffic.
Description
Use the if-match command to define a match criterion.
Use the undo if-match command to remove the match criterion.
When defining match criteria, note the following:
1) Define an ACL-based match criterion
l If the ACL referenced in the if-match command does not exist, the class cannot be applied to hardware.
l For a class, you can reference an ACL twice by its name and number respectively with the if-match command.
2) Define a criterion to match a destination MAC address or a source MAC address.
l You can configure multiple destination MAC address or source MAC address match criteria for a class.
3) Define a criterion to match DSCP values
l You can configure multiple DSCP match criteria for a class. All the defined DSCP values are automatically arranged in ascending order.
l You can configure up to eight DSCP values in one command line. If multiple identical DSCP values are specified, the system considers them as one. If a packet matches one of the defined DSCP values, it is considered as matching the if-match clause.
l To delete a criterion that matches DSCP values, the specified DSCP values must be identical with those defined in the rule (the sequence may be different).
4) Define a criterion to match the 802.1p priority values of the customer network or service provider network
l You can configure multiple 802.1p priority match criteria for a class. All the defined 802.1p values are automatically arranged in ascending order.
l You can configure up to eight 802.1p priority values in one command line. If the same 802.1p priority value is specified multiple times, the system considers them as one. If a packet matches one of the defined 802.1p priority values, it is considered as matching the if-match clause.
l To delete a criterion that matches 802.1p priority values, the specified 802.1p priority values in the command must be identical with those defined in the criterion (the sequence may be different).
5) Define a criterion to match IP precedence values
l You can configure multiple IP precedence match criteria for a class. The defined IP precedence values are automatically arranged in ascending order.
l You can configure up to eight IP precedence values in one command line. If the same IP precedence is specified multiple times, the system considers them as one. If a packet matches one of the defined IP precedence values, it is considered as matching the if-match clause.
l To delete a criterion that matches IP precedence values, the specified IP precedence values in the command must be identical with those defined in the criterion (the sequence may be different).
6) Define a criterion to match customer network VLAN IDs or service provider network VLAN IDs
l You can configure multiple VLAN ID match criteria for a class. The defined VLAN IDs are automatically arranged in ascending order.
l You can configure multiple VLAN IDs in one command line. If the same VLAN ID is specified multiple times, the system considers them as one. If a packet matches one of the defined VLAN IDs, it is considered as matching the if-match clause.
l To delete a criterion that matches VLAN IDs, the specified VLAN IDs in the command must be identical with those defined in the criterion (the sequence may be different).
Related commands: traffic classifier.
Examples
# Define a match criterion for class class1 to match the packets with the destination MAC address 0050-ba27-bed3.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match destination-mac 0050-ba27-bed3
# Define a match criterion for class class2 to match the packets with the source MAC address 0050-ba27-bed2.
<Sysname> system-view
[Sysname] traffic classifier class2
[Sysname-classifier-class2] if-match source-mac 0050-ba27-bed2
# Define a match criterion for class class1 to match ACL 3101.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match acl 3101
# Define a match criterion for class class1 to match the ACL named flow.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match acl name flow
# Define a match criterion for class class1 to match IPv6 ACL 3101.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match ipv6 acl 3101
# Define a match criterion for class class1 to match the IPv6 ACL named flow.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match ipv6 acl name flow
# Define a match criterion for class class1 to match all packets.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match any
# Define a match criterion for class class1 to match the packets with a DSCP value of 1, 6, or 9.
<Sysname> system-view
[Sysname] traffic classifier class1 operator or
[Sysname-classifier-class1] if-match dscp 1 6 9
# Define a match criterion for class class1 to match the packets with an IP precedence value of 1 or 6.
<Sysname> system-view
[Sysname] traffic classifier class1 operator or
[Sysname-classifier-class1] if-match ip-precedence 1 6
# Define a match criterion for class class1 to match IP packets.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match protocol ip
# Define a match criterion for class class1 to match the packets with a customer network VLAN ID of 1, 6, or 9.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match customer-vlan-id 1 6 9
# Define a match criterion for class class1 to match packets with the local QoS ID 3.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] if-match qos-local-id 3
# Change the match criterion of class class1 from ACL 2008 to ACL 2009.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1] undo if-match acl 2008 update acl 2009
Syntax
traffic classifier tcl-name [ operator { and | or } ]
undo traffic classifier tcl-name
View
System view
Default Level
2: System level
Parameters
and: Specifies the operator of the class as logical AND, that is, specifies that the packets that match all the criteria belong to this class.
or: Specifies the operator the class as logical OR, that is, specifies that the packets that match any of the criteria belong to this class.
tcl-name: Class name.
Description
Use the traffic classifier command to create a class and enter class view.
Use the undo traffic classifier command to remove a class.
By default, the operator of a class is AND.
Related commands: qos policy, qos apply policy, classifier behavior.
Examples
# Create a class named class1.
<Sysname> system-view
[Sysname] traffic classifier class1
[Sysname-classifier-class1]
Syntax
accounting { byte | packet }
undo accounting
View
Traffic behavior view
Default Level
2: System level
Parameters
byte: Accounts packets in the unit of bytes.
packets: Accounts packets in the unit of packets.
Description
Use the accounting command to configure traffic accounting for the traffic behavior.
Use the undo accounting command to remove traffic accounting from the traffic behavior.
You can use the display qos policy interface command and the display qos vlan-policy command to view the related statistics.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Configure traffic accounting in bytes for traffic behavior database.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] accounting byte
Syntax
car cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ pir peak-information-rate ] [ green action ] [ red action ] [ yellow action ] [ hierarchy-car hierarchy-car-name [ mode { and | or } ] ]
undo car
View
Traffic behavior view
Default Level
2: System level
Parameters
cir committed-information-rate: Committed information rate (CIR) in kbps, which specifies the average traffic rate. The committed-information-rate argument ranges from 8 to 32000000 and must be a multiple of 8.
cbs committed-burst-size: Committed burst size (CBS) in bytes. The committed-burst-size argument ranges from 512 to 16000000 and defaults to 512.
ebs excess-burst-size: Excess burst size (EBS) in bytes. The excess-burst-size argument ranges from 0 to 16000000 and defaults to 512.
pir peak-information-rate: Peak information rate (PIR) in kbps. The peak-information-rate argument ranges from 8 to 32000000, and must be a multiple of 8.
green action: Action to take on packets that conform to CIR. The default is pass.
red action: Action to take on packets that conforms to neither CIR nor PIR. The default is discard.
yellow action: Action to take on packets that conform to PIR but not to CIR. The default is pass.
action: Action to take on packets, which can be:
l discard: Drops the packet.
l pass: Permits the packet to pass through.
l remark-dot1p-pass new-cos: Sets the 802.1p priority of the packet to new-cos and permits the packet to pass through. The new-cos argument ranges from 0 to 7.
l remark-dscp-pass new-dscp: Sets the DSCP value of the packet to new-dscp and permits the packet to pass through. The new-dscp argument ranges from 0 to 63.
l remark-lp-pass new-local-precedence: Sets the local precedence value of the packet to new-local-precedence and permits the packet to pass through. The new-local-precedence argument ranges from 0 to 7.
hierarchy-car-name: Name of the referenced hierarchical CAR.
mode: Collaborating mode of the hierarchical CAR action and the common CAR action, which can be AND (the default) or OR.
l AND mode (the and keyword), in which the traffic rate of a flow is limited by both the common CAR applied to it and the total traffic rate defined with hierarchical CAR. For example, you can use common CAR actions to limit the Internet access rates of flow 1 and flow 2 to 128 kbps each, and use a hierarchical CAR action to limit their total traffic rate to 192 kbps. Thus, when flow 1 is not present, flow 2 can access the Internet at the maximum rate, 128 kbps. If both flows are present, each flow cannot exceed its own rate limit, and the total rate cannot exceed 192 kbps.
l OR mode (the or keyword), in which a flow may pass through at an rate equal to the common CAR applied to it or at a higher rate if the total traffic rate of all flows does not exceed the hierarchical CAR. For example, you can use generic CAR actions to limit the rates of video flow 1 and flow 2 to 128 kbps each, and use a hierarchical CAR action to limit their total traffic rate to 512 kbps. As long as the rate of flow 1 does not exceed 128 kbps, flow 2 can pass at a rate up to 384 kbps.
Description
Use the car command to configure a CAR action for the traffic behavior.
Use the undo car command to remove the CAR action from the traffic behavior.
Note that: if this command is configured multiple times for the same traffic behavior, the last configuration takes effect.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Configure a CAR action for traffic behavior database: set CIR to 128 kbps, CBS to 50000 bytes, and EBS to 0; allow the conforming packets to pass, and mark the excess packets with DSCP value 0 and forward them.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] car cir 128 cbs 50000 ebs 0 green pass red remark-dscp-pass 0
# Configure a CAR action for traffic behavior database: set the CIR to 256 kbps, CBS to 50000 bytes, and EBS to 0; allow the conforming packets to pass, and mark excess packets with DSCP precedence 0 and forward them. In addition, reference hierarchical CAR hcar in the action, with the collaborating mode as or.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] car cir 256 cbs 50000 ebs 0 green pass red remark-prec-pass 0 hierarchy-car hcar mode or
Syntax
display traffic behavior user-defined [ behavior-name ]
View
Any view
Default Level
1: Monitor level
Parameters
user-defined: Displays user-defined traffic behaviors.
behavior-name: Behavior name. If no traffic behavior is specified, information of all user-defined behaviors is displayed.
Description
Use the display traffic behavior command to display traffic behavior information.
Examples
# Display all user-defined traffic behaviors.
<Sysname> display traffic behavior user-defined
User Defined Behavior Information:
Behavior: 2
Accounting enable: byte
Committed Access Rate:
CIR 12800 (kbps), CBS 4000 (byte), EBS 4000 (byte)
Green Action: pass
Red Action: discard
Yellow Action: pass
NetStream filter enable : permit
Redirect enable:
Redirect type: cpu
Redirect destination: cpu
Marking:
Remark dot1p COS 1
Marking:
Remark DSCP af12
Table 1-3 display traffic behavior user-defined command output description
Field |
Description |
|
|
User Defined Behavior Information |
User-defined behavior information |
|
|
Behavior |
Name of a behavior |
|
|
Accounting enable |
Traffic accounting mode, in packets or in bytes |
|
|
Committed Access Rate |
Information about the CAR action |
|
|
NetStream filter enable |
NetStream configuration information. The NetStream filtering option can be permit or deny |
|
|
Redirect enable |
Traffic redirecting configuration information |
||
Redirect type |
Traffic redirecting type, which can be redirecting traffic to the CPU, an interface, or the next-hop |
||
Redirect destination |
Destination for traffic redirecting, which can be an interface name, the IP address of the next hop, or the CPU |
||
Marking |
Priority marking information |
||
Syntax
filter { deny | permit }
undo filter
View
Traffic behavior view
Default Level
2: System level
Parameters
deny: Drops the packets.
permit: Permits the packet to pass through.
Description
Use the filter command to configure a traffic filtering action for the traffic behavior.
Use the undo filter command to remove the traffic filtering action.
Examples
# Configure the traffic filtering action as deny for traffic behavior database.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] filter deny
Syntax
redirect { cpu | interface interface-type interface-number | next-hop { ipv4-add1 [ ipv4-add2 ] | ipv6-add1 [ interface-type interface-number ] [ ipv6-add2 [ interface-type interface-number ] ] } }
undo redirect { cpu | interface interface-type interface-number | next-hop }
View
Traffic behavior view
Default Level
2: System level
Parameters
cpu: Redirects traffic to the CPU.
interface: Redirects traffic to the specified interface.
interface-type interface-number: Interface specified by its type and number.
next-hop: Redirects traffic to a next hop.
ipv4-add1/ipv4-add2: IPv4 address of the next hop. ipv4-add2 backs up ipv4-add1. If redirecting traffic to ipv4-add1 fails, traffic is redirected to ipv4-add2.
ipv6-add1/ipv6-add2: IPv6 address of the next hop. ipv6-add2 backs up ipv6-add1. If redirecting traffic to ipv6-add1 fails, traffic is redirected to ipv6-add2. interface-type interface-number specifies a VLAN-interface by its number. If the IPv6 address is a link-local address, you must specify a VLAN-interface for the IPv6 address of the next hop. If the IPv6 address is not a link-local address, you do not need to specify a VLAN-interface for the IPv6 address of the next hop.
Description
Use the redirect command to configure a traffic redirecting action for the traffic behavior.
Use the undo redirect command to remove the traffic redirecting action.
Redirecting traffic to the CPU, redirecting traffic to an interface, and redirecting traffic to the next hop are all mutually exclusive in the same traffic behavior.
Examples
# Configure the action of redirecting traffic to interface GigabitEthernet 1/0/1 for traffic behavior database.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] redirect interface gigabitethernet1/0/1
Syntax
remark dot1p { 8021p | customer-dot1p-trust }
undo remark dot1p
View
Traffic behavior view
Default Level
2: System level
Parameters
8021p: 802.1p priority to be marked for packets, in the range of 0 to 7.
customer-dot1p-trust: Copies the 802.1p priority value in the inner VLAN tag to the outer VLAN tag after the QoS policy is applied to a port. This keyword does not take effect on single-tagged packets.
Description
Use the remark dot1p command to configure the 802.1p priority marking action or the inner-to-outer tag priority copying action.
Use the undo remark dot1p command to remove the action.
Note that: the remark dot1p 8021p command and the remark dot1p customer-dot1p-trust command override each other, and whichever is configured last takes effect.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the 802.1p priority to 2.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark dot1p 2
# Configure the inner-to-outer tag priority copying action.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark dot1p customer-dot1p-trust
Syntax
remark drop-precedence drop-precedence-value
undo remark drop-precedence
View
Traffic behavior view
Default Level
2: System level
Parameters
drop-precedence-value: Drop precedence value to be marked for packets, in the range of 0 to 2.
Description
Use the remark drop-precedence command to configure the drop precedence marking action.
Use the undo remark drop-precedence command to remove the action.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the drop precedence value to 2 for packets.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark drop-precedence 2
Syntax
remark dscp dscp-value
undo remark dscp
View
Traffic behavior view
Default Level
2: System level
Parameters
dscp-value: DSCP value, a number in the range of 0 to 63 or a keyword as shown in Table 1-4.
Table 1-4 DSCP keywords and values
Keyword |
DSCP value (binary) |
DSCP value (decimal) |
default |
000000 |
0 |
af11 |
001010 |
10 |
af12 |
001100 |
12 |
af13 |
001110 |
14 |
af21 |
010010 |
18 |
af22 |
010100 |
20 |
af23 |
010110 |
22 |
af31 |
011010 |
26 |
af32 |
011100 |
28 |
af33 |
011110 |
30 |
af41 |
100010 |
34 |
af42 |
100100 |
36 |
af43 |
100110 |
38 |
cs1 |
001000 |
8 |
cs2 |
010000 |
16 |
cs3 |
011000 |
24 |
cs4 |
100000 |
32 |
cs5 |
101000 |
40 |
cs6 |
110000 |
48 |
cs7 |
111000 |
56 |
ef |
101110 |
46 |
Description
Use the remark dscp command to configure the DSCP marking action.
Use the undo remark dscp command to remove the action.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the DSCP value of packets to 6.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark dscp 6
Syntax
remark ip-precedence ip-precedence-value
undo remark ip-precedence
View
Traffic behavior view
Default Level
2: System level
Parameters
ip-precedence-value: IP precedence value to be marked for packets, in the range of 0 to 7.
Description
Use the remark ip-precedence command to configure the IP precedence marking action.
Use the undo remark ip-precedence command to remove the action.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the IP precedence value of packets to 6.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark ip-precedence 6
Syntax
remark local-precedence local-precedence
undo remark local-precedence
View
Traffic behavior view
Default Level
2: System level
Parameters
local-precedence: Local precedence value to be marked for packets, in the range of 0 to 7.
Description
Use the remark local-precedence command to configure the local precedence marking action.
Use the undo remark local-precedence command to remove the action.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the local precedence value of packets to 2.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark local-precedence 2
Syntax
remark qos-local-id local-id-value
undo remark qos-local-id
View
Traffic behavior view
Default Level
2: System level
Parameters
local-id-value: QoS local ID to be marked for packets, in the range of 1 to 4095. The local QoS IDs supported on the S5820X & S5800 series switches range from 1 to 3999.
Description
Use the remark qos-local-id command to configure the QoS local ID marking action.
Use the undo remark qos-local-id command to remove the action.
Related commands: qos policy, traffic behavior, classifier behavior.
Examples
# Set the QoS local ID of packets to 2.
<Sysname> system-view
[Sysname] traffic behavior database
[Sysname-behavior-database] remark qos-local-id 2
Syntax
traffic behavior behavior-name
undo traffic behavior behavior-name
View
System view
Default Level
2: System level
Parameters
behavior-name: Behavior name.
Description
Use the traffic behavior command to create a traffic behavior and enter traffic behavior view.
Use the undo traffic behavior command to remove a traffic behavior.
Related commands: qos policy, qos apply policy, classifier behavior.
Examples
# Create a traffic behavior named behavior1.
<Sysname> system-view
[Sysname] traffic behavior behavior1
[Sysname-behavior-behavior1]
Syntax
classifier tcl-name behavior behavior-name [ mode do1q-tag-manipulation ]
undo classifier tcl-name
View
Policy view
Default Level
2: System level
Parameters
tcl-name: Class name.
behavior-name: Behavior name.
mode dot1q-tag-manipulation: Specifies that the class-behavior association is used for the VLAN mapping function.
Description
Use the classifier behavior command to associate a behavior with a class in the policy.
Use the undo classifier command to remove a class from the policy.
Note that:
l Each class in the policy can be associated with only one behavior.
l If the class and traffic behavior specified for the command do not exist, the system creates a null class and a null traffic behavior.
l The do1q-tag-manipulation keyword only applies to many-to-one VLAN mapping configuration. For more information about many-to-one VLAN mapping, see VLAN Mapping Configuration in the Configuration Guide - Part 3 - Access.
Related commands: qos policy.
Examples
# Associate traffic class database with traffic behavior test in QoS policy user1.
<Sysname> system-view
[Sysname] qos policy user1
[Sysname-qospolicy-user1] classifier database behavior test
[Sysname-qospolicy-user1]
Syntax
display qos policy user-defined [ policy-name [ classifier tcl-name ] ]
View
Any view
Default Level
1: Monitor level
Parameters
user-defined: Displays user-defined QoS policies.
policy-name: QoS policy name, which is a string of 1 to 31 characters. If no policy is specified, configuration information of all the user-defined policies is displayed.
tcl-name: Class name.
Description
Use the display qos policy command to display user-defined QoS policy configuration information.
Examples
# Display the configuration information of all the user-defined QoS policies.
<Sysname> display qos policy user-defined
User Defined QoS Policy Information:
Policy: test
Classifier: default-class
Behavior: be
-none-
Classifier: USER1
Behavior: USER1
Committed Access Rate:
CIR 256 (kbps), CBS 15000 (byte), EBS 0 (byte)
Green Action: pass
Red Action: discard
Marking:
Remark IP Precedence 3
Table 1-5 display qos policy command output description
Field |
Description |
Policy |
Policy name |
Classifier |
Class name A policy can contain multiple classes. Each class is associated with a traffic behavior. A class can be configured with multiple match criteria. Refer to the traffic classifier command for related information. |
Behavior |
The behavior associated with the class above. It can be configured with multiple actions. Refer to the traffic behavior command for related information. |
Syntax
display qos policy global [ slot slot-number ] [ inbound | outbound ]
View
Any view
Default Level
1: Monitor level
Parameters
inbound: Displays the QoS policy applied globally to the incoming traffic of all ports.
outbound: Displays the QoS policy applied globally to the outgoing traffic of all ports.
slot slot-number: Displays the global QoS policy configuration of the specified device in the IRF virtual device. If the slot-number argument is not specified, the global QoS policy configuration of all devices in the IRF virtual device is displayed. If no IRF virtual device is formed, the global QoS policy configuration of the current device is displayed. The range for the slot-number argument depends on the number of devices and the numbering of devices in the IRF virtual device.
Description
Use the display qos policy global command to display information about the QoS policy globally applied globally in the inbound or outbound direction of all ports.
Note that: if no direction is specified, the global QoS policy information in both the inbound and outbound directions is displayed.
Examples
# Display information about the global QoS policy applied to the incoming traffic.
<Sysname> display qos policy global inbound
Direction: Inbound
Policy: 1
Classifier: 2
Operator: AND
Rule(s) : If-match acl 2000
Behavior: 2
Accounting Enable
20864 (Bytes)
Committed Access Rate:
CIR 128 (kbps), CBS 8000 (Bytes), EBS 0 (Bytes)
Red Action: discard
Green : 12928(Bytes)
Yellow: 7936(Bytes)
Red : 43904(Bytes)
Table 1-6 display qos policy global command output description
Field |
Description |
Direction |
Indicates that the QoS policy is applied to the incoming or outgoing traffic |
Policy |
Policy name and its contents |
Classifier |
Class name and its contents |
Operator |
Logical relationship between match criteria |
Rule(s) |
Match criteria |
Behavior |
Name of the traffic behavior, and the actions in the traffic behavior |
Accounting |
Traffic accounting status: enabled or disabled |
Committed Access Rate |
Information about traffic rate limiting |
CIR |
Committed information rate (CIR) in kbps |
CBS |
Committed burst size in bytes, which specifies the depth of the token bucket for holding bursty traffic |
EBS |
Excessive burst size (EBS) in bytes, which specifies the allowed traffic exceeding CBS when two token buckets are used |
Red Action |
Action to take on red packets |
Green |
Statistics on green packets |
Yellow |
Statistics on yellow packets |
Red |
Statistics on red packets |
Syntax
display qos policy interface [ interface-type interface-number ] [ inbound | outbound ]
View
Any view
Default Level
1: Monitor level
Parameters
interface-type interface-number: Specifies an interface by type and number.
Description
Use the display qos policy interface command to display QoS policy configuration and operational information on an interface or all interfaces.
Examples
# Display the QoS configuration and operational information on interface GigabitEthernet1/0/1.
<Sysname> display qos policy interface gigabitethernet 1/0/1
Interface: GigabitEthernet1/0/1
Direction: Inbound
Policy: 1
Classifier: 1
Operator: AND
Rule(s) : If-match acl 2000
Behavior: 1
Accounting Enable:
Mirror enable:
Mirror type: interface
Mirror destination: GigabitEthernet1/0/2
NetStream filter enable: permit
Redirect enable:
Redirect type: cpu
Redirect destination: cpu
Marking:
Remark Customer VLAN ID 100
Marking:
Remark dot1p COS 2
Marking:
Remark IP precedence 3
Marking:
Remark qos local ID 3
Table 1-7 display qos policy interface command output description
Field |
Description |
Interface |
Interface type and interface number |
Direction |
The direction in which the policy is applied to the interface |
Policy |
Name of the policy applied to the interface |
Classifier |
Class name and the corresponding configuration information |
Operator |
Logical relationship between match criteria in the class |
Rule(s) |
Match criteria in the class |
Behavior |
Behavior name and the corresponding configuration information |
Syntax
display qos vlan-policy { name policy-name | vlan [ vlan-id ] } [ slot slot-number ] [ inbound | outbound ]
View
Any view
Default Level
1: Monitor level
Parameters
name policy-name: Displays information of the VLAN QoS policy specified by its name, which is a string of 1 to 31 characters.
vlan vlan-id: Displays the QoS policy applied to the VLAN specified by its ID.
inbound: Displays the QoS policy applied to the incoming traffic of the VLAN specified by its ID.
outbound: Displays the QoS policy applied to the outgoing traffic of the VLAN specified by its ID.
slot-number: Displays VLAN QoS policy information about the specified device in the IRF virtual device. If the slot-number argument is not specified, the VLAN QoS policy information of all devices in the IRF virtual device is displayed. If no IRF virtual device is formed, the VLAN QoS policy information of the current device is displayed. The range for the slot-number argument depends on the number of devices and the numbering of devices in the IRF virtual device.
Description
Use the display qos vlan-policy command to display VLAN QoS policy information.
Note that: if no direction is specified, the VLAN QoS policy information in both the inbound and outbound directions is displayed.
Examples
# Display information about QoS policy test on the device numbered 6 in the IRF virtual device.
<Sysname> display qos vlan-policy name test slot 6
Policy test
Vlan 200: inbound
Vlan 300: outbound
Table 1-8 display qos vlan-policy command output description
Field |
Description |
Policy |
Name of the QoS policy |
Vlan |
ID of the VLAN where the VLAN policy is applied |
inbound |
The QoS policy is applied to the incoming traffic of the VLAN |
outbound |
The QoS policy is applied to the outgoing traffic of the VLAN |
# Display the QoS policy applied to VLAN 2.
<Sysname> display qos vlan-policy vlan 2
Vlan 2
Direction: Inbound
Policy: 1
Classifier: 2
Operator: AND
Rule(s) : If-match acl 2000
Behavior: 2
Accounting Enable
163 (Packets)
Committed Access Rate:
CIR 128 (kbps), CBS 8000 (byte), EBS 0 (byte)
Red Action: discard
Green : 12928(Bytes)
Yellow: 7936(Bytes)
Red : 43904(Bytes)
Table 1-9 display qos vlan-policy command output description
Field |
Description |
Vlan |
ID of the VLAN where the QoS policy is applied |
Direction |
The direction in which the QoS policy is applied for the VLAN |
Classifier |
Class name and its contents |
Operator |
Logical relationship between match criteria |
Rule(s) |
Match criteria |
Behavior |
Name of the behavior, and its actions |
Accounting |
Traffic accounting status: enabled or disabled |
Committed Access Rate |
CAR information |
CIR |
Committed information rate (CIR) in kbps |
CBS |
Committed burst size (CBS) in bytes, which specifies the depth of the token bucket for holding bursty traffic |
EBS |
Excessive burst size (EBS) in bytes, which specifies the allowed amount of traffic exceeding the CBS when two token buckets are used |
Red Action |
Action on red packets |
Green |
Statistics on green packets |
Yellow |
Statistics on yellow packets |
Red |
Statistics on red packets |
Syntax
qos apply policy policy-name { inbound | outbound }
undo qos apply policy { inbound | outbound }
View
Interface view, port group view
Default Level
2: System level
Parameters
inbound: Inbound direction.
outbound: Outbound direction.
policy-name: Policy name, which is a string of 1 to 31 characters.
Description
Use the qos apply policy command to apply a QoS policy.
Use the undo qos apply policy command to cancel the QoS policy application.
Settings in interface view are effective on the current interface. Settings in port group view are effective on all ports in the port group.
Examples
# Apply policy USER1 to the outgoing traffic of interface GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] qos apply policy USER1 outbound
Syntax
qos apply policy policy-name { inbound | outbound }
undo qos apply policy { inbound | outbound }
View
User profile view
Default Level
2: System level
Parameters
inbound: Applies the QoS policy to the incoming traffic of online users.
outbound: Applies the QoS policy to the outgoing traffic of online users.
policy-name: Policy name, which is a string of 1 to 31 characters.
Description
Use the qos apply policy command to apply a QoS policy to a user profile.
Use the undo qos apply policy command to cancel the QoS policy application.
Note that:
l If a user profile is activated, the QoS policy applied to it cannot be configured or removed, except the ACLs referenced in the QoS policy. However, when the users of the user profile are online, the referenced ACLs also cannot be modified.
l The QoS policy applied to a user profile becomes effective when the user-profile is activated and the corresponding users are online.
l Only the remark, car, and filter actions are supported in the QoS policies applied in user profile view.
l A null policy cannot be applied in user profile view.
Examples
# Apply policy test to the outgoing traffic of the online users of user profile user. (Assume that that the QoS policy has been configured.)
<Sysname> system-view
[Sysname] user-profile user
[Sysname-user-profile-user] qos apply policy test outbound
Syntax
qos apply policy policy-name global { inbound | outbound }
undo qos apply policy global { inbound | outbound }
View
System view
Default Level
2: System level
Parameters
policy-name: Policy name, which is a string of 1 to 31 characters.
inbound: Applies the QoS policy to the incoming packets of all ports.
outbound: Applies the QoS policy to the outgoing packets of all ports.
Description
Use the qos apply policy global command to globally apply a QoS policy. A globally-applied QoS policy takes effect on all incoming or outgoing traffic depending on the direction in which the policy is applied.
Use the undo qos apply policy global command to cancel the global application of the QoS policy.
Examples
# Apply the QoS policy user1 to the incoming traffic globally.
<Sysname> system-view
[Sysname] qos apply policy user1 global inbound
Syntax
qos policy policy-name
undo qos policy policy-name
View
System view
Default Level
2: System level
Parameters
policy-name: Policy name, which is a string of 1 to 31 characters.
Description
Use the qos policy command to create a policy and enter policy view.
Use the undo qos policy command to delete a policy.
A policy applied to an interface cannot be directly deleted. You must first remove the policy application before deleting the policy with the undo qos policy command.
Related commands: classifier behavior, qos apply policy.
Examples
# Create a policy named user1.
<Sysname> system-view
[Sysname] qos policy user1
[Sysname-qospolicy-user1]
Syntax
qos vlan-policy policy-name vlan vlan-id-list { inbound | outbound }
undo qos vlan-policy vlan vlan-id-list { inbound | outbound }
View
System view
Default Level
2: System level
Parameters
policy-name: QoS policy name, which is a string of 1 to 31 characters.
vlan-id-list: A list of up to eight VLAN IDs in the range 1 to 4094. You can input individual discontinuous VLAN IDs and VLAN ID ranges in the form of start-vlan-id to end-vlan-id, where the start VLAN ID must be smaller than the end VLAN ID. Each item in the VLAN list is separated by a space.
inbound: Applies the QoS policy to the incoming packets of the specified VLAN(s).
outbound: Applies the QoS policy to the outgoing packets of the specified VLAN(s).
Description
Use the qos vlan-policy command to apply a QoS policy to the specified VLAN(s).
Use the undo qos vlan-policy command to cancel the QoS policy application to the specified VLAN(s).
Examples
# Apply the QoS policy test to the incoming traffic of VLAN 200, VLAN 300, VLAN 400, and VLAN 500.
<Sysname> system-view
[Sysname] qos vlan-policy test vlan 200 300 400 500 inbound
Syntax
reset qos policy global [ inbound | outbound ]
View
User view
Default Level
1: Monitor level
Parameters
inbound: Specifies the inbound direction.
outbound: Specifies the outbound direction.
Description
Use the reset qos policy global command to clear the statistics of a global QoS policy.
Examples
# Clear the statistics of the global QoS policy applied to the incoming traffic.
<Sysname> reset qos policy global inbound
Syntax
reset qos vlan-policy [ vlan vlan-id ] [ inbound | outbound ]
View
User view
Default Level
1: Monitor level
Parameters
vlan-id: VLAN ID, in the range of 1 to 4094.
inbound: Clears the statistics of the QoS policy applied in the inbound direction of the specified VLAN.
outbound: Clears the statistics of the QoS policy applied in the outbound direction of the specified VLAN.
Description
Use the reset qos vlan-policy command to clear the statistics of the QoS policy applied in a certain direction of a VLAN.
Examples
# Clear the statistics of QoS policies applied to VLAN 2.
<Sysname> reset qos vlan-policy vlan 2