Save 15% on Instant Deploy Bare-Metal Servers in 26 Global Markets with Coupon Code: EdgeSave

How to open certain ports in CSF Firewall on a dedicated server

1. Login to your Dedicated server with root

2. To open ports in CSF, you will want to edit these lines in this file:

# Allow incoming TCP ports
TCP_IN =  “20,21,22,25,26,53,80,110,143,443,465,587,993,995,2077,2078,2082,2083,2086,2087,2095,2096”
# Allow outgoing TCP ports
TCP_OUT = “20,21,22,25,26,37,43,53,80,110,113,443,465,873,2087,2089,2703”
# Allow incoming UDP ports
UDP_IN = “20,21,53,465,6277,24441”
# Allow outgoing UDP ports
UDP_OUT = “20,21,53,113,123,465,873,6277,24441,33434:33523”

and add the port number at the end of each line. See this example below where I add port 12345 to the incoming TCP ports section:

# Allow incoming TCP ports
TCP_IN = “20,21,22,25,26,53,80,110,143,443,465,587,993,995,2077,2078,2082,2083,2086,2087,2095,2096,12345”

Once that is done, save the file and then restart the firewall:

service csf restart

Share on Twitter
Share on Facebook