No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CLI-based Configuration Guide - QoS

AR100-S, AR110-S, AR120-S, AR150-S, AR160-S, AR200-S, AR1200-S, AR2200-S, and AR3200-S V200R009

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Configuring Traffic Statistics

Example for Configuring Traffic Statistics

Networking Requirements

As shown in Figure 9-2, the MAC address of PC1 is 0000-0000-0003 and PC1 is connected to the WAN-side network device through the switch. The Router is required to collect statistics on packets with the source MAC address of 0000-0000-0003.

Figure 9-2  Networking for configuring traffic statistics

Configuration Roadmap

You can define the traffic statistics action in a traffic policy. The configuration roadmap is as follows:
  1. Configure interfaces so that the Router can connect to the switch and PC1.
  2. Configure an ACL to match packets with the source MAC address of 0000-0000-0003.
  3. Configure a traffic classifier and reference the ACL in the traffic classifier.
  4. Configure a traffic behavior so that the Router collects statistics on packets matching rules.
  5. Configure a traffic policy, bind the traffic policy to the traffic classifier and traffic behavior, and apply the traffic policy to the inbound direction of Eth2/0/0 so that the Router collects statistics on packets with the source MAC address of 0000-0000-0003.

Procedure

  1. Create VLANs and configure interfaces.

    # Create VLAN 20 on the Router.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] vlan 20
    [Router-vlan20] quit
    

    # Configure Eth2/0/0 on the Router as a trunk interface and add Eth2/0/0 to VLAN 20.

    [Router] interface ethernet 2/0/0
    [Router-Ethernet2/0/0] port link-type trunk
    [Router-Ethernet2/0/0] port trunk allow-pass vlan 20
    [Router-Ethernet2/0/0] quit
    

    # Create VLAN 20 on the switch, configure GE1/0/2 as a trunk interface and GE1/0/1 as an access interface, and add GE1/0/2 to VLAN 20.

    <Huawei> system-view
    [Huawei] sysname Switch
    [Switch] vlan 20
    [Switch-vlan20] quit
    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] port link-type access
    [Switch-GigabitEthernet1/0/1] port default vlan 20
    [Switch-GigabitEthernet1/0/1] quit
    [Switch] interface gigabitethernet 1/0/2
    [Switch-GigabitEthernet1/0/2] port link-type trunk
    [Switch-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
    [Switch-GigabitEthernet1/0/2] quit
    

  2. Configure an ACL.

    # Create ACL 4000 (Layer 2 ACL) on the Router to match packets with the source MAC address of 0000-0000-0003.

    [Router] acl 4000
    [Router-acl-L2-4000] rule permit source-mac 0000-0000-0003 ffff-ffff-ffff
    [Router-acl-L2-4000] quit
    

  3. Configure a traffic classifier.

    # Create a traffic classifier c1 on the Router and reference ACL 4000 in the traffic classifier.

    [Router] traffic classifier c1
    [Router-classifier-c1] if-match acl 4000
    [Router-classifier-c1] quit
    

  4. Configure a traffic behavior.

    # Create a traffic behavior b1 on the Router and configure the traffic statistics action in the traffic behavior.

    [Router] traffic behavior b1
    [Router-behavior-b1] statistic enable
    [Router-behavior-b1] quit
    

  5. Configure a traffic policy and apply the traffic policy to an interface.

    # Create a traffic policy p1 on the Router and bind the traffic policy to the traffic classifier and traffic behavior.

    [Router] traffic policy p1
    [Router-trafficpolicy-p1] classifier c1 behavior b1
    [Router-trafficpolicy-p1] quit
    

    # Apply the traffic policy p1 to Eth2/0/0.

    [Router] interface ethernet 2/0/0
    [Router-Ethernet2/0/0] traffic-policy p1 inbound
    [Router-Ethernet2/0/0] quit
    

  6. Verify the configuration.

    # View the ACL configuration.

    <Router> display acl 4000
    L2 ACL 4000, 1 rule
    Acl's step is 5
     rule 5 permit source-mac 0000-0000-0003 
    

    # View the traffic classifier configuration.

    <Router> display traffic classifier user-defined
      User Defined Classifier Information:                                          
       Classifier: c1                                                               
        Operator: OR                                                                
        Rule(s) :
         if-match acl 4000  
    

    # View the traffic policy configuration.

    <Router> display traffic policy user-defined p1
      User Defined Traffic Policy Information:                                      
      Policy: p1                                                                    
       Classifier: c1                                                               
        Operator: OR                                                                
         Behavior: b1                                                               
          statistic: enable 
    

    # View the traffic statistics.

    <Router> display traffic policy statistics interface ethernet 2/0/0 inbound
                                                                                    
     Interface: Ethernet2/0/0                                                       
     Traffic policy inbound: p1                                                     
     Rule number: 1                                                                 
     Current status: OK!                                                            
    Item                     Sum(Packets/Bytes)               Rate(pps/bps)         
    ------------------------------------------------------------------------------- 
    Matched                            0/0                           0/0       
      Passed                           0/0                           0/0        
      Dropped                          0/0                           0/0        
        Filter                         0/0                           0/0            
        CAR                            0/0                           0/0        
      Queue Matched                    0/0                           0/0            
        Enqueued                       0/0                           0/0            
        Discarded                      0/0                           0/0            
      CAR                              0/0                           0/0  
        Green packets                  0/0                           0/0       
        Yellow packets                 0/0                           0/0            
        Red packets                    0/0                           0/0   

Configuration Files

  • Router configuration file

    #
     sysname Router
    #
    vlan batch 20
    #
    acl number 4000
     rule 5 permit source-mac 0000-0000-0003 
    #
    traffic classifier c1 operator or
     if-match acl 4000
    #
    traffic behavior b1
     statistic enable
    #
    traffic policy p1
     classifier c1 behavior b1 
    #                                                                               
    interface Ethernet2/0/0
     port link-type trunk                                                           
     port trunk allow-pass vlan 20                                                  
     traffic-policy p1 inbound                                                      
    #
    return
    
  • Switch configuration file

    #
     sysname Switch
    #
    vlan batch 20
    #
    interface GigabitEthernet1/0/1
     port link-type access                                                           
     port default vlan 20                                                  
    #
    interface GigabitEthernet1/0/2
     port link-type trunk                                                           
     port trunk allow-pass vlan 20                                                  
    #
    return
    
Translation
Download
Updated: 2019-05-17

Document ID: EDOC1000174115

Views: 42254

Downloads: 30

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next