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

S12700 V200R012C00 Configuration Guide - QoS

This document describes the configurations of QoS functions, including MQC, priority mapping, traffic policing, traffic shaping, interface-based rate limiting, congestion avoidance, congestion management, packet filtering, redirection, traffic statistics, ACL-based simplified traffic policy, and HQoS.
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

In Figure 8-2, the MAC address of PC1 is 0000-0000-0003, and PC1 connects to GE1/0/1 on the Switch. The Switch is required to collect statistics on packets with the source MAC address of 0000-0000-0003.

Figure 8-2  Networking for 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 Switch can connect to the router 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 Switch collects statistics on packets matching rules.
  5. Configure a traffic policy, bind the traffic classifier and traffic behavior to the traffic policy, and apply the traffic policy to the inbound direction of GE1/0/1 so that the Switch 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 Switch.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan 20
    [Switch-vlan20] quit
    

    # Configure GE1/0/1 as an access interface and GE1/0/2 as a trunk interface, and add them to VLAN 20.

    [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
    

    # Create VLANIF 20 and configure IP address 10.10.10.2/24 for it.

    [Switch] interface vlanif 20
    [Switch-Vlanif20] ip address 10.10.10.2 24
    [Switch-Vlanif20] quit
    
    NOTE:

    Configure IP address 10.10.10.1/24 for the router interface connected to the Switch.

  2. Configure an ACL.

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

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

  3. Configure a traffic classifier.

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

    [Switch] traffic classifier c1 operator and
    [Switch-classifier-c1] if-match acl 4000
    [Switch-classifier-c1] quit
    

  4. Configure a traffic behavior.

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

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

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

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

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

    # Apply the traffic policy p1 to GE1/0/1.

    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] traffic-policy p1 inbound
    [Switch-GigabitEthernet1/0/1] quit
    

  6. Verify the configuration.

    # View the ACL configuration.

    [Switch] 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.

    [Switch] display traffic classifier user-defined
      User Defined Classifier Information:                                          
       Classifier: c1                                                               
        Precedence: 5
        Operator: AND                                                                
        Rule(s) : if-match acl 4000  
    
    Total classifier number is 1  

    # View the traffic policy configuration.

    [Switch] display traffic policy user-defined p1
      User Defined Traffic Policy Information:                                      
      Policy: p1                                                                    
       Classifier: c1                                                               
        Operator: AND                                                                
         Behavior: b1                                                               
          Permit
          Statistic: enable 
    

    # View the traffic statistics.

    [Switch] display traffic policy statistics interface gigabitethernet 1/0/1 inbound
                                                                                    
     Interface: GigabitEthernet1/0/1                                                       
     Traffic policy inbound: p1                                                     
     Rule number: 1                                                                 
     Current status: success                                                            
     Statistics interval: 300                         
    ---------------------------------------------------------------------           
     Board : 1                           
    ---------------------------------------------------------------------       
     Matched          |      Packets:                             0                 
                      |      Bytes:                               0                 
                      |      Rate(pps):                           0                 
                      |      Rate(bps):                           0                 
    ---------------------------------------------------------------------           
       Passed         |      Packets:                             0                 
                      |      Bytes:                               0                 
                      |      Rate(pps):                           0                 
                      |      Rate(bps):                           0                 
    ---------------------------------------------------------------------           
       Dropped        |      Packets:                             0                 
                      |      Bytes:                               0                 
                      |      Rate(pps):                           0                 
                      |      Rate(bps):                           0                 
    ---------------------------------------------------------------------           
         Filter       |      Packets:                             0                 
                      |      Bytes:                               0                 
    ---------------------------------------------------------------------           
         Car          |      Packets:                             0                 
                      |      Bytes:                               0                 
    ---------------------------------------------------------------------
    

Configuration Files

  • Switch configuration file

    #
    sysname Switch
    #
    vlan batch 20
    #
    acl number 4000
     rule 5 permit source-mac 0000-0000-0003 
    #
    traffic classifier c1 operator and precedence 5 
     if-match acl 4000
    #
    traffic behavior b1
     permit
     statistic enable
    #
    traffic policy p1 match-order config
     classifier c1 behavior b1 
    #
    interface Vlanif20
     ip address 10.10.10.2 255.255.255.0
    #                                                                               
    interface GigabitEthernet1/0/1
     port link-type access                                                           
     port default vlan 20                                                   
     traffic-policy p1 inbound                                                      
    #                                                                               
    interface GigabitEthernet1/0/2
     port link-type trunk                                                           
     port trunk allow-pass vlan 20                                                   
    #
    return
    
Translation
Download
Updated: 2019-01-18

Document ID: EDOC1100038410

Views: 17744

Downloads: 24

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