Block all people outside my country who use VPN

Answer these questions to help the Community help you with Security questions.

Have you searched for an answer?
Yes, haven’t found a solution

Describe the issue you are having:
I run Facebook ads in my country, and i’m getting some spammer who spam my form, by blocking their IP address they are using VPN to bypass that and spam me! I want to block all people from other countries so i can stop the VPN (by the way, i’m from Algeria and Algeria don’t have a VPN) So they can’t choose Algeria as a VPN) but i want to allow Facebook bot ads. Facebook ads bot isn’t listed in the knows bots in Cloudflare, what should i do?

(ip.geoip.country ne “DZ” and not cf.client.bot and ip.geoip.asnum ne 32934 and ip.geoip.asnum ne 63293)

I don’t know if this is correct.

I don’t see a ready method in Cloudflare.

However, you can subscribe a 3rd party VPN IP database and query it your page to block traffics.

You mean I can use that to block all VPNs? But how can I block all VPNs and allow only bot from Facebook?

I’d suggest you to purchase some monthly trial VPN like Namecheap offers, connect withing each of the countries, check the IP and look for the ASN, make a list of ASNs and block them using IP Access Rules at Cloudflare dashboard.

Therefore, make sure to whitelist Facebook IP or ASN.

However, this doesn’t make you more secure, as far as Facbook scraping tool can be abused and misused against your website. Kindly, search on Google for those kind of topics for more related information.

Might be a difficult one, but you can block the most that way, if so.

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