VPS Firewall
A firewall is an essential security component that filters network traffic on your server.
Overview
| Feature | Details |
|---|---|
| Type | Software firewall (UFW) |
| Default Policy | DROP for incoming |
| Availability | 24/7 |
What is a Firewall
A firewall monitors incoming and outgoing network traffic based on defined rules. It allows you to:
- Allow or block specific ports
- Filter traffic by IP address
- Restrict access to services
Accessing the Firewall
You can manage the firewall in two ways:
1. Via CoreSynth Panel
In your dashboard, go to your VPS server and select the Firewall section.
2. Via Terminal (UFW)
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw deny 22/tcpAdding Rules
Rule Parameters
| Parameter | Type | Description |
|---|---|---|
| Action | allow / deny | Permit or block |
| Direction | in / out | Inbound or outbound |
| Protocol | tcp / udp / any | Protocol type |
| Port | 80, 443, 22 | Port number |
| Source | IP address or range | Traffic origin |
Rule Examples
# Allow HTTP
sudo ufw allow 80/tcp
# Allow HTTPS
sudo ufw allow 443/tcp
# Allow SSH from specific IP
sudo ufw allow from 192.168.1.100 to any port 22
# Block specific IP
sudo ufw deny from 10.0.0.50
# Allow port range
sudo ufw allow 1000:2000/tcpRecommended Rules
Basic Server Protection
# SSH only from your IP (CHANGE IP!)
sudo ufw allow from YOUR_IP to any port 22
# HTTP and HTTPS
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Default policy - block everything else
sudo ufw default deny incomingNote: Replace
YOUR_IPwith your actual IP address.
Managing Rules
View Active Rules
sudo ufw status numberedDelete a Rule
sudo ufw delete allow 80/tcpEdit a Rule
Rules cannot be directly edited. First delete the old rule, then add a new one:
sudo ufw delete allow 22/tcp
sudo ufw allow 2222/tcpFirewall Monitoring
Statistics
sudo ufw status verboseFirewall Logs
# View recent entries
sudo tail -f /var/log/ufw.log
# Enable logging
sudo ufw logging onTroubleshooting
Cannot Connect via SSH
Cause: Firewall rule blocking SSH port.
Solution:
# View current rules
sudo ufw status
# Allow SSH
sudo ufw allow 22/tcpWebsite Not Working
Cause: Firewall blocking HTTP/HTTPS ports.
Solution:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcpFirewall Blocking Everything
Cause: Too restrictive rules.
Solution:
# Temporarily disable firewall
sudo ufw disable
# Reset all rules
sudo ufw resetEnabling and Disabling Firewall
# Disable firewall
sudo ufw disable
# Enable firewall
sudo ufw enable
# Reset all rules
sudo ufw resetNext Steps
- VPS Security — Advanced server security
- Backups — Back up your data
Need help? Open a support ticket or ask Alex.
Last updated on