Block whole countries accessing server/website except you wants – CSF

Hey guys! We already discussed one of the amazing option in CSF for blocking/allowing countries. The usage of “CC_ALLOW” and “CC_DENY” to allow and deny countries with its country code.
You can refer this from the link added below:

If we use the options “CC_DENY” or “CC_ALLOW”, we have to specify the countries code to block or allow access. Here is an alternate option for blocking whole countries except we wants. How is it!!
Here is an example. If you want to allow only one country to your server, you need to specify all country codes in “CC_DENY” to block others, that’s not an easy way. We can done the same by using an alternate CSF directive.
CC_ALLOW_FILTER, by using this directive we can block all other countries to server.

# An alternative to CC_ALLOW is to only allow access from the following
# countries but still filter based on the port and packets rules. All other
# connections are dropped
CC_ALLOW_FILTER = ""

How to do this?

Yep! You can do this by editing the CSF configuration file “/etc/csf/csf.conf“.

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!