This article will guide you on how to block/allow countries in the CSF #firewall. CSF is used to restrict or allow countrywide IP ranges in the server using the country codes. For every country you want to deny, you just enter those letters in the field (separated by a comma). Once you're done, scroll to the bottom of the page and click CHANGE. This will restart the firewall, and you're now all set to go.
ConfigServe Firewall (#CSF) is a firewall configuration script created to provide better security for your server while giving you an easy to use and advanced interface for managing your #firewall settings in cPanel servers.
To limit the ability to connect on a specific port or ports to visitors with IP addresses originating in a specific country or countries, you must:
1. close the ports in the firewall.
2. define the country code allowed to connect on those blocked ports.
3. specify the blocked #ports to be opened for the specified country.