Set up a firewall for your vServer | Speed-Net

Set up a firewall for your vServer

With the firewall in the vServer Control Panel you define which traffic may reach your vServer. You combine the rules in a firewall plan, which you assign to one or more vServers. The firewall works in front of your server, in addition to a firewall in the operating system.

⏱️ Timeapprox. 15 minutes
📊 DifficultyAdvanced
🧰 You needAddress and login details of the vServer Control Panel (see welcome email)
⛔ Warning
A wrong rule can lock you out of your server. Always allow SSH access (port 22) first before assigning the plan. If you still cannot reach the server, use the VNC console and remove the plan again.
1

Create a firewall plan

  1. In the menu on the left, click Network › Firewall.
  2. Click Add Firewall Plan.
  3. Under Plan Name, enter a name, for example webserver.
  4. Leave Default Policy at DROP. This blocks everything you do not explicitly allow.

2

Add rules

Fill in the fields for each rule and click Add at the end of the row. You must always fill in the IP field. If a rule applies to all addresses, enter 0.0.0.0/0. For a typical web server you need these rules:

DirectionIP TypeDecisionProtocolPortIPPurpose
INIPv4ACCEPTTCP220.0.0.0/0SSH
INIPv4ACCEPTTCP80,4430.0.0.0/0Website
INIPv4ACCEPTICMP0.0.0.0/0Ping
OUTIPv4ACCEPTTCPALL0.0.0.0/0outgoing, e.g. updates
OUTIPv4ACCEPTUDPALL0.0.0.0/0outgoing, e.g. DNS

ℹ️ Note
The table shows rules for IPv4. If your server should also be reachable via IPv6, create the same rules again with IP Type IPv6 and the IP ::/0.
💡 Tip
If possible, allow SSH only from your own fixed IP address instead of 0.0.0.0/0. This keeps automated attacks away.
  1. Check the list of rules.
  2. Click Save Plan.
3

Assign the plan to the vServer

  1. Open your vServer and click Networking › Change Firewall Plan.
  2. Select your plan. The rules are shown below.
  3. Click Change Firewall Plan.

⚠️ Important
Keep your existing SSH connection open and test in a second window whether you can still log in before closing the first connection.

How to check that everything works

Reconnect via SSH and open your website. A port you have not allowed is no longer reachable from outside.

Common problems and solutions

After assigning the plan I can no longer reach the server.

Open the console via VNC or temporarily assign no plan under Change Firewall Plan. Then check whether the rule for port 22 is missing.

The server can no longer download updates.

The rules for outgoing traffic (OUT) are missing. Add them as shown in the table above.

Further help

Stuck? Create a support ticket in the Support Center. We are happy to help.