Skip to Content
🇬🇧Firewall

VPS Firewall

A firewall is an essential security component that filters network traffic on your server.


Overview

FeatureDetails
TypeSoftware firewall (UFW)
Default PolicyDROP for incoming
Availability24/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/tcp

Adding Rules

Rule Parameters

ParameterTypeDescription
Actionallow / denyPermit or block
Directionin / outInbound or outbound
Protocoltcp / udp / anyProtocol type
Port80, 443, 22Port number
SourceIP address or rangeTraffic 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/tcp

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 incoming

Note: Replace YOUR_IP with your actual IP address.


Managing Rules

View Active Rules

sudo ufw status numbered

Delete a Rule

sudo ufw delete allow 80/tcp

Edit 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/tcp

Firewall Monitoring

Statistics

sudo ufw status verbose

Firewall Logs

# View recent entries sudo tail -f /var/log/ufw.log # Enable logging sudo ufw logging on

Troubleshooting

Cannot Connect via SSH

Cause: Firewall rule blocking SSH port.

Solution:

# View current rules sudo ufw status # Allow SSH sudo ufw allow 22/tcp

Website Not Working

Cause: Firewall blocking HTTP/HTTPS ports.

Solution:

sudo ufw allow 80/tcp sudo ufw allow 443/tcp

Firewall Blocking Everything

Cause: Too restrictive rules.

Solution:

# Temporarily disable firewall sudo ufw disable # Reset all rules sudo ufw reset

Enabling and Disabling Firewall

# Disable firewall sudo ufw disable # Enable firewall sudo ufw enable # Reset all rules sudo ufw reset

Next Steps


Need help? Open a support ticket  or ask Alex.

Last updated on