Skip to content

Zone-Based Firewall

The zone-based firewall model evaluates traffic between security zones using class maps and policy maps. It is designed for policy reasoning and labs, not for deep inspection of application payloads.

AreaLevelNotes
Security zonesSupportedInterfaces can be assigned to zones.
Zone pairsSupportedSource/destination zone policy attachment, including same-zone pairs and the self zone. Each pair defaults to drop.
Class mapsSupportedmatch-any matches every line it lists. match-all matches what all its lines match. Classes belong to the router that defines them.
Policy mapsSupportedinspect, pass, and drop actions per class; class-default for the rest.
Stateful inspectionBehaviour modelReturn traffic is allowed through connection state. ICMP echo sessions are keyed by identifier and direction.
Application inspectionPartial12 protocol names map to a protocol and port. No payload parsing.
Junos SRX / PAN-OS zone policySupportedNamed rules with source, destination, and application, first match wins, in the order the config writes them. A restated IOS zone policy keeps its place in the order.
StandardCoverageNotes
Cisco IOS ZBFWBehaviour modelZone, zone-pair, class-map, policy-map semantics.
FeatureStatusNotes
zone securitySupportedCreates a zone.
zone-member securitySupportedAssigns interface to zone.
zone-pair securitySupportedBinds source/destination zones. The pair drops what no class permits. A pair naming a missing policy-map drops everything.
class-map type inspectSupportedClassifies traffic. A class-map no zone-pair policy uses is reported: its match lines have no effect.
match protocolPartialKnown names: tcp, udp, icmp, http, https/ssl, ssh, telnet, ftp, smtp, dns, ntp, snmp. Other names are not matched.
match access-group name|<n>PartialThe class matches what the ACL permits, one entry at a time in ACL order. A deny entry means “not this class”, so the next class is tried. Entries a class cannot hold (established/TCP flags, ICMP type, time-range, object-group) keep the class all-IP; the import says so in its notes.
policy-map type inspectSupportedApplies actions in written order.
inspectSupportedAllows matching traffic and its return flow. The return is not dropped by the reverse pair’s class-default drop. An inspected ping lets only the echo-reply back.
pass / dropSupportedStateless allow/drop decisions. A class drop names the class.
Intra-zone trafficSupportedAllowed by default; a configured same-zone pair is enforced.
match-all / match-anySupportedmatch-any matches every match line. match-all intersects its lines.
Unzoned interfaceSupportedIOS drops traffic between a zone member and an interface in no zone (firewall.zone-unzoned). Two unzoned interfaces still route.
Self zoneSupportedA pair with source self or destination self governs traffic from or to the router through its policy-map. With no such pair, that traffic is permitted.
show zone securitySupportedZones and their member interfaces.
show zone-pair securitySupportedPairs with source, destination and service-policy.
show policy-map type inspect zone-pair [sessions]PartialEach pair’s classes in order, with their actions. sessions shows the same view; there are no per-session counters.
CommandIOS-styleJunos-styleVyOS-styleNotes
zone security INSIDESupportedn/an/aZone definition.
zone-member security INSIDESupportedn/an/aInterface membership.
class-map type inspect match-any WEBSupportedn/an/aClassification. Several match protocol lines all count.
policy-map type inspect INSIDE-OUTSupportedn/an/aPolicy actions.
service-policy type inspect INSIDE-OUTSupportedn/an/aZone-pair attachment.
set security zones security-zone Z interfaces In/aSupportedn/aSRX zone membership.
set security policies from-zone A to-zone B policy P …n/aSupportedn/aSRX rule with address-book and junos-* applications.
show zone security / show zone-pair securitySupportedn/an/aZones and pairs from state.
show policy-map type inspect zone-pair [sessions]Partialn/an/aClasses and actions; no session counters.

PAN-OS zones and security rules use the same model, and show zone lists them. A rule whose match cannot be represented is refused and reported, so the pair’s default deny decides. On an SRX or a PAN-OS box, an interface in no zone passes no transit traffic. Traffic to the box itself on such a port is still permitted. A class or policy belongs to the device that defines it: two routers with the same class name each enforce their own.

Zone policy is evaluated after routing identifies the egress side. Between two zoned interfaces, the matching class decides first; the zone pair’s action is the default. When nothing permits the flow, only an established inspected return gets through.

Traffic the router sends or receives itself is checked against a self pair when one exists. The symbolic analysis uses the same decision, so it does not call reachable what the data plane drops at an unzoned port or a self pair.

Inspected ICMP echo sessions are keyed by the ICMP identifier and direction. Only the echo-reply returns. A host that was just pinged cannot ping back through a pair that permits nothing in that direction. Other ICMP types still match on addresses only.

Canonical example
configure terminal
zone security INSIDE
zone security OUTSIDE
class-map type inspect match-any WEB
match protocol https
policy-map type inspect INSIDE-OUT
class type inspect WEB
inspect
zone-pair security IN-OUT source INSIDE destination OUTSIDE
service-policy type inspect INSIDE-OUT
interface GigabitEthernet0/1
zone-member security INSIDE
interface GigabitEthernet0/0
zone-member security OUTSIDE
end

Vendor styles

IOS-style
zone security INSIDE
zone security OUTSIDE
class-map type inspect match-any WEB
match protocol http
policy-map type inspect INSIDE-OUT
class type inspect WEB
inspect
zone-pair security IN-OUT source INSIDE destination OUTSIDE
service-policy type inspect INSIDE-OUT
Junos-style
set security zones security-zone trust interfaces ge-0/0/1.0
set security zones security-zone untrust interfaces ge-0/0/0.0
set security policies from-zone trust to-zone untrust policy WEB match application junos-http
set security policies from-zone trust to-zone untrust policy WEB then permit

Deep packet inspection, ALG helpers, NAT/firewall vendor ordering quirks, and detailed session timeout tuning are not modelled. match protocol knows 12 names. ACL entries with TCP flags, ICMP types, time-ranges or object-groups widen the class to all IP. show policy-map type inspect zone-pair sessions has no per-session counters. OpenWrt and ASA do not drop traffic at an unzoned interface. VyOS zone firewall is not read.