CSF firewall can block all traffic from a country or list of countries using the GeoIP database.
To block a country, edit the file
/etc/csf/csf.conf
Find
CC_DENY=""
Replace with
CC_DENY="2_LETTER_COUNTRY_CODE"
Here is an example to block all traffic from China
CC_DENY="CN"
If you want to block another country, you can add it like
CC_DENY="CN,RU"
Now restart CSF firewall with
csf -r
See CSF firewall
Leave a Reply