IP Access Rule is not working

I tried to clock the whole country. According to instruction I went to Firewall / Tools / IP Access Rules

Choose “United states”, Block, This website, Add…

and nothing happening. No error, nothing, I cannot add this rule. If I choose “Allow” then I can add the rule. When I try to edit the rule to “Block” but it doesn’t save.

Is this a bug or feature?

Also, is it possible to redirect users from specific country to special page like “We do not serve you yet” ?


Both :wink:

You need an Enterprise plan to block countries, but don’t fret, you can simply use a firewall rule, where that will work on your plan too. As always, the search has all the details on that.

Not with the mentioned tools, you’d need a custom Worker for that or customise the respective error page, though this will show up for all users then.

You need an Enterprise plan to block countries

I seem paying $5000 / month for such simple thing is kind of too much :slight_smile: and documentation Configuring IP Access Rules – Cloudflare Help Center doesn’t say what I need some kind of special plan…

you can simply use a firewall rule,

This is what i tried and it do not work :frowning:

I can block one IP, but cannot block whole country. If it need to block US, the only option is to provide hundreds of IP ranges, which is just insane

I can add “allow” rule", but cannot add “block” rule. It just silently do not save my changes

choose “block”

now refresh page

and it “allow” again

bug? any way around it?

you’d need a custom Worker for that

I don’t know how to write such scripts :frowning: I thought it might be possible to set up simple rule
“if country == US then redirectto page /we-dont-serve-you-yet.htm”

I looked at the worker solution – it is not possible to set up a “worker for country”. Error page… but how can I show error page, I wanted to use cloud flare I’m paying for every month.

I can write code on my backend to check country, but … Why cloud flare cannot do such simple thing? Very frustrating

Custom pages can be configured at https://dash.cloudflare.com/redirect?zone=custom-pages.

A Worker would work, but would not be country-specific. It would run for all your requests and you would need to handle this yourself, this is where the custom part comes in.

That’s not a firewall rule, but an IP access rule. Again, the search has all on that.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.