Behind Cloudflare, Which IP Should the Origin Allowlist?
Key takeaways
- A proxied Cloudflare request uses two separate connections: visitor to edge, and edge to origin.
- Your origin firewall sees Cloudflare origin-facing egress IP on incoming packets, so allowlisting only the visitor IP blocks proxied traffic.
- Cloudflare passes the visitor IP in the CF-Connecting-IP HTTP header, which your application should trust only after the firewall restricts access to Cloudflare egress.
- Dedicated CDN egress is available on Enterprise plans, and a single BYOIP prefix binds to either CDN ingress or CDN egress rather than both simultaneously.
On this page
When a website sits behind Cloudflare’s proxy, a visitor’s browser never opens a direct network connection to your origin server. Instead, the visitor connects to Cloudflare, and Cloudflare opens a second connection to your origin. Knowing which IP address appears at the firewall versus inside HTTP headers prevents lockouts and forged-header mistakes.
For the foundational mechanics of source-address filtering, see What Is IP Allowlisting?. This walkthrough focuses specifically on the Cloudflare CDN proxy path.
One proxied HTTPS request, two separate connections
Trace one ordinary proxied HTTPS request to shop.example.net using documentation example addresses (RFC 5737):
- Connection 1 (Visitor to Cloudflare edge): The visitor at example address
198.51.100.42resolvesshop.example.netand connects to Cloudflare’s proxied edge destination203.0.113.50. - Connection 2 (Cloudflare edge to Origin): Cloudflare terminates the visitor’s TLS connection at the edge and opens a separate outbound HTTPS connection from a Cloudflare origin-facing IP (for example, shared egress
192.0.2.15, or Enterprise dedicated BYOIP egress198.51.100.200) to your origin server.
Your origin firewall sees only Connection 2. The network source IP on the packet arriving at the origin firewall is Cloudflare’s egress IP, never the visitor’s IP 198.51.100.42. If you configure the origin firewall to allow only the visitor’s address, the proxied connection from Cloudflare is rejected.
What the visitor, firewall, and application each see
Compare the same proxied request to shop.example.net across all three vantage points and both egress models (all addresses are documentation examples):
| Vantage point | Shared Cloudflare egress | Dedicated Enterprise BYOIP egress | Operational takeaway |
|---|---|---|---|
| Visitor | Src 198.51.100.42 -> Dst 203.0.113.50 (shop.example.net) | Src 198.51.100.42 -> Dst 203.0.113.50 (shop.example.net) | Changing Cloudflare’s origin-facing egress does not change the visitor IP or the public site destination |
| Origin firewall | Sees packet source 192.0.2.15 (from Cloudflare’s published origin-facing ranges) | Sees packet source 198.51.100.200 (from your dedicated egress prefix) | Allowlist Cloudflare’s egress source here; allowing only visitor IP 198.51.100.42 drops proxied traffic |
| Origin application | Reads HTTP header CF-Connecting-IP: 198.51.100.42 | Reads HTTP header CF-Connecting-IP: 198.51.100.42 | Application uses the header for logging or user-level logic only after the firewall confirms traffic came through Cloudflare |
Inspect each vantage point below and toggle between shared and dedicated egress, or test a visitor-only firewall rule:
Cloudflare Proxied Request Inspector (Example Addresses)
Request to https://shop.example.net · visitor 198.51.100.42 · public edge 203.0.113.50.
- Visitor address (fixed)
- 198.51.100.42
- Public site destination (fixed)
- 203.0.113.50
- Origin-side source IP
- 192.0.2.15
Connection 2: Packet arriving at the origin firewall
The origin firewall sees packet source 192.0.2.15 (example shared Cloudflare origin-facing range). It never sees visitor IP 198.51.100.42 in the TCP/IP packet header.
Allowed: packet source 192.0.2.15 matches the origin allowlist.
With shared egress, your firewall allows Cloudflare published origin-facing ranges so proxied requests reach the origin.
Where the visitor IP appears and why the trust boundary matters
To let your application know who initiated the request, Cloudflare adds documented HTTP request headers such as CF-Connecting-IP (carrying 198.51.100.42 in our example; see Cloudflare HTTP request headers).
Keep the trust boundary clear: an HTTP header is plain request data, not a network-layer guarantee. If your origin server accepts direct connections from the wider internet on port 443, any external client can connect straight to the origin and send a forged CF-Connecting-IP header. Your origin firewall must first restrict inbound connections to Cloudflare’s origin-facing egress (and ideally pair that with Authenticated Origin Pulls or Cloudflare Tunnel) before your application treats CF-Connecting-IP as trustworthy.
Shared Cloudflare ranges vs. dedicated CDN egress
Standard proxied setups allowlist Cloudflare’s published shared IP ranges at the origin firewall. That keeps direct-to-origin scans off your server, yet those shared ranges also originate traffic for other Cloudflare customers.
Organizations that need a tighter origin allowlist can use dedicated CDN egress, which Cloudflare offers on Enterprise plans. With BYOIP, Cloudflare’s BYOIP service bindings documentation notes an important design constraint: a single BYOIP prefix is bound to either CDN ingress or CDN egress, not both at the same time. If you want both custom ingress addresses for visitors and dedicated BYOIP egress addresses toward your origin, plan separate prefixes for each role.
FAQ
Related resources
Ready to see where BYOIP is supported?
Continue the series
Who Can Sign a Letter of Authorization for a BYOIP Prefix?
Your team leases a /24 and the new network asks for an LOA. Find out whose authority the letter must carry and what the provider checks.
6 min read · Updated 4 December 2026
Read articleHow Does an IPv6-Only Server Reach an IPv4-Only API?
Follow one outbound request from an IPv6-only server, through DNS and a translation gateway, to the IPv4 source address the API sees.
5 min read · Updated 4 December 2026
Read article