How to Set Up a Firewall: 6 Steps for Home and Business

By George Mutune   Published: 03/04/22   Updated: 09/26/26   10 min read

Updated September 2026. We rewrote this guide with current steps for Windows, macOS, Linux and home routers, plus a six-step process for business firewalls based on NIST SP 800-41, CIS Controls v8.1 and recent CISA guidance. Outdated vendor quotes and a 2019 Gartner prediction were removed.

A firewall decides which network traffic is allowed in and out, based on rules you set. Setting one up well comes down to three ideas: block everything you don’t need, protect the firewall itself, and keep the rules and firmware up to date. This guide starts with the quick setup most people need, then walks through a full configuration for an office or business network.

Firewalls also need protecting themselves. Verizon’s 2026 Data Breach Investigations Report found that exploited vulnerabilities were the most common way attackers got in, at 31% of breaches, and VPNs, firewalls and other edge devices were frequent targets (Verizon DBIR). A badly configured or unpatched firewall can become the way in.

Quick answer: how to set up a firewall

  1. Turn on the firewall that’s already there. Windows, macOS and most Linux distributions include one, and every home router has a basic one.
  2. Update firmware and change default passwords before the firewall goes live.
  3. Set a default-deny rule for incoming traffic and allow only the services you need.
  4. Close remote admin access from the internet, or restrict it to a VPN and specific IP addresses.
  5. Turn on logging so you can see what gets blocked and spot problems.
  6. Test the rules, back up the configuration and review it on a schedule.

Set up the firewall on your computer

Host-based firewalls protect a device even on hotel, airport or coffee-shop Wi-Fi. CIS Controls v8.1 lists them as basic safeguards for both servers (4.4) and end-user devices (4.5), with a default-deny approach (CIS).

Windows 11

  1. Open Start, search for Windows Security and select Firewall & network protection.
  2. Check that the firewall is On for Domain, Private and Public networks.
  3. Mark untrusted networks (like public Wi-Fi) as Public. Windows applies stricter rules to that profile.
  4. Use Allow an app through firewall only for apps you trust and recognize. Remove old entries you no longer use.

Microsoft’s Windows Security firewall guide explains each setting. Businesses usually manage these rules centrally with Intune or Group Policy instead of on each PC.

macOS

  1. Choose Apple menu > System Settings > Network > Firewall and turn it on.
  2. Click Options. Turn on stealth mode so your Mac doesn’t answer probes such as ping.
  3. For maximum protection on untrusted networks, choose Block all incoming connections. Turn it off again if you need file or screen sharing.

See Apple’s guide to blocking connections with the macOS firewall.

Linux (Ubuntu and Debian with UFW)

UFW (“uncomplicated firewall”) is a simple front end for the Linux packet filter. On a server you reach over SSH, allow SSH before you enable the firewall so you don’t lock yourself out:

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status verbose

Add rules only for services the machine actually offers, such as sudo ufw allow 443/tcp for a web server. Ubuntu’s firewall documentation covers more options.

Set up the firewall on your home router

Your router’s built-in firewall blocks unsolicited traffic from the internet by default. Most of the work is closing the extra doors manufacturers leave open. The NSA’s home network guidance recommends the same basics:

For Wi-Fi settings such as WPA3, see our guide to wireless network security.

How to configure a business firewall in 6 steps

These steps apply to any network firewall, whether it’s a hardware appliance, a virtual firewall or a cloud firewall. They follow the lifecycle in NIST SP 800-41, the U.S. government’s firewall guidance (NIST). If you’re still choosing a device, our comparison of hardware vs. software firewalls explains the trade-offs.

Step 1: Secure the firewall itself

Step 2: Plan zones and IP addressing

Group systems into zones based on how sensitive they are and who needs to reach them. A typical layout:

Assign each zone its own subnet and VLAN, then map zones to firewall interfaces. More zones mean better separation but more rules to maintain, so start simple.

Step 3: Write access rules (ACLs) with default deny

Step 4: Turn on security features and logging

Most current firewalls are “next-generation” firewalls that can do more than filter ports: application control, intrusion prevention (IPS), web filtering and TLS inspection. Turn on what you’ll actually monitor, and disable services you don’t need, such as a DHCP server when another device already does that job. Send logs to a central log server or SIEM and sync the clock with NTP so timestamps line up during an investigation. If you handle card data, PCI DSS 4.0.1 has specific rules for network security controls and logging.

Step 5: Test before and after going live

Step 6: Manage it in production

Common firewall setup mistakes

MistakeWhy it’s riskyFix
“Allow any” rules left from setupThey quietly open the networkReplace with specific rules, then delete the broad ones
Admin interface reachable from the internetAttackers scan for and exploit these constantlyRestrict management to a VPN or internal network
Ignoring outbound trafficMalware and data theft go out unnoticedAllow only needed outbound services
Delayed firmware updatesKnown flaws are exploited within daysTrack vendor advisories and patch urgently
No logging or no one reviewing logsAttacks go unnoticedCentralize logs and set alerts
Shared admin accountsNo accountability, easy to abuseNamed accounts with MFA

For more settings to check, see our guide to the best firewall settings. A firewall is one control among many; our cybersecurity controls and cybersecurity checklist guides show where it fits. To keep up with new firewall and VPN vulnerabilities as they’re disclosed, sign up for the CyberExperts Daily Brief, a short weekday email.

Frequently asked questions

How do I set up a firewall at home?

Turn on the firewall built into your computer (Windows Security or macOS System Settings), then log in to your router, update its firmware, change the admin password and turn off remote management, UPnP and WPS. For most homes, that plus automatic updates is enough.

Do I need a firewall if my router has one?

Yes, keep both on. The router firewall blocks unsolicited traffic from the internet, while the firewall on your computer protects it on other networks, like public Wi-Fi, and from other devices on your own network.

What is the most important firewall rule?

Default deny: block all incoming traffic unless a rule specifically allows it. Add narrow allow rules only for services you need, and log what the deny rule blocks.

How often should firewall rules be reviewed?

At least every six months, and whenever systems are added or retired. Remove unused, duplicate and overly broad rules. Firmware should be updated as soon as security patches are released.

Should I block outbound traffic?

On business networks, yes, at least partly. Limiting which systems can reach the internet and on which ports makes it harder for malware to communicate or send data out. On a home computer, the default of allowing outbound traffic is usually fine.

Is Windows Firewall good enough?

For most home users, yes, as long as it stays on and you only allow apps you trust. Businesses usually manage it centrally and add a network firewall at the edge.

How do I test my firewall?

Scan your public IP address from outside your network with a tool like Nmap to see which ports are open. Only the services you intended to expose should respond. Businesses should also test between internal zones and include the firewall in penetration tests.

Sources

Stay Current

Newer CyberExperts coverage on this topic

This article still works as background. If you want the current picture, start with the freshest related coverage below and today's brief.

Recent Coverage

OpenSea NFT Vulnerabilty Discovered

A vulnerability was found in the OpenSea NFT marketplace that allowed attackers to create fake listings and deceive buyers into purchasing fake...

Latest Daily Brief

Tuesday’s brief: GitLab’s critical fix, then Patch Tuesday, hijacked fridge controllers and Server 2012’s last update

The fastest way to catch up on what changed after this article was published.

Read Today's Brief

George Mutune

I am a cyber security professional with a passion for delivering proactive strategies for day to day operational challenges. I am excited to be working with leading cyber security teams and professionals on projects that involve machine learning & AI solutions to solve the cyberspace menace and cut through inefficiency that plague today's business environments.