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.
Topic: Network Security in Cybersecurity & Ethical Hacking · Explainer
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?
- What Is a Packet-Filtering Firewall?
- What Is a Stateful Firewall?
- What Is a Proxy or Application Firewall?
- What Is a Next-Generation Firewall?
- What Is a Web Application Firewall?
- Where Can Firewalls Be Deployed?
- How Do You Combine Them?
- References
How Do Firewall Types Compare?
| Type | Inspects | Strength | Limitation |
|---|---|---|---|
| Packet filter | IP, port, protocol | Fast, simple | No connection or content awareness |
| Stateful | Headers plus connection state | Blocks unsolicited traffic | Limited content inspection |
| Proxy / application | Full protocol content | Deep control, hides internal hosts | Slower, protocol-specific |
| NGFW | Applications, users, threats | Granular policy, IPS | Cost, complexity, encrypted traffic |
| WAF | HTTP requests and responses | Blocks web attacks | Web 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?
| Deployment | Examples |
|---|---|
| Network perimeter | Appliances between the internet and internal networks |
| Internal segmentation | Firewalls between zones such as users and servers |
| Host-based | Windows Firewall, nftables, UFW |
| Cloud | Security groups, network security groups, managed cloud firewalls |
| Firewall as a service | Cloud-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
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0