I have understood that I can block countries through CSF, but for example I have blocked access from China using CN, but I see in the log exim no authentication attempts from China, as I can block 100% of traffic from countries using CSF?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Hello there,
You can also use a third-party providers like CloudFlare that have Firewall features where you can block access from certain IP addresses or whole country IP ranges. They also regularly update their IP lists which means you’re likely to bypass some requests coming from proxies.
Just enter an IP address, an IP range, or a two-letter country code you wish to block
https://serverpilot.io/docs/how-to-block-ips-with-cloudflare/
Hope that helps!
hello there,
In order to block a country, you can use the
CC_DENY
option which accepts two-letter country codes such as US, GB and etc.In order to list more than one country you just need to separate them using commas:
CC_DENY = "AB,CD,EF"
You may find a list of ISO 3166-1 alpha-2 code at https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
If you’re not familiar with CSF or you want to install it on CentOS or Ubuntu droplet check out this mini tutorial:
For CentOS:
https://www.digitalocean.com/community/questions/how-to-install-and-configure-config-server-firewall-csf-on-centos
Hope that this helps!
Your question is not very clear, but yes. ConfigServer Firewall can have rules set up based on a country code rather than specifying IP ranges. The CC_ALLOW and CC_DENY directives allow you to specify country codes to allow or deny. The following list of country codes should be accepted by CSF.