ACL (Access Control List)
Objective
This document explains how to configure Access Control Lists (ACLs) on broadcom sonic. ACLs consist of one or more access control entries (ACEs) that define rules to permit or deny network traffic based on source/destination addresses, protocols, and ports, providing control over traffic flow and security.
Prerequisites
Hardware:
Switches or routers that support VLANs
(e.g., edgecore, ufispace)
Software:
Network operating systems that support VLAN configuration
(e.g., SONiC-OS-4.4.0-Enterprise_Base, SONiC-OS-4.4.2-Enterprise_Base)
Access:
Administrative or privileged CLI access
Network:
IP addressing details (source and destination).
Protocol and port requirements (if filtering by service).
Topology Diagram
Example:
ACL controlling traffic from Host A to Host B on specific ports or protocols.
Basic Configuration Steps
1. Define the ACL
Create an ACL with one or more ACEs specifying permit or deny actions and match conditions.
2. Specify Match Conditions
Use criteria such as:
Source/destination IP addresses or subnets
Protocols (TCP, UDP, ICMP, etc.)
Source/destination ports (if applicable)
3. Apply the ACL
Bind the ACL to an interface (inbound or outbound) or globally depending on the platform.
Example Configuration (DUT_1 and DUT_2)
DUT_1
configure terminal
ip access-list ssh_block
seq 10 deny tcp any any eq 22
interface Ethernet0
mtu 9100
speed 100000
unreliable-los auto
no shutdown
ip access-group ssh_block in
Verification
show access-group # Displays ACL configuration
Test traffic
Attempt SSH connection to verify it is blocked.
Confirm other services are still allowed.
Troubleshooting Tips
Ensure ACLs are applied in the correct direction (inbound or outbound).
Remember ACLs are processed top-down; order matters.
Verify there is an implicit deny all at the end of most ACLs — explicitly permit needed traffic.
Use hit counters to confirm which rules are matching.
Be cautious when applying ACLs remotely to avoid locking yourself out.