Every network has a front door. And just like the front door of a building, someone has to decide who gets in, who gets out, and what they are carrying. In networking, that someone is a firewall.
What Firewalls Actually Do#
A firewall is a network security device that monitors and controls incoming and outgoing traffic based on a set of predetermined rules. It sits between trusted and untrusted networks, making decisions about every packet that tries to cross the boundary.
But here is something that trips people up: firewalls are not magic. Understanding what a firewall cannot protect against is just as important as knowing what it can.
What Firewalls Cannot Stop#
- Insider attacks: A firewall monitors the perimeter. If the threat is already inside your network, the firewall never sees it
- Connections that bypass it: Rogue wireless access points, unauthorized VPN tunnels, or direct physical connections all skip the firewall entirely
- Malware inside encrypted traffic: If traffic is encrypted end-to-end, traditional firewalls cannot inspect the payload
- Social engineering: No firewall on earth can stop a user from clicking a phishing link or handing over their credentials
The takeaway: a firewall is your first line of defense, not your only one.
The Four Generations of Firewalls#
Firewalls have evolved significantly since their introduction. Each generation added capabilities that addressed the shortcomings of the previous one.
1st Generation: Packet Filter Firewalls#
The original firewall concept. These operate at OSI Layers 3 and 4, performing stateless inspection where each packet is examined completely independently.
Decisions are based on:
- Source and destination IP addresses
- MAC addresses
- Protocol type
- Source and destination ports
After making a permit or deny decision, the firewall forgets the packet ever existed. There is no memory of previous packets or connection context.
Strengths: Fast, scalable, solid first line of defense. Weaknesses: No application awareness, cannot track connection state, easily fooled by spoofed packets.
2nd Generation: Stateful Firewalls#
The breakthrough. Stateful firewalls operate at Layers 3 through 5 and maintain a state table that tracks every active connection passing through.
For each packet, a stateful firewall determines whether it is:
- The start of a new connection (SYN)
- Part of an existing connection
- Termination of a connection (FIN/RST)
This means return traffic for established connections is automatically allowed without needing an explicit rule. It also enables detection of attacks like SYN floods by watching for abnormal connection patterns.
| Feature | Stateless (Packet Filter) | Stateful |
|---|---|---|
| Connection tracking | No | Yes, maintains state table |
| Return traffic handling | Must explicitly permit | Automatically allowed for established connections |
| OSI layers | Layer 3-4 | Layer 3-5 |
| Attack detection | Very limited | SYN floods, sequence number anomalies |
The key difference comes down to connection awareness. A stateless firewall treats every single packet as a stranger. A stateful firewall remembers conversations.
3rd Generation: Application-Level Firewalls#
This generation splits into two distinct approaches:
Proxy Firewalls create separate connections with both the client and the server. The client never talks directly to the server. Instead, the proxy receives the request, inspects it, and creates a brand new connection to the server on the client's behalf.
This approach recreates packets from scratch, which sanitizes any malicious content. The tradeoff is performance. Each application (HTTP, FTP, SMTP) needs its own dedicated proxy, and the extra processing adds latency.
Deep Packet Inspection (DPI) firewalls work transparently, meaning they do not break the connection. Instead, they inspect packets across all seven OSI layers. They can categorize traffic by application (spotting Skype, BitTorrent, or streaming services regardless of port) and provide IDS/IPS functionality. They can also inspect outbound data to prevent data exfiltration.
4th Generation: Next-Generation Firewalls (NGFW)#
NGFWs combine everything from previous generations into a single platform:
- Application awareness: Identifies applications regardless of port, protocol, or encryption
- Integrated IPS: Built-in intrusion prevention, not bolted on
- Deep packet inspection with anti-malware capabilities
- SSL/TLS decryption: Can break open encrypted traffic for inspection
- User-based policies: Security rules tied to user identity, not just IP addresses
Modern ML-Powered NGFWs (2020 and beyond) take this further with inline machine learning that inspects files during download and blocks threats instantly. They deliver zero-delay signature updates within seconds rather than hours. They provide ML-powered IoT visibility that discovers and secures IoT devices automatically. And they generate automated policy recommendations based on observed behavior patterns.
Firewall Architectures#
How you position a firewall matters as much as what type you use. There are several established architectural patterns.
Dual-Homed (Two-Leg Perimeter)#
The simplest setup. A single firewall sits between two networks with two interfaces: one facing the internal network, one facing the external. A special case is the screening router, where the router itself performs firewall functions.
Single-Homed Bastion Host#
A heavily hardened server that provides proxy services. All external traffic must go through the bastion host. It runs minimal services, has extensive logging, and is treated as a high-value target that will eventually be compromised.
Screened Host#
Combines a screening router with a bastion host. The screening router handles initial packet filtering while the bastion host provides application-level proxy services. The advantage is eliminating a single point of failure. The disadvantage: if the bastion host is compromised, the attacker lands directly on the internal network.
Screened Subnet#
This is the architecture that matters most for real-world deployments. It adds a perimeter network between the internal network and the internet:
- External router (Access router): Protects the perimeter network from the internet
- Perimeter network: Contains the bastion host. Even if the bastion is compromised, the attacker is trapped in the perimeter
- Internal router (Choke router): Controls access between the perimeter and internal network
Both routers enforce the same packet filtering rules for protecting the internal network. The critical insight: the perimeter network isolates any breach, preventing direct access to internal resources.
Multi-Homed (Three-Leg Perimeter / DMZ)#
The firewall has three or more interfaces: Internal, External, and one or more DMZ segments. This is the most common enterprise architecture.
The DMZ: Your Public-Facing Buffer Zone#
The DMZ is a perimeter network segment that hosts services accessible from the untrusted network. It is not "inside" your network and it is not "outside" either. It occupies its own security zone with its own rules.
The purpose is straightforward: expose public services (web servers, email servers, DNS, FTP) without exposing your internal network. External attackers who compromise a DMZ server still cannot reach internal resources directly.
Common DMZ services:
- Web servers
- Public-facing email servers
- DNS servers
- FTP servers
- Reverse proxies
CBAC: The Predecessor to Modern Zone-Based Firewalls#
Context-Based Access Control was introduced by Cisco in 1997 as an IOS feature that went beyond basic ACL filtering.
What CBAC Brought to the Table#
- Stateful packet filtering at Layer 5 (session layer)
- Traffic inspection that detects SYN floods and tracks TCP sequence numbers
- Intrusion detection by monitoring half-opened TCP connections
- Auditing and alerting capabilities
How It Worked#
CBAC stored connection information in a state table and dynamically created temporary ACL entries to permit return traffic. When a connection terminated, those temporary entries were automatically removed.
Why It Was Replaced#
CBAC had a fundamental design flaw: its default policy was allow all. You had to explicitly configure which traffic to inspect. Anything not explicitly inspected passed through freely.
In 2006, Cisco introduced the Zone-Based Policy Firewall (ZPF) in IOS 12.4(6)T with the opposite philosophy: deny all by default. Traffic between zones is denied unless a policy explicitly permits it. ZPF also introduced a cleaner configuration model using class-maps and policy-maps instead of per-interface inspection rules.
Takeaways#
- Firewalls are essential but not sufficient on their own. They cannot stop insider threats, social engineering, or traffic that bypasses them
- The four generations build on each other: packet filter, stateful, application-level (proxy and DPI), and NGFW with ML
- Architecture matters. The screened subnet isolates breaches by adding a perimeter network between attacker and target
- The DMZ is a separate security zone for public services, not just "the outside"
- CBAC was stateful but defaulted to allow-all. ZPF replaced it with deny-all, which is the foundation of modern Cisco firewall policy


Comments (0)
Sign in to join the conversation