98
Class-based accounting configuration example
Network requirements
As shown in
, configure class-based accounting to collect statistics for traffic sourced from
1.1.1.1/24 and received on GigabitEthernet 1/0/1.
Figure 35 Network diagram
Configuration procedure
# Create basic ACL 2000, and configure a rule to match packets with source IP address 1.1.1.1.
<Router> system-view
[Router] acl number 2000
[Router-acl-basic-2000] rule permit source 1.1.1.1 0
[Router-acl-basic-2000] quit
# Create a class named
classifier_1
, and use ACL 2000 as the match criterion in the class.
[Router] traffic classifier classifier_1
[Router-classifier-classifier_1] if-match acl 2000
[Router-classifier-classifier_1] quit
# Create a behavior named
behavior_1
, and configure the traffic accounting action.
[Router] traffic behavior behavior_1
[Router-behavior-behavior_1] accounting
[Router-behavior-behavior_1] quit
# Create a policy named
policy
, and associate class
classifier_1
with behavior
behavior_1
in the
policy.
[Router] qos policy policy
[Router-qospolicy-policy] classifier classifier_1 behavior behavior_1
[Router-qospolicy-policy] quit
# Apply the policy named
policy
to the incoming traffic of GigabitEthernet 1/0/1.
[Router] interface gigabitethernet 1/0/1
[Router-GigabitEthernet1/0/1] qos apply policy policy inbound
[Router-GigabitEthernet1/0/1] quit
# Display traffic statistics to verify the configuration.
[Router] display qos policy interface gigabitethernet 1/0/1
Interface: GigabitEthernet1/0/1
Direction: Inbound
Policy: policy
Classifier: classifier_1
Operator: AND