Key Takeaway:
A firewall is a set of rules that decides which network connections are allowed. At home you almost certainly have two already: your router blocks connections from the internet that nothing inside asked for, and your computer’s built-in firewall does the same for that one device, even on someone else’s Wi-Fi. They block uninvited connections well. They don’t stop phishing, a malicious download you run yourself, or anything you’ve allowed through. Check both are on, then check from outside with a port scan.
The word gets used for everything from a setting in Windows to a rack-mounted box in a data centre. Here’s what they all have in common, which ones protect you at home, and how to check they’re doing their job.
What a Firewall Does
Every connection has a source, a destination and a port, which identifies the service, such as a website or remote desktop. A firewall looks at each one and applies its rules: allow, block, or block silently. Two ideas explain most of what home firewalls do:
- Inbound vs outbound. Connections you start, like opening a website, are outbound. Connections someone else starts towards you are inbound. Home firewalls are strict about inbound and relaxed about outbound.
- Stateful inspection. The firewall remembers the connections you started, so the replies are let back in. Anything arriving that doesn’t belong to one of your connections is dropped. That’s how your computer can browse freely while staying unreachable to people scanning the internet.
Types of Firewall
| Type | What it looks at | Where you’ll find it |
|---|---|---|
| Packet filter | Addresses and ports of each packet, one at a time | Simple routers, access lists on network equipment |
| Stateful firewall | Whole connections, remembering which ones you started | Home routers, Windows, macOS and Linux firewalls |
| Application firewall | Which program is connecting, or the content itself | Per-app rules on computers; web application firewalls in front of websites |
| “Next-generation” firewall | All of the above, plus threat signatures and filtering | Businesses |
There’s also the split between a network firewall, which protects everything behind it (your router), and a host firewall, which protects the one device it runs on (Windows, macOS, Linux). Home users benefit from both: the router covers devices that can’t run a firewall themselves, like TVs and cameras, and the host firewall goes with your laptop to the café.
Firewall #1: Your Router
Home routers share one public address between all your devices using NAT. A side effect is that a connection arriving from the internet has nowhere to go unless a device inside asked for it. Most routers add a proper stateful firewall on top. Our article on what a NAT firewall is explains exactly what this blocks and what it doesn’t.
Things that punch holes in it, on purpose or not:
- Port forwarding rules, which send outside connections to a device inside. See what port forwarding is.
- UPnP, which lets apps and consoles open ports for themselves without asking you.
- Remote management, which makes the router’s own admin page reachable from the internet.
- IPv6. Each device gets its own public address and NAT no longer stands in the way, so the router’s IPv6 firewall setting is what keeps devices unreachable. Make sure it’s on.
Firewall #2: Your Computer
Windows
Microsoft Defender Firewall is built in. Check it under Settings, then Privacy & security, then Windows Security, then Firewall & network protection, or in PowerShell:
Get-NetFirewallProfile | Select-Object Name, EnabledYou’ll see three profiles, Domain, Private and Public, and all three should say True. Windows applies a different profile depending on how you’ve labelled the network you’re on. Mark networks you don’t control, such as cafés, hotels and airports, as Public: open the Wi-Fi network’s properties in Settings and set Network profile type to Public. That hides your PC from other people on the same Wi-Fi and stops it offering file sharing to them.
Mac
Go to System Settings, then Network, then Firewall. If it’s off, turn it on, and use Options to see which apps are allowed to accept connections. Apple points out that turning on a sharing service, such as file sharing, opens a port for it, so turn off sharing features you don’t use.
Linux
Many desktop distributions use ufw or firewalld. Check with sudo ufw status or sudo firewall-cmd --state, and enable whichever your system uses.
🔍 Check It From the Outside
Settings tell you what should happen; a scan shows what does. Turn off any VPN and run our port scanner, which checks your own public address the way an internet scanner would. “Filtered” on every port is the ideal: your router dropped the attempts without replying. Anything “Open” means a rule or an app has opened a door. Our guide to checking open ports shows how to trace it.
What a Firewall Doesn’t Protect You From
- Phishing and scam sites. You opening a website is an outbound connection the firewall is built to allow. Our Scam Test and free course Scams and Staying Safe cover this side.
- Malware you run yourself. A program you install can make outgoing connections like any other app. That’s antivirus territory.
- Anything you’ve allowed. A port you forwarded, an app you let through, or a router with an old, unpatched admin page all sit on the “allowed” side of the rules.
- Snooping on what you send. A firewall controls whether a connection happens, not who can read it. Encryption (HTTPS, a VPN) does that.
| Tool | Its job |
|---|---|
| Firewall | Decides which connections are allowed in and out |
| Antivirus | Finds and stops malicious programs and files on the device |
| VPN | Encrypts your traffic to the VPN server and replaces your IP address. See what a VPN is. |
When the Firewall Blocks Something You Want
A game’s voice chat, a printer, a media server or a remote-access app may need to accept connections. Don’t switch the whole firewall off. Allow that one app instead: on Windows, use “Allow an app through firewall” in the Firewall & network protection page, and only for the Private profile if it’s for use at home. On a Mac, add the app under Firewall, then Options. If something outside your home needs to reach a device inside, that’s a router job, through port forwarding or the app’s own remote-access service.
Frequently Asked Questions
Do I need to buy a firewall?
For most homes, no. The router’s firewall and the one built into Windows, macOS or Linux cover the uninvited-connection problem. What’s worth your time is checking they’re on, removing port forwards and UPnP mappings you don’t need, and keeping the router’s firmware up to date.
Is my router’s firewall enough on its own?
At home, mostly. But it doesn’t come with your laptop when you leave, and it can’t protect one device from another device inside your own network. Keep the computer’s firewall on too.
Does a VPN include a firewall?
Some VPN apps include a “kill switch” that blocks traffic if the VPN drops, which is a firewall rule. A VPN doesn’t replace your router’s or computer’s firewall. See what a VPN kill switch is.
Can a firewall slow my internet down?
A home firewall’s rules are simple and rarely the bottleneck. If your connection is slow, look elsewhere first: how to fix slow internet.
Should I turn off my firewall for gaming?
No. Allow the game through the firewall instead. If your console reports a strict NAT type, the cause is usually the router or your provider, not your computer’s firewall. See what CGNAT is.