I’m trying to get a user’s IPv4 address in addition to their IPv6 address on Cloudflare without upgrading to the enterprise plan.
I saw on Reddit someone said:
“You can just use a Transform Rule to add that header, though – for free.”
Turning on the True Client IP Header in CLOUDFLARE
by inCloudFlare
So far I’ve done:
1. Rules -> Transform Rules
2. Create Rule -> Modify Request Header
3. Rule Name -> All incoming requests -> Set Dynamic
4. Header Name: "X-IPv4-O", Value: ip.src
Unfortunately ip.src still gives me the IPv6 address. I’ve asked ChatGPT/Claude what the syntax would be to get the IPv4 address but they don’t know. Given this Reddit comment saying it’s possible, I was wondering if anybody knew the right syntax to get the IPv4 address as a custom header.