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


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


CLI-based Configuration Guide - Security

AR100, AR120, AR150, AR160, AR200, AR1200, AR2200, AR3200, and AR3600 V200R010

This document provides the basic concepts, configuration procedures, and configuration examples in different application scenarios of the network management feature supported by the device.
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 Using Layer 2 ACLs to Block Network Access of the Specified Users

Example for Using Layer 2 ACLs to Block Network Access of the Specified Users

Networking Requirements

As shown in Figure 5-20, the Router that functions as the gateway is connected to the users' PCs. The administrator wants to block network access of PC1 after detecting that PC1 (00e0-f201-0101) is an unauthorized user.

Figure 5-20  Using Layer 2 ACLs to block network access of the specified users

Configuration Roadmap

The following configurations are performed on the Router. The configuration roadmap is as follows:

  1. Configure a Layer 2 ACL and ACL-based traffic classifier to discard packets from MAC address 00e0-f201-0101 (preventing the user with this MAC address from accessing the network).
  2. Configure a traffic behavior to discard the packets matching the ACL.
  3. Configure and apply a traffic policy to make the ACL and traffic behavior take effect.


  1. Configure an ACL.

    # Configure a Layer 2 ACL to meet the preceding requirement.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] acl 4000
    [Router-acl-L2-4000] rule deny source-mac 00e0-f201-0101 ffff-ffff-ffff
    [Router-acl-L2-4000] quit

  2. Configure an ACL-based traffic classifier.

    # Configure the traffic classifier tc1 to classify packets that match ACL 4000.

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

  3. Configure a traffic behavior.

    # Configure the traffic behavior tb1 to reject packets.

    [Router] traffic behavior tb1
    [Router-behavior-tb1] deny
    [Router-behavior-tb1] quit

  4. Configure a traffic policy.

    # Configure the traffic policy tp1 and associate tc1 and tb1 with the traffic policy.

    [Router] traffic policy tp1
    [Router-trafficpolicy-tp1] classifier tc1 behavior tb1
    [Router-trafficpolicy-tp1] quit

  5. Apply the traffic policy.

    # Packets from PC1 to the Internet are received by GE2/0/0, so apply the traffic policy tp1 to the inbound direction of GE2/0/0.

    [Router] interface gigabitethernet 2/0/0
    [Router-GigabitEthernet2/0/0] traffic-policy tp1 inbound
    [Router-GigabitEthernet2/0/0] quit

  6. Verify the configuration.

    # Check the configuration of the ACL rule.

    [Router] display acl 4000
    L2 ACL 4000, 1 rule                                                             
    Acl's step is 5                                                                 
     rule 5 deny source-mac 00e0-f201-0101 

    # Check the configuration of the traffic classifier.

    [Router] display traffic classifier user-defined                                    
      User Defined Classifier Information:                                          
       Classifier: tc1                                                              
        Operator: OR                                                                
        Rule(s) :                                                                   
         if-match acl 4000   

    # Check the configuration of the traffic policy.

    [Router] display traffic policy user-defined tp1
      User Defined Traffic Policy Information:                                      
      Policy: tp1                                                                   
       Classifier: tc1                                                              
        Operator: OR                                                                
         Behavior: tb1                                                              

    # The user with MAC address 00e0-f201-0101 cannot access the Internet.

Configuration Files

Router configuration file

 sysname Router
acl number 4000
 rule 5 deny source-mac 00e0-f201-0101
traffic classifier tc1 operator or 
 if-match acl 4000
traffic behavior tb1
traffic policy tp1
 classifier tc1 behavior tb1
interface GigabitEthernet2/0/0
 traffic-policy tp1 inbound  
Updated: 2019-08-07

Document ID: EDOC1100034077

Views: 127041

Downloads: 231

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