How to Block a Country in CSF firewall

To block all traffic from a country in CSF Firewall edit file /etc/csf/csf.conf

vi /etc/csf/csf.conf

Find the line

CC_DENY = ""

In this line, you can add 2 Letter country code. For example to block China and Russia, add

CC_DENY = "CN,RU"

Now you need to restart firewall with command

systemctl restart lfd
csf -r
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *