Firewall for Beginners – Simple Introduction
Posted: Sun Apr 26, 2026 4:09 am
What Is a Firewall?
A firewall is a security system that monitors and controls incoming and outgoing network traffic based on defined rules.
It acts as a barrier between a trusted network (like your home or server) and untrusted networks (like the internet).
---
1. Why Do You Need a Firewall?
Without a firewall, your system would be directly exposed to the internet.
A firewall helps to:
2. How a Firewall Works
A firewall checks network traffic and decides:
3. Types of Firewalls
1. Network Firewall
4. Common Firewall Rules
5. Example (Linux UFW)
Allow SSH:
Allow web traffic:
Enable firewall:
---
6. Firewall vs NAT
---
7. Important Tips
A firewall is a security system that monitors and controls incoming and outgoing network traffic based on defined rules.
It acts as a barrier between a trusted network (like your home or server) and untrusted networks (like the internet).
---
1. Why Do You Need a Firewall?
Without a firewall, your system would be directly exposed to the internet.
A firewall helps to:
- Block unauthorized access
- Protect services and ports
- Prevent attacks
- Control network traffic
2. How a Firewall Works
A firewall checks network traffic and decides:
- Allow the connection
- Block the connection
- Allow port 80 (web server)
- Allow port 443 (HTTPS)
- Block all other incoming traffic
3. Types of Firewalls
1. Network Firewall
- Protects an entire network
- Usually built into routers
- Runs on a single system
- Controls traffic for that device
- UFW (Uncomplicated Firewall)
- iptables / nftables
4. Common Firewall Rules
- Allow specific ports (e.g. SSH, HTTP, HTTPS)
- Block all other incoming traffic
- Limit access to trusted IPs
5. Example (Linux UFW)
Allow SSH:
Code: Select all
sudo ufw allow 22
Code: Select all
sudo ufw allow 80
sudo ufw allow 443
Code: Select all
sudo ufw enable
6. Firewall vs NAT
- NAT → translates IP addresses
- Firewall → controls traffic
---
7. Important Tips
- Always enable a firewall on servers
- Allow only required ports
- Regularly review rules
- Combine with updates and security tools