How to open a port on Firewalld?

vps-firewall-port

How to open a port on Firewalld?

Introduction:

For the safety and availability of virtual private servers (VPS), it is important to manage the firewall settings.

Firewalld, a Linux-based firewall manager that manages both inbound and outbound traffic, provides robust features.

By opening ports on Firewalld, specific services or applications can communicate with each other, resulting in better VPS preformance.

Understanding Firewalld:

A Linux management tool called Firewalld is designed to handle firewall rules dynamically, with a versatile framework that can accommodate IPv4 and IPv6 configurations, zones, services, and rich rule sets. 

Each firewall uses a zone to establish varying levels of security of its connections.

Firewalld is a standard component in CentOS, AlmaLinux, and other contemporary Linux distributions.

Opening a Port on Firewalld: 

Across various Linux distributions, this guide will teach you how to open a port on Firewalld:

  1. CentOS and AlmaLinux:

    • Check the currently active zones using the command:

      sudo firewall-cmd --get-active-zones
    • Identify the zone relevant to your network interface, such as ‘public’, ‘internal’, or ‘trusted’.

    • To open a specific port, say port 8080, run the command:

      sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
    • Apply the changes by reloading the firewall:

      sudo firewall-cmd --reload
  2. Ubuntu and Debian:

    • Check the current status of Firewalld:

      sudo ufw status
    • If UFW (Uncomplicated Firewall) is not installed, install it:

      sudo apt update
      sudo apt install ufw
    • Open the desired port, for example, port 8080:

      sudo ufw allow 8080/tcp
    • Reload the firewall for the changes to take effect:

      sudo ufw reload

Conclusion:

Effective firewall management is a must-have for optimizing your VPS’s performance and security. Learn how to access and configure ports on  Firewalld  for your applications and and services in Linux distributions like CentOS , Ubuntu, Debian, AlmaLinux, By taking these steps, you can maximize the potential of your VPS and create a secure and robust environment that meets your specific requirements. Maintain proactive firewalling practices to safeguard your VPS and optimize its performance for future deployment.

Post Your Comment

Free Migration Assistance

If you need assistance with migrating your current data from another provider, we would be more than happy to assist.