A packet filtering firewall is a firewall that inspects the header of each network packet — source and destination IP address, protocol, and source and destination port — and allows or drops the packet based on an ordered list of rules. It is stateless, meaning it judges each packet on its own without remembering earlier packets, and it does not inspect packet contents.
Key takeaways
- A packet filter judges each packet by its header alone: IP addresses, protocol and ports.
- It is fast and simple, but stateless — it cannot tell a legitimate reply from a forged packet.
- Use packet filtering as one layer, with stateful inspection and application controls on top.
Every packet that crosses a network carries a label: where it came from, where it is going, which protocol it uses and which port it is aimed at. A packet filtering firewall reads that label, checks it against a list of rules, and decides in a fraction of a millisecond whether the packet lives or dies.
What is a packet filtering firewall?
A packet filtering firewall is a firewall that inspects the header of each packet and allows or drops it based on rules keyed to source and destination IP address, protocol, and source and destination port. It does not look inside the packet, and it does not remember earlier packets.
NIST defines firewalls in SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy, as devices or programs that control the flow of network traffic between networks or hosts with differing security postures. Packet filtering is the oldest and simplest of the firewall technologies the guide describes, and it remains the foundation of almost every firewall sold today.
The key word is stateless. A packet filter treats each packet as a stranger. It has no memory of the packet that came before it, no idea whether this packet is part of a conversation your network started, and no interest in what the packet contains.
How does a packet filtering firewall work?
A packet filter sits on a network path — in a router, on a server, or at the edge of a network — and examines every packet that passes. For each packet it reads the header fields, walks through its rule list in order, and applies the first rule that matches. If no rule matches, the default policy applies.
The header fields a packet filter can use are: source IP address, destination IP address, protocol (TCP, UDP, ICMP and others), source port, destination port, the network interface the packet arrived on, and the direction of travel. For TCP packets it can also look at flags such as SYN, which marks the start of a connection.
Rule order matters. Most packet filters apply the first matching rule and stop. A broad allow rule placed above a specific deny rule will let through traffic the deny rule was meant to stop. That is why firewall rule sets are reviewed from the top down, not just as a list of individual rules.
What do packet filtering rules look like?
A packet filtering rule set for a small web server might be only five rules long. That brevity is the point: the shorter the list, the easier it is to audit.
| Rule | Source | Destination | Protocol / Port | Action |
|---|---|---|---|---|
| 1 | Any | Web server | TCP 443 (HTTPS) | Allow |
| 2 | Any | Web server | TCP 80 (HTTP) | Allow |
| 3 | Office IP range | Web server | TCP 22 (SSH) | Allow |
| 4 | Any | Web server | TCP 22 (SSH) | Deny |
| 5 | Any | Any | Any | Deny |
Rule 3 shows the pattern that matters most: administrative access is allowed only from a known source. Rule 4 then denies SSH from everyone else, and rule 5 is the default-deny catch-all. Without rule 5, anything not listed would pass — which is the opposite of a security policy.
In practice, packet filters also need rules for reply traffic. Because a stateless filter cannot tell a reply from a new connection, allowing web traffic out usually means allowing traffic back in from port 443 — a broad rule that an attacker can exploit by sending packets that claim to come from port 443. That weakness is exactly why stateful inspection was invented.
Packet filtering vs stateful inspection: what is the difference?
Packet filtering and stateful inspection answer the same question — should this packet pass? — with different amounts of memory. A packet filter remembers nothing. A stateful firewall keeps a table of active connections and checks each packet against it.
| Packet filtering | Stateful inspection | Next-generation firewall | |
|---|---|---|---|
| Inspects | Headers only | Headers + connection state | Headers, state, application, content |
| Memory | None — stateless | Connection table | Connection + application state |
| Reply traffic | Needs a broad allow rule | Allowed automatically for known sessions | Allowed automatically |
| Speed | Very fast | Fast | Slower, more processing |
| Can spot forged packets? | No | Yes, if no matching session exists | Yes |
| Sees malware in content? | No | No | Yes, with inspection |
| Typical use | Router ACLs, cloud security groups | Standard business firewall | Enterprise perimeter |
A stateful firewall records a connection when a client inside the network opens it, then automatically allows the replies. A packet claiming to belong to a TCP session the firewall never saw opened is dropped, even if its addresses and ports would match an allow rule. That single difference closes the port-443 forgery hole described above.
Next-generation firewalls add application awareness and deep packet inspection on top of stateful filtering. They can tell that traffic on port 443 is actually a file-sharing app, not a browser, and block it on that basis. Packet filtering cannot do any of that — which is why it is a layer, not a complete defense.
What are the advantages of packet filtering?
Packet filtering has three real strengths: speed, simplicity and transparency. Because it only reads headers, a packet filter can process traffic at line speed with almost no latency. That matters on fast links and on small devices such as routers, where there is no spare processing power for deep inspection.
Simplicity is a security advantage in itself. A five-rule packet filter can be audited in minutes, and its behavior is easy to predict. A complex firewall with hundreds of application rules is harder to reason about, and misconfigurations hide in the complexity. NIST's guidance recommends rulesets that are as specific as possible for the traffic they control — a principle packet filtering makes easy to follow.
Packet filtering is also transparent to users. It does not break encryption, does not need certificates installed on devices, and does not slow down legitimate traffic. That is why it survives inside every modern firewall: the advanced features sit on top of it, not instead of it.
What are the limitations of packet filtering?
The limitations follow directly from what a packet filter cannot see. It cannot see packet contents, so it cannot detect malware, SQL injection, or a phishing page served over HTTPS. It cannot see the application, so it cannot tell a browser from a command-and-control channel using the same port.
- Statelessness: it cannot distinguish a legitimate reply from a forged packet with the same header fields.
- No content inspection: anything hidden in the payload passes straight through.
- Port-based rules are brittle: attackers routinely tunnel traffic over port 443, the one port almost every firewall allows.
- No user or application awareness: a rule can allow a port, but not a person or an application.
- Fragmentation and spoofing: crafted packets can evade simple header checks if the filter is not configured to handle fragments and spoofed addresses.
None of these limitations makes packet filtering useless. They make it insufficient on its own. A packet filter is the fence around the property; you still need locks on the doors and someone watching the cameras.
Where are packet filtering firewalls used today?
Packet filtering is everywhere, usually under another name. Router access control lists are packet filters. Cloud security groups in AWS, Azure and Google Cloud are packet filters. The host firewall on a Linux server, configured through nftables, is a packet filter with stateful extensions. Windows Firewall filters by program, address, protocol and port — packet filtering with application awareness added.
On a home network, your router's firewall is doing packet filtering right now: blocking unsolicited inbound connections while allowing the replies to connections you started. On a business network, packet filtering is the first check at the perimeter, before stateful inspection and application controls take over. The full text of SP 800-41 Rev. 1 describes these placements in detail. Our guide to how to secure your Wi-Fi covers the home side of the same controls.
Packet filtering is also the right tool when you need to block something quickly and simply — a single hostile IP address, a port that should never be exposed, or all traffic from a country you do not serve. A one-line rule does that job better than a complex policy.
How do you set up packet filtering safely?
The safest setup follows NIST's core recommendation from SP 800-41 Rev. 1: deny by default, then allow only the traffic you explicitly need. Everything not expressly permitted is blocked.
- List the services you must expose. For most small organizations that is a website on ports 80 and 443, and nothing else inbound.
- Allow those services from anywhere, or from specific sources where possible. Administrative access such as SSH on port 22 and RDP on port 3389 should never be open to the whole internet — restrict them to your office IP range or require a VPN.
- Deny everything else explicitly. A final deny-all rule makes the default policy visible and auditable.
- Log denied packets. Denied traffic is your early warning system: a sudden rise in denied packets often means someone is scanning you.
- Review the rules regularly. Rules accumulate over time as people add temporary allows and forget to remove them. A quarterly review catches the ones that should have expired.
- Test from outside. Use an external port scan to confirm that only the ports you intended are reachable. Our free SSL checker covers the web-facing side of the same check.
Keep the rule set short. Every rule is a decision someone must understand later, and a 200-rule packet filter is a 200-opportunity misconfiguration. If the list is growing, that is a sign you need stateful or application controls to express the policy more cleanly.
The bottom line
A packet filtering firewall is the simplest firewall there is: it reads packet headers, checks them against an ordered rule list, and allows or drops each packet. It is fast, transparent and easy to audit — and blind to content, stateless, and easy to fool with forged headers.
Use it as the first layer, not the only layer. Put packet filtering at the edge, stateful inspection behind it, and application controls where they matter. And keep the rule set short, default-deny, and reviewed regularly. Check what your own site exposes with the free SSL checker.
Frequently asked questions
What is a packet filtering firewall in simple terms?
It is a gatekeeper that reads the address label on every packet of network traffic and checks it against a list of rules. If the label matches an allow rule, the packet passes; if it matches a deny rule or no rule at all, it is dropped.
What does a packet filtering firewall check?
It checks the packet header: source and destination IP address, the protocol such as TCP or UDP, and the source and destination port numbers. Some packet filters also check the network interface and the direction of travel.
Is a packet filtering firewall stateless or stateful?
Stateless. A packet filter judges each packet on its own and keeps no memory of earlier packets in the same connection. Stateful firewalls add a connection table so they can tell whether a packet belongs to a connection that was already opened.
What is the difference between a packet filtering firewall and a stateful firewall?
A packet filter looks only at headers and has no memory. A stateful firewall tracks active connections and automatically allows reply packets for connections it has seen established, while dropping packets that claim to belong to a session that was never opened.
Can a packet filtering firewall block malware?
No, not by itself. A packet filter cannot see inside a packet, so it cannot detect malware, phishing pages or attack patterns in the content. It can only block traffic to or from addresses and ports you have listed in its rules.
Where are packet filtering firewalls used today?
They are used in routers as access control lists, in cloud security groups, in host firewalls such as Linux nftables and Windows Firewall, and as the first layer inside more advanced firewalls. Almost every modern firewall still does packet filtering underneath its other features.
What is an example of a packet filtering rule?
Allow inbound TCP traffic to destination port 443 on the web server, deny inbound TCP traffic to port 22 from the public internet, and deny everything else. That is a default-deny rule set: only the traffic you explicitly allow gets through.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against NIST SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy (September 2009).
How we write and fact-check →