BYOIP

Last updated Apr 16, 2026 When creating a Spectrum application, Cloudflare normally assigns an arbitrary IP from Cloudflare’s IP pool to your application. If you want to be explicit in your network setup or use your own IP addresses, BYOIP with Spectrum allows you to do just that.

BYOIP stands for Bring Your Own IP. If you own an IP prefix you can migrate it to Cloudflare. After migration, Cloudflare broadcasts your IP prefix and traffic is routed to the global Cloudflare network. However, without configuration, Cloudflare will not know how to handle this traffic. The last step is to add Spectrum applications for all applications that you wish to protect with the IP addresses you want associated with them.

Caution

When switching from non-BYOIP to BYOIP, if you are already using a Spectrum application, you need to delete your configurations and recreate new ones.

The smallest prefixes that Cloudflare currently supports is /24 for IPv4 and /48 for IPv6.

BYOIP does not come standard with Spectrum. To enable it, contact your account team.

UDP applications

Spectrum UDP applications are supported with BYOIP, including CDN and Spectrum service bindings. However, they are not currently supported with Magic Transit service bindings.

Assign an IP address

To use an IP, it must be assigned to a Spectrum app to create the appropriate A (IPv4) or AAAA (IPv6) records. This is done by specifying one or more IP addresses when creating an application through the API. Any change to the application's properties also needs to be done via API. In addition, you must update the DNS "type" field to "ADDRESS" to create a Spectrum app using BYOIP.

{
  "id": "4590376cf2994d72cee36828ec4eff19",
  "protocol": "tcp/22",
  "dns": {
    "type": "ADDRESS",
    "name": "ssh.example.com"
  },
  "origin_direct": ["tcp://192.0.2.1:22"],
  "ip_firewall": true,
  "proxy_protocol": false,
  "spp": false,
  "tls": "off",
  "traffic_type": "direct",
  "edge_ips": {
    "type": "static",
    "ips": ["198.51.100.10", "2001:DB8::1"]
  }
}

Example

In the example below, the application routes traffic through Cloudflare’s HTTP pipeline, including WAF, Workers and CDN functionality.

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>Zone Settings Write</code>

</details>

Create Spectrum application using a name for the originbash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/spectrum/apps" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "protocol": "tcp/80",
        "dns": {
                "type": "ADDRESS",
                "name": "www.example.com"
        },
        "origin_direct": [
                "tcp://192.0.2.1:80"
        ],
        "tls": "off",
        "traffic_type": "http",
        "edge_ips": {
                "type": "static",
                "ips": [
                        "198.51.100.10",
                        "2001:DB8::1"
                ]
        }
    }'

Was this helpful?

YesNo

On this page

BYOIP - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/spectrum/about/byoip/#page","headline":"BYOIP","description":"Use your own IP addresses with Spectrum applications.","url":"https://developers.cloudflare.com/spectrum/about/byoip/","inLanguage":"en","image":"https://developers.cloudflare.com/spectrum/about/byoip/og.png?v=6cc5919c3bc7abb3","dateModified":"2026-04-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Layer 3 and 4 DDoS protection for TCP and UDP Spectrum applications. title: DDoS Protection for Spectrum image: https://developers.cloudflare.com/spectrum/about/ddos-for-spectrum/og.png?v=ffa429f47a817909


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/spectrum/llms.txt
Use this file to discover all available pages before exploring further.