Pcornel
Networking · Security › ACL

Apply IPv4 ACL

Cheat sheet · https://pcornel.dk/topic.php?topic=761

Back to the Topic

Answer

Applying an IPv4 ACL attaches it to an interface with ip access-group <name> in|out. Inbound ACLs check packets as they arrive, before routing; outbound ACLs check packets leaving the interface.

Remember

Direction is seen from the router: "in" is traffic entering that interface. An outbound ACL does not filter traffic the router itself generates. Applying an ACL that does not exist yet permits everything on IOS; applying one with a mistake can lock you out — use reload in <min> when editing remotely.

First checks

  • show access-lists <name> — entries in order with match counters.
  • show ip interface <if> | include access list — ACLs applied inbound and outbound.
  • show running-config | section access-list — the ACL as configured.
  • show ipv6 access-list <name> — IPv6 ACL entries and counters.
  • clear access-list counters <name> — reset counters before a test.

Commands

ip access-group <acl> in
Apply an IPv4 ACL to inbound traffic on an interface.
ip access-group <acl> out
Apply an IPv4 ACL to outbound traffic on an interface.
show ip access-lists

Verify in this order

ACL applied on the right interface and direction → packet compared top-down → first matching entry decides → no match = implicit deny → counter increments on the matching entry

Where it usually breaks

local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result

Interface ACL direction

DirectionPacket positionFast check
inArriving on the interfaceDid the packet enter the router here?
outLeaving through the interfaceWill the router forward the packet out here?

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=761

Confirmation

Confirm action

Continue?