---
title: ACL Configuration
slug: enterprise-v6p1/acl-configuration
createdAt: 2025-12-05T07:57:34.706Z
---

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

Communication between information points and communication between internal and external networks are essential business requirements in enterprise networks. To ensure the security of the internal network, it is necessary to use security policies to ensure that unauthorized users can only access specific network resources. An Access Control List (ACL) consists of a series of rules that form a packet processing policy. These rules typically consist of conditional statements describing packet matching conditions, such as source MAC, destination MAC, source IP, destination IP, source port number, destination port number, etc. Switches use these rules to filter packets. After configuring ACL rules, switches allow specific packets to pass through while blocking certain packets, achieving access control and traffic filtering. In short, ACL serves as a network technology means of controlling access, enhancing network security, and ensuring reliable network transmission.

# <font color="#1d50a2">Explanation of Principles</font>

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

The ACL table is a collection of ACL rules that are bound to specific interfaces in the form of tables. The "stage" indicates the direction, which can be "ingress" or "egress," corresponding to whether the ACL table is applied in the inbound or outbound direction.
For CX series products, different directions have different available matches. The match fields in the ingress direction are not available in the egress direction. The available ACL Table types on the current device are as follows, representing filtering for different services:

- **L3**: Regular IPv4 business packets received/sent by service interfaces
- **L3V6**: Regular IPv6 business packets received/sent by service interfaces
- **CTRLPLANE**: Used to filter SSH management packets and SNMP protocol packets for device login
- **CTRLPLANEv6**: Used to filter SSH management packets and SNMP protocol IPv6 type packets for device login
- **nexthop-group**: Used when configuring policy-based routing based on PBR to specify the next hop address group.

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

An ACL rule pertains to a table. Within a rule, you define the priority, matching conditions, and actions upon a match. An ACL rule can only be added to one table, but a table can contain multiple rules, creating a "many-to-one" relationship between rules and tables.

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

Priority indicates the priority of a rule. The larger the numerical value, the higher the priority. The priority value must be less than 500. Priority is used when multiple rules can match; the rule with the highest priority is selected. The same table cannot have rules with the same priority. When rules are named non-numerically, the priority is determined based on the order of configuration. The rule configured first has a higher priority.

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

****<font color="#1d50a2">**Ingress Direction**</font>****

| **Actions**  | **Keywords**     | **Description**                                                                                                                                                                                                                                                                    |
| ------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Basic action | packet\_action   | **permit**:  Allows forwarding of the packet.<br />**drop**:  Discards the packet.<br />**trap**:  Sends the packet to the CPU for processing without forwarding.<br />**copy**:  Sends a copy of the packet to the CPU for processing while also forwarding  the original packet. |
| Redirect     | redirect\_action | Redirect  to interface/next hop/next hop group                                                                                                                                                                                                                                     |
| QoS Marking  | traffic-behavior | Implement  port-based traffic rate limiting based on ACL and traffic behavior                                                                                                                                                                                                      |

<font color="#1d50a2">**Egress Direction**</font>

| **Actions**  | **Keywords**   | **Description**                                                                                                                                                                                                                                                                    |
| ------------ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Basic action | packet\_action | **permit**:  Allows forwarding of the packet.<br />**drop**:  Discards the packet.<br />**trap**:  Sends the packet to the CPU for processing without forwarding.<br />**copy**:  Sends a copy of the packet to the CPU for processing while also forwarding  the original packet. |

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

<font color="#1d50a2">**L3/L3v6 Matching Filter**</font>

| **Keywords**  | **Description**                                                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ethernet-type | 16-bit  Ethernet type value, HEX\<0-FFFF>, e.g., 0x0800                                                                                                     |
| src-mac       | Source  MAC address, format nn\:nn\:nn\:nn\:nn\:nn                                                                                                          |
| outer-vlan    | Outer  VLAN ID                                                                                                                                              |
| vlan-pri      | VLAN  priority                                                                                                                                              |
| ip-protocol   | IP  protocol type, can be configured using either the numeric value or protocol  name                                                                       |
| icmpv6-type   | ICMPv6  message type, range 1-137                                                                                                                           |
| src-ip        | Source  IP address (with subnet mask), e.g., "10.1.1.1/24"                                                                                                  |
| dst-ip        | Destination  IP address (with subnet mask), e.g., "10.1.1.1/24"                                                                                             |
| icmp-type     | 8-bit  ICMP type value, range 0-16                                                                                                                          |
| src-port      | Protocol  source port number                                                                                                                                |
| dst-port      | Protocol  destination port number                                                                                                                           |
| ip-type       | NON\_IP for filtering  non-IP packets<br />IPV4ANY for filtering  IPv4 packets<br />IPV6ANY for filtering  IPv6 packets<br />ARP for filtering ARP  packets |

## <font color="#1d50a2">**CTRLPLANE/ CTRLPLANEv6 Matching Filter**</font>

| **Keywords** | **Description**         |
| ------------ | ----------------------- |
| src-ip       | Source  IP address      |
| dst-ip       | Destination  IP address |

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

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

<font color="#1d50a2">**Network requirements**</font>

A company interconnects all departments through Switch, and the server Server stores the company's confidential technical data, while backing up to the cloud.

To ensure information security, it is required to properly configure ACL rules to achieve:

Block user group A from accessing resources on the server and the cloud.

User group B is prohibited from accessing the server resources directly, but can access the information by accessing the cloud.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/OJ-qEcRanuUlous0Jm2aX-20251203-104520.png" size="80" width="656" height="245" position="center" showCaption="false"}

<font color="#1d50a2">**Procedure**</font>

1. Omit the VLAN configuration process
2. Configure the interface IP address

```text
sonic(config)# interface ethernet 49
sonic(config-if-49)# ip address 192.168.10.1/24
sonic(config)# interface ethernet 50
sonic(config-if-50)# ip address 192.168.20.1/24
sonic(config)# interface vlan 10
sonic(config-vlanif-10)# ip address 192.168.4.1/24
sonic(config)# interface vlan 20
sonic(config-vlanif-20)# ip address 192.168.5.1/24
```

3. Configure ACL rules

```text
sonic(config)# access-list l3 TABLE_1 ingress
sonic(config-l3-acl-table_1)# rule 1 src-ip 192.168.4.0/24 dst-ip 192.168.20.0/24 packet-action deny
sonic(config-l3-acl-table_1)# rule 2 src-ip 192.168.4.0/24 dst-ip 192.168.10.0/24 packet-action deny
 
sonic(config)# access-list l3 TABLE_2 ingress
sonic(config-l3-acl-table_2)# rule 3 src-ip 192.168.5.0/24 dst-ip 192.168.20.0/24 packet-action deny
```

4. Binding rules

```text
sonic(config)# interface vlan 10
sonic(config-vlanif-10)# acl TABLE_1
sonic(config)# interface vlan 20
sonic(config-vlanif-20)# acl TABLE_2
```

<font color="#1d50a2">**Verify configuration**</font>

User A can access User B and other network resources normally, but cannot access the cloud and server resources.
User B can access User A, and the cloud resources normally, but not the server resources.

## <font color="#1d50a2">CTRLPLANE ACL configuration example</font>

<font color="#1d50a2">**Network requirements**</font>
The PC accesses the login device through the cloud and goes out to the network security consideration, all users need to jump through the springboard machine to login the device. You need to configure ACL filtering rules on the device to prohibit other IPs other than the hopper IP from accessing the device.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/zy7sSQGTZlvBks_j-mRNI-20251203-104610.png" size="70" width="620" height="168" position="center" showCaption="false"}

<font color="#1d50a2">**Procedure**</font>

```text
sonic(config)# access-list CTRLPLANE SSH ingress srv SSH,SNMP
sonic(config-CTRLPLANE-acl-SSH)# rule 100 src-ip 192.168.0.0/20
sonic(config-CTRLPLANE-acl-SSH)# rule 90 src-ip 10.11.1.0/24
```

<font color="#1d50a2">**Verify configuration**</font>
PC can only log into the device normally through the springboard machine, other ways are unable to log in and the normal business functions of the device are not affected by the rule.

****
