Hosting or Servers Logo

Block A Country Using the CSF GUI and CC_DENY

Head over to your ConfigServer Security & Firewall (CSF) settings page. It should look like the image marked Figure 1.

ConfigServer Security & Firewall Settings

Figure 1.


From the dropdown menu (Figure 2.) select "Country Code Lists and Settings."

CSF Drop Down Menu Country Codes

Figure 2.


You now have two options to choose between. Figure 3. is the MaxMind Database. Figure 4. is the ipdeny.com databases. MaxMind needs a free license key but provides a more robust set of features. The ipdeny.com database is also free but can have downtime and inconsistencies. Once you have picked which database you prefer then enter "1" or "2" in the CC_SRC box and scroll down the page to CC_DENY option.

CSF MaxMind Settings

Figure 3.

CSF CC_SRC

Figure 4.


In the box labelled CC_DENY you should create a comma separated line of Country Codes belonging to the Countries you wish to block. The table below contains examples of commonly used codes. Head HERE for a complete list.

You Are Leaving Us

This link is being provided as a convenience and for informational purposes only it is not an endorsement or an approval of any of the products, services or opinions of the corporation or organization or individual.

Hostingorservers.com bears no responsibility for the accuracy, legality or content of the external site or for that of subsequent links.

Country Code
Country

GB

Great Britain

US

United States of America

AF

Afghanistan

CA

Canada

CN

The People's Republic of China

DK

The Kingdom of Denmark

DE

The Federal Republic of Germany

IR

The Islamic Republic of Iran

PS

The State of Palestine

CSf Enter Country Codes

Scroll down the page until you reach the bottom and then save your changes. You should then be presented with the option to restart CSF and LFD in order to launch the changes you made.

CSF Save Settings Button
Memory and ResourcesSome of the CIDR lists are huge with each entry requiring a rule within the incoming iptables chain. It is recommended you take caution not to overwhelm your VPS or dedicated server.

You Are Leaving Us

This link is being provided as a convenience and for informational purposes only it is not an endorsement or an approval of any of the products, services or opinions of the corporation or organization or individual.

Hostingorservers.com bears no responsibility for the accuracy, legality or content of the external site or for that of subsequent links.