New: S3 Object storage

Firewall rules in Hexabyte Cloud

In Hexabyte Cloud every instance (also called a VPS) can have its own firewall that controls which traffic is allowed to and from the server. The firewall function can be either active or inactive:

  • Active firewall: traffic is filtered according to the rules you have set.
  • Inactive firewall: all traffic passes through, no rules are applied.

You can see whether the firewall is active directly in the instance’s Firewall tab.

What is a firewall rule?

A firewall rule is an instruction that decides whether certain network traffic should be allowed or blocked, based on:

  • Direction:
    • Ingress: incoming traffic to the server.
    • Egress: outgoing traffic from the server.
  • Source: the IP address or network the traffic comes from.
  • Destination: the IP address or network the traffic is going to.
  • Source port / Destination port: which ports are used in the communication (for example port 22 for SSH).
  • Protocol: for example TCP, UDP, ICMP4/ICMP6 (for ping), or any for all protocols.
  • Action: allow to permit or reject to block the traffic.
  • State: enabled or disabled, to turn the rule on or off without deleting it.

How the interface works

In the firewall tab for your instance you can see all active rules. When you add or edit a rule, you fill in fields such as:

  • Protocol, Source, Port, Destination, Description and so on.
  • You can enter specific IP addresses, port numbers, or use any to allow/block everything.

Examples of common rules

Allow SSH (for logging in via terminal)

Direction Protocol Destination port Description
Ingress TCP 22 Allow SSH to server

Allow HTTP and HTTPS (for a web server)

Direction Protocol Destination port Description
Ingress TCP 80, 443 Allow HTTP/HTTPS

Allow ping (ICMP)

Direction Protocol Description
Ingress ICMP4 Allow ping via IPv4
Ingress ICMP6 Allow ping via IPv6

Allow all outgoing traffic

Direction Protocol Description
Egress Any Allow all outgoing traffic

Limit traffic to a specific IP address

You can use the Source field to allow traffic only from a certain IP address. That is particularly useful when you want to:

  • Protect SSH so that only you (or your office) can log in.
  • Allow access to an API service only from trusted sources.
  • Reduce the risk of intrusion by limiting unnecessary exposure.

Example: allow only your IP for SSH

If your IP address is 203.0.113.45:

Direction Protocol Destination port Source Description
Ingress TCP 22 203.0.113.45 Allow SSH from my IP

You can also use CIDR notation (for example 203.0.113.0/24) if you want to allow a whole network.

Tips

  • Note that the order does not matter; the system sorts the rules automatically when you save.
  • Leaving fields empty (any) means that everything in that field is allowed.
  • There is an automatic default policy at the bottom: traffic that does not match any earlier rule is rejected.
  • Remember to click save when you have added or changed rules.

If you open port 22 in the firewall, the guide to installing an SSH server on Debian is a good next step. To also slow down repeated login attempts against that open port, see the guide to Fail2Ban.