Does Single Redirect have an implied ELSE statement?

If we put 2 or 3 “if src.ip ne x.x.x.x, redirect to old site” separated by OR, shouldn’t the PCs of those listed be allowed to go the new site? It seems those rules catch everyone, even those with those specific public IPs.

If you have a simple expression like

(ip.src ne 1.1.1.1) or (ip.src ne 1.2.3.4) or (ip.src ne 8.8.8.8)
You’re saying “if the ip is not equal to x, or if the Ip is not equal to y, or if …”. Your IP will not be not equal to more then one unique IP, so it’ll always be true.

You want to use “and”
(ip.src ne 1.1.1.1 and ip.src ne 1.2.3.4 and ip.src ne 8.8.8.8)
If IP is not equal to 1, and not equal to 2, and not equal to …

Or better yet, not in list
(not ip.src in {1.1.1.1 1.2.3.4 8.8.8.8})
If IP isn’t in the list… do x action

The Ruleset Engine is based on Wireshark Display Filters, docs here: Rule expressions · Cloudflare Ruleset Engine docs

5 Likes

Thank you! That worked and my bad, I was overthinking it!

3 Likes

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