Config Server Firewall is known as CSF. This is most popular firewall for linux to secure your server. It comes with many useful features, You can manage CSF by command line or control panel.

From Command line you can edit csf configuration file /etc/csf/csf.conf

To allow Country you can use option CC_ALLOW

CC_ALLOW

To block Country you can use option CC_DENY

CC_DENY

After changes save and restart firewall.

csf -r

Similarly you can block country by using WHM go to plugin section

screenshot_142

1. Config Server Security & Firewall

2. Firewall Configuration

screenshot_143

 

Now in firewall configuration section you can block and allow country by using CC_ALLOW and  CC_DENY

 

screenshot_144

In above screenshot you can see some countries are block like CN = China , RU = Russia and CC_ALLOW IN = India is allowed.

After changes restart your firewall.

screenshot_147

That’s it!