Close All Port But Allow List

Reza Salehi

Registered
May 30, 2019
1
0
1
GE
cPanel Access Level
Root Administrator
Hello
I have a server with centos OS with cpanel control panel and firewall CSF. I want close all output ports except allowed list IPs. would you please help me, how can I close port?
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,770
324
363
Chesapeake, VA
cPanel Access Level
DataCenter Provider
You want to close all outgoing ports? This is not advisable as it would break lots of functions.

By default, CSF closes all outgoing ports except the ones that are commonly needed:

TCP_OUT = "20,21,22,25,37,43,53,80,110,113,443,587,873,993,995,2086,2087,2089,2703"

This allows for FTP out, SSH out, DNS out. Web, email, and cpanel services.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463