ACL
ACL
· Jomplair · Lexicon Lab

ACL (Access Control List)

An Access Control List (ACL) is a set of rules used to control network traffic by allowing or denying packets based on specific criteria. ACLs are commonly used in networking devices like switches and routers to enforce security policies, manage traffic flow, and improve network performance.

What is an ACL?

An ACL is like a "filter" that examines incoming or outgoing traffic and decides whether to permit or deny it based on predefined rules. These rules can match various attributes of the traffic, such as:

  • Source IP address
  • Destination IP address
  • Protocol (e.g., TCP, UDP, ICMP)
  • Port number (e.g., HTTP, FTP, SSH)

How ACLs Work in Switches

In a switch, ACLs are used to:

  1. Control Traffic Flow:
    • Allow or block traffic between devices within the same network.
    • For example, you can prevent a specific device from accessing a server.
  2. Enhance Security:
    • Restrict unauthorized access to sensitive resources.
    • For example, block external users from accessing internal servers.
  3. Improve Network Performance:
    • Limit unnecessary traffic, such as broadcast or multicast packets, to reduce network congestion.

Types of ACLs

  1. Standard ACL:
    • Filters traffic based only on the source IP address.
    • Example: Block traffic from a specific IP address.
  2. Extended ACL:
    • Filters traffic based on source IP, destination IP, protocol, and port number.
    • Example: Allow only HTTP traffic (port 80) from a specific IP to a web server.
  3. Named ACL:
    • Similar to standard or extended ACLs but uses a name instead of a number for identification.
    • Example: Create an ACL named "BLOCK_VPN" to block VPN traffic.

ACL Configuration Examples

Example 1: Standard ACL

  • Goal: Block traffic from the IP address 192.168.1.10.
  • Configuration:

Switch(config)# access-list 1 deny 192.168.1.10

Switch(config)# access-list 1 permit any

Switch(config)# interface GigabitEthernet0/1

Switch(config-if)# ip access-group 1 in

    • access-list 1: Creates a standard ACL with ID 1.
    • deny 192.168.1.10: Blocks traffic from this IP.
    • permit any: Allows all other traffic.
    • ip access-group 1 in: Applies the ACL to incoming traffic on the interface.

Example 2: Extended ACL

  • Goal: Allow only HTTP traffic (port 80) from 192.168.1.0/24 to a web server at 10.0.0.1.
  • Configuration:

Switch(config)# access-list 101 permit tcp 192.168.1.0 0.0.0.255 host 10.0.0.1 eq 80

Switch(config)# access-list 101 deny ip any any

Switch(config)# interface GigabitEthernet0/2

Switch(config-if)# ip access-group 101 out

    • access-list 101: Creates an extended ACL with ID 101.
    • permit tcp 192.168.1.0 0.0.0.255 host 10.0.0.1 eq 80: Allows HTTP traffic from the subnet to the server.
    • deny ip any any: Blocks all other traffic.
    • ip access-group 101 out: Applies the ACL to outgoing traffic on the interface.

Example 3: Named ACL

  • Goal: Block VPN traffic (port 500) from any source.
  • Configuration:

Switch(config)# ip access-list extended BLOCK_VPN

Switch(config-ext-nacl)# deny udp any any eq 500

Switch(config-ext-nacl)# permit ip any any

Switch(config-ext-nacl)# interface GigabitEthernet0/3

Switch(config-if)# ip access-group BLOCK_VPN in

    • ip access-list extended BLOCK_VPN: Creates a named extended ACL.
    • deny udp any any eq 500: Blocks VPN traffic (UDP port 500).
    • permit ip any any: Allows all other traffic.
    • ip access-group BLOCK_VPN in: Applies the ACL to incoming traffic on the interface.

Key Points to Remember

  1. Order of Rules:
    • ACL rules are processed from top to bottom. The first matching rule is applied, so order your rules carefully.
  2. Implicit Deny:
    • By default, an ACL denies all traffic that does not match any rule. Always include a permit rule if you want to allow other traffic.
  3. Direction Matters:
    • ACLs can be applied to inbound (traffic entering the interface) or outbound (traffic leaving the interface) traffic.
  4. Testing and Verification:
    • Use commands like show access-lists to verify ACL configuration and ping or traceroute to test traffic filtering.

Conclusion

ACLs are a powerful tool for managing and securing network traffic in switches. By defining rules to permit or deny traffic based on specific criteria, you can control access, enhance security, and optimize network performance. Whether you're using standard, extended, or named ACLs, understanding how to configure and apply them is essential for effective network management.

Latest posts