What Is a Firewall? Types, How It Works and Limits
2 min read
Published · Updated
Short answer
A firewall allows or blocks network traffic based on rules, usually blocking unsolicited incoming connections. It protects the connection, not you from malware you install or phishing.

In this article (5 sections)
A firewall is software or hardware that decides which network traffic is allowed in or out, based on rules. It sits between your device or network and the internet, and blocks connections that do not match what you have permitted. A good default is to block unsolicited incoming traffic and allow what you started yourself.
What a firewall does
Every connection has a source and destination address, a port and a protocol. The firewall checks those against its rules and then allows or drops the traffic. Most home firewalls follow a simple pattern: deny incoming connections you did not ask for, allow outgoing ones.
Types of firewall
| Type | How it decides | Used in |
|---|---|---|
| Packet filter (stateless) | Looks at each packet's address, port and protocol on its own | Basic router rules and older gear |
| Stateful inspection | Tracks connections, so it only lets in replies to traffic you started | Nearly all home routers and operating systems |
| Application or proxy firewall | Understands the application protocol and can filter content | Offices, web filters, school networks |
| Next-generation firewall (NGFW) | Adds app awareness, intrusion prevention and threat feeds | Businesses and data centers |
| Web application firewall (WAF) | Protects a website from attacks such as SQL injection | Websites and APIs |
They also differ in where they run. A network firewall is built into your router or a dedicated box and protects everything behind it. A host firewall runs on one computer: Windows Defender Firewall on Windows and the built-in firewall on macOS. Using both is sensible, since the host firewall also protects you on café or hotel Wi-Fi where no router firewall is yours.
What a firewall does not do
- It does not stop you from installing malware that you chose to download.
- It does not catch phishing messages or fake login pages.
- It does not encrypt your traffic. For that, use HTTPS and, on untrusted Wi-Fi, a VPN.
- It cannot protect you if you open a port you do not need or turn it off.
Think of it as a locked front door. It is essential, but it does not replace updates, strong passwords and care with links and attachments.
Firewalls and your home network
Your home router already filters unsolicited inbound traffic by default, which is why devices at home are not directly reachable from the internet. Opening a port for a game server or camera makes a hole in that protection. Open only what you need, keep the router firmware updated, and close ports you no longer use. If forwarding does not work at all, you may be behind a second router, see double NAT.
Quick checklist
- Keep the Windows or macOS firewall switched on.
- Log in to your router and make sure remote administration is off unless you need it.
- Remove port forwards you do not use.
- Update router firmware and change the default admin password.
- Use a VPN on public Wi-Fi.
Schools and workplaces use firewalls to block sites, which is a different job from protecting you. Our post on school firewalls covers that side. For wireless safety at home, see how to secure your Wi-Fi network.



