How to Open Ports in WHM Firewall?

There are times when you are required to open some ports in the firewall to run applications. With Linux VPS, we offer CSF firewall on demand. If you have not requested for a firewall, you do not need to open any ports. If you have installed any other (except CSF) firewall on your Linux VPS, you’ll have to refer its manual to open ports and other configuration settings. In this article, we will learn how to open a port in the CSF firewall from Web Host Manager (WHM) and SSH as well.

Open Port in CSF Firewall through SSH


CSF firewall is too easy to configure in both ways (through WHM and SSH).

  1. Login to your Linux machine through SSH. Open csf.conf file using any text editor.

    /etc/csf/csf.conf
  2. Add the port you wish to open and restart CSF firewall for the changes to take into effect.

    # Allow incoming TCP ports
    TCP_IN = "20,443,465,21,22,587,993,25,53,80,110,143,995"
    # Allow outgoing TCP ports
    TCP_OUT = "20,21,443,587,22,25,80,110,43,53"
    csf -r  // To restart CSF firewall


Open Port in CSF Firewall through WHM

  1. Login to WHM.
  2. Type firewall in Find bar and click on ConfigServer Security&Firewall link.

    Firewall

  3. At this page, click on the Firewall Configuration button.

    Firewall Configuration

  4. Scroll down and locate Allow incoming TCP ports section. Enter the port you wish to open and click on the Change button at the bottom to save your changes. Then after, you will need to restart csf by clicking on Restart csf+lfd button.

    Ports

  • 1 Users Found This Useful

Was this answer helpful?

Related Articles

Fix - cPanel Account Restore Failed: Failed to create the account. A database owner with the name “cpaneluser” already exists

One of our customers was migrated from another cPanel host. While restoring his account to our...

How to Install ClamAV plugin from WHM?

ClamAV is a one of the most popular open source antivirus plugin available for cPanel servers....

How to Set the Server Time Zone in WHM?

We deliver Linux VPS with default Timezone i.e. MST – Mountain Standard Time. You may need to...

How to install ConfigServer Explorer to cPanel/WHM?

Undoubtedly, WHM has been the most comprehensive control panel of all time for Linux based...

How to install ConfigServer Firewall to cPanel/WHM?

The ConfigServer Firewall - CSF is one of the most popular and advanced firewall suite available...