Standard ACLs
Standard ACLs filter traffic based only on source IP address - use when you need simple permit/deny based on where traffic comes from.
Why Use Standard ACLs?
Section titled “Why Use Standard ACLs?”You need standard ACLs when:
- You want to restrict which networks can access certain resources
- You need to control remote access to the router/switch (SSH, Telnet)
- You’re configuring NAT and need to specify which IPs to translate
- You don’t need to filter by protocol or port (use Extended ACLs for that)
ACL Numbers: 1-99, 1300-1999
Placement Rule: Apply close to the destination (to avoid blocking too much traffic).
Numbered Standard ACL
Section titled “Numbered Standard ACL”Router(config)# access-list 10 permit 192.168.10.0 0.0.0.255Router(config)# access-list 10 deny 192.168.20.10 0.0.0.0Router(config)# access-list 10 permit anyParameters:
- 10 - ACL number. Can be 1-99 or 1300-1999.
- 192.168.10.0 0.0.0.255 - Network and wildcard mask to permit. Replace with your network.
- 192.168.20.10 0.0.0.0 - Specific host to deny. Replace with any host IP.
Note: Statements are processed top to bottom - first match wins.
Wildcard mask examples:
0.0.0.0= Exact match (single host)0.0.0.255= Match entire /24 subnet (256 IPs)0.0.255.255= Match entire /16 subnet (65,536 IPs)
Keyword shortcuts:
host 192.168.10.10= Same as192.168.10.10 0.0.0.0(single host)any= Same as0.0.0.0 255.255.255.255(all IPs)
Named Standard ACL
Section titled “Named Standard ACL”Router(config)# ip access-list standard BLOCK-SALESRouter(config-std-nacl)# deny 192.168.10.0 0.0.0.255Router(config-std-nacl)# permit anyRouter(config-std-nacl)# exitApply ACL to Interface
Section titled “Apply ACL to Interface”Router(config)# interface GigabitEthernet0/0/0Router(config-if)# ip access-group 10 inDirection:
in= Filter traffic entering the interfaceout= Filter traffic leaving the interface
ACL with Remarks
Section titled “ACL with Remarks”Document your ACLs for easier management.
Router(config)# access-list 10 remark Permit only management subnetRouter(config)# access-list 10 permit 192.168.100.0 0.0.0.255Router(config)# access-list 10 remark Block guest networkRouter(config)# access-list 10 deny 192.168.50.0 0.0.0.255Router(config)# access-list 10 permit anyNamed ACL with remarks:
Router(config)# ip access-list standard OFFICE-ACCESSRouter(config-std-nacl)# remark Allow only IT departmentRouter(config-std-nacl)# permit 192.168.100.0 0.0.0.255Router(config-std-nacl)# remark Deny everyone elseRouter(config-std-nacl)# deny anyImplicit Deny
Section titled “Implicit Deny”Every ACL has an invisible deny any at the end. If no permit statement matches, traffic is dropped.
Example:
Router(config)# access-list 15 permit 192.168.10.0 0.0.0.255! Anything not 192.168.10.0/24 is automatically deniedExplicit permit any (if needed):
Router(config)# access-list 15 permit 192.168.10.0 0.0.0.255Router(config)# access-list 15 permit anyEdit ACL - Text Editor Method
Section titled “Edit ACL - Text Editor Method”Step 1: Copy ACL from config
Router# show running-config | include access-listStep 2: Paste into text editor, make changes
Step 3: Remove old ACL, paste new one
Router(config)# no access-list 10Router(config)# access-list 10 permit 192.168.10.0 0.0.0.255Router(config)# access-list 10 deny 192.168.20.0 0.0.0.255Router(config)# access-list 10 permit anyEdit ACL - Sequence Numbers Method
Section titled “Edit ACL - Sequence Numbers Method”View sequence numbers:
Router# show access-listsStandard IP access list 10 10 permit 192.168.10.0, wildcard bits 0.0.0.255 20 deny 192.168.20.0, wildcard bits 0.0.0.255 30 permit anyEdit specific line:
Router(config)# ip access-list standard 10Router(config-std-nacl)# no 20Router(config-std-nacl)# 20 deny 192.168.30.0 0.0.0.255Router(config-std-nacl)# exitInsert new line between existing entries:
Router(config)# ip access-list standard 10Router(config-std-nacl)# 15 permit 192.168.15.0 0.0.0.255Router(config-std-nacl)# exitNow line 15 is processed before line 20.
Secure VTY Lines (Telnet/SSH Access)
Section titled “Secure VTY Lines (Telnet/SSH Access)”Restrict remote access to specific IPs.
! Create ACLRouter(config)# access-list 50 permit 192.168.100.0 0.0.0.255Router(config)# access-list 50 deny any
! Apply to VTY linesRouter(config)# line vty 0 4Router(config-line)# access-class 50 inRouter(config-line)# exitNow only devices from 192.168.100.0/24 can SSH/Telnet to the router.
Best practice: Use login local with SSH only.
Router(config)# username admin privilege 15 secret AdminPass123Router(config)# line vty 0 4Router(config-line)# transport input sshRouter(config-line)# login localRouter(config-line)# access-class 50 inRemove ACL from Interface
Section titled “Remove ACL from Interface”Router(config)# interface GigabitEthernet0/0/0Router(config-if)# no ip access-group 10 in⚠️ The ACL still exists in the config - this only removes it from the interface.
Delete ACL
Section titled “Delete ACL”Router(config)# no access-list 10Or for named ACLs:
Router(config)# no ip access-list standard BLOCK-SALESVerify Configuration
Section titled “Verify Configuration”Router# show access-listsRouter# show access-lists 10Router# show ip access-listsRouter# show ip interface GigabitEthernet0/0/0 | include access listRouter# show running-config | section access-listCheck hit counts (traffic matched by ACL):
Router# show access-listsStandard IP access list 10 10 permit 192.168.10.0, wildcard bits 0.0.0.255 (47 matches) 20 deny 192.168.20.0, wildcard bits 0.0.0.255 (12 matches) 30 permit any (523 matches)Example Scenarios
Section titled “Example Scenarios”Scenario 1: Allow one host, block everyone else
Router(config)# access-list 5 permit host 192.168.10.50Router(config)# access-list 5 deny any
Router(config)# interface GigabitEthernet0/0/1Router(config-if)# ip access-group 5 outScenario 2: Block one subnet, allow everything else
Router(config)# access-list 15 deny 192.168.99.0 0.0.0.255Router(config)# access-list 15 permit any
Router(config)# interface Serial0/1/0Router(config-if)# ip access-group 15 inScenario 3: Named ACL for VTY access
Router(config)# ip access-list standard ADMIN-ACCESSRouter(config-std-nacl)# remark Only allow IT subnetRouter(config-std-nacl)# permit 10.100.0.0 0.0.255.255Router(config-std-nacl)# deny anyRouter(config-std-nacl)# exit
Router(config)# line vty 0 15Router(config-line)# access-class ADMIN-ACCESS in