acl name (Layer 2 ACL)

Function

The acl name command creates a Layer 2 ACL and displays the ACL view. If the Layer 2 ACL already exists, this command directly displays the ACL view.

The undo acl name command deletes a created Layer 2 ACL.

By default, no Layer 2 ACL is created.

Format

acl name link-acl-name link [ match-order { config | auto } ]

acl name link-acl-name [ link ] number link-acl-number [ match-order { config | auto } ]

Parameters

Parameter Description Value
link-acl-name

Creates a Layer 2 ACL with a name.

The value is a string of 1 to 64 case-sensitive characters, spaces not supported. The name must start with a letter or digit, and cannot contain only digits.

link

Creates a Layer 2 ACL with a keyword.

-

match-order

Indicates the order in which Layer 2 ACL rules are matched.

-

config

Indicates the configuration order, meaning that ACL rules are matched in the order they are configured.

This mechanism applies only when rule numbers are not specified. If rule numbers are specified, the ACL rules are matched based on the numbers in ascending order.

-

auto

Indicates the automatic order, meaning that ACL rules are matched based on the depth-first principle.

  • The depth-first principle matches ACL rules based on how precise the rules are. The more matching criteria an ACL rule contains, the more precise the rule is.
  • If two rules have the same precision, they are matched in the order they are configured.

-

number link-acl-number

Creates a Layer 2 ACL with a number.

The value is an integer ranging from 4000 to 4999.

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
acl write

Usage Guidelines

Usage Scenario

A Layer 2 ACL defines rules for filtering packets based on Layer 2 information, such as the source MAC addresses, destination MAC addresses, and Layer 2 protocol types of packets. To create a Layer 2 ACL, run the acl command.

Configuration Impact

The undo acl all command deletes all types of ACLs on a device. If the ACLs being deleted are applied to services, these services are interrupted. Before deleting an ACL, ensure that the ACL is not referenced by services.

Follow-up Procedure

Run the rule command to configure a rule for a created advanced ACL. Then the ACL rule can be applied to match packets.

Run the description command to configure a description for a created advanced ACL. The description can contain the functions of the advanced ACL, facilitating applications.

Example

# Create a Layer 2 ACL named link-acl.
<HUAWEI> system-view
[~HUAWEI] acl name link-acl link
# Create a Layer 2 ACL named link-acl and numbered 4999.
<HUAWEI> system-view
[~HUAWEI] acl name link-acl number 4999
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >