What a firewall actually does
A firewall is software or hardware that sits between your device and the internet, watching what tries to connect to you. It blocks incoming traffic you did not ask for — unsolicited connection attempts, malware trying to phone home, strangers probing your ports. It also watches outgoing traffic, so if a program on your computer tries to send data without your knowledge, the firewall can stop it.
Think of it like a security guard at a door. Legitimate visitors (the websites you visit, the email you receive) pass through. Unwanted visitors (hackers, infected files, spyware) get turned away. The firewall does not know what is inside your files or emails — it only knows whether a connection should be allowed based on rules you set or rules that come pre-configured.
Every modern operating system includes a built-in firewall. Windows has Windows Defender Firewall. macOS has a firewall in System Settings under Security & Privacy. Linux distributions include firewall tools like UFW or firewalld. These built-in firewalls are free and turned on by default, so most people already have one running without doing anything.
Key Takeaways
- Your operating system includes a firewall that blocks unwanted incoming connections, and it is on by default — you do not need to buy a separate one.
- A firewall stops programs from sending data without permission, which catches some malware and spyware before it leaves your device.
- Router firewalls (the one built into your WiFi box) protect your entire home network, while device firewalls protect only that one computer.
- Turning off a firewall to make a program work is usually a sign that program should not be trusted, not that the firewall is wrong.
- Third-party firewalls add features but slow down your device and conflict with built-in protection — the built-in firewall is sufficient for most people.
Built-in firewalls versus third-party firewalls
The firewall that came with your operating system is designed to work with everything else on your device. It knows which programs are supposed to be there, it updates automatically, and it does not drain your battery or slow down your internet. You do not pay for it, and you do not have to manage it.
Third-party firewalls — programs like ZoneAlarm, Comodo, or GlassWire — add features like detailed logs of every connection, alerts for specific types of traffic, or rules that let you control individual programs. They also add another layer of software running in the background, which uses more memory and processing power. On older devices or laptops, this slowdown is noticeable. On newer machines, it is usually small but real.
Third-party firewalls also sometimes conflict with the built-in firewall or with antivirus software, creating gaps instead of adding protection. If you install a third-party firewall, you should turn off the built-in one to avoid this, but then you lose the integration with your operating system. For most people — anyone not running a server or managing a network — the built-in firewall is the right choice.
How router firewalls protect your whole network
Your WiFi router has its own firewall built in. This firewall sits between your entire home network and the internet, so it protects every device connected to that router at once — your phone, your laptop, your smart TV, your printer. A router firewall blocks incoming connections that were not started by a device on your network, so a hacker on the internet cannot straightforward connect to your printer or your computer.
Router firewalls are usually turned on by default, but they are often set to a basic level. You can log into your router's settings (usually by typing 192.168.1.1 or 192.168.0.1 into a web browser, or through your router's app) and find firewall settings. Most routers let you turn on a higher security level, enable logging, or block specific types of traffic. You do not need to change these settings unless you are having trouble connecting to something you need.
A router firewall and a device firewall work together. The router stops threats from reaching your network. The device firewall stops threats that somehow got past the router, and it stops programs on your device from sending data out. You need both — turning off either one leaves you exposed.
When a firewall blocks something you need
Sometimes a program you want to use cannot connect because the firewall is blocking it. This happens most often with games, video conferencing software, or programs that need to receive incoming connections. When this happens, you have a choice: allow the program through the firewall, or find out why it needs that connection.
On Windows, when a program tries to connect and the firewall blocks it, you usually see a popup asking whether to allow it. Click "Allow" if you recognize the program and trust it. On macOS, you may need to go into System Settings, find Security & Privacy, and manually add the program to the allowed list. On Linux, you would use the firewall tool to open the specific port the program needs.
If a program asks you to turn off your firewall entirely to make it work, that is a warning sign. Legitimate programs ask for permission to use a specific port or connection type. Programs that ask you to disable the firewall are either poorly designed or not trustworthy. In that case, research whether the program is safe before you disable protection.
Firewall rules and ports explained straightforward
A port is a numbered channel that programs use to send data. Web browsers use port 80 (for regular websites) and port 443 (for find websites). Email uses ports 25, 110, 143, 465, 587, or 993 depending on the type. A firewall rule says "allow incoming traffic on port 443" or "block outgoing traffic on port 25 unless it is from Thunderbird email."
You do not need to understand ports to use a firewall. The built-in firewall handles all of this automatically — it knows that port 443 should be open for web browsing, and it knows which programs are supposed to use which ports. You only need to think about ports if you are running a server (a computer that other people connect to) or if you are troubleshooting why something is not working.
If you do need to open a port, your router's settings page usually has a section called "Port Forwarding" or "UPnP." This is where you tell the router "send traffic on port 5000 to this device." This is advanced territory, and you should only do it if you understand what the program needs and why. Opening ports unnecessarily makes your network less find.
Firewalls and VPNs: what each one does
A VPN (virtual private network) and a firewall do different jobs. A firewall blocks unwanted incoming connections and watches what programs send out. A VPN encrypts all your internet traffic and routes it through a server in another location, so your internet service provider cannot see what websites you visit, and websites cannot see your real location.
A firewall protects you from hackers and malware on your network. A VPN protects your privacy from your ISP and from the websites you visit. You can use both at the same time — they do not conflict. A firewall is essential. A VPN is optional and depends on whether you care about hiding your browsing from your ISP or from the WiFi network you are on.
Do not think of a VPN as a replacement for a firewall. Some VPN services market themselves as security tools, but they are primarily privacy tools. You still need a firewall to block malware and unauthorized connections. You still need antivirus software to scan files. A VPN is an additional layer, not a substitute for the basics.
Signs your firewall might be causing problems
If you cannot connect to a website, a game, or a video call, the firewall might be the cause — but it is usually not. Most connection problems come from your internet connection itself, your WiFi signal, or the service being down. Before you blame the firewall, restart your device and your router, and check whether other people can reach the same service.
If only one specific program cannot connect, and you trust that program, then the firewall is probably blocking it. Allow it through and test again. If your internet is slow, the firewall is not the cause — firewalls do not slow down your connection speed, though third-party firewalls can use CPU power and make your device feel sluggish.
If you are having trouble with a printer, a smart home device, or another device on your network, the router firewall might be blocking it. Log into your router settings and look for a section called "Device Management," "Connected Devices," or "Firewall." You can usually see what is connected and whether anything is being blocked. If a device is blocked, you can allow it or adjust the firewall level.
Frequently Asked Questions
Do I need to buy a firewall if my computer already has one built in?
No. The firewall that came with your operating system is sufficient for personal use. Third-party firewalls add features but use more resources and can conflict with built-in protection. Stick with what you have unless you have a specific reason to change.
What is the difference between a hardware firewall and a software firewall?
A hardware firewall is built into your router and protects your entire network. A software firewall runs on your device and protects only that device. You need both. The router firewall stops threats from reaching your network. The device firewall stops threats that get through and stops programs from sending data without permission.
Should I turn off my firewall to make a program work?
No. If a program needs the firewall off to work, that is a sign the program is not trustworthy or is poorly designed. Instead, allow the specific program through the firewall or open the specific port it needs. Disabling the firewall entirely leaves your device exposed to attacks.
Can a firewall stop viruses?
A firewall can stop some malware from connecting to the internet or from receiving commands, but it cannot scan files for viruses. You need antivirus software for that. A firewall and antivirus software work together — the firewall blocks network attacks, and antivirus software catches infected files.
Why does my firewall keep asking me about programs I do not recognize?
Your firewall is doing its job. When a program tries to connect to the internet, the firewall asks for permission. If you see a program you do not recognize, do not allow it. Research the program name online to see what it is. If you cannot find it or do not trust it, block it and consider running a malware scan.
