How to Open a Port in CSF Firewall via WHM/cPanel?

Ports are the places where IP addresses and Internet protocols originate and communicate with source or destination addresses. The port is part of the client-server model and has an identification number that is 16 digits long. Obviously the CSF firewall must be configured to open the port because server security is important.

To Open a Port in CSF Firewall

1. Log into WHM with your root account.

2. Select the Plugins option from the navigation menu.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_plugins.png

3. Click on ConfigServer Security & Firewall.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_configserver_security_firewall.png

The ConfigServer Security & Firewall panel will appear.

4. Go to the csf tab and click on the Firewall Configuration button in the csf-ConfigServer Firewall section.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_configserverwhm_configserver_security_firewall_csf-min.png

Different customization options appear for the firewall.

5. Select the IPV4 port Settings section from the dropdown list.

6. Copy/enter the following port numbers in the Allow incoming TCP ports and Allow outgoing TCP ports fields.

Allow incoming TCP ports:

20,21,22,25,53,80,110,143,443,465,587,993,995,2077,2078,2082,2083,2086,2087,2095,2096,26

Allow outgoing TCP ports:

20,21,22,25,37,43,53,80,110,113,443,587,873,2086,2087,2089,2703

https://www.milesweb.com/hosting-faqs/wp-content/uploads/2021/09/whm_csfirewall_ipv4settings_ports.png

Although we recommend these port numbers, you can enter other port numbers as per the requirement.

7. Click the Change button at the end.

It will save the changes you made to the firewall configuration.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_restart_csf_ifd.png

8. Click on Restart csf+lfd.  It will restart the csf firewall and apply the changes.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 133