The word “firewall” has quietly misled millions of people for thirty years. It sounds like a wall — a solid barrier that keeps bad things out and safe things in. That mental image is the single most common reason organizations with expensive firewalls still get breached, because a firewall isn’t a wall at all. It’s a doorman who checks a guest list, and the entire security of your network depends on how that list was written.
If you’ve ever wondered what a firewall actually does — beyond the vague sense that it “blocks hackers” — this guide will make every network you ever touch make more sense. No jargon, no prior security knowledge required. By the end you’ll understand what a firewall protects, the exact point where that protection ends, the different types you’ll encounter, and why “we have a firewall” has never been the same thing as “we’re secure.”
2. The assumption hidden in the name
3. How a firewall actually works
4. The main types of firewalls
5. Why a firewall isn’t enough on its own
6. The mental model to keep forever
7. Frequently asked questions
1. What a firewall really is
A firewall is one of the oldest and most fundamental pieces of network security. Nearly every network on earth has one — your home router contains a basic firewall, and every corporate network is ringed by far more sophisticated versions. Its purpose is to sit between two networks, usually your internal network and the wider internet, and control which traffic is allowed to pass between them. That’s the job. Nothing more mysterious than that.
The concept dates back to the late 1980s, when the internet was small enough that connecting to it felt like leaving your front door open to a growing neighborhood of strangers. Engineers needed a way to decide which visitors could come in and which should be turned away at the edge. The name borrowed from building architecture, where a “firewall” is a physical barrier that stops fire from spreading between sections. That borrowed word is exactly where the confusion started, because the two things do very different jobs.
Understanding what a firewall genuinely does — and just as importantly, what it doesn’t do — is one of the most clarifying things you can learn in security. The gap between what people think a firewall does and what it actually does is enormous, and that gap has real consequences. Organizations make costly security decisions based on the comforting but false belief that being behind a firewall means being protected.
2. The assumption hidden in the name
The assumption is right there in the word. A firewall sounds like a barrier — something that stops threats the way a physical wall stops intruders. From this image flows a whole set of beliefs: that a firewall inspects threats and blocks the dangerous ones, that being inside the firewall means being safe, and that it’s actively hunting for attacks. Most people, including a surprising number of IT professionals, carry some version of this picture.
A traditional firewall doesn’t understand threats. It doesn’t know what an attack looks like. It only knows the rules it was given about what traffic to allow and what to block — and it follows those rules with perfect, unthinking obedience.
This is the critical misunderstanding. A firewall is not intelligent and it is not vigilant. It’s a rule-follower. If the rules say “allow traffic coming in to the web server on the standard web port,” the firewall allows every bit of traffic matching that description — the legitimate visitors and the attacker exploiting a flaw in that web server, indistinguishably. The firewall isn’t failing when it lets the attack through. It’s doing precisely what it was told. The doorman checked the list, the guest was on it, and in they walked.
3. How a firewall actually works
A firewall works by examining traffic and comparing it against a set of rules. The classic version makes its decisions based on a few simple properties of each connection: where the traffic is coming from (the source), where it’s going (the destination), and which port it’s trying to reach. A port is essentially a numbered door on a machine — web traffic conventionally uses one door, email another, remote access yet another. The firewall’s rules say which doors may be opened, from where, and to where. Everything else gets turned away.
That diagram shows the whole problem in one picture. The doorman checks whether a guest is on the list — but he doesn’t know the guest’s intentions. If an attacker’s traffic matches an allowed rule, it passes, no matter what that traffic intends to do once inside. A business has to allow traffic to its web server, or nobody could visit the website. That allowed pathway is a legitimate open door, and an attacker exploiting a vulnerability in the web application walks straight through it using the exact same door as every real customer. The attack didn’t defeat the firewall — it used a door the firewall was configured to hold open.
4. The main types of firewalls
Not all firewalls check the same things. As attacks grew more sophisticated, firewalls did too — but each generation still follows the same core logic of matching traffic against rules. Understanding the types helps you see both how far the technology has come and why the fundamental limitation never went away.
Packet-filtering firewalls are the original and simplest. They look only at the basic envelope of each packet — source, destination, and port — and decide allow or deny. Fast and lightweight, but they have no idea what’s inside the traffic or whether a connection makes sense in context. This is the pure “doorman with a list” model.
Stateful inspection firewalls added memory. Instead of judging each packet in isolation, they track whole conversations — so they can tell the difference between a reply you asked for and an unsolicited connection pretending to be one. This is the doorman who remembers who he let in, and won’t be fooled by someone claiming “I’m just coming back from the restroom” when he never entered.
Next-generation firewalls (NGFW) are what most organizations run today. They can inspect the actual content of traffic, recognize specific applications regardless of which port they use, and pull in threat intelligence to spot known-bad sources. They’re a dramatically smarter doorman with a dramatically better list. But — and this is the point — they are still a doorman checking a list. A next-generation firewall can only act on the rules, signatures, and patterns it has been given. It cannot judge intent it has never been taught to recognize.
5. Why a firewall isn’t enough on its own
The blind spot that matters mostA firewall mainly watches the doors coming in. It’s far less concerned with what leaves than what enters. So when malware inside your network phones home to an attacker — or quietly ships your data out — it often uses the same ordinary web doors the firewall was told to keep open. The threat was already inside. The doorman only watches the entrance.
This is why a firewall, however advanced, is one layer and never the whole defense. Once an attacker is through an open door — whether by exploiting your website, tricking an employee, or riding in on a trusted connection — the firewall’s job is largely done. It was built to control who gets in, not to hunt for what’s already inside or to notice your own data quietly walking out. Modern security recognizes this, which is why firewalls sit alongside other controls: monitoring for suspicious internal activity, protecting the applications behind the open ports, and limiting how far any single compromise can spread. Security professionals call this defense in depth — the principle that no single control should be trusted to stand alone.
6. The mental model to keep forever
Here’s the shift worth carrying: a firewall controls access, it doesn’t provide safety. Those are different things, and confusing them is where the danger lives. Access control means deciding who and what is allowed to communicate — a genuinely valuable function that dramatically reduces the ways an attacker can reach you. But every door you must leave open for your business to function is a door that access control alone cannot protect. The firewall narrows the entrances. It does nothing about what comes through the entrances you’re required to keep open.
This is why “we have a firewall” is never an answer to “are we secure?” The right questions are different ones. What doors have we opened, and do we truly need every one of them? What’s protecting the things behind those open doors — the web application, the server, the data? And who’s watching what leaves, not just what enters? A firewall is a foundational, necessary layer. It is never a complete defense, and the moment anyone treats it as one, they’ve stopped thinking about the doors they were forced to leave open — which are precisely the doors an attacker is counting on.
7. Frequently asked questions
Does a firewall stop viruses and malware?
Not directly, and not reliably. A traditional firewall controls which connections are allowed — it isn’t designed to scan files for malware. Malware often arrives through channels the firewall permits (like web traffic or email) and can leave the same way. Antivirus and endpoint protection handle that job; the firewall handles access.
If I have a firewall, do I still need antivirus?
Yes. They solve different problems. The firewall decides who can connect; antivirus and endpoint tools deal with malicious files and behavior once something is on a device. Relying on either alone leaves a large gap.
What’s the difference between a hardware and a software firewall?
A hardware firewall is a dedicated device guarding a whole network at its edge. A software firewall runs on an individual computer, protecting just that machine. Most environments use both — one at the network boundary, one on each device — as layers.
Can a firewall be hacked?
More often it’s bypassed than “hacked.” Attackers don’t usually break the firewall itself — they travel through a door it was configured to keep open, or they trick a person inside into opening a path. Misconfigured rules are a far more common weakness than flaws in the firewall software.
Security, Decoded.
If this made firewalls click, you’ll like the newsletter. One security idea, decoded clearly, every week — free.
Subscribe to SKB Decoded →

