We have already discussed about installing  the ConfigServer firewall (CSF) in linux. The post you will be using most common commands and changes in the configuration file.

Allow port number in Firewall:

Below ports are opened by defaults,

# vi /etc/csf/csf.conf

##Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"

##Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,443"

##Allow incoming UDP ports
UDP_IN = "20,21,53"

##To allow outgoing traceroute add 33434:33523 to this list
UDP_OUT = "20,21,53,113,123"

For example if you want to set MySQL port 3306  should be opened  give comma(,) add the port in TCP_IN and TCP_OUT.
After chnages:
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,3306"
TCP_OUT = "20,21,22,25,53,80,110,113,443,3306"

How to block IP Address:
# csf -d "Mentions the reason block IP"

Adding to csf.deny and iptables DROP...
DROP  all opt -- in !lo out *  ->  
LOGDROPOUT  all opt -- in * out !lo  ->
Deny an IP address and added to /etc/csf/csf.deny directory

How to unblock an IP address :
# csf -dr

Removing rule...
DROP  all opt -- in !lo out *  ->  
LOGDROPOUT  all opt -- in * out !lo  ->
Unblock an IP address and removed from /etc/csf/csf.deny directory

How to allow an IP address permenatly:
# csf -a "server IP"

Adding to csf.allow and iptables ACCEPT...
ACCEPT  all opt -- in !lo out *  ->  
ACCEPT  all opt -- in * out !lo  -> 
Allow an IP address and added to /etc/csf/csf.allow 

How to Deny or Allow  countries:

Search the option  CC_DENY or CC_ALLOW and added the country codes.

Each option is a comma separated list of CC's

How Ignore the LFD email alert at particular user.

Enter the user id to csf.uidignore file,
# vi /etc/csf/csf.uidignore   

You can get a user id from   /etc/passwd

How to set alert  email  report from server :

Do you get an alert report email from the server lfd will send  the relevant alert template to configured email
# vi /etc/csf/csf.conf

LF_ALERT_TO = "alert@mydomain.com"

Executables (exe) command lines (cmd) and usernames (user) that lfd process tracking will ignore open the csf pignore file and add the exe path, for example three executable files ignored.
#vi /etc/csf/csf.pignore


If you curious more csf command ask help :
# csf --help
csf: v7.03 (cPanel)