Types of Firewalls Explained: From Packet Filters to NGFW and WAF

Firewalls can be grouped by how deeply they inspect traffic and where they run.

Jul 21, 2025 - 10:44
Updated: 
103k

Network Security in Cybersecurity & Ethical Hacking · Explainer

Types of Firewalls Explained: From Packet Filters to NGFW and WAF

Quick answer: Firewalls can be grouped by how deeply they inspect traffic and where they run. Packet-filtering firewalls check addresses and ports; stateful firewalls also track connections; proxy or application-level firewalls understand protocols such as HTTP; next-generation firewalls (NGFW) add application identification, user awareness and intrusion prevention; and web application firewalls (WAF) protect web apps from attacks such as SQL injection. By deployment, firewalls can be network appliances, host-based software on each device, or cloud services. Most organisations combine several types in layers.

Key takeaways

  • Inspection depth ranges from headers only to full application content.
  • Stateful inspection is the baseline for modern network firewalls.
  • NGFWs add application awareness and intrusion prevention.
  • WAFs protect web applications and complement, not replace, network firewalls.
  • Host and cloud firewalls protect individual workloads wherever they run.

Table of Contents

How Do Firewall Types Compare?

TypeInspectsStrengthLimitation
Packet filterIP, port, protocolFast, simpleNo connection or content awareness
StatefulHeaders plus connection stateBlocks unsolicited trafficLimited content inspection
Proxy / applicationFull protocol contentDeep control, hides internal hostsSlower, protocol-specific
NGFWApplications, users, threatsGranular policy, IPSCost, complexity, encrypted traffic
WAFHTTP requests and responsesBlocks web attacksWeb traffic only, needs tuning

NIST SP 800-41 describes these technologies and how to build firewall policy.

What Is a Packet-Filtering Firewall?

It applies rules to each packet independently based on source and destination IP, ports and protocol. Router access control lists are a common example:

! Cisco ACL: allow web traffic to a server, deny everything else to it
access-list 110 permit tcp any host 203.0.113.10 eq 443
access-list 110 deny   ip any host 203.0.113.10

What Is a Stateful Firewall?

It tracks connections, so replies to traffic you started are allowed automatically, while unsolicited inbound packets are dropped. Linux nftables and most network firewalls work this way:

# nftables: allow established connections and SSH, drop the rest
nft add rule inet filter input ct state established,related accept
nft add rule inet filter input tcp dport 22 accept
nft add rule inet filter input drop

What Is a Proxy or Application Firewall?

A proxy terminates the client's connection and opens a new one to the server, inspecting the full protocol in between. Web proxies can filter URLs and scan downloads; email gateways inspect SMTP. Proxies hide internal addresses but add latency and must understand each protocol.

What Is a Next-Generation Firewall?

NGFWs combine stateful inspection with application identification (recognising applications regardless of port), user identity integration, intrusion prevention, URL filtering and often TLS inspection. Policies can say "allow Microsoft Teams for staff, block file sharing apps". See our next-generation firewall guide.

What Is a Web Application Firewall?

A WAF sits in front of web applications and inspects HTTP traffic for attacks such as SQL injection, cross-site scripting and path traversal, often using the OWASP Core Rule Set. It can run as a cloud service, a reverse proxy or a server module. The OWASP WAF page explains the concept. WAFs need tuning to avoid blocking legitimate users and do not replace secure coding.

Where Can Firewalls Be Deployed?

DeploymentExamples
Network perimeterAppliances between the internet and internal networks
Internal segmentationFirewalls between zones such as users and servers
Host-basedWindows Firewall, nftables, UFW
CloudSecurity groups, network security groups, managed cloud firewalls
Firewall as a serviceCloud-delivered firewalls within SASE platforms

How Do You Combine Them?

  • Perimeter NGFW or cloud firewall for internet traffic.
  • Internal firewalls or cloud security groups for segmentation.
  • Host firewalls on every server and laptop.
  • WAF in front of public web applications and APIs.
  • Central logging from all firewalls for monitoring.

Related: firewall vs antivirus and cloud firewalls. WebAsha offers firewall and network security training.

References

Frequently Asked Questions

Packet-filtering, stateful, proxy or application-level, next-generation firewalls and web application firewalls.

A firewall that tracks connections, allowing replies to outbound traffic and blocking unsolicited inbound packets.

Application identification, user awareness, intrusion prevention, URL filtering and often TLS inspection.

Protecting web applications from attacks such as SQL injection and cross-site scripting.

No. A WAF protects web traffic; network firewalls control all traffic types.

Firewall software running on an individual device, such as Windows Firewall or nftables on Linux.

Yes. They are stateful firewalls applied to cloud resources.

A stateful or NGFW router at the edge, host firewalls on devices and a WAF for public web apps.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.