Block Country in CSF firewall

CSF firewall can block all traffic from a country or list of counrty using GeoIP database.

To block a country, edit file

1/etc/csf/csf.conf

Find

1CC_DENY=””

Replace with

1CC_DENY=”2_LETTER_COUNTRY_CODE”

Here is an example to block all traffic from China

1CC_DENY=”CN”

If you want to block another counrt, you can add it like

1CC_DENY=”CN,RU”

Now restart csf firewall with

1csf -r

Leave a Comment

Pin It on Pinterest

Share This
Open chat