About IP blocking

About IP blocking

My clients base is in Japan
So for safety reasons
I want to block IPs from other countries
Only allow Japanese IP, can access my website

I use the free plan and I go to WAF there are five rules I can set it up

I set up a one

Field equals Japan and allow for my first rule

My question is how to allow google and FB crawler robots into my website to collect website information
it is so important because of SEO and FB Pixel.
so how to set up the second rule for google and Fb Pixel.

and next question is my Email based on the google workspace to customize such as [email protected]
so how do allow my Email MX record below

in order to get the mail.

so how to set up the third rule for Email

I am just a wordpress website designer so I really don’t know about the internet system

so I wish someone can help me and give me a favor.

Thank you all a lot.

1 Like

If you’re wanting a firewall rule that will block requests from outside of Japan that aren’t a verified bot, you can use something like this with a Block action:

(ip.geoip.country ne "JP" and not cf.client.bot)

You won’t create a rule in Cloudflare for access to your MX records, those are owned and managed by Google and access to them is based on their policies.

Hi Jwds1978

Thank you for your answer
My client base is in Japan
so do you mean my rule should be

`(ip.geoip.country qe “JP” and not cf.client.bot) allow


(ip.geoip.country ne “JP” and not cf.client.bot) allow


Hi cscharff

Thank you for your answer.

I got it

Thanks a lot

You want the firewall rule’s action to be Block, not Allow.

(ip.geoip.country ne "JP" and not cf.client.bot)

This will block requests that originate from outside of Japan and aren’t a verified bot.

Hello Jwds1978

Yes I follow your answer and it is work now

Thank you very much.

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