---
title: ACL Configuration Guide
slug: aidc/acl-configuration-guide
description: Security Configuration Guide
createdAt: 2025-11-12T12:13:53.858Z
---

## <font color="#1d50a2">Introduction</font>

Communication between information points and internal and external networks are essential business requirements in enterprise network. In order to ensure the security of the intranet, security policy is needed to ensure that unauthorized users can only access specific network resources. ACL (Access Control List) is packet processing policy consisting of a series of rules, which are generally judgment statements describing the matching conditions of packets, such as the source MAC, destination MAC, source IP, destination IP, source port number, destination port number, etc. The switch filters packets based on these rules. After configuring ACL rules, the switch will allow certain packets to pass and block certain packets to achieve the purpose of access control and traffic filtering. In short, ACL as a network technology means to control access, improve the security of the network environment and the reliability of network transmission.

## <font color="#1d50a2">Basic Concepts</font>

### <font color="#1d50a2">**ACL Table**</font>

ACL table is port specific. Binding ports means that the ACL table is valid for traffic on those ports. A single ACL table can bind multiple ports, and multiple ACL tables can exist on a single port, i.e. a "many-to-many" relationship.

<font color="#1d50a2">**ACL table naming rule**</font>

The ACL tables’ name is supposed to be different.

<font color="#1d50a2">**ACL table type**</font>

ACL table type affects the match fields of the ACL, in other words, determines which characteristics are used to match traffic. ACL table type is available as L2, L3, L3v6, MIRROR, MIRRORv6, FLOW\_CONTROL. In particular, FLOW\_CONTROL is used as a special ACL table type in combination with the traffic behavior module for the speed-limiting of specific flows.

<font color="#1d50a2">**ACL table direction**</font>

The ACL table stage indicates the direction, optionally ingress and egress, which corresponds to whether the ACL table is applied to the ingress or egress direction respectively. If stage is not specified, the default is ingress. Currently, the same ACL table does not support matching in both the ingress and egress directions.
For the CX family, the matches available in different directions are different. The ACL match fields in the ingress direction are not available in the egress direction, and there are fewer types of match fields for egress than for ingress. See [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for a detailed description of the match fields.

### <font color="#1d50a2">**ACL Rule**</font>

ACL rule is table-specific rule that defines the priority of the rule, the matching conditions and the action to be taken if the match is successful. An ACL rule can only be added to one table, but a table can have multiple rules, i.e. the rule and the table are in a "many-to-one" relationship.
The match field of an ACL rule must match the match field of the table in which it is located, and cannot exceed the match field defined by the table.

****<font color="#1d50a2">**ACL rule naming rule**</font>****

The ACL rules’ name is supposed to be different.

<font color="#1d50a2">**ACL rule priority**</font>

Priority indicates the priority of rule, the higher the value, the higher the priority, and is specified to be less than 500. Priority is used to match the highest priority rule when there are multiple rules to match. The same table does not allow rules of the same priority to be configured.

<font color="#1d50a2">**ACL rule action**</font>

- **Ingress**

<font color="#1d05a2">Table 1 ACL rule ingress action</font>

| **Action**       | **Key words**    | **Description**                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Basic actions    | packet\_action   | Optional permit\|deny\|drop\|trap-to-cpu\|copy-to-cpu, permit means forward; deny means the packet is not forwarded but can be normally trapped; drop means the packet is neither forwarded nor trapped; trap-to-cpu means the packet is only sent to the CPU without forwarding; copy means the packet is sent to the CPU and also forwarded.                                                                  |
| Modify DSCP      | set\_dscp        | Modify the packet dscp value, range 0-63                                                                                                                                                                                                                                                                                                                                                                        |
| Modify PCP       | set\_pcp         | Modify the packet pcp value, range 0-7                                                                                                                                                                                                                                                                                                                                                                          |
| Modify TC        | set\_tc          | Modify the tc value, range 0-7, generally used in conjunction with forcing modification of the packet DSCP ingress.                                                                                                                                                                                                                                                                                             |
| Redirection      | redirect\_action | Redirect, which support redirecting to an interface or to the next hop, are available in the following forms.Interface name, e.g. "Ethernet10".Lag name, e.g. "PortChannel0005".The global IP of the next hop, e.g. "10.0.0.1".The IP and VRF of the next hop, e.g. "10.0.0.2\@Vnet2".The IP and interface name of the next hop, e.g. "10.0.0.3\@Ethernet1".Next hop group, e.g. "10.0.0.1,10.0.0.3\@Ethernet1" |
| Traffic behavior | traffic-behavior | ACLs and traffic behavior are used to limit the speed of specific traffic on a port.                                                                                                                                                                                                                                                                                                                            |

- **Egress**

<font color="#1d05a2">Table 2 ACL rule egress action</font>

| **Action**    | **Key words**  | **Description**                                                                                             |
| ------------- | -------------- | ----------------------------------------------------------------------------------------------------------- |
| Basic actions | packet\_action | Optional permit\|deny, forward means forward, permit means forward; deny means the packet is not forwarded. |
| Modify DSCP   | set\_dscp      | Modify the packet dscp value, range 0-63                                                                    |
| Modify PCP    | set\_pcp       | Modify the packet pcp value, range 0-7                                                                      |

<font color="#1d50a2">**ACL rule match fields**</font>

The supported match fields for different types of ACL tables vary, and the specific match fields for each type of ACL table are described below.

- **L2 match fields**

:::hint{type="info"}
**NOTE:** L2 ACL is only supported on CX308P-48Y-N-V2 and CX532P-N-V2.
:::

<font color="#1d05a2">Table 3 L2 Keywords</font>

| **Key words**   | **Description of parameters**                                                                                 | **Notes**                                |
| --------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| vlan-pri        | 3-bit VLAN priority value, range 0-7                                                                          | -                                        |
| ethernet-type   | 16-bit Ethernet type value, HEX\<0-FFFF>, for example 0800                                                    | Supported only in the ingress direction. |
| outer-vlan      | VLAN ID value, supports mask: vlan-id(1-4094)/mask(0x01-0x0fff) or vlan-id(1-4094).                           | -                                        |
| source-mac      | Source MAC, supports mask: HH\:HH\:HH\:HH\:HH\:HH or HH\:HH\:HH\:HH\:HH\:HH/mask(HH\:HH\:HH\:HH\:HH\:HH)      | Supported only in the ingress direction. |
| destination-mac | Destination MAC, supports mask: HH\:HH\:HH\:HH\:HH\:HH or HH\:HH\:HH\:HH\:HH\:HH/mask(HH\:HH\:HH\:HH\:HH\:HH) | Supported only in the ingress direction. |

- **L3 match fields**

<font color="#1d05a2">Table 4 L3 Keywords</font>

| **Key words**    | **Description of parameters**                                                                                      | **Notes**                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| ethernet-type    | 16-bit Ethernet type value, HEX\<0-FFFF>, for example 0800                                                         | Supported only in the ingress direction.                                            |
| outer-vlan       | VLAN ID value, supports mask: vlan-id(1-4094)/mask(0x01-0x0fff) or vlan-id(1-4094).                                | -                                                                                   |
| ip-type          | IP packtet type, optional any\|ip\|non\_ip\|ipv4any\|non\_ipv4\|ipv6any\|non\_ipv6\|arp\|arp\_request\|arp\_reply. | Not supported on CX308P-48Y-N-V2 and CX532P-N-V2; supported on other device models. |
| ip-protocol      | 8-bit IP protocol value, range 0-255                                                                               | -                                                                                   |
| tcp-flags        | tcp\_flag value, range 0-63                                                                                        | -                                                                                   |
| source-ip        | Source IPv4 address (can with prefix), e.g. "10.1.1.1/24"                                                          | -                                                                                   |
| destination-ip   | Destination IPv4 address (can with prefix), e.g. "10.1.1.1/24"                                                     | -                                                                                   |
| icmp-type        | 8-bit icmp type value, range 0-16                                                                                  | -                                                                                   |
| icmp-code        | 8-bit icmp code value, range 0-5                                                                                   | -                                                                                   |
| source-port      | source port，range 0-65535                                                                                          | -                                                                                   |
| destination-port | destination port，range 0-65535                                                                                     | -                                                                                   |
| dscp             | Value of Dscp, range 0-63                                                                                          | -                                                                                   |
| ip-precedence    | IP Precedence value, range 0-7                                                                                     | -                                                                                   |
| ecn              | The value of ecn, in the range 0-3                                                                                 | -                                                                                   |
| vlan-pri         | vlan priority, range0-7                                                                                            | -                                                                                   |
| vxlan-vni        | VXLAN VNI, range 1-16777215                                                                                        | Supported only in the ingress direction.                                            |

- **L3v6 match fields**

<font color="#1d05a2">Table 5 L3v6 Keywords</font>

| **Key words**    | **Description of parameters**                                  | **Notes**                                                                           |
| ---------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| ip-protocol      | 8-bit IP protocol value, range 0-255                           | Supported only in the ingress direction.                                            |
| source-ipv6      | Source IPv6 address (can with prefix), e.g. "2001\::1/128"     | -                                                                                   |
| destination-ipv6 | Destination IPv6 address (can with prefix), e.g. "2001\::1/96" | -                                                                                   |
| icmpv6-type      | 8-bit icmpv6 type value, range 1-137                           | Supported only in the ingress direction.                                            |
| icmpv6-code      | 8-bit icmpv6 code value, range 0-4                             | Supported only in the ingress direction.                                            |
| source-port      | source port，range 0-65535                                      | Supported on CX308P-48Y-N-V2 and CX532P-N-V2; not supported on other device models. |
| destination-port | destination port，range 0-65535                                 | Supported on CX308P-48Y-N-V2 and CX532P-N-V2; not supported on other device models. |

- **MIRROR match fields**

<font color="#1d05a2">Table 6 MIRROR Keywords</font>

| **Key words**    | **Description of parameters**                                                                                      | **Notes**                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| in-ports         | Ingress traffic interface; multiple interfaces separated by commas.                                                | Supported only in the ingress direction.                                            |
| outer-vlan       | VLAN ID value, supports mask: vlan-id(1-4094)/mask(0x01-0x0fff) or vlan-id(1-4094).                                | -                                                                                   |
| ip-type          | IP packtet type, optional any\|ip\|non\_ip\|ipv4any\|non\_ipv4\|ipv6any\|non\_ipv6\|arp\|arp\_request\|arp\_reply. | -                                                                                   |
| tcp-flags        | tcp\_flag value, range 0-63                                                                                        | -                                                                                   |
| source-ip        | IP address range with prefix, e.g. "1.1.1.1/32"                                                                    | -                                                                                   |
| destination-ip   | IP address range with prefix, e.g. "1.1.1.0/24"                                                                    | -                                                                                   |
| icmp-type        | 8-bit icmp type value, range 0-16                                                                                  | -                                                                                   |
| icmp-code        | 8-bit icmp code value, range 0-5                                                                                   | -                                                                                   |
| source-port      | source port，range 0-65535                                                                                          | -                                                                                   |
| destination-port | destination port，range 0-65535                                                                                     | -                                                                                   |
| dscp             | Value of Dscp, range 0-63.                                                                                         | -                                                                                   |
| ip-precedence    | IP Precedence value, range 0-7                                                                                     | -                                                                                   |
| bth-opcode       | Value of bth-opcode, range 0-255                                                                                   | Not supported on CX308P-48Y-N-V2 and CX532P-N-V2; supported on other device models. |
| aeth\_syndrome   | aeth\_syndrome value, supports mask, aeth\_syndrome(0-255)/mask(0x01-0xff) or aeth\_syndrome(0-255)                | Not supported on CX308P-48Y-N-V2 and CX532P-N-V2; supported on other device models. |

- **MIRRORv6 match fields**

<font color="#1d05a2">Table 7 MIRRORv6 keywords</font>

| **Key words**    | **Description of parameters**                                                                      | **Notes**                                                                           |
| ---------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| source-ipv6      | Source IPv6 address (can with prefix), e.g. "2001\::1/128"                                         | -                                                                                   |
| destination-ipv6 | Destination IPv6 address (can with prefix), e.g. "2001\::1/96"                                     | -                                                                                   |
| bth-opcode       | Value of bth-opcode, range 0-255                                                                   | Not supported on CX308P-48Y-N-V2 and CX532P-N-V2; supported on other device models. |
| aeth\_syndrome   | eth\_syndrome value, supports mask, aeth\_syndrome(0-255)/mask(0x01-0xff) or aeth\_syndrome(0-255) | Not supported on CX308P-48Y-N-V2 and CX532P-N-V2; supported on other device models. |

- **Flow Control match fields**

<font color="#1d05a2">Table 8 Flow Control Keywords</font>

| **Key words**    | **Description of parameters**                                                                                 | **Notes**                                |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| in-ports         | List of bound interfaces, multiple interfaces separated by commas                                             | Supported only in the ingress direction. |
| out-ports        | List of bound interfaces, multiple interfaces separated by commas                                             | Supported only in the egress direction.  |
| source -mac      | Source MAC, supports mask: HH\:HH\:HH\:HH\:HH\:HH or HH\:HH\:HH\:HH\:HH\:HH/mask(HH\:HH\:HH\:HH\:HH\:HH)      | Supported only in the ingress direction. |
| destination-mac  | Destination MAC, supports mask: HH\:HH\:HH\:HH\:HH\:HH or HH\:HH\:HH\:HH\:HH\:HH/mask(HH\:HH\:HH\:HH\:HH\:HH) | Supported only in the ingress direction. |
| outer-vlan       | VLAN ID value, supports mask: vlan-id(1-4094)/mask(0x01-0x0fff) or vlan-id(1-4094).                           | Supported only in the ingress direction. |
| ip-protocol      | 8-bit IP protocol value, range 0-255                                                                          | -                                        |
| source-ip        | Source IPv4 address (can with prefix), e.g. "10.1.1.1/24"                                                     | -                                        |
| destination-ip   | Destination IPv4 address (can with prefix), e.g. "10.1.1.1/24"                                                | -                                        |
| source-port      | source port，range 0-65535                                                                                     | -                                        |
| destination-port | destination port，range 0-65535                                                                                | -                                        |
| vxlan-vni        | VXLAN VNI, range 1-16777215                                                                                   | Supported only in the ingress direction. |

## <font color="#1d50a2">ACL Configuration</font>

### <font color="#1d50a2">**Configure L2 ACL Table**</font>

:::hint{type="info"}
**NOTE:** L2 ACL is only supported on CX308P-48Y-N-V2 and CX532P-N-V2.
:::

<font color="#1d05a2">Table 9 Configure L2 ACL Table</font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* **l2** \{**ingress**\|**egress**}                             | -                                                                                                                                                                                                                                                                                                                                             |
| Apply the ACL table to the interface.                 | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.                                                                                                                                                                                                                                                                                                             |
| Create an ACL rule.                                   | **rule** *rule-id* *\[rule\_options*] *action\_options*                                     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details.<br />*action\_options*: see <u>**[ACL rule action](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule)**</u> for details. |

### <font color="#1d50a2">**Configure L3 ACL Table**</font>

<font color="#1d05a2">Table 10 Configure L3 ACL Table</font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* **l3** \{**ingress**\|**egress**}                             | -                                                                                                                                                                                                                                                                                                                                             |
| Apply the ACL table to the interface.                 | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.                                                                                                                                                                                                                                                                                                             |
| Create an ACL rule.                                   | **rule** *rule-id* *\[rule\_options*] *action\_options*                                     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details.<br />*action\_options*: see <u>**[ACL rule action](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule)**</u> for details. |

### <font color="#1d50a2">**Configure L3v6 ACL Table**</font>

<font color="#1d05a2">Table 11 Configure L3v6 ACL Table</font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* **l3v6** \{**ingress**\|**egress**}                           | -                                                                                                                                                                                                                                                                                                                                             |
| Apply the ACL table to the interface.                 | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.                                                                                                                                                                                                                                                                                                             |
| Create an ACL rule.                                   | **rule** *rule-id* *\[rule\_options*] *action\_options*                                     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details.<br />*action\_options*: see <u>**[ACL rule action](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule)**</u> for details. |

### <font color="#1d50a2">**Configure ACL redirection**</font>

ACL redirection can be configured to a specified interface, next hop, or next hop group.

<font color="#1d05a2">Table 12 Configure ACL redirection  </font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* \{**l3**\|**l3v6**} **ingress**                               | -                                                                                                                                                                                                                                                                                                                                             |
| Apply the ACL table to the interface.                 | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.                                                                                                                                                                                                                                                                                                             |
| Create an ACL rule.                                   | **rule** *rule-id* *\[rule\_options*] *action\_options*                                     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details.<br />*action\_options*: see <u>**[ACL rule action](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule)**</u> for details. |

### <font color="#1d50a2">**Configure ACL redirection next-hop-group**</font>

ACL redirection can be configured to a specified interface, next hop, or next hop group.

<font color="#1d05a2">Table 13 Configure ACL redirection next-hop-group</font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                     |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                   |
| Create an ACL redirection next-hop-group.             | **access-list nexthop-group** *group\_number*                                               | *group\_number*: the range is 1-12.                                                                                                                                                                 |
| Add next hop.                                         | **ip-address** \{*A.B.C.D*\|*A\::B*}                                                        | Multiple next hops can be configured; the next hops must be reachable.                                                                                                                              |
| Commit                                                | **commit**                                                                                  | -                                                                                                                                                                                                   |
| Exit                                                  | **exit**                                                                                    | -                                                                                                                                                                                                   |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* \{**l3**\|**l3v6**} **ingress**                               | -                                                                                                                                                                                                   |
| Apply the ACL table to the interface.                 | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.                                                                                                                                                                   |
| Create an ACL rule.                                   | **rule** *rule-id* \[*rule\_options*] **redirect-action nexthop-group** *group\_number*     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details. |

### <font color="#1d50a2">**Configure ACL-Based Complex Traffic Behavior**</font>

Please refer to <u>**Configure ACL-Based Complex Traffic Behavior**</u> in [Traffic Behavior Configuration Guide](https://v1.docs.asternos.com/aidc/traffic-behavior-configuration-guide#configure-acl-based-complex-traffic-behavior) for details.

### <font color="#1d50a2">**Configure User-defined ACL**</font>

<font color="#1d05a2">Table 14 Configure user-defined ACL Type</font>

| **Purpose**                            | **Commands**                                                                     | **Description**                                                                                                                         |
| -------------------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.       | **configure terminal**                                                           | -                                                                                                                                       |
| Create a user-defined ACL type.        | **access-list user-defined-type** \{**ipv4**\|**ipv6**\|**non\_ip**} *type-name* | *type-name:* the name of user-defined ACL type.                                                                                         |
| Configure the type of bound interface. | **bind-points** \{**port**\|**switch**}                                          | **port**:indicates that the port must be specified in the ACL Table.<br />**switch**:indicates that it is applied to the entire device. |
| Configure match options                | **matches** *match\_options*                                                     | 500.*rule\_options*: see  for details.                                                                                                  |
| Configure action                       | **actions** *action\_options*                                                    | *action\_options*: see <u>**ACL rule action**</u> for details.                                                                          |

Use user-defined ACL Type to configure the ACL Table.

<font color="#1d05a2">Table 15 Configure ACL Table</font>

| **Purpose**                                           | **Commands**                                                                                | **Description**                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                      | **configure terminal**                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* u**ser-define-type** *type-name* \{**ingress**\|**egress**}   | -                                                                                                                                                                                                                                                                                                                                             |
| (Optional) Apply the ACL table to the interface.      | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**} | **all**: Binds to all interfaces.<br />This command is available only when the bind-ports field in the user-defined Type is set to "port".                                                                                                                                                                                                    |
| Create an ACL rule.                                   | **rule** *rule-id* \[*rule\_options*] *action\_options*                                     | *rule-id* also indicates the priority level, in the range 0-500.<br />*rule\_options*: see [ACL rule match fields](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule) for details.<br />*action\_options*: see <u>**[ACL rule action](https://v1.docs.asternos.com/aidc/acl-configuration-guide#acl-rule)**</u> for details. |

### <font color="#1d50a2">**Configure Control Plane ACL**</font>

<font color="#1d05a2">Table 16 Configure ACL Table</font>

| **Purpose**                                           | **Commands**                                                                                                                                  | **Description**                                                                                        |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Enter global configuration view.                      | **configure terminal**                                                                                                                        | -                                                                                                      |
| Create an ACL table and enter the configuration view. | **access-list** *table\_name* **ctrlplane** \{**SSH**\|**SNMP**\|**TELNET**\|**NTP**\|**BGP**}                                                | -                                                                                                      |
| (Optional) Apply the ACL table to the interface.      | **bind interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*\|**all**}                                                   | **all**: Binds to all interfaces.                                                                      |
| Create an ACL rule.                                   | **rule** \{**default\_drop** \[**interface** **all**]}\|*rule-id* \{**source-ip**\|**source-ipv6**} **packet-action** \{**deny**\|**accept**} | **default\_drop** means drop all packets.<br />*rule-id* indicates the rule index, in the range 0-500. |

### <font color="#1d50a2">**Configure Packet Remarking**</font>

Please refer to <u>**Configure Packet Remarking**</u> in [ACL Configuration Guide](https://v1.docs.asternos.com/aidc/acl-configuration-guide) for details.

## <font color="#1d50a2">Display and Maintenance</font>

<font color="#1d05a2">Table 17 ACL Display and Maintenance</font>

| **Purpose**           | **Commands**                                            | **Description**                              |
| --------------------- | ------------------------------------------------------- | -------------------------------------------- |
| Show ACL rules        | **show acl rule** \[*table\_name*] \[*rule\_id* ]       | Table, rule can be specified                 |
| Show ACL tables       | **show acl table** \[*table\_name*]                     | Table can be specified                       |
| Show ACL matches      | **show counters acl** \[*acl-table-name*] \[*rule-id* ] | Show hit count, you can specify table, rule. |
| Clear ACL match count | **clear counters acl**                                  | Clear hit count                              |

## <font color="#1d50a2">Typical Configuration Example</font>

### <font color="#1d50a2">**L3 IPv4 ACL Configuration example**</font>

1. Networking Requirements
   A company interconnects its departments via the switch. The Server stores confidential technical information about the company and also backs it up to the cloud.
   To ensure information security, it is required that ACL rules are correctly configured to achieve:

- Prohibit Department A from accessing resources on the server or in the cloud.
- Department B is prohibited from accessing the server resources directly, but can access the information by accessing the cloud.

2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/zNacKm8qchZdbDwZfsRUS-20251201-022818.png" size="40" width="287" height="396" position="center" caption="L3 IPv4 ACL Configuration Group Diagram" showCaption="true"}

3. Procedure

\#Configure the IP of each port of the switch

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# ip address 192.168.4.1/24
sonic(config-if-0/0)# ex
sonic# configure terminal
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# ip address 192.168.5.1/24
sonic(config-if-0/1)# ex
sonic# configure terminal
sonic(config)# interface ethernet 0/48
sonic(config-if-0/48)# ip address 192.168.10.1/24
sonic(config-if-0/48)# ex
sonic# configure terminal
sonic(config)# interface ethernet 0/52
sonic(config-if-0/52)# ip address 192.168.10.2/24
sonic(config-if-0/52)# ex
```

\#Configure ACL rules
Ethernet0 ingress direction: packets with destination IP 192.168.20.2 received are discarded

```plaintext
sonic# configure terminal
sonic(config)# access-list TABLE_A l3 ingress
sonic(config-l3-acl-TABLE_A)# bind interface ethernet 0/0
sonic(config-l3-acl-TABLE_A)# rule 100 destination-ip 192.168.20.2 packet-action deny
sonic(config-l3-acl-TABLE_A)# ex
#Ethernet1 ingress direction: received packet with destination IP 192.168.20.2 redirected to Ethernet48
sonic# configure terminal
sonic(config)# access-list TABLE_B l3 ingress
sonic(config-l3-acl-TABLE_B)# bind interface ethernet 0/1
sonic(config-l3-acl-TABLE_B)# rule 200 destination-ip 192.168.20.2 redirect-action 192.168.10.2
sonic(config-l3-acl-TABLE_B)# ex
```

4. Verify the configuration.
   Verify that the ACL rule is configured successfully.

```plaintext
sonic# show acl table
Name     Type     Binding    Description    Stage
------   ------  ---------  -------------  -------
TABLE_B  L3      0/1        TABLE_B        ingress
TABLE_A  L3      0/0        TABLE_A        ingress
sonic# show acl rule
Table      Rule    Priority              Action                             Match
-------  ------  ----------  ---------------------------------  -------------------
TABLE_B  rule_200     200                  DROP                       DST_IP: 192.168.20.2
TABLE_A  rule_100     100                  DROP                       DST_IP: 192.168.20.2
TABLE_A  rule_101     101                  DROP                       DST_IP: 192.168.10.2
```

A PC pinging the server from department A does not work, and when pinging the server from a PC in department B the packets go to Ethernet48.

##

