What Firewall Rules Mean
Firewall rules control which network traffic is allowed to reach the server. For a website VPS, the firewall should expose only the services that need to be reachable from the internet.
Where Firewall Sits In The Stack
The firewall sits at the network and server security layer. It affects SSH access, HTTP traffic, HTTPS traffic, database exposure and admin services.
How Firewall Rules Work
A firewall checks incoming and outgoing connections against rules. If a port is allowed, the traffic can pass. If a port is denied, the traffic is blocked before reaching the service.
Why Firewall Mistakes Are Dangerous
If the firewall is too open, attackers can scan and attack unnecessary services. If it is too strict, real users or admins may be blocked from the website or SSH.
How To Think About Firewall
A firewall is not a complete security system, but it is a necessary boundary. Start with minimum open ports and expand only when there is a clear reason.
Infrastructure Layer
Network
Difficulty Level
Beginner
Core Concept
Firewall rules define which ports and services are reachable from the network.
System Role
They protect the server boundary by reducing exposed services and controlling access to SSH, web traffic and internal services.
How It Works
Incoming traffic reaches the server network layer. The firewall checks the port and rule. Allowed traffic passes to the service. Blocked traffic is rejected or dropped.
Connected Components
SSH, HTTP, HTTPS, Nginx, MySQL, VPS provider firewall, UFW, iptables, monitoring, admin IP addresses.
Common Failure Points
Exposed MySQL port, locked-out SSH, blocked HTTPS, open unused ports, no provider firewall, no documentation of allowed ports.
Verification Method
Check active firewall status, allowed ports, listening services, SSH access, HTTP and HTTPS reachability, and whether database ports are exposed publicly.
Basic Commands
ufw status verbose;
ss -tulpn;
curl -I https://example.com;
systemctl status ssh;
systemctl status nginx