Firewall Types Explained: Packet Filtering, Stateful, NGFW, and WAF (2026)

Firewall Types
Firewall Types
By HOC Team  |  Last updated: July 2026  |  Read time: ~22 min

When most people hear "firewall," they picture a single thing — the box between your network and the internet that blocks bad traffic. In reality, "firewall" describes an entire family of technologies with fundamentally different architectures, operating at different layers of the network stack, solving different security problems.

A packet filtering firewall and a Web Application Firewall are both called firewalls, but they operate as differently as a bouncer checking IDs at the door versus an expert reading body language inside the room.

This matters practically because choosing the wrong firewall for a specific security requirement leaves gaps that attackers exploit. A stateful firewall protecting a web application cannot inspect the HTTP payload for SQL injection.

A WAF protecting a database API has no ability to block port scans targeting other services. Organisations that understand the distinctions deploy the right tool for each layer of their security architecture — and do not rely on a single firewall type to solve all problems.

This guide covers every major firewall type in depth — packet filtering, stateful inspection, Next-Generation Firewalls, Web Application Firewalls, and cloud firewalls — with real configuration examples, the specific attacks each type can and cannot stop, vendor comparisons, and a corporate deployment framework that shows where each type belongs in a layered defence architecture.

📊 Firewall market — 2026 context Global NGFW market valued at $5.7 billion · 94% of enterprise organisations have at least one firewall · 43% of web application attacks bypass traditional network firewalls (Verizon DBIR 2025) · WAF adoption grew 38% in 2025 driven by API security requirements · Zero trust adoption is reshaping firewall placement from perimeter-only to every network segment boundary
1. What is a firewall — and what it is not

A firewall is a network security control that monitors and filters traffic between network zones based on a defined rule set — permitting traffic that matches allowed patterns and blocking traffic that does not. It sits at the boundary between two or more network zones and acts as the enforcement point for the traffic policy between those zones.

Critically: a firewall is not an intrusion detection system (though NGFWs include IDS/IPS functionality). It is not an antivirus. It is not a VPN (though firewalls often terminate VPN connections). It is not a complete security solution on its own. A firewall enforces a network traffic policy — what can flow between zones, on what ports, using what protocols. Everything else in the security stack handles what happens at layers a firewall cannot inspect.

🔑
The core concept — default deny

Every well-configured firewall operates on the principle of default deny: everything is blocked unless explicitly permitted. Rules are written to allow specific, required traffic flows. Any traffic not matching a permit rule is silently dropped or rejected. This is the inverse of how most networks are built without firewalls — where everything is permitted unless explicitly blocked.

Default deny is important because it means the security team must consciously decide what is allowed. Every open port, every permitted protocol, every allowed source-destination pair is a deliberate, documented decision. This mindset — explicit permit, implicit deny — is the foundation of all effective firewall policy.

Inbound vs outbound filtering — do both. Most firewall policies focus on inbound traffic (blocking attacks coming in). Egress filtering — controlling what goes out — is equally important: it detects compromised internal systems calling home to C2 servers, prevents data exfiltration, and catches malware that is already inside the network. A firewall with strong inbound rules and no egress filtering is half a firewall.
Firewall types mapped to OSI model layers — showing which layer each type inspects and what it can detect
Firewall Types — OSI Model Coverage OSI LAYER 7 — Application HTTP, HTTPS, DNS, SMTP, FTP 6 — Presentation (SSL/TLS) 5 — Session 4 — Transport TCP, UDP — ports, flags 3 — Network IP addresses, routing 2 — Data Link (MAC) 1 — Physical Packet Filtering L3–L4 only Type 1 Stateful Inspection L3–L4 + state Type 2 Next-Gen Firewall (NGFW) L3–L7 App-aware IDS/IPS Type 3 Web App Firewall (WAF) Type 4 Stops: Port scans IP spoofing Stops: SYN floods Session hijack Stops: Malware · C2 App abuse · TLS Stops: SQLi · XSS OWASP Top 10
2. Type 1 — Packet filtering firewall OSI Layer 3–4
📦
Packet Filtering Firewall
The original firewall technology — examines each packet in isolation against a rule set of IPs and ports. Fast, simple, blind to context.
Oldest type Stateless Very fast
OSI layers
3 (Network) and 4 (Transport)
Inspects
Source IP, Dest IP, Port, Protocol
State tracking
None — stateless
Performance
Extremely high throughput
Best use
Simple network ACLs, router filters

A packet filtering firewall examines each network packet in isolation and compares it against an access control list (ACL). Each packet is checked against rules that specify: source IP address, destination IP address, source port, destination port, and protocol (TCP or UDP). If the packet matches a permit rule, it is forwarded. If it matches a deny rule or no rule at all, it is dropped. The decision is made independently for every single packet — there is no memory of previous packets and no concept of a "connection."

Packet filtering is implemented in router ACLs (Cisco IOS access-list commands), Linux iptables with simple rules, and basic firewall configurations. It is still widely used today — not as a primary firewall, but as a fast first-pass filter at network boundaries before traffic reaches more sophisticated controls.

Example packet filtering ACL — Cisco IOS
! Standard extended ACL — permit specific services, deny rest ! Applied to interface: ip access-group CORP-IN in ip access-list extended CORP-IN remark Allow established web traffic inbound permit tcp any 10.0.0.0 0.0.255.255 eq 80 permit tcp any 10.0.0.0 0.0.255.255 eq 443 remark Allow SSH only from management subnet permit tcp 10.10.99.0 0.0.0.255 any eq 22 remark Allow DNS permit udp any any eq 53 remark Allow ICMP ping (limited) permit icmp any any echo-reply remark Deny and log everything else deny ip any any log
Example rule table
#ProtocolSource IPDest IPDest PortActionPurpose
1TCPANY10.0.0.5443PERMITAllow HTTPS to web server
2TCP10.10.99.0/24ANY22PERMITSSH from management subnet only
3UDPANY10.0.0.253PERMITDNS to internal resolver
4TCPANY10.0.0.0/823DENYBlock Telnet everywhere
5ANYANYANYANYDENYImplicit deny all
What packet filtering can and cannot stop
  • Can stop: Port scans reaching closed ports, connections from blocked IP ranges, traffic on prohibited protocols, traffic to services not in the ACL, basic IP spoofing (with anti-spoofing rules)
  • Cannot stop: Attacks through permitted ports (SQL injection on port 443 looks identical to legitimate HTTPS), IP spoofing where the source IP is in a permitted range, fragmented packet attacks (some packets bypass ACLs if fragmented correctly), return traffic attacks (no state tracking — cannot verify a packet is a legitimate TCP response)
3. Type 2 — Stateful inspection firewall OSI Layer 3–4 + State
📋
Stateful Inspection Firewall
Tracks the state of network connections in a state table — verifies packets are legitimate parts of established sessions. The standard for 25 years.
Industry standard Stateful Connection tracking
OSI layers
3–4 plus connection state tracking
Inspects
IP, port, protocol, TCP flags, sequence numbers, session state
State tracking
Full connection state table (SYN, ESTABLISHED, FIN)
Performance
High throughput, low latency
Best use
Perimeter defence, inter-VLAN filtering, most corporate deployments

Stateful inspection was introduced by Check Point in 1994 and solved the fundamental problem with packet filtering: a stateless firewall has no way to know whether an inbound packet is a legitimate response to an outbound request or an unsolicited attack packet. A stateful firewall maintains a connection state table — a record of every active TCP/UDP session crossing the firewall.

When a client initiates a TCP connection (SYN), the firewall records the session: source IP, source port, destination IP, destination port, and the current TCP state (SYN_SENT). When the server responds (SYN-ACK), the firewall verifies this packet matches an existing entry in the state table and updates it to ESTABLISHED. Return traffic matching an established session is automatically permitted without requiring a separate inbound rule. This eliminates the need for open inbound rules for return traffic — a major security improvement over packet filtering.

How stateful inspection works — TCP three-way handshake
# Stateful firewall tracks this TCP handshake: # State table entry created at each step Client 10.0.1.5:52000 → Server 203.x.x.x:443 Step 1: Client sends SYN Firewall checks rule: permit tcp 10.0.1.0/24 any eq 443 → MATCH Firewall creates state table entry: [10.0.1.5:52000 → 203.x.x.x:443 | TCP | SYN_SENT] Step 2: Server sends SYN-ACK Firewall checks state table: matches entry above State updated: [... | ESTABLISHED] Packet forwarded to client — no explicit inbound rule needed Step 3: Client sends ACK — connection established State table confirms valid sequence numbers and ACK All subsequent packets in this session permitted automatically Step 4: Connection closes (FIN/ACK exchange) State table entry removed after timeout or FIN Any packets arriving after removal are blocked
What stateful inspection adds over packet filtering
  • SYN flood protection — SYN packets without corresponding ACKs are tracked. Flood conditions trigger SYN cookies or rate limiting. Packet filtering has no concept of "too many SYNs."
  • No inbound rules for return traffic — stateful firewalls only need outbound permit rules. Return traffic is automatically permitted if it matches an established session. Packet filtering requires explicit inbound rules for return traffic, creating security gaps.
  • TCP sequence number validation — verifies that TCP sequence numbers in packets are within the expected range for the session, blocking TCP session hijacking attempts.
  • FTP, SIP helper inspection — protocols that open dynamic ports for data transfer (FTP's data channel, SIP's media streams) are handled by application layer helpers that track the negotiated secondary ports and permit only those — without opening broad port ranges.
  • Still blind to payload — stateful inspection operates at Layer 3–4. It knows a valid TCP session on port 443 is established. It cannot see that the HTTPS payload contains a SQL injection string.
Common stateful firewall products

Linux iptables / nftables (with connection tracking module), Windows Firewall with Advanced Security, Cisco ASA (now Secure Firewall), older Check Point appliances, pfSense / OPNsense (open-source), and Fortinet FortiGate at basic configuration. Most modern deployments use these as the base layer of an NGFW rather than as standalone stateful firewalls.

4. Type 3 — Next-generation firewall (NGFW) OSI Layer 3–7
🚀
Next-Generation Firewall (NGFW)
Stateful inspection + deep packet inspection + application identification + IDS/IPS + TLS decryption + user identity. The corporate perimeter standard in 2026.
Current enterprise standard Layer 7 inspection IDS/IPS included
OSI layers
3–7 — full stack inspection
Key capabilities
DPI, App-ID, User-ID, TLS inspect, IDS/IPS, URL filter
TLS inspection
Decrypts and re-inspects encrypted traffic
Performance
Lower throughput than stateful (DPI overhead)
Leading vendors
Palo Alto, Fortinet, Check Point, Cisco

The term "next-generation firewall" was defined by Gartner in 2009 to describe a new class of firewall that moved beyond stateful inspection to include deep packet inspection (DPI), application awareness, and integrated intrusion prevention. By 2026, NGFW is simply what most people mean when they say "firewall" — the stateful-only firewall is increasingly a legacy device.

What makes an NGFW "next-generation"
1. Deep Packet Inspection (DPI)

Where stateful inspection tracks TCP sessions at Layer 4, DPI reads the actual content of each packet's payload. It reassembles TCP streams and inspects the application-layer data — the HTTP headers, the DNS query payload, the TLS certificate, the SMTP commands. This is what enables all the higher-level capabilities below.

2. Application identification (App-ID)

Traditional firewalls identify applications by port. An NGFW identifies the actual application regardless of port — Skype on port 80, BitTorrent on port 443, Dropbox disguised as HTTPS. Palo Alto Networks' App-ID is the most advanced implementation: it identifies over 3,500 applications by analysing protocol behaviour, payload signatures, and traffic patterns. This prevents the common bypass technique of using non-standard ports or tunnelling traffic over common protocols.

3. User identity (User-ID)

Traditional firewalls operate on IP addresses. An NGFW integrates with Active Directory, LDAP, or RADIUS to map IP addresses to user accounts. Policies can be written as: "Allow Marketing group to access social media on port 443, deny Engineering group on the same policy." When a user's IP changes (DHCP reassignment), the policy follows the user identity, not the IP.

4. Integrated IDS/IPS

NGFWs include an intrusion detection and prevention system inline — inspecting traffic for known attack signatures (Snort/Suricata rule sets), protocol anomalies, and behavioural patterns. When an attack signature matches, the IPS can block the traffic in real time (prevention mode) or alert and log it (detection mode). This consolidates two previously separate appliances (firewall + IPS) into one.

5. TLS/SSL inspection

Over 90% of internet traffic is now encrypted with TLS. A firewall that cannot decrypt TLS is largely blind to modern attacks — malware C2 communications, data exfiltration, and HTTPS-delivered exploits all look like generic encrypted traffic. NGFW TLS inspection works by acting as a trusted man-in-the-middle: the firewall terminates the TLS connection from the client, inspects the decrypted payload, then re-encrypts and forwards to the destination. This requires deploying the NGFW's CA certificate as a trusted CA on all managed endpoints.

NGFW policy example — Palo Alto Networks style
# NGFW policies use App-ID and User-ID — not just port and IP # Rule 1: Allow web browsing for all users via URL category filtering Name: Allow-Web-Browsing Source: Users-VLAN (10.10.20.0/24) User: Any authenticated domain user App-ID: web-browsing, ssl Category: any (except: malware, phishing, gambling, adult) Action: Allow | Decrypt | IPS-profile: Strict | AV-scan: Yes # Rule 2: Block known C2 applications by App-ID Name: Block-C2-Apps Source: Any App-ID: cobalt-strike, metasploit, empire-c2, any-known-C2 Action: Block | Log | Alert-SOC # Rule 3: Allow SaaS apps for specific user groups only Name: Allow-Salesforce-Sales-Team Source: Any User: AD-Group: SalesTeam App-ID: salesforce Action: Allow | Log # Rule 4: Block file uploads to personal cloud storage Name: Block-Personal-Cloud-Upload Source: Users-VLAN App-ID: dropbox, google-drive-personal, onedrive-personal Action: Block | Alert-DLP-Team
What NGFW can and cannot stop
  • Can stop: Known malware signatures in traffic, C2 communications (known domains and IPs), application policy violations, URL category-based threats, TLS-encrypted attacks (with SSL inspection enabled), protocol anomaly-based attacks, many zero-day exploits via signature updates, DNS tunnelling, data exfiltration via known channels
  • Cannot stop: Unknown zero-day attacks not yet in signature databases, attacks within encrypted traffic if TLS inspection is not deployed, SQL injection and XSS in web application payloads (these require a WAF that understands web application context, not just network traffic), insider threats using legitimate application sessions, advanced threats that evade signature detection
TLS inspection is not optional in 2026. With over 90% of traffic encrypted, an NGFW without TLS inspection is largely blind. Yes, TLS inspection introduces latency, requires certificate management, and raises privacy considerations. The alternative — leaving most of your traffic uninspected — is not acceptable for security-conscious organisations. Deploy TLS inspection with a documented privacy policy, proper certificate management, and exclude sensitive categories (online banking, healthcare portals) from inspection.
5. Type 4 — Web Application Firewall (WAF) OSI Layer 7 only
🌐
Web Application Firewall (WAF)
Sits in front of web applications and APIs, inspecting HTTP/HTTPS traffic for OWASP Top 10 attack patterns — SQLi, XSS, CSRF, and API abuse. Understands web context that NGFWs cannot.
Layer 7 specialist OWASP Top 10 API security
OSI layer
7 — Application (HTTP/HTTPS) only
Protects against
SQLi, XSS, CSRF, SSRF, XXE, RCE, OWASP Top 10
Deployment modes
Inline reverse proxy, out-of-band, CDN-integrated
API security
REST/GraphQL schema validation, rate limiting
Leading vendors
Cloudflare, AWS WAF, Imperva, F5, Akamai

A Web Application Firewall operates exclusively at Layer 7 — it understands HTTP and HTTPS at a semantic level, not just as network traffic. While an NGFW sees "encrypted traffic on port 443," a WAF sees the actual HTTP request: the URI, query parameters, request headers, cookies, and POST body. This context is what enables it to detect web application attacks that are completely invisible to network-layer firewalls.

A WAF sits in front of web applications as a reverse proxy. All requests destined for the application are first received by the WAF, inspected, and either forwarded to the application (if clean) or blocked (if malicious). The application server only sees traffic that the WAF has cleared.

What a WAF inspects — HTTP request anatomy
# A WAF analyses every part of the HTTP request: POST /api/v1/login HTTP/1.1 Host: app.example.com ← Host header injection check User-Agent: Mozilla/5.0... ← Bot detection, scanner fingerprinting Cookie: session=abc123; cart=... ← Cookie tampering, session fixation Content-Type: application/json ← Content-type mismatch detection X-Forwarded-For: 203.x.x.x ← IP geolocation, reputation check { "username": "admin' OR 1=1-- -", ← WAF detects SQL injection "password": "..." } # WAF decision: BLOCK — SQL injection pattern in username field # Response: 403 Forbidden (or silently drop, depending on mode) # Alert: sent to SIEM with full request details
Core WAF detection capabilities
  • SQL injection detection — pattern matching and heuristic analysis of SQL metacharacters, keywords (UNION SELECT, OR 1=1, DROP TABLE), and injection patterns in query parameters, POST bodies, headers, and cookies
  • XSS detection — detection of JavaScript injection patterns, HTML event handlers, and script tags in user input before they reach the application
  • CSRF protection — validation of anti-CSRF tokens, origin headers, and referrer validation for state-changing requests
  • Rate limiting and DDoS mitigation — request rate limits per IP, per session, per endpoint; challenge-response (CAPTCHA) for suspicious traffic patterns
  • Bot detection — distinguishing legitimate browsers and crawlers from automated attack tools through behavioural analysis, JavaScript challenges, and browser fingerprinting
  • API security — schema validation (does this API request match the OpenAPI specification?), rate limiting per API key, detection of parameter pollution and mass assignment attacks
  • OWASP Core Rule Set (CRS) — the open-source rule set used by ModSecurity and many commercial WAFs, covering all OWASP Top 10 vulnerability categories
WAF deployment modes
# Mode 1: Detection only (log but do not block) # Use this initially to identify false positives before enabling blocking WAF Mode: Detection | Score requests | Alert on high score | Log everything # Mode 2: Prevention (inline blocking) # WAF blocks requests matching rules — production mode after tuning WAF Mode: Prevention | Block score > threshold | Return 403 | Log + alert # Cloudflare WAF — custom rule example (Terraform) resource "cloudflare_ruleset" "example" { zone_id = var.zone_id name = "Block SQLi in API" kind = "zone" phase = "http_request_firewall_custom" rules { action = "block" expression = "(http.request.uri.path contains \"/api/\" and cf.waf.score.sqli gt 40)" description = "Block SQLi on API endpoints" } }
WAF vs NGFW — the critical distinction

The most common misunderstanding: organisations deploy an NGFW and believe their web applications are protected from SQLi and XSS. They are not. An NGFW sees HTTPS traffic on port 443 — with TLS inspection enabled, it can inspect the payload for known malware signatures and C2 patterns, but it has no semantic understanding of SQL syntax or HTML/JavaScript context. A WAF specifically understands web application attack patterns because it is designed to parse and understand HTTP at the application layer. Both are required for a complete web security posture — NGFW for network-layer control, WAF for application-layer protection.

6. Type 5 — Cloud-native and virtual firewalls
Cloud firewalls — the emerging category
Fastest growing segment

As workloads migrate to the cloud, traditional hardware firewalls at the network perimeter become insufficient. Cloud environments require firewall controls that understand cloud-native concepts — virtual network interfaces, dynamic IP addressing, auto-scaling groups, serverless functions, and container networking — rather than static physical topology.

Cloud-native security groups and VPC firewalls

AWS Security Groups, Azure Network Security Groups (NSGs), and GCP Firewall Rules are cloud-native stateful packet filters. They operate at the virtual network interface level — each EC2 instance, Azure VM, or GCP compute instance has a Security Group that controls inbound and outbound traffic at Layer 3–4. They are automatically applied to all resources in the security group regardless of IP address changes.

# AWS Security Group — web application server example # Inbound rules: only port 443 from anywhere, port 22 from management only aws ec2 authorize-security-group-ingress \ --group-id sg-0abc12345 \ --protocol tcp --port 443 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress \ --group-id sg-0abc12345 \ --protocol tcp --port 22 --source-group sg-mgmt99999 # SSH only from management security group — not a CIDR range # This follows instances even if their IPs change — more secure than IP rules
Cloud-delivered NGFW (FWaaS / SASE)

Firewall-as-a-Service (FWaaS) delivers NGFW capabilities from the cloud without hardware. Traffic is routed through the vendor's cloud Points of Presence (PoPs) rather than backhauled to a central corporate firewall. This solves the performance problem of routing cloud and SaaS traffic through an on-premises NGFW and is the network enforcement mechanism in SASE (Secure Access Service Edge) architectures.

  • Zscaler Internet Access (ZIA) — market-leading FWaaS. Traffic from users anywhere routes through Zscaler PoPs for NGFW inspection, URL filtering, DLP, and threat protection. No hardware required.
  • Palo Alto Prisma Access — cloud-delivered Palo Alto NGFW capabilities with global PoP infrastructure. Brings Palo Alto's App-ID and security profiles to distributed workforces.
  • Cloudflare Gateway — DNS and HTTP filtering at Layer 7, with network firewall for TCP/UDP traffic. Part of Cloudflare Zero Trust.
  • AWS Network Firewall / Azure Firewall — managed NGFW services for filtering traffic within cloud VPCs without deploying firewall appliances. AWS Network Firewall uses Suricata-compatible rules.
7. Side-by-side comparison — all firewall types
TypeOSI LayerStatefulApp awareIPSTLS inspectStops SQLi/XSSBest deployment
Packet FilteringL3–L4NoNoNoNoNoRouter ACLs, simple network edges
Stateful InspectionL3–L4 + stateYesNoNoNoNoNetwork perimeter, inter-VLAN, VPN
NGFWL3–L7YesYesYesYesPartial*Primary perimeter, branch offices, DC edge
WAFL7 onlySession-awareYes — HTTPHTTP attacksTerminates TLSYes — specialistIn front of every web app and API
Cloud Security GroupL3–L4YesNoNoNoNoCloud instance-level access control
FWaaS / SASEL3–L7YesYesYesYesPartial*Distributed workforce, cloud-first orgs

*Partial: NGFW and FWaaS with TLS inspection can detect some web attack signatures but lack the HTTP semantic understanding of a dedicated WAF. A WAF is required for comprehensive OWASP Top 10 protection.

8. Firewalls and the OSI model — which layer each operates at
OSI LayerWhat it carriesFirewall type that inspects hereWhat the inspection catches
Layer 3 — NetworkIP packets — source/destination IP addresses, routing informationPacket filtering, stateful, NGFW, all typesConnections from blocked IP ranges, IP spoofing, geo-blocking
Layer 4 — TransportTCP/UDP segments — ports, TCP flags, sequence numbersPacket filtering, stateful, NGFW, all typesPort scanning, SYN floods, invalid TCP flags, port-based access control
Layer 5 — SessionSession establishment and management (NetBIOS, RPC, SQL*Net)NGFW (via application proxies)Protocol abuse, session anomalies in stateful protocols
Layer 6 — PresentationTLS/SSL encryption, data encodingNGFW with TLS inspection, WAFMalicious TLS certificates, weak cipher suites, TLS tunnelling
Layer 7 — ApplicationHTTP, DNS, SMTP, FTP payload — the actual application dataNGFW (partially), WAF (specialist)SQLi, XSS, malware downloads, C2 DNS queries, data exfiltration payloads, OWASP Top 10
9. Top firewall vendors in 2026
VendorPrimary productStrengthsBest forMarket position
Palo Alto NetworksPA-Series NGFW, Prisma Access (FWaaS)Best-in-class App-ID, strongest security effectiveness ratings, rich telemetry for SIEMEnterprise, high-security environments, zero trust adoptionGartner Leader #1 for 10+ consecutive years
FortinetFortiGate NGFW, FortiSASEHighest firewall throughput (custom ASIC), best price/performance ratio, broad product ecosystemMid-market to enterprise, performance-sensitive environments, SD-WANGartner Leader, highest unit market share by volume
Check PointQuantum NGFW, CloudGuardThreat prevention efficacy, unified management (SmartConsole), strong compliance reportingEnterprise, financial services, compliance-heavy environmentsGartner Leader, dominant in financial services
CiscoSecure Firewall (formerly ASA+FTD), Umbrella (DNS)Deep network ecosystem integration, SD-WAN, existing Cisco infrastructure leverageCisco-centric enterprises, government, educationGartner Challenger — strong in existing Cisco shops
CloudflareCloudflare WAF, Gateway, Magic FirewallGlobal CDN + WAF at extreme scale, DDoS mitigation, zero trust integration, easy APIWeb application protection, FWaaS for distributed teams, API securityWAF market leader by usage; zero trust growing
AWS / Azure / GCPAWS WAF + Network Firewall, Azure Firewall, GCP Cloud ArmorNative cloud integration, zero infrastructure overhead, auto-scalingCloud-native workloads on respective platformsEssential for respective cloud customers
ImpervaCloud WAF, SecureSphere (on-prem)Best-in-class WAF for complex web applications, strong API security, DDoS protectionLarge web applications, API-heavy environments, e-commerceWAF specialist leader
pfSense / OPNsenseOpen-source stateful firewall + add-on packagesFree, flexible, excellent for learning and small environments, active communityHome labs, small businesses, security research, educationLeading open-source firewall platform
10. Corporate deployment framework — layering firewall types

No single firewall type solves all security requirements. A comprehensive corporate network defence uses multiple firewall types at different layers of the architecture — each solving the problems the others cannot. This is the layered defence-in-depth model.

🏗
Corporate firewall deployment framework — where each type belongs
Defence in depth
1
Internet perimeter — NGFW (primary control)
The NGFW sits at the network perimeter between the internet and the DMZ. It performs: application identification and control (block BitTorrent and consumer cloud storage by App-ID), IPS inspection (block known exploit patterns), TLS inspection (decrypt and inspect HTTPS traffic), URL category filtering (block malware and phishing sites), and threat intelligence feed matching (block connections to known bad IPs). Vendor choice: Palo Alto PA-Series or Fortinet FortiGate at this layer.
2
In front of every web application and API — WAF
Every web application and API endpoint that accepts user input needs a WAF. This is not optional. Place the WAF as a reverse proxy in front of each application — cloud WAF (Cloudflare, AWS WAF, Imperva CDN) for externally-facing apps; on-premises WAF or application delivery controller (F5 BIG-IP ASM) for sensitive internal applications. OWASP Top 10 protection, API schema validation, and bot detection operate here.
3
Network segment boundaries — stateful or NGFW
Every VLAN boundary (as defined in the network segmentation guide) needs a firewall enforcing inter-VLAN traffic policy. This can be a Layer 3 switch with ACLs (equivalent to packet filtering) for high-throughput internal segments, or an internal NGFW for segments requiring application-layer inspection — particularly between the server VLAN and the database VLAN, where you want to detect SQL connections initiated from unexpected application servers.
4
Cloud workloads — cloud security groups + cloud WAF
Every cloud instance needs a Security Group (AWS) or NSG (Azure) as the L3–L4 control, following the principle of least privilege: only the ports required for the specific service are open, and only from the specific sources that need access. Public-facing cloud applications additionally need a cloud WAF (AWS WAF, Azure WAF, or Cloudflare in front). Never expose a cloud application directly to the internet without both a security group and a WAF.
5
Remote workforce — FWaaS / SASE
Remote workers connecting to SaaS applications and cloud resources should route through a FWaaS platform (Zscaler ZIA, Palo Alto Prisma Access, Cloudflare Gateway). This provides the same NGFW-level inspection for remote traffic that on-premises users get from the perimeter NGFW — without the performance penalty of backhauling all cloud traffic through a central data centre firewall. ZTNA (covered in the zero trust guide) replaces VPN for application access.
⚠ The most common corporate firewall mistake in 2026 The single most common mistake: organisations deploy an enterprise NGFW at the perimeter and consider their web applications protected. They are not protected against application-layer attacks. The NGFW protects the network. The WAF protects the application. SQLi and XSS pass through the NGFW on port 443 completely undetected — they are valid HTTPS traffic containing malicious HTTP payloads. Every publicly accessible web application and API needs a WAF, regardless of what network-layer firewall protects the perimeter.
43%
of web attacks bypass traditional network firewalls (Verizon DBIR)
90%+
of internet traffic encrypted — NGFW without TLS inspection is largely blind
$5.7B
global NGFW market size in 2026
38%
WAF adoption growth in 2025 driven by API security

⚡ Apply this to your network

  1. Audit which firewall types you currently have — do you have only an NGFW at the perimeter? Are your web applications behind a WAF? Are your network segments separated by firewall policies or just VLANs without enforcement? Map your current state before planning improvements.
  2. Deploy a WAF in front of every public web application — if you have public-facing web applications or APIs without a WAF, this is your highest-priority gap. Cloudflare's free tier WAF and AWS WAF provide entry-level protection. Enable the OWASP Core Rule Set in detection mode first, tune out false positives, then enable blocking mode.
  3. Enable TLS inspection on your NGFW — if you have an NGFW without TLS inspection enabled, you are blind to over 90% of your traffic. Deploy the NGFW CA certificate to managed endpoints via Group Policy and enable TLS inspection for non-sensitive categories. Exclude online banking and healthcare sites.
  4. Learn how firewalls fit network segmentation — firewalls are the enforcement mechanism between network segments. Without firewall policies between VLANs, segmentation is architectural theatre. Network segmentation guide →
  5. Understand how firewalls fit zero trust — NGFW and FWaaS are the network enforcement components of zero trust. ZTNA replaces VPN and complements perimeter firewalls by providing application-level access control for remote users. Zero trust architecture guide →
Frequently asked questions
What are the main types of firewalls?

The main firewall types are: packet filtering (examines IP and port headers of individual packets, stateless), stateful inspection (tracks the state of TCP connections to verify packets are legitimate session traffic), next-generation firewall or NGFW (adds deep packet inspection, application identification, IPS, and TLS inspection to stateful inspection), Web Application Firewall or WAF (Layer 7 specialist that understands HTTP/HTTPS to detect SQLi, XSS, and other web attacks), and cloud firewalls (security groups, cloud WAF, and FWaaS for cloud-native and distributed environments). Enterprise networks typically deploy multiple types in layers.

What is the difference between a stateful and stateless firewall?

A stateless (packet filtering) firewall examines each packet independently with no memory of previous packets. It cannot tell whether an inbound packet is a legitimate response to an outbound request or a new unsolicited connection — it only checks source IP, destination IP, and ports. A stateful firewall maintains a connection state table tracking the full TCP handshake and session state. Return traffic matching an existing established session is automatically permitted, and packets that do not match any known session are blocked — even if they have the correct source/destination IP and port. Stateful firewalls are significantly more secure and have been the standard since the mid-1990s.

What is the difference between a WAF and a firewall?

A traditional firewall (including NGFW) operates at the network layer — it controls which IP addresses and ports can communicate. A Web Application Firewall (WAF) operates at the HTTP application layer — it understands the structure of web requests and can detect attack patterns in query parameters, POST bodies, cookies, and headers. A WAF can detect SQL injection and XSS because it parses HTTP semantics. A traditional firewall cannot — it sees valid HTTPS traffic on port 443 and has no way to see that the payload contains a malicious SQL statement. Both are required: the firewall controls network access, the WAF protects the application from malicious content.

What is a next-generation firewall (NGFW)?

A next-generation firewall (NGFW) combines traditional stateful packet inspection with deep packet inspection (reading packet payload content), application identification (identifying which application is generating traffic regardless of port), user identity awareness (mapping IP addresses to Active Directory users), integrated IDS/IPS (detecting and blocking known attack signatures), TLS/SSL inspection (decrypting encrypted traffic for inspection), and URL category filtering (blocking access to malicious or inappropriate websites). Defined by Gartner in 2009, NGFW is now the standard for enterprise perimeter and internal security, replacing basic stateful firewalls in most deployments.

Does TLS inspection break privacy or compliance?

TLS inspection involves the firewall decrypting, inspecting, and re-encrypting HTTPS traffic — a form of man-in-the-middle inspection that raises legitimate privacy and legal questions. For compliance: most enterprise security frameworks (PCI-DSS, ISO 27001, NIST) accept TLS inspection when it is documented, disclosed to users via acceptable use policies, and implemented with appropriate safeguards. Privacy considerations: exclude genuinely sensitive categories (personal online banking, healthcare portals, email accounts) from inspection. Legal considerations: employment contracts and acceptable use policies should inform employees that corporate traffic is subject to inspection. In many regulated jurisdictions, inspecting employee personal traffic on personal devices is prohibited even on corporate networks.

Which firewall should a small business use?

For a small business, a unified threat management (UTM) appliance or entry-level NGFW provides the best balance of security and simplicity. Fortinet FortiGate 40F–80F series, pfSense (open-source, free software), and Sophos XG are commonly recommended. For web application protection, Cloudflare's free tier WAF is excellent for small businesses with public websites — easy to configure and requires no hardware. The critical security controls for a small business, in priority order: (1) any decent stateful firewall between internet and internal network, (2) separate guest Wi-Fi VLAN for visitors, (3) WAF for any public web presence, (4) cloud DNS filtering (Cloudflare Gateway or Cisco Umbrella) to block malicious domains before they are reached.

What is a FWaaS and how is it different from a traditional firewall?

Firewall-as-a-Service (FWaaS) delivers NGFW security capabilities from the cloud rather than from a hardware appliance. Instead of routing traffic through an on-premises firewall, traffic from users and devices is directed to the vendor's cloud PoPs (Points of Presence) where it is inspected and forwarded. FWaaS eliminates hardware procurement and maintenance, scales elastically with traffic volume, and provides consistent security policy regardless of where users are located — office, home, or travel. Traditional firewalls require backhauling traffic to a central location; FWaaS inspects traffic at the nearest PoP, typically reducing latency for cloud and SaaS applications. FWaaS is a core component of SASE (Secure Access Service Edge) architectures from vendors like Zscaler, Palo Alto Prisma, and Cloudflare.

About the author Written by the HOC Team at Hackers Online Club — a cybersecurity community trusted by network security engineers, SOC analysts, penetration testers, and security students since 2010. 15+ years of free practical cybersecurity tutorials, network security guides, and corporate security resources. Learn more about HOC →