This article will explain how you can open ports for your server in CSF.

[alert]Please be aware that opening ports on your server can be a security risk, please be aware of any risks when opening a specific port on your server.[/alert]

There are 2 different ways to open ports on your server. One way is through WHM and one is via command line.

[headline]Steps to open ports in WHM[/headline]

1.) Log in to your WHM: SERVER-IP/WHM

2.) Click “ConfigServer Security & Firewall,” which is under the “Plugins” section

[image source="http://hostdime.com/resources/wp-content/uploads/WHM-Firewall.png " hovertext=" "]

3.) Go to "Firewall Configuration"

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/CONFIG.png " hovertext=" "]

4.) Find "TCP_IN=" under "IPv4 Port Settings"

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/WHMTCPIN.png " hovertext=" "]

5.) Enter the port number in the list below. Make sure to separate ports with a single comma and do not enter any spaces.

6.) Click "Change" at the bottom of the page.

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/WHMCHANGE.png " hovertext=" "]

This will reset the firewall so that the ports that you have opened will take effect.

[headline]Steps to open ports via command line[/headline]

1.) SSH into your server.

2.) Go to the directory with the CSF configuration file.

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/CDETCCSF.png " hovertext=" "]

3.) Open the file "csf.conf"

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/nanocsf.png " hovertext=" "]

4.) Once you are in the configuration file, find "TCP_IN=", it will be under "# Allow incoming TCP ports"

[image source="https://www.hostdime.com/resources/wp-content/uploads/2015/06/TCPALLOW.png " hovertext=" "]

5.) Within the quotation marks, put the port number that you wish to open. Separate each IP using a single comma and no spaces.

6.) Close the file and save all changes.

7.) Restart the firewall.