This guide shows you how to turn on the LifeinCloud firewall for a VPS, add allow/deny rules, and verify that everything works without locking yourself out.

Default: The firewall is disabled by default (all ports open). When you enable it, the default policy changes to block all traffic unless explicitly allowed by your rules.

Step 1 — Open the Firewall for your VPS

  1. Go to your LifeinCloud client area.
  2. Open Services → Your VPS and select the server you want to protect.
  3. Navigate to the Firewall section.

Step 2 — Add a Safe Access Rule before Enabling

To avoid lockouts, first create an allow rule for your admin access:

Linux VPS (SSH)
  • Direction: Inbound
  • Protocol: TCP
  • Port: 22 (or your custom SSH port)
  • Source: YOUR.PUBLIC.IP/32

Replace YOUR.PUBLIC.IP with your real IP (e.g., 203.0.113.10). If your IP changes often, temporarily use 0.0.0.0/0 during setup and tighten later.

Windows VPS (RDP)
  • Direction: Inbound
  • Protocol: TCP
  • Port: 3389
  • Source: YOUR.PUBLIC.IP/32

For extra safety, allow RDP only from your office/home IPs.

Now enable the firewall. Your admin port stays reachable.

Step 3 — Understand Rule Fields

  • Direction: Inbound or Outbound (most users only need inbound rules).
  • Action: Allow or Deny.
  • Protocol: TCP, UDP, or Both (for services using both, like some games).
  • Port(s): Single (e.g., 443), list (e.g., 80,443), or range (e.g., 30000–30100).
  • Source (Inbound): IP/CIDR allowed to reach your VPS (e.g., 0.0.0.0/0, 203.0.113.0/24).
  • Destination (Outbound): Where your VPS can connect (leave as any unless you need egress control).
  • IPv4 / IPv6: Add rules for both stacks if your VPS has IPv6 enabled.
  • Priority / Order: Rules are processed top-to-bottom; first match wins. Keep “allow admin” near the top.

Step 4 — Add Common Service Rules

Web Server (HTTP/HTTPS)
  • Allow TCP 80 from 0.0.0.0/0
  • Allow TCP 443 from 0.0.0.0/0

If hosting only HTTPS, you can skip port 80 after forcing HTTPS.

Mail Server (example)
  • Allow TCP 25,465,587 (SMTP)
  • Allow TCP 110,995 (POP3/POP3S)
  • Allow TCP 143,993 (IMAP/IMAPS)

Open only what you use. Many providers block outbound 25 by policy.

Databases (private access only)
  • Allow TCP 3306 (MySQL/MariaDB) from YOUR.PRIVATE.RANGE/24 or a specific app server IP

Avoid exposing databases to the internet. Prefer private networking.

Game Server (example: Minecraft)
  • Allow TCP/UDP 25565 from 0.0.0.0/0
  • Keep SSH/RDP rules for administration

Some games need multiple ports or ranges—check the game’s docs.

Step 5 — Add IPv6 Rules (If Your VPS Has IPv6)

If your VPS has an IPv6 address, create equivalent IPv6 rules. For example:

  • Allow TCP 22 from YOUR:IPV6:ADDR::/128
  • Allow TCP 80 and 443 from ::/0

IPv6 is a separate stack—opening IPv4 does not automatically open IPv6.

Step 6 — Apply & Test Your Rules

  1. Apply/Save your firewall changes.
  2. Keep your current SSH/RDP session open. From another terminal/computer, test access:
    # From your computer (replace IP)
    # Check open web ports
    curl -I http://YOUR.SERVER.IP
    curl -I https://YOUR.SERVER.IP -k
    
    # Probe a port (Linux/macOS)
    nc -vz YOUR.SERVER.IP 22
    nc -vz YOUR.SERVER.IP 443
            
  3. If something fails, review rules and ordering. Ensure your source IP matches what the rule expects.

Tip: Add a temporary “Allow SSH/RDP from anywhere” rule while testing, then tighten it to your IP.

Recommended Rule Order

  1. Allow SSH/RDP from your IP(s)
  2. Allow critical services (HTTP/HTTPS, etc.)
  3. Allow private-only services from specific IPs/subnets
  4. Optional outbound controls (egress)
  5. Implicit/explicit deny (block everything else)

Maintenance & Best Practices

  • Review rules periodically; remove ports you no longer need.
  • Prefer allowlists (specific IPs) for admin ports over open internet access.
  • Mirror rules for both IPv4 and IPv6 if applicable.
  • Document why each rule exists (helpful for teams and audits).
Next: See Common Firewall Rule Examples & Use Cases for ready-made templates you can copy. If you get locked out or something doesn’t work, read Troubleshooting Firewall Issues.
¿Fue útil la respuesta? 0 Los Usuarios han Encontrado Esto Útil (0 Votos)