Access Control Lists Fundamentals
An access control list (ACL) is the router’s bouncer: a list of permit and deny rules that decides, packet by packet, who is allowed in and who is turned away. Every security exam in networking builds on this one idea, so this lesson gets the mechanics exactly right: wildcard masks, implicit deny, direction, and the ordering rule that catches most people out.
What an ACL is, and how packet filtering works
An access control list (ACL) is an ordered set of rules, each saying
either permit or deny, that a router consults when a packet matches
certain fields. The ACL itself does nothing by itself: it is just a list stored in the configuration.
It only has power once it is applied to somewhere that sees traffic — usually an
interface, in a particular direction, using ip access-group.
ACLs are packet filters: they inspect the headers of a packet — not the payload — and match them against the fields in the list. A router can check the source and destination IP addresses, the protocol field (such as TCP, UDP, ICMP), and, for TCP/UDP, the source and destination port numbers. None of this requires opening the packet; it is all in the IP and transport headers, so filtering is fast and cheap.
Why does this matter for security? A router with an ACL becomes a first line of defence before a
firewall: you can keep a whole subnet away from your servers, allow SSH in only from a management
network, or block a scanning bot from reaching your network’s interior. ACLs are also used for
tasks beyond security — for example restricting debug output, limiting what routes
a routing protocol advertises, or controlling NAT translation selection.
An ACL bound inbound to Gi0/0 inspects every packet arriving through that interface. Permitted packets proceed; denied packets are discarded before the router ever routes them.
Wildcard masks
An ACL needs to describe which addresses it matches — and it does that with a wildcard mask, the confusing cousin of the subnet mask. Wildcard masks work in binary between the address and the mask:
- A 0 bit in the wildcard means this bit must match the value in the address.
- A 255 bit (a 1 in binary) means this bit is ignored — it can be 0 or 1.
0.0.0.255. For /26 (255.255.255.192) it is
0.0.0.63. Remember the saying well: 0 means “check”, 1 means
“ignore”.| Std. subnet mask | Wildcard mask | What it matches |
|---|---|---|
| 255.255.255.255 | 0.0.0.0 | Exactly one host (used with host shorthand) |
| 255.255.255.0 | 0.0.0.255 | One /24 subnet |
| 255.255.255.192 | 0.0.0.63 | One /26 subnet |
| 255.255.0.0 | 0.0.255.255 | One /16 subnet |
| 0.0.0.0 | 255.255.255.255 | Any address (the any shorthand) |
Because writing permit 192.168.1.1 0.0.0.0 is clumsy for a single host, IOS lets you
write permit host 192.168.1.1, and instead of
permit 0.0.0.0 255.255.255.255 you write permit any. The exam will use
all three styles in different questions; convert them mentally before comparing answers.
The implicit deny rule, and inbound vs outbound
Every ACL ends with a rule you never type: implicit deny, which
matches all remaining traffic and denies it. It is not shown in show access-lists
output, but it is always there in the background.
- An ACL with only
permitstatements still blocks everything the statements do not explicitly allow. - An empty ACL — a list with no statements — denies everything, so applying it is the quickest way to kill all matching traffic.
- The last line of every complete ACL must effectively be a
permit any(or adenyintended to catch the rest), or traffic you meant to allow silently disappears.
deny statement, applies the list, and wonders why everything
stopped — including traffic the deny was not aimed at. The implicit deny took over. Always ask:
what happens to traffic that matches no statement? Answer: it is denied.A useful exam phrase: an inbound ACL matches traffic before routing; an outbound ACL matches traffic after routing. Also remember the direction is always judged from the router’s point of view of the interface, not the network’s.
Order matters — the first match wins
ACLs are evaluated top to bottom, and the first matching
statement wins. If an early statement permits a packet, the router never checks the later
ones — even if a stricter deny further down would have matched it too. Ordering
therefore controls behaviour.
- Put the most specific rules first and the general rules after them.
- Place a
permit anyordeny anycatch-all at the end, where it effectively becomes the explicit version of implicit deny. - Never place a broad
deny anybefore the specific lists you still want to allow.
1 permit 192.168.1.0 0.0.0.255 followed by 2 deny 192.168.1.50. The second
line is useless for packets from 192.168.1.50 — they already matched line 1 and were permitted
before line 2 was consulted. If the question asks “what does a packet from 192.168.1.50
do?”, the answer is permitted. Order is the whole story.Named and numbered ACLs, and applying them
ACLs come in two flavours. Numbered ACLs are identified by a number that also fixes their type and capabilities. Named ACLs use a descriptive word and can be edited one statement at a time.
| Feature | Numbered | Named |
|---|---|---|
| Identifier | Number only | Descriptive name (case-sensitive, no spaces) |
| Editing | Whole-list rewrite is typical; you remove and re-add line numbers | Delete or insert single statements with no and sequence numbers |
| Standard / extended | Chosen by the number range | Chosen by the keyword ip access-list standard or extended |
| Exam relevance | Ranges 1-99 and 100-199 appear constantly | Preferred in modern configs for readability |
Named ACLs give the whole game away in their syntax:
ip access-list standard Lab-ACL then a deny/permit line; or
ip access-list extended Corp-Edge for source and destination with ports. Both use the
same wildcard masks and the same implicit deny. The type (standard or extended) is what determines
what the list can match on, not the naming style — that distinction drives the next two
lessons.
Applying an ACL with ip access-group
Two commands together make an ACL live: access-list (or the named variant) builds the
rule set, and ip access-group binds it to an interface and direction.
! Build a small numbered standard ACL (filters by source only) R1(config)# access-list 10 permit 192.168.1.0 0.0.0.255 R1(config)# access-list 10 deny any ! Bind it inbound on the first interface so only allowed sources may enter R1(config)# interface gigabitEthernet0/0 R1(config-if)# ip access-group 10 in R1(config-if)# end R1# show ip interface gigabitEthernet0/0 GigabitEthernet0/0 is up, line protocol is up Internet address is 192.168.1.1/24 Inbound access list is 10 Outgoing access list is not set
Notice show ip interface reports which ACL is bound, inbound and outbound, on every
interface. Removing the bind uses the same keyword with no:
no ip access-group 10 in. The list itself is verified with
show access-lists, which shows every statement plus a match counter beside each one
— the fastest way to see whether traffic is actually hitting the rule.
The facts in one place
| Fact | Value |
|---|---|
| ACL evaluation | Top to bottom; the first matching statement wins |
| Hidden final rule | Implicit deny — all unmatched traffic is denied |
| Wildcard bit 0 | This bit must match the address |
| Wildcard bit 1 (255) | This bit is ignored |
| Wildcard from a subnet mask | 255.255.255.255 minus the subnet mask |
| Inbound ACL | Applied before the routing decision, on arrival |
| Outbound ACL | Applied after the routing decision, on exit |
| Bind a list to an interface | ip access-group <number> in|out |
| Bind a list to the VTY lines | access-class <number> in |
| Standard ranges | 1-99 and 1300-1999 |
| Extended ranges | 100-199 and 2000-2699 |
| Single host / any | host <ip> / any |
| Verify the rules | show access-lists (with hit counters) |
| Verify the binding | show ip interface <if> |
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics, Security Fundamentals domain. cisco.com.
- Cisco. Configuring IP Access Lists (Cisco IOS Security Configuration Guide). cisco.com.
- Baker, F. RFC 1700: Assigned Numbers (1994), port and protocol registries. rfc-editor.org/rfc/rfc1700.
- IANA. Protocol Numbers and Service Name and Transport Protocol Port Number registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.