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