How to block all IP’s addresses except some in CloudFlare

Fedepoi
2 min readMar 18, 2021

Sometimes for privacy and security reasons you may have to allow only certain IP addresses to enter your website. You may know how to allow or block specific IP’s in CloudFlare using “IP Access Rules” in Firewall>Tools>IP Access Rules. However, this trick will allow you to block all IP’s addresses expect one or two.

How ?

  • Login into your CloudFlare account.
  • Go to Firewall>Firewall Rules>Create a Firewall rule
  • Give a name (it does not matter). In the field section select “IP Source Addresses”; in operator select does not equals; in value write your IP that you WANT to allow the user to enter. Bellow, in the action dropdown, select BLOCK.
  • You can repeat this process the number of times that you want, adding the IP’s addresses that you want the user to enter.

It should look something like this:

Congrats! You have already blocked the users you do not want in your website :).

See you in another article! Chauuu

--

--

Fedepoi

I am a 19 years old software developer from Argentina currently pursuing a computer science degree in the United States while playing college tennis.