What does a firewall do and why it matters

Share
A home router sitting on a desk in a simple indoor setting.

A firewall is a traffic filter for your device or network. It allows some network connections, blocks others, and decides based on rules such as which app is asking, what port is being used, and where the traffic is coming from. If you keep hearing that you need one, the short answer is that you probably already have at least one firewall running. The real question is where it sits, what it protects, and whether the settings are right for what you do.

What a firewall actually does

A firewall watches network traffic and compares it with a set of rules. If the traffic matches the rules, it passes. If it doesn’t, the firewall blocks it.

Those rules can be simple or detailed. A firewall might allow web browsing, email, and video calls, while blocking unknown incoming connection attempts. It can also decide based on the app making the request, the device trying to connect, the port being used, or where the traffic is coming from.

A useful way to think about it is a security desk at a building entrance. It doesn’t inspect everything inside the building. It decides who gets through the door and where they’re allowed to go.

For example, your browser may be allowed to reach websites, while a random program trying to open an outside connection may be denied until you approve it. The main job is control: permit normal traffic, block traffic that looks risky, and reduce the number of open doors on your network.

A home router with several ethernet cables plugged into it.

A simple example of blocking traffic

Say your laptop is connected to the internet at home. You open your browser and go to a news site. The firewall sees that outgoing request, checks its rules, and lets it through because web browsing is allowed.

Now imagine an unknown device on the internet tries to connect to your laptop from the outside. If you didn’t ask for that connection and your firewall rule says unsolicited incoming traffic should be blocked, it gets stopped before it reaches your apps. That matters because many attacks start with random scans and connection attempts looking for something open.

The same idea applies to apps. For example, a firewall may let your chat app connect to its service, but warn you if a newly installed program tries to reach the network for no clear reason. On some systems, you’ll see a prompt asking whether to allow or block it. That’s the firewall asking you to make the rule explicit instead of letting the connection happen automatically.

A firewall can also control which apps are allowed to use the internet at all. That’s useful when you want a specific program to stay offline unless you approve it, or when a business app needs network access but everything else should stay limited.

A laptop and a home router sitting together on a desk.

Why your computer already has one

Most modern devices already include firewall protection. That can come from your router, your operating system, or both.

Your router firewall sits at the edge of your home or office network. It filters traffic between your local devices and the wider internet. This is helpful because it can block a lot of unwanted incoming traffic before it reaches anything inside your network.

Your device firewall lives on the laptop, desktop, or phone itself. Windows, macOS, and many other systems have built-in firewall features that control traffic for that specific device. That matters even on the same network because two computers on the same Wi‑Fi can have different firewall rules.

The two layers do different jobs. The router protects the network as a whole, while the device firewall protects one machine. You can have both turned on, and in many setups that’s normal. A built-in firewall is not a sign that you’ve already done everything possible, but it does mean you may already have basic protection without buying anything extra.

What a firewall can stop and what it can’t

A firewall can block unwanted connections, limit which apps can use the network, and reduce exposure from open ports or services. That’s useful, but it is not a full security system.

It won’t remove malware that’s already on your device. If a malicious program is already installed and allowed to run, a firewall may not stop all of its activity. It also won’t fix weak passwords, spot every phishing email, or stop you from handing your login details to a fake website.

It can’t replace antivirus or anti-malware tools, and it doesn’t make unsafe downloads harmless. If you click a bad attachment or install a harmful app, the firewall is only one layer. It may block some of the network activity later, but it does not undo the original mistake.

So the cleanest way to think about it is this: a firewall controls traffic. It does not judge trust in the broader sense. That’s why it’s useful alongside other protections, not instead of them.

When you actually need to think about it

Most people can leave firewall settings alone most of the time, but there are a few situations where they matter more.

At home, your router firewall and device firewalls should usually stay on. That helps protect anything connected to your network, including laptops, phones, smart TVs, and printers.

On public Wi‑Fi, a firewall on your device matters even more because you’re sharing a network with strangers. A good firewall setup helps block unwanted incoming traffic from other devices on that network.

If you work remotely, a firewall can matter for the work laptop you take between networks. The machine may move from your home network to an airport, a café, or an office, and the firewall helps keep its exposure consistent.

You also need to think about firewall settings if you run game servers, remote access tools, cameras, file sharing, or other services that need incoming connections. In those cases, you may need to open a port or create a rule so the service can work. That’s normal, but it should be done only for the specific app or service you trust, not by opening broad access just to make a problem disappear.

If you’re on public Wi‑Fi, keep in mind that a firewall is not the whole answer. It helps reduce exposure, but you still need to be careful about what you sign into and what you download.

Do you need to change the settings?

For most home users and small businesses, the default answer is no: keep the firewall on and use the built-in settings unless you have a specific reason to change them.

That rule works because default firewall settings are usually chosen to block risky incoming traffic while allowing ordinary use of the internet. If everything is working normally, changing rules can add risk without giving you much in return.

Change settings only when you know what you’re trying to allow or block. A common case is setting up a printer, game server, remote desktop, or business app that needs a specific connection. In those cases, adjust the smallest rule that solves the problem, then stop there.

If you’re not sure what a rule does, leave it alone. A firewall is most helpful when it quietly does its job in the background, not when you keep opening holes just because a prompt appears.

Conclusion

If you want the practical takeaway, think of a firewall as a traffic filter, not a magic shield. It blocks suspicious or unwanted connections and can control which apps talk to the internet, but it won’t replace antivirus, safe habits, or good account security. If your device and router already have firewalls enabled, that’s a strong start. The main times to pay attention are public Wi‑Fi, remote work, and any setup that needs incoming connections.

Frequently Asked Questions

Do I need both a router firewall and a device firewall?

In many setups, yes. The router firewall protects the network edge, while the device firewall protects each machine individually. Having both on is common and usually helpful.

Can a firewall stop viruses?

Not by itself. A firewall can block some suspicious traffic, but it does not remove malware or replace antivirus and anti-malware tools.

Why would a firewall block an app I trust?

Because the firewall is following a rule about network access, not judging the app’s intent. Trusted apps can still need permission to connect, especially the first time they try.

Is a firewall useful on public Wi‑Fi?

Yes. Public Wi‑Fi is one of the places where a device firewall matters most, because it helps block unwanted incoming traffic from other devices on the same network.