What is a Firewall?
A firewall monitors and controls incoming and outgoing network traffic based on security rules. Think of it as a bouncer for your network - it decides what gets in and what stays out.
firewall-concept
[INTERNET] ---> [FIREWALL] ---> [YOUR NETWORK]
|
+-- Rules: Allow/Deny based on:
- IP addresses
- Ports (80, 443, 22...)
- Protocols (TCP, UDP)
Types of Firewalls
| Type | Location | Best For |
|---|---|---|
| Software Firewall | On device | Personal computers |
| Hardware Firewall | Network edge | Home/office networks |
| Cloud Firewall | Cloud-based | Web applications |
| Next-Gen (NGFW) | Network | Enterprise security |
Software Firewalls
Built-in Options
- Windows Firewall - Excellent, keep it enabled
- macOS Firewall - Good, enable in Security settings
- Linux iptables/nftables - Powerful, requires config
Third-Party Options
- GlassWire - Visual network monitor
- Little Snitch (Mac) - Outbound traffic control
- Portmaster - Privacy-focused, open source
Hardware Firewalls
Your router has a basic firewall (NAT). For better protection:
- pfSense - Free, powerful, runs on old PC
- OPNsense - Fork of pfSense, user-friendly
- Ubiquiti EdgeRouter - Affordable hardware option
- Firewalla - Plug-and-play home firewall
Best Practices
Default Deny
Block everything by default, then allow only what's needed. This is the most secure approach.
- Keep firewall always enabled
- Review rules periodically
- Log and monitor traffic
- Block unused ports
- Use both inbound and outbound rules