The most effective single option is a firewall, but the real protection comes from using it with a password
A firewall is the primary tool that blocks unauthorized access to your network. It sits between your devices and the internet, examining incoming and outgoing traffic and refusing connections that don't match rules you set or that the firewall recognizes as suspicious. Every modern computer, phone, and router comes with a firewall built in — Windows Defender Firewall on Windows machines, the firewall in macOS, and the firewall in Android and iOS. The firewall alone stops a large category of attacks before they reach your devices.
But a firewall only works if unauthorized people cannot get inside your network in the first place. That's where your Wi-Fi password comes in. Without a strong password, someone sitting in a parked car outside your house can connect to your network, bypass your firewall's protections, and access your files, cameras, or other devices directly. The password is what keeps them from connecting at all.
Together — a firewall on each device plus a strong Wi-Fi password on your router — these two layers stop most unauthorized access. Neither one alone is enough.
Key Takeaways
- A firewall blocks unauthorized connections from reaching your devices, but only works against traffic coming from outside your network.
- A strong Wi-Fi password prevents unauthorized people from connecting to your network in the first place, which is the first line of defense.
- Your router's firewall and your individual device firewalls work together — if someone gets inside your network, the device firewall still protects each computer or phone.
- Changing your router's default password from the one printed on the box is essential, because attackers know the defaults and can take control of your router.
- A firewall cannot protect you from threats that come from inside your network, such as malware you download or a compromised device already connected to your Wi-Fi.
How a firewall examines traffic and makes decisions
A firewall works by looking at every piece of data trying to enter or leave your network and asking: Is this connection allowed? It makes this decision based on rules — either rules you set yourself or rules built into the firewall by default. For example, a firewall rule might say "allow web traffic on port 443" (which is how HTTPS websites work) but "block all incoming connections on port 3389" (which is used for remote access that you probably don't need).
Most firewalls also use a concept called stateful inspection. This means the firewall remembers that you initiated a connection — say, you opened a website — and allows the website's response to come back to you. But if a stranger on the internet tries to start a connection to your computer without you asking for it, the firewall refuses it. This is why you can browse the web freely, but hackers cannot simply knock on your door and demand access.
The firewall on your router protects your entire network. The firewall on each individual device (your laptop, phone, tablet) adds a second layer. If someone somehow gets inside your network — by guessing your Wi-Fi password, for example — the firewall on your laptop still prevents them from accessing files on your laptop without permission.
Why your Wi-Fi password is the first barrier
Your router broadcasts a Wi-Fi signal that anyone nearby can see. Without a password, anyone can connect. With a weak password — something like "password123" or your street address — someone with basic tools can crack it in minutes. Once they are connected to your network, they are inside your firewall's perimeter, and the firewall treats them as a trusted device.
A strong Wi-Fi password should be at least 16 characters long and include uppercase letters, lowercase letters, numbers, and symbols. The longer and more random it is, the longer it takes to crack. A password like "Tr0pic@lSunset#2024!" is far stronger than "MyWifi2024" even though both are 12 characters, because the first one has more variety.
Your router comes with a default password printed on the bottom or back of the device. Change this password immediately. Attackers know these defaults — they are published online — and if you leave it unchanged, someone who connects to your network can log into your router's settings and disable the firewall, change your Wi-Fi password, or redirect your traffic to a fake website.
The difference between router firewalls and device firewalls
Your router has its own firewall that protects your entire network from outside threats. Your individual devices — laptop, phone, tablet — each have their own firewalls that protect that specific device. They work at different points in the chain.
The router firewall is your first line of defense. It blocks attacks coming from the internet before they reach any of your devices. If you turn off the firewall on your router, you lose this protection, and every device on your network is exposed to direct attacks from the internet.
The device firewall is your second line of defense. Even if someone gets inside your network, the firewall on your laptop still prevents unauthorized programs from listening on network ports or accepting incoming connections. On Windows, you can check that Windows Defender Firewall is on by going to Settings > Privacy & Security > Windows Security > Firewall & Network Protection. On Mac, go to System Settings > General > Security & Privacy > Firewall.
What a firewall cannot protect you from
A firewall stops unauthorized people from connecting to your network and stops external attackers from reaching your devices. It does not stop threats that originate inside your network. If you download malware — malicious software hidden in a file you thought was safe — the firewall cannot stop it, because you initiated the download. Once the malware is on your device, it can do damage even with the firewall running.
A firewall also cannot protect you from phishing emails or social engineering. If someone tricks you into giving them your password, or into installing software that looks legitimate but is actually malicious, the firewall is powerless. The threat is coming from you, not from the network.
Similarly, if a device on your network is already compromised — say, a family member's laptop has malware on it — the firewall does not prevent that compromised device from attacking other devices on the same network. This is why keeping your devices updated with security patches and running antivirus software matters alongside the firewall.
How to check if your firewall is on
On Windows: Open Settings, go to Privacy & Security, select Windows Security, then click Firewall & Network Protection. You should see "Windows Defender Firewall" with a green checkmark next to "Domain networks", "Private networks", and "Public networks". If any of these show a red X, your firewall is off for that network type.
On Mac: Open System Settings, go to General, click Security & Privacy, then select Firewall. The firewall is on if you see "Firewall: On". If it says "Off", click the lock icon to unlock the settings, then click Turn On Firewall.
On your router: Open a web browser and type your router's IP address (usually 192.168.1.1 or 192.168.0.1 — check your router's manual or the sticker on the back). Log in with your router's admin username and password. Look for a section called Firewall, Security, or Advanced Settings. The exact location varies by router brand, but most routers have the firewall on by default. If you see an option to turn it off, leave it on.
When you might need to adjust firewall rules
Most of the time, the default firewall settings work fine. You browse the web, send emails, and use apps without thinking about it. But 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 accept incoming connections.
When this happens, you have two options: add the program to the firewall's allowed list, or create a specific rule for it. On Windows, go to Settings > Privacy & Security > Windows Security > Firewall & Network Protection > Allow an app through firewall. Find the program in the list and check the boxes next to it. On Mac, you typically need to go to System Settings > General > Security & Privacy > Firewall Options and add the program there, though the exact steps vary by macOS version.
Only add programs to the firewall's allowed list if you trust them and you understand why they need the permission. If you are unsure, search online for the program name plus "firewall" to see if other users have reported needing to allow it.
Frequently Asked Questions
Can I use a firewall instead of a Wi-Fi password?
No. A firewall only protects against external attacks. If someone connects to your Wi-Fi without a password, they are inside your network, and the firewall treats them as trusted. You need both: a strong Wi-Fi password to keep unauthorized people off your network, and a firewall to block external attacks.
Does turning on a VPN replace the need for a firewall?
No. A VPN encrypts your traffic so your internet provider cannot see what you are doing, but it does not protect your local network or your devices from unauthorized access. A firewall and a VPN do different jobs. You should use both if you are on public Wi-Fi, but a firewall is essential on your home network regardless of whether you use a VPN.
What if I turn off my firewall to fix a problem?
Turn it back on as soon as the problem is solved. Running without a firewall leaves your devices exposed to attacks from the internet. If a program genuinely needs the firewall off to work, that is a sign the program is not trustworthy — consider uninstalling it and finding an alternative.
Does my phone need a firewall?
Your phone has a built-in firewall that you cannot turn off, which is one reason phones are generally more secure than computers. However, this does not mean your phone is invulnerable. Use a strong password or biometric lock on your phone, keep it updated, and be careful about which apps you install.
Can my router's firewall protect devices that are not connected to my Wi-Fi?
No. The router firewall only protects devices on your network. If you take your laptop to a coffee shop and connect to their Wi-Fi, their firewall protects you (if they have one), not yours. This is why you should use a VPN on public Wi-Fi and keep your device firewall on at all times.