What types of firewall are there?
Main types of firewall
1. Packet Filtering Firewall
The simplest type of firewall.
How it works:
- checks each packet individually;
- looks at IP addresses, protocols and ports;
- does not "remember" previous packets.
Pros:
- fast;
- simple to implement.
Cons:
- does not understand the connection's context;
- weak protection.
Works mostly at the network layer (L3).
2. Stateful Firewall
The most common type of firewall.
How it works:
- tracks connection state;
- understands which packet is a request and which is a reply;
- passes only legitimate traffic.
Pros:
- much safer than packet filtering;
- protects well against many attacks.
Cons:
- requires more resources.
Works at the network and transport layers (L3-L4).
3. Application Firewall (Application Layer Firewall)
A firewall at the application layer.
How it works:
- analyzes traffic content;
- understands application protocols (HTTP, FTP, SMTP);
- can block attacks at the application layer.
Pros:
- high accuracy;
- protection against attacks on applications.
Cons:
- slower;
- harder to configure.
Works at the application layer (L7).
4. Web Application Firewall (WAF)
A specialized firewall for web applications.
How it works:
- protects HTTP/HTTPS;
- blocks SQL injection, XSS and other web attacks.
Pros:
- excellent protection for websites;
- filters web traffic specifically.
Cons:
- protects only web applications.
Often used together with a regular firewall.
5. Proxy Firewall
Works as an intermediary between client and server.
How it works:
- the client connects to the proxy;
- the proxy connects to the server itself;
- there is no direct connection.
Pros:
- hides the internal network;
- can filter content.
Cons:
- latency;
- harder to administer.
6. Next-Generation Firewall (NGFW)
A modern, "smart" firewall.
What it can do:
- stateful filtering;
- application analysis;
- IDS/IPS;
- user control;
- SSL inspection.
It effectively combines several security tools in one.
Brief comparison
| Firewall type | Layer | Characteristic |
|---|---|---|
| Packet filtering | L3 | Simple filtering |
| Stateful | L3-L4 | Understands connections |
| Application | L7 | Analyzes content |
| WAF | L7 | Protects web applications |
| Proxy | L7 | Works as an intermediary |
| NGFW | L3-L7 | Maximum protection |
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.