Skip to main content

Set up the VPS firewall

The Firewall tab is on Linux Premium, Windows Basic, Windows Premium, and Forex VPS. Traffic is checked against the rules from the top, and the first rule that matches decides. Traffic that doesn't match any rule follows the default policy for its direction. The firewall is off until you turn it on, and you can prepare rules while it's off.

The rules are entirely yours, and nothing keeps a port open for you. The inbound default starts as Block, so once the firewall is on, every inbound connection that no rule allows is dropped. Before you turn it on, add an inbound Allow rule for the way you connect, such as the SSH or RDP preset. If you lock yourself out, the HTML console still works.

Add a rule​

  1. On the Firewall tab, under Rules, select Add rule.

  2. Choose the Direction: Inbound or Outbound.

  3. Choose the Action: Allow, Block (drops the traffic silently), or Reject (refuses it and tells the sender).

  4. Under Traffic, set Match by to Preset and choose one, such as SSH or HTTPS. Or set it to Protocol, choose the protocol, and enter the ports.

    Ports can be one port, a list such as 80,443, or a range such as 1000-2000. A rule takes up to 15 port entries: each single port counts as one, and each range counts as two. Split a longer list into more rules.

    For ICMP or ICMPv6, choose an ICMP type instead of ports. ICMP is for IPv4 addresses, and ICMPv6 is for IPv6 addresses.

  5. Enter the Source and the Destination. Either list addresses or networks separated by commas, or enter one range, one alias by its name, or one IP set as + and its name, such as +office. Leave a field empty for any address.

  6. Select Save rule.

Use the arrows on a rule to move it up or down, because the order decides which rule matches first. Clear Rule is active to pause a rule: a paused rule stays in the list but doesn't apply. On a VPS with more than one network interface, Interface binds a rule to one of them, and a rule bound to one interface is always saved paused.

The firewall holds up to 100 rules, 100 aliases, and 100 IP sets, and an IP set holds up to 1,000 entries.

Set the default policies​

Select Change next to Inbound default or Outbound default, choose Allow, Block, or Reject for each direction, and select Save policies.

Use aliases and IP sets​

  • An alias is a name for one address or network. Select Add alias, then use the name as a rule's source or destination.
  • An IP set is a named group of addresses and networks. Select Add IP set, then use it in a rule as +name. An entry marked Exclude takes its addresses out of the set.

An alias or IP set that a rule still uses can't be removed or renamed. Change the rule first.

Turn the firewall on​

Allow your own connection first

The inbound default starts as Block, so once the firewall is on, every inbound connection that no rule allows is dropped. Add an inbound Allow rule for the way you connect, such as the SSH or RDP preset, before you turn it on. If you lock yourself out, the HTML console still works.

Switch Firewall on and select Turn on in the dialog, which names the inbound default. Switch it off to stop applying the rules.

Result: a change applies a few seconds after it's saved. If the firewall doesn't accept a change, nothing changes, and Dash points at the field to correct.