How to block countries using CSF firewall ?

Discussions related with hosting control panels used, which include cPanel, Plesk, Directadmin etc..

Moderator: Staff

Post Reply
chris ben
Posts: 0
Joined: Fri Sep 16, 2016 10:09 am

How to block countries using CSF firewall ?

Post by chris ben »

Is it possible to block countries using CSF firewall ?


Martin
Posts: 36
Joined: Fri Sep 16, 2016 10:34 am

Re: How to block countries using CSF firewall ?

Post by Martin »

Hello,

Yes, it is possible to block counties using CSF.

1. Log into server via SSH

2. Edit CSF configuration file

vi /etc/csf/csf.conf

3. Search for 'CC_DENY ' and enter the country code to block

CC_DENY = ""

Example : CC_DENY = "US" -- this will block united states.

5. Save the file and exit

6. Restart the firewall : csf -r

=============================
Martin
Linux Support Engineer.
Nixtree Solutions
Managed Full Server Backups
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree


If you are looking for assistance in server management, please get in touch with our support.
Post Reply