Zone-Based Firewall (ZBF) Basics
The classic Cisco IOS firewall approach — applying ACLs inbound and outbound on individual interfaces — becomes unwieldy as networks grow. Every new interface needs its own ACL, return traffic requires matching rules in the opposite direction, and there is no built-in concept of which interfaces belong to the same security domain. The Zone-Based Policy Firewall (ZBF) replaces this interface-centric model with a zone-centric model: interfaces are assigned to named security zones, and traffic policies are defined between zone pairs — controlling exactly which traffic flows are permitted, inspected, or dropped between each pair of zones.
ZBF provides stateful inspection — the firewall tracks the state of each allowed connection and automatically permits the corresponding return traffic without needing an explicit return rule. A policy that inspects outbound HTTP from the inside zone to the outside zone automatically allows the HTTP response packets back in. This makes ZBF fundamentally more secure than ACL-based firewalling, where permitting return traffic often requires an overly broad inbound rule.
Before configuring ZBF, ensure basic routing is operational — ZBF policies apply after routing decisions are made. For the routing context, review Static Route Configuration or OSPF Single-Area Configuration. For the ACL concepts that ZBF replaces, see Extended ACL Configuration and ACL Overview. For common port numbers referenced throughout this lab, see Common Port Numbers. For securing management access on the router running ZBF, see AAA with TACACS+ and Login Security — Brute-Force Protection. For DMZ servers that also require static NAT mappings, see Static NAT Configuration.
1. ZBF Architecture — Core Concepts
Zones, Zone-Pairs, and the Self Zone
A zone is a named group of one or more router interfaces that share the same security level and trust requirements. Traffic between interfaces in the same zone is always permitted without any policy. Traffic between interfaces in different zones is blocked by default unless a zone-pair policy explicitly permits or inspects it:
Zone model:
┌──────────────┐ zone-pair policy ┌──────────────┐
│ INSIDE zone │ ─────────────────────────► │ OUTSIDE zone │
│ (Gi0/1) │ ◄───────────────────────── │ (Gi0/0) │
└──────────────┘ separate return zone-pair └──────────────┘
Rules:
1. Interfaces in the SAME zone: traffic always allowed — no policy needed
2. Interfaces in DIFFERENT zones: BLOCKED by default
3. A zone-pair enables a directional policy: source-zone → dest-zone
4. Traffic from INSIDE → OUTSIDE: governed by zone-pair INSIDE to OUTSIDE
5. Return traffic OUTSIDE → INSIDE: governed by zone-pair OUTSIDE to INSIDE
(or handled automatically by stateful INSPECT action)
6. Interfaces NOT assigned to any zone: no ZBF policy applies to them
7. The SELF zone: represents the router itself — controls traffic TO/FROM the router
The Self Zone
The self zone is a built-in zone representing the router's own processes. It is not assigned to any interface — it automatically captures traffic destined for or originating from the router itself (SSH, OSPF, BGP, SNMP, DNS queries from the router). Zone-pairs involving the self zone control management and routing protocol access:
| Zone-Pair Direction | Controls | Example Traffic |
|---|---|---|
| INSIDE → self | Traffic from internal hosts TO the router | SSH management from admin PC, SNMP polls from monitoring server |
| self → INSIDE | Traffic FROM the router TO internal hosts | OSPF Hellos sent to internal neighbours, syslog to internal server |
| OUTSIDE → self | Traffic from external network TO the router | Inbound BGP from ISP, ICMP ping to router's WAN IP |
| self → OUTSIDE | Traffic FROM the router TO external destinations | NTP sync to public NTP server, DNS resolution by router |
The Three ZBF Policy Actions
| Action | Command Keyword | Behaviour | Return Traffic |
|---|---|---|---|
| Inspect | inspect |
Allows matched traffic AND creates a stateful session entry — tracks connection state | Automatically permitted — no return zone-pair policy needed for the reply |
| Pass | pass |
Allows matched traffic in one direction — stateless, no session tracking | NOT automatically permitted — a separate zone-pair policy must permit return traffic |
| Drop | drop |
Silently discards matched traffic — no RST or ICMP unreachable sent | N/A — traffic is discarded |
ZBF vs ACL Firewall — Key Differences
| Feature | ACL Firewall | Zone-Based Firewall |
|---|---|---|
| Configuration unit | Per-interface — each interface needs its own ACL | Per-zone-pair — one policy covers all interfaces in a zone |
| Return traffic | Manual — must explicitly permit return traffic (or use established keyword) |
Automatic with inspect — stateful connection tracking handles returns |
| Default behaviour | Permit all unless denied by ACL | Block all inter-zone traffic unless a zone-pair policy explicitly permits/inspects |
| Same-zone traffic | Treated identically to different-zone traffic — needs ACL entries | Always permitted — no policy required for traffic between interfaces in the same zone |
| Scalability | Grows linearly with interfaces — hard to manage at scale | Scales by zone grouping — adding interfaces to a zone inherits existing policy |
ZBF Configuration Building Blocks
ZBF uses a specific sequence of configuration objects — each must be completed in order. Understanding this hierarchy before touching the CLI prevents common errors:
Step 1: Define zones
zone security INSIDE
zone security OUTSIDE
Step 2: Define class maps (match traffic)
class-map type inspect [match-all|match-any] HTTP-TRAFFIC
match protocol http
match protocol https
Step 3: Define policy maps (assign actions to matched traffic)
policy-map type inspect INSIDE-TO-OUTSIDE-POLICY
class HTTP-TRAFFIC
inspect
class class-default
drop
Step 4: Create zone-pairs (link two zones with a direction)
zone-pair security INSIDE-TO-OUTSIDE source INSIDE destination OUTSIDE
service-policy type inspect INSIDE-TO-OUTSIDE-POLICY
Step 5: Assign interfaces to zones
interface Gi0/1
zone-member security INSIDE
interface Gi0/0
zone-member security OUTSIDE
2. Lab Topology & Scenario
NetsTuts_R1 is the edge router acting as the ZBF. Three zones are defined: INSIDE (corporate LAN), OUTSIDE (internet/WAN), and DMZ (a web server accessible from both inside and outside). The policy permits inside hosts to browse the web and reach the DMZ, permits outside hosts to access only the DMZ web server, and blocks all other traffic from outside to inside:
192.168.10.0/24 203.0.113.0/30
[INSIDE LAN] [OUTSIDE / ISP]
| |
Gi0/1 ─── INSIDE zone OUTSIDE zone ─── Gi0/0
└──────────────────┬──────────────────────────────────┘
│ NetsTuts_R1
│ Gi0/2 ─── DMZ zone
│ |
192.168.20.0/24
[DMZ: Web Server 192.168.20.10]
Zone-Pairs configured:
INSIDE → OUTSIDE : inspect HTTP, HTTPS, DNS, ICMP
INSIDE → DMZ : inspect HTTP, HTTPS
OUTSIDE → DMZ : inspect HTTP, HTTPS (public web access)
DMZ → INSIDE : drop all (server cannot initiate to LAN)
OUTSIDE → INSIDE : drop all (default — no policy = block)
self → INSIDE : pass OSPF, SSH (router management)
INSIDE → self : inspect SSH, ICMP (admin access to router)
| Interface | Zone | Network | IP Address |
|---|---|---|---|
| GigabitEthernet0/1 | INSIDE | 192.168.10.0/24 — Corporate LAN | 192.168.10.1 |
| GigabitEthernet0/0 | OUTSIDE | 203.0.113.0/30 — WAN/Internet | 203.0.113.2 |
| GigabitEthernet0/2 | DMZ | 192.168.20.0/24 — DMZ servers | 192.168.20.1 |
3. Step 1 — Define Security Zones
NetsTuts_R1>en NetsTuts_R1#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Define the three security zones ────────────────────── NetsTuts_R1(config)#zone security INSIDE NetsTuts_R1(config-sec-zone)#description Corporate LAN - trusted hosts NetsTuts_R1(config-sec-zone)#exit NetsTuts_R1(config)#zone security OUTSIDE NetsTuts_R1(config-sec-zone)#description Internet / ISP WAN link NetsTuts_R1(config-sec-zone)#exit NetsTuts_R1(config)#zone security DMZ NetsTuts_R1(config-sec-zone)#description DMZ - public-facing web server NetsTuts_R1(config-sec-zone)#exit
description
is optional but recommended for documentation. At this point, no
interfaces are assigned to any zone — all traffic continues to flow
normally. ZBF policy takes effect only after interfaces are assigned
to zones in the final step.
4. Step 2 — Define Class Maps (Traffic Matching)
Class maps define which traffic to match. ZBF uses
class-map type inspect — these are separate from QoS
class maps. The match-any keyword means traffic matching
any one of the match criteria is classified. match-all
requires all criteria to match simultaneously (less common for firewall
rules):
! ── Class map: web browsing traffic ────────────────────── NetsTuts_R1(config)#class-map type inspect match-any WEB-TRAFFIC NetsTuts_R1(config-cmap)#description HTTP and HTTPS web browsing NetsTuts_R1(config-cmap)#match protocol http NetsTuts_R1(config-cmap)#match protocol https NetsTuts_R1(config-cmap)#exit ! ── Class map: DNS resolution ───────────────────────────── NetsTuts_R1(config)#class-map type inspect match-any DNS-TRAFFIC NetsTuts_R1(config-cmap)#match protocol dns NetsTuts_R1(config-cmap)#exit ! ── Class map: ICMP (ping and traceroute) ──────────────── NetsTuts_R1(config)#class-map type inspect match-any ICMP-TRAFFIC NetsTuts_R1(config-cmap)#match protocol icmp NetsTuts_R1(config-cmap)#exit ! ── Class map: SSH management access to router ─────────── NetsTuts_R1(config)#class-map type inspect match-any MGMT-TRAFFIC NetsTuts_R1(config-cmap)#match protocol ssh NetsTuts_R1(config-cmap)#exit ! ── Class map: routing protocols for self zone ─────────── NetsTuts_R1(config)#class-map type inspect match-any ROUTING-TRAFFIC NetsTuts_R1(config-cmap)#match protocol ospf NetsTuts_R1(config-cmap)#exit
match protocol keyword uses Cisco's Network-Based
Application Recognition (NBAR) engine to identify traffic by application
protocol — not just port number. NBAR identifies HTTP even on
non-standard ports, recognises protocol signatures, and handles
protocols that negotiate ports dynamically (like FTP data channels).
This is more robust than a simple ACL matching TCP port 80.
Common match protocol Keywords
| Keyword | Protocol / Traffic | Port(s) |
|---|---|---|
http |
HTTP web traffic | TCP 80 (and non-standard ports via NBAR) |
https |
HTTPS encrypted web traffic | TCP 443 |
dns |
DNS queries and responses | UDP/TCP 53 |
icmp |
ICMP (ping, traceroute) | IP protocol 1 |
ssh |
Secure Shell management | TCP 22 |
ftp |
FTP control + data (both channels) | TCP 20/21 (NBAR handles dynamic data channel) |
ospf |
OSPF routing protocol | IP protocol 89 |
smtp |
Email sending (SMTP) | TCP 25 |
Matching by ACL (for non-NBAR traffic)
! ── Alternative: match traffic defined by an ACL ───────── ! ── Use when NBAR does not recognise the protocol ───────── NetsTuts_R1(config)#ip access-list extended CUSTOM-APP NetsTuts_R1(config-ext-nacl)#permit tcp 192.168.10.0 0.0.0.255 any eq 8080 NetsTuts_R1(config-ext-nacl)#exit NetsTuts_R1(config)#class-map type inspect match-any CUSTOM-TRAFFIC NetsTuts_R1(config-cmap)#match access-group name CUSTOM-APP NetsTuts_R1(config-cmap)#exit
match protocol),
use match access-group name [ACL] to reference an
extended ACL. This combines the precise source/destination/port
matching of an ACL with the ZBF policy framework. The ACL inside
a ZBF class map acts purely as a traffic selector — its permit/deny
actions are ignored; the class map action (inspect/pass/drop) in the
policy map determines what happens.
5. Step 3 — Define Policy Maps (Assign Actions)
Policy maps link class maps to actions. The
class class-default entry at the end of every policy map
catches all traffic not matched by any named class — the action applied
here (typically drop) determines the default behaviour
for unmatched traffic:
! ── Policy: INSIDE to OUTSIDE (internet access) ────────── NetsTuts_R1(config)#policy-map type inspect INSIDE-TO-OUTSIDE NetsTuts_R1(config-pmap)#class type inspect WEB-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class type inspect DNS-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class type inspect ICMP-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class class-default NetsTuts_R1(config-pmap-c)#drop NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#exit ! ── Policy: INSIDE to DMZ (access internal web server) ─── NetsTuts_R1(config)#policy-map type inspect INSIDE-TO-DMZ NetsTuts_R1(config-pmap)#class type inspect WEB-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class class-default NetsTuts_R1(config-pmap-c)#drop NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#exit ! ── Policy: OUTSIDE to DMZ (public web server access) ──── NetsTuts_R1(config)#policy-map type inspect OUTSIDE-TO-DMZ NetsTuts_R1(config-pmap)#class type inspect WEB-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class class-default NetsTuts_R1(config-pmap-c)#drop NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#exit ! ── Policy: INSIDE to self (SSH to router) ─────────────── NetsTuts_R1(config)#policy-map type inspect INSIDE-TO-SELF NetsTuts_R1(config-pmap)#class type inspect MGMT-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class type inspect ICMP-TRAFFIC NetsTuts_R1(config-pmap-c)#inspect NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class class-default NetsTuts_R1(config-pmap-c)#drop NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#exit ! ── Policy: self to INSIDE (OSPF + routing) ────────────── NetsTuts_R1(config)#policy-map type inspect SELF-TO-INSIDE NetsTuts_R1(config-pmap)#class type inspect ROUTING-TRAFFIC NetsTuts_R1(config-pmap-c)#pass NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#class class-default NetsTuts_R1(config-pmap-c)#pass NetsTuts_R1(config-pmap-c)#exit NetsTuts_R1(config-pmap)#exit
pass for routing protocols
rather than inspect. OSPF is a connectionless protocol —
it does not establish TCP sessions that can be tracked statelessly.
Using pass for OSPF means the router's OSPF Hello and
LSA packets are forwarded toward INSIDE, but the corresponding OSPF
replies from INSIDE back to self must also be explicitly permitted
by the INSIDE-TO-SELF policy (which inspects ROUTING-TRAFFIC or
passes it via class-default). The final class class-default pass
in SELF-TO-INSIDE ensures the router can reach internal hosts for all
other functions without being blocked by its own firewall.
6. Step 4 — Create Zone-Pairs and Apply Policy Maps
Zone-pairs are directional — a zone-pair from INSIDE to OUTSIDE is completely independent of a zone-pair from OUTSIDE to INSIDE. Each zone-pair can have at most one service-policy applied:
! ── Zone-pair: INSIDE → OUTSIDE (outbound internet) ────── NetsTuts_R1(config)#zone-pair security INSIDE-TO-OUTSIDE source INSIDE destination OUTSIDE NetsTuts_R1(config-sec-zone-pair)#service-policy type inspect INSIDE-TO-OUTSIDE NetsTuts_R1(config-sec-zone-pair)#exit ! ── Zone-pair: INSIDE → DMZ ─────────────────────────────── NetsTuts_R1(config)#zone-pair security INSIDE-TO-DMZ source INSIDE destination DMZ NetsTuts_R1(config-sec-zone-pair)#service-policy type inspect INSIDE-TO-DMZ NetsTuts_R1(config-sec-zone-pair)#exit ! ── Zone-pair: OUTSIDE → DMZ (public access to web server) NetsTuts_R1(config)#zone-pair security OUTSIDE-TO-DMZ source OUTSIDE destination DMZ NetsTuts_R1(config-sec-zone-pair)#service-policy type inspect OUTSIDE-TO-DMZ NetsTuts_R1(config-sec-zone-pair)#exit ! ── Zone-pair: INSIDE → self (admin SSH to router) ──────── NetsTuts_R1(config)#zone-pair security INSIDE-TO-SELF source INSIDE destination self NetsTuts_R1(config-sec-zone-pair)#service-policy type inspect INSIDE-TO-SELF NetsTuts_R1(config-sec-zone-pair)#exit ! ── Zone-pair: self → INSIDE (routing protocols) ───────── NetsTuts_R1(config)#zone-pair security SELF-TO-INSIDE source self destination INSIDE NetsTuts_R1(config-sec-zone-pair)#service-policy type inspect SELF-TO-INSIDE NetsTuts_R1(config-sec-zone-pair)#exit ! ── Note: OUTSIDE → INSIDE has NO zone-pair configured ─── ! ── This means all OUTSIDE → INSIDE traffic is DROPPED ─── ! ── by default — no explicit deny needed ──────────────────
source and
destination reference the zone names defined in Step 1.
The keyword self is the built-in self zone — it does not
need to be created. Notice that no OUTSIDE-TO-INSIDE zone-pair is
configured — this is intentional. Without a zone-pair between two
zones, all traffic between them is blocked by default. The
inspect actions in INSIDE-TO-OUTSIDE automatically
handle the return HTTP/DNS/ICMP traffic from OUTSIDE back to INSIDE
through the stateful session table — no explicit OUTSIDE-TO-INSIDE
zone-pair is needed for return traffic.
Why inspect Handles Return Traffic Automatically
Inside host 192.168.10.10 opens HTTP connection to 8.8.8.8:80
Outbound packet (INSIDE → OUTSIDE):
Matches INSIDE-TO-OUTSIDE zone-pair
Matches WEB-TRAFFIC class map (protocol http)
Action: INSPECT
→ Session entry created: 192.168.10.10:54321 ↔ 8.8.8.8:80 TCP ESTABLISHED
→ Packet forwarded to OUTSIDE
Return packet (OUTSIDE → INSIDE):
No OUTSIDE-TO-INSIDE zone-pair exists
ZBF checks stateful session table BEFORE applying zone-pair policy
→ Session match found: this is the return for the inspected connection
→ Packet FORWARDED without needing a zone-pair policy
→ This is stateful inspection — ZBF knows it belongs to an allowed session
New unsolicited packet from OUTSIDE to INSIDE:
No OUTSIDE-TO-INSIDE zone-pair exists
Checked against session table — NO match (no existing session)
→ Packet DROPPED — default inter-zone behaviour
7. Step 5 — Assign Interfaces to Zones
This is the final step — and the most operationally sensitive. The moment an interface is assigned to a zone, ZBF policies become active on that interface. Traffic that was previously flowing without policy will now be subject to the zone-pair rules. Always assign interfaces to zones in a maintenance window and keep console access open:
! ── Assign interfaces to security zones ────────────────── NetsTuts_R1(config)#interface GigabitEthernet0/1 NetsTuts_R1(config-if)#zone-member security INSIDE NetsTuts_R1(config-if)#exit NetsTuts_R1(config)#interface GigabitEthernet0/0 NetsTuts_R1(config-if)#zone-member security OUTSIDE NetsTuts_R1(config-if)#exit NetsTuts_R1(config)#interface GigabitEthernet0/2 NetsTuts_R1(config-if)#zone-member security DMZ NetsTuts_R1(config-if)#exit NetsTuts_R1(config)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
class-default drop and is silently
discarded. Verify that all required traffic classes are in the policy
maps before assigning interfaces. If connectivity breaks after
assignment, the console (not ZBF-protected) is the recovery path.
Important: Interfaces Not Assigned to Any Zone
! ── Interface NOT in any zone: ZBF does NOT apply ───────── ! ── Loopback0 is intentionally left unzoned ─────────────── ! ── (management plane traffic uses loopback) ────────────── NetsTuts_R1(config)#interface Loopback0 NetsTuts_R1(config-if)#ip address 1.1.1.1 255.255.255.255 NetsTuts_R1(config-if)#exit ! ── No zone-member command — loopback is outside ZBF scope
8. Verification
show zone security
NetsTuts_R1#show zone security
zone self
Description: System defined zone
zone INSIDE
Description: Corporate LAN - trusted hosts
Member Interfaces:
GigabitEthernet0/1
zone OUTSIDE
Description: Internet / ISP WAN link
Member Interfaces:
GigabitEthernet0/0
zone DMZ
Description: DMZ - public-facing web server
Member Interfaces:
GigabitEthernet0/2
show zone security confirms all four zones exist (including
the system-defined self zone). Each user-defined zone
shows its assigned member interface. If an interface is missing from
the expected zone, the zone-member security [zone] command
was not applied to that interface.
show zone-pair security
NetsTuts_R1#show zone-pair security
Zone-pair name INSIDE-TO-OUTSIDE
Source-Zone INSIDE Destination-Zone OUTSIDE
service-policy INSIDE-TO-OUTSIDE
Zone-pair name INSIDE-TO-DMZ
Source-Zone INSIDE Destination-Zone DMZ
service-policy INSIDE-TO-DMZ
Zone-pair name OUTSIDE-TO-DMZ
Source-Zone OUTSIDE Destination-Zone DMZ
service-policy OUTSIDE-TO-DMZ
Zone-pair name INSIDE-TO-SELF
Source-Zone INSIDE Destination-Zone self
service-policy INSIDE-TO-SELF
Zone-pair name SELF-TO-INSIDE
Source-Zone self Destination-Zone INSIDE
service-policy SELF-TO-INSIDE
zone-pair security command
was entered and that service-policy type inspect was
applied under it.
show policy-map type inspect zone-pair — Session Statistics
NetsTuts_R1#show policy-map type inspect zone-pair INSIDE-TO-OUTSIDE sessions
policy exists on zp INSIDE-TO-OUTSIDE
Zone-pair: INSIDE-TO-OUTSIDE
Service-policy inspect : INSIDE-TO-OUTSIDE
Class-map: WEB-TRAFFIC (match-any)
Match: protocol http
2847 packets, 3456890 bytes
30 second rate 142 bps
Match: protocol https
1523 packets, 2341200 bytes
Inspect
Active sessions: 12
Session creations since subsystem startup or last reset: 184
Class-map: DNS-TRAFFIC (match-any)
Match: protocol dns
342 packets, 18420 bytes
Inspect
Active sessions: 0
Session creations since subsystem startup or last reset: 67
Class-map: class-default
Drop
3 packets, 180 bytes
show policy-map type inspect zone-pair — Drop Statistics
NetsTuts_R1#show policy-map type inspect zone-pair OUTSIDE-TO-DMZ
policy exists on zp OUTSIDE-TO-DMZ
Zone-pair: OUTSIDE-TO-DMZ
Service-policy inspect : OUTSIDE-TO-DMZ
Class-map: WEB-TRAFFIC (match-any)
Inspect
Active sessions: 4
Session creations since subsystem startup or last reset: 89
Class-map: class-default
Drop
47 packets, 2820 bytes
Verification Command Summary
| Command | What It Shows | Primary Use |
|---|---|---|
show zone security |
All zones and their assigned member interfaces | Confirm interfaces are in the correct zones — most common first-check after configuration |
show zone-pair security |
All zone-pairs with source/destination zones and applied service-policy | Verify all required zone-pairs exist and have policies applied |
show policy-map type inspect zone-pair [name] sessions |
Per-class match counters, active session count, cumulative session creation count | Confirm traffic is matching the intended class maps; identify traffic hitting class-default drop |
show class-map type inspect |
All ZBF class maps with their match criteria | Verify class map definitions — confirm match-any/match-all and protocol list |
show logging |
ZBF drop events — %FW-6-DROP_PKT syslog messages when traffic is dropped | Real-time monitoring of dropped traffic — identify attacks or misconfigured policies |
debug ip inspect detail |
Real-time ZBF session creation and teardown events | Deep troubleshooting — trace which packets are creating sessions and which are being dropped. Use undebug all after use |
9. Troubleshooting ZBF Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| All traffic blocked after interface assignment | No connectivity between inside and outside after assigning interfaces to zones | Either no zone-pair is configured between the zones, or the zone-pair exists but has no service-policy applied, or all traffic hits class-default drop because no class map matches it | Check: show zone-pair security — confirm the zone-pair exists and has a service-policy. Check: show policy-map type inspect zone-pair [name] sessions — if class-default drop counter is rising rapidly, traffic is not matching any class map. Add the required protocol to the appropriate class map. |
| Traffic flows out but responses never return | HTTP requests go out but no web pages load — session initiated but no response received | The outbound policy uses pass instead of inspect — stateless pass does not create a session entry, so return packets from OUTSIDE have no session to match and are dropped by default |
Change the action from pass to inspect in the policy map class: policy-map type inspect [name] → class type inspect [class] → inspect. Inspect creates the stateful session that permits return traffic automatically. |
| Routing protocol adjacency drops after ZBF activation | OSPF or EIGRP neighbours drop when interfaces are assigned to zones | No zone-pair policy between the self zone and the interface's zone permits routing protocol traffic. ZBF applies to traffic TO and FROM the router (self zone) once interfaces are in zones | Create zone-pairs: zone-pair security SELF-TO-INSIDE source self destination INSIDE with a policy that passes or inspects OSPF. Also zone-pair security INSIDE-TO-SELF source INSIDE destination self for inbound OSPF. Use match protocol ospf in the class map. |
| SSH to router fails after ZBF activation | Admin cannot SSH to the router from the inside network after zones are assigned | No INSIDE-TO-self zone-pair permits SSH traffic to the router. Traffic to the router itself is controlled by self zone policies | Create INSIDE-TO-SELF zone-pair with a policy that inspects SSH: zone-pair security INSIDE-TO-SELF source INSIDE destination self with a policy containing class type inspect MGMT-TRAFFIC and action inspect. |
| Static IP server in DMZ unreachable | The public web server in DMZ is reachable from OUTSIDE but not from INSIDE | INSIDE-TO-DMZ zone-pair is missing or its policy does not include the correct traffic class for the server's service type | Verify INSIDE-TO-DMZ zone-pair: show zone-pair security. Check the policy: show policy-map type inspect zone-pair INSIDE-TO-DMZ sessions — if class-default drop counter increments when accessing the server, add the missing protocol to the WEB-TRAFFIC or a dedicated class map. |
| FTP data transfer fails through ZBF | FTP login succeeds (port 21 works) but file transfers fail (data channel port 20 or passive ports blocked) | Active FTP data channel (TCP 20) or passive FTP ephemeral ports are not matched by the class map. If using match protocol ftp, NBAR handles both channels — but if using ACL match, only TCP 21 may be permitted |
Use match protocol ftp in the class map — NBAR's FTP protocol signature handles both the control channel (21) and the data channel (20 active, ephemeral passive). Avoid using ACL-based matching for FTP as it requires opening large port ranges for passive FTP. |
Key Points & Exam Tips
- ZBF replaces interface-based ACL firewalling with a zone-centric model: interfaces are grouped into zones, and traffic policies are applied between zone-pairs — not on individual interfaces.
- Traffic between interfaces in the same zone is always permitted without any policy. Traffic between interfaces in different zones is blocked by default unless a zone-pair policy explicitly permits or inspects it.
- The self zone is built-in and represents the router itself. Zone-pairs involving self control traffic to and from the router's own processes — SSH, routing protocols, SNMP, NTP. If no self zone-pair exists, these also fail.
- The three policy actions are:
inspect(stateful — permits traffic and tracks session for automatic return),pass(stateless — permits one direction only, no return tracking), anddrop(silently discards). - Use
inspectrather thanpassfor TCP and UDP traffic —passdoes not create session state, so return packets are dropped by default (no zone-pair exists for the return direction from OUTSIDE to INSIDE). - The ZBF configuration sequence must be followed in order: (1) define zones, (2) create class maps, (3) create policy maps referencing class maps, (4) create zone-pairs referencing zones, (5) apply service-policy to zone-pair, (6) assign interfaces to zones.
class class-defaultat the end of every policy map catches all unmatched traffic — always include an explicitdropaction here to ensure the default deny behaviour is enforced rather than relying on implicit behaviour.match protocol [keyword]uses NBAR for application-level identification — more robust than port matching and handles protocols that negotiate ports dynamically (FTP, SIP). Usematch access-group name [ACL]as an alternative for non-NBAR protocols.show policy-map type inspect zone-pair [name] sessionsis the primary diagnostic command — shows per-class match counters, active sessions, and class-default drop counts that reveal traffic being incorrectly blocked.- On the CCNA exam: know the five-step ZBF sequence, the three policy actions and their differences (especially inspect vs pass return traffic behaviour), the self zone purpose, and the default inter-zone block behaviour.