I am using PRO plan $25/month. I want all traffic to come from 1 country, but exclude some IPs in that country. What should I do?

I am using PRO plan $25/month. I want all traffic to come from 1 country, but exclude some IPs in that country. What should I do?

Cloudflare’s network is anycast and so users traffic will originate from whichever datacenter they are routed to, typically their closest one.

There is nothing available to the Free, Pro or Business plans to restrict this.

1 Like

Are you asking if you can add a rule in Cloudflare to only allow vistors from one specific country unless they match specific IPs that you also wish to block from connecting?

1 Like

Create a list of excluded IPs blocked_ip_lists

Create a rule:

(not ip.geoip.country in {“AQ”} or ip.src in $blocked_ip_lists) then block

Blocks all traffic not from Antarctica or where IP is in blocked_ip_lists

2 Likes

For example I’m from Antarctica, I want to block all traffic coming from Antarctica . But except for my computer’s IP, because I’m in Antarctica

OK, thats the reverse of the above:

Create a list of included IPs allowed_ip_list

Create a rule:

(ip.geoip.country in {“AQ”} and not ip.src in $allowed_ip_list) then block

Blocks all traffic from Antarctica and where IP is NOT in allowed_ip_list

Or simpler, if you are on a fixed IP: just add your IP

(ip.geoip.country eq “AQ” and ip.src ne 0.0.0.0)

2 Likes