Bring Your Own IP: Address Maps, Service Bindings and Prefix Validation
How BYOIP works with Cloudflare: onboard prefixes, validate IRR and RPKI, bind services, and use address maps for proxied DNS.
This page summarises Cloudflare BYOIP (Bring Your Own IP): using your own public IP prefixes with Cloudflare’s proxy and network services while keeping DNS answers and routing under your control where the product allows. The offering is Enterprise-only; your contract must include BYOIP and the right service configuration before onboarding.
Get Cloudflare’s security and performance while using your own IPs.
— Cloudflare, Cloudflare BYOIP
BYOIP: why use your own IPs instead of default anycast
Section titled “BYOIP: why use your own IPs instead of default anycast”When Cloudflare acts as a reverse proxy, it normally answers DNS for proxied hostnames with Cloudflare-owned anycast addresses. Traffic is still accelerated and protected, but the IP seen by clients is Cloudflare’s, not yours.
When you use Cloudflare as a reverse proxy, Cloudflare responds to DNS queries for proxied records with Cloudflare-owned IP addresses. For some organizations, it is important to keep their website or application associated with IP addresses they already own rather than using Cloudflare’s.
— Cloudflare, Cloudflare BYOIP
With BYOIP, Cloudflare announces your prefixes from its global network. You can tie those IPs to Magic Transit, CDN, Spectrum, Gateway DNS locations, and dedicated egress. Service bindings decide which Cloudflare pipeline receives traffic for each address in the prefix; address maps decide which IPs appear in DNS responses for proxied records when you use BYOIP or account-level static IPs.
Address maps: proxied DNS answers vs origin reachability
Section titled “Address maps: proxied DNS answers vs origin reachability”An address map is the control that swaps default anycast answers for addresses you specify.
Address map is a data structure enabling customers with BYOIP prefixes or account-level static IPs to specify which IP addresses should be mapped to DNS records when they are proxied through Cloudflare.
— Cloudflare, About address maps
How address maps behave for proxied hostnames
Section titled “How address maps behave for proxied hostnames”For zones on Cloudflare authoritative DNS, proxied names usually get anycast IPs. If a zone or account is linked to an address map, responses use the IPs on that map instead.
By default, Cloudflare responds to DNS queries for proxied hostnames with Cloudflare-owned anycast IP addresses. Address maps allow you to override this behavior — when a zone or account is associated with an address map, Cloudflare responds with the IP addresses you specify instead.
— Cloudflare, About address maps
Address maps affect what clients resolve, not how Cloudflare finds your origin.
Address maps do not change how Cloudflare reaches the configured origin. The IP addresses defined on your zone’s DNS Records continue to instruct Cloudflare how to reach the origin.
— Cloudflare, About address maps
In the proxy scenario diagram, DNS can return an address from your BYOIP space; the client connects there; Cloudflare terminates on its network and forwards to the origin IP in your DNS record (for example using SNI). IPv4 and IPv6 are supported on maps.
BYOIP prefixes vs leased static IPs on address maps
Section titled “BYOIP prefixes vs leased static IPs on address maps”| Source | How the map is created | Editing |
|---|---|---|
| Leased static IPs | Cloudflare creates a map with your static IPs during onboarding | You may edit that map; you cannot create a second map using the same static IPs |
| BYOIP | You bring leased or owned space and create address maps yourself | Full create/edit via dashboard or API per Set up address maps |
Leased static IPs allow you to use a set of specifically assigned Cloudflare IPs to ensure they do not change. Cloudflare creates an address map with your static IPs that you may edit. You cannot create another map using your static IPs.
— Cloudflare, About address maps
Static IPs help when you must allowlist or publish fixed ingress addresses without operating your own routed prefix. Both BYOIP and static IPs can use address maps per the static IPs concept page.
Immutable account-wide address maps (BYOIP-only accounts)
Section titled “Immutable account-wide address maps (BYOIP-only accounts)”Some accounts must proxy only through BYOIP and cannot use Cloudflare IPs on proxied names. Cloudflare then creates an immutable, account-wide address map so all zones fall back to BYOIP addresses. That map cannot be deleted. You can still add zone-level maps with specific BYOIPs; zones without a zone map use the account-wide map.
When you must create an address map for CDN ingress
Section titled “When you must create an address map for CDN ingress”After BGP advertisement and an active CDN service binding, create and associate an address map if you want proxied DNS to return your BYOIP addresses. Confirm advertisement and binding status first, then verify DNS before production cutover.
If the prefix will be used for CDN ingress, create an address map after the BGP prefix is advertised. An address map determines which BYOIP addresses Cloudflare returns for proxied DNS records in an account or zone.
— Cloudflare, Get started
Address maps are not required for services that do not use Cloudflare’s proxied DNS responses (for example Spectrum-only use). Maps can be account-level (all proxied records in the account) or zone-level (one zone). Zone membership takes priority over account membership when both apply, per Set up address maps.
Prefix onboarding: requirements, LOA, and validation
Section titled “Prefix onboarding: requirements, LOA, and validation”Onboarding is API-driven for the self-serve path on Get started (that guide does not apply to Magic Transit-only prefix flows; use Magic Transit get started instead). Contact your account team to confirm BYOIP on the contract before you begin.
Prefix size, RIR, IRR, and RPKI prerequisites
Section titled “Prefix size, RIR, IRR, and RPKI prerequisites”Cloudflare rejects onboarding if registration, IRR, RPKI, or ownership checks fail. Typical requirements include:
- Prefix registered with a supported RIR (AFRINIC, APNIC, ARIN, LACNIC, RIPE)
- Minimum IPv4 /24 and/or IPv6 /48 (maximum IPv6 /32 on the BYOIP get-started page)
- IRR
route/route6objects that exactly match each prefix, with origin matching the ASN Cloudflare will use (self-serve on that page uses AS13335 unless your account team arranges otherwise) - Accurate ROAs, verifiable via Cloudflare’s RPKI Portal and tools such as Routinator
Your Internet Routing Registry (IRR) records must contain: A route or route6 object that exactly matches each prefix you want to onboard. An origin that matches the ASN Cloudflare will use to advertise the prefix.
— Cloudflare, Get started
Internet Routing Registry entries are the public record that Cloudflare may announce your space; peers use IRR and RPKI for filtering, as described in Internet Routing Registry (IRR).
Letter of Agency (LOA): manual PDF vs delegated creation
Section titled “Letter of Agency (LOA): manual PDF vs delegated creation”A Letter of Agency (LOA) authorises Cloudflare to announce your blocks; transit providers require it. It must list prefixes and the announcing ASN. For Cloudflare’s ASN on new onboardings, use AS13335 per Letter of Agency. The LOA must be a PDF (not JPG/PNG).
Self-serve onboarding can set delegate_loa_creation to true on Add Prefix so Cloudflare generates the LOA, relying on RPKI ROAs and ownership validation. If delegate_loa_creation is false, you upload the LOA manually and approval can take longer.
Add prefix, prove ownership, and reach approved status
Section titled “Add prefix, prove ownership, and reach approved status”-
Add the prefix with the Add Prefix endpoint (save
idandownership_validation_token). Example from Get started:curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/addressing/prefixes" \--request POST \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--json '{"cidr":"203.0.113.0/24","asn":13335,"delegate_loa_creation":true}' -
Prove ownership by publishing
cf-validation: <OWNERSHIP_VALIDATION_TOKEN>in the matching IRR object or acf-validationTXT in reverse DNS zones (only one method required). Delegate reverse zones at your RIR if you use DNS validation. -
Trigger validation with the Validate Prefix endpoint, then poll Prefix Details until
irr_validation_state,rpki_validation_state, andownership_validation_statepass andapprovedisV. -
Remove the ownership validation token from IRR or DNS after success, then continue with service bindings (prefix should remain withdrawn while bindings are configured per get-started guidance).
If validation fails, use Troubleshoot prefix validation and re-run validation after fixes. States such as missing, invalid, and mismatch_asn map to IRR, ROA, or token mismatches.
For Magic Transit-specific prefix and BGP prefix objects (billing per BGP prefix, onboarding up to /24 only), see Advertise prefixes.
Service bindings: Magic Transit, CDN, and Spectrum per CIDR
Section titled “Service bindings: Magic Transit, CDN, and Spectrum per CIDR”Service bindings map destination IPs in your prefix to a Cloudflare service: Magic Transit, CDN, or Spectrum. A default binding must cover the entire prefix; more-specific bindings override it for narrower CIDRs.
In the context of BYOIP, service bindings map traffic destined for IP addresses to the Cloudflare service it should be routed through - such as Magic Transit, CDN, or Spectrum. A default binding covering the entire prefix is required when you first onboard, and additional bindings can be created at any time to route specific IP addresses or CIDR ranges to a different service.
— Cloudflare, IP address service bindings
Scope rules and propagation time
Section titled “Scope rules and propagation time”| Configuration | Rule |
|---|---|
| Magic Transit as default | Magic Transit can only be the default binding for the whole prefix; add CDN or Spectrum on subnets, not the reverse |
| CDN ↔ Spectrum within a prefix | Individual IPs in a CDN prefix can bind to Spectrum and vice versa; see Scope |
| Egress from prefix IPs | Traffic egressing to an IP in the prefix goes to Magic Transit even if CDN/Spectrum bindings overlap (same IP as ingress and origin) |
| API availability | Binding create/delete is API-only today |
Creating or deleting a binding takes four to six hours to propagate; traffic in scope may be disrupted during that window. Wait until bindings are active before advertising BGP. Cloudflare recommends aggregating contiguous addresses into the largest practical CIDR (example: eight CDN-upgraded IPs as one /29 in Get started).
After the default binding, Cloudflare provisions a corresponding BGP prefix in withdrawn state; allow at least five hours before advertising.
Prefix delegations and parent-account bindings
Section titled “Prefix delegations and parent-account bindings”Prefix delegations let the owning account grant another Cloudflare account use of all or part of a prefix (useful with Cloudflare for SaaS and address maps). Service bindings for delegated space are created on the parent account that owns the prefix. The dashboard delegates entire prefixes; partial delegation uses the API.
Common mistakes and API errors
Section titled “Common mistakes and API errors”- Advertising before bindings are active — leads to
advertise_state_lockedor incomplete deployment; wait forprovisioning.stateactive on bindings. - Creating BGP without default service binding —
incomplete_bgp_deployment: configure the default edge service binding first (Troubleshooting). - Assuming address maps change origin routing — only DNS answers change; origin IPs remain in DNS records.
- Wrong API token scope — Spectrum-scoped tokens may lack IP Prefix permissions; Spectrum errors 11018 (BYOIP not enabled) and 11019 (not authorised) are documented in Spectrum error codes.
- IRR/ROA drift — onboarding and ongoing reachability depend on accurate IRR and ROA; verify with WHOIS/IRR Explorer per Manage IRR entries.
- Non-SNI legacy certificates — BYOIP cannot pair with legacy custom certs for non-SNI; address maps can set default SNI per Troubleshooting.
How to check this on your site
Section titled “How to check this on your site”- Call the Prefix Details endpoint for your prefix and confirm
approvedisVand IRR, RPKI, and ownership states are valid, following Troubleshoot prefix validation. - List service bindings on the prefix and confirm the default binding and any more-specific bindings show
provisioning.stateactive (IP address service bindings). - After BGP is advertised for CDN ingress, query public DNS for a proxied hostname and confirm answers match the IPs on your address map (compare with a lookup before the map was associated).
- Optionally verify IRR/route objects for your prefix with
whois -h rr.ntt.net <NETWORK_PREFIX>as shown in Manage IRR entries. - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.