Set up Private Network Load Balancing with Client-to-Tunnel

Last updated Oct 12, 2026 You can use Private Network Load Balancing to distribute Cloudflare One Client traffic to private hostnames and IPs connected via Cloudflare Tunnel.

For example, assume you have an internal application running in two data centers, and you want Cloudflare One Client users to access the application from the data center closest to their geographic location. A typical load balancing configuration is shown in the following diagram:

graph LR
    W[WARP clients] --> C{Private load balancer <br> 100.112.0.0}
    C -- Tunnel 1 --> cf1
    C -- Tunnel 2 --> cf2
        subgraph D2[Data center 2]
            cf2@{ shape: processes, label: "cloudflared" }
            subgraph F[Pool 2]
                    S3["Endpoint <br> 10.0.0.1 (VNET-2)"]
                    S4["Endpoint <br> 10.0.0.2 (VNET-2)"]
            end
            cf2-->S3
            cf2-->S4
        end
        subgraph D1[Data center 1]
            cf1@{ shape: processes, label: "cloudflared" }
            subgraph E[Pool 1]
                    S1["Endpoint <br> 10.0.0.1 (VNET-1)"]
                    S2["Endpoint <br> 10.0.0.2 (VNET-1)"]
            end
            cf1-->S1
            cf1-->S2
        end

        style E stroke-width:2px,stroke-dasharray: 5 5
        style F stroke-width:2px,stroke-dasharray: 5 5

The components in the diagram include:

  • cloudflared: Each data center is connected to Cloudflare with its own Cloudflare Tunnel. cloudflared installs on one or more host machines in the network.
  • Private load balancer IP: End users connect to the application using the load balancer's IP address. This can either be a Cloudflare-assigned IP in 100.112.0.0/16 or a custom /32 IP in an RFC 1918 range ↗︎.
  • Load balancer pool: The load balancer is configured with one pool per tunnel.
  • Load balancer endpoint: A pool contains one or more endpoints, where each endpoint is a server behind cloudflared that is running the application. If your servers have overlapping IPs, you can assign a distinct virtual network (VNET) per tunnel so that Load Balancer can deterministically route requests to the correct endpoint.

Note

Load Balancing does not currently support private hostname routing. Load balancing endpoints must be defined using an IP address and virtual network (for example, 10.0.0.1 (VNET-1)).

Prerequisites

  • Your endpoint IP addresses route through Cloudflare Tunnel. To learn how to connect your private network, refer to Connect an IP/CIDR.

1. Create load balancer pools

Load balancer pools are logical groupings of endpoints, typically organized by physical datacenter or geographic region. The endpoints in the pool are the destinations where traffic is ultimately routed.

Pools can be created using either the Cloudflare dashboard or the API.

To create a pool using the dashboard, refer to the Create a pool documentation.

Endpoint IP address limitations

  • All endpoints with private IPs must have a virtual network (VNET) specified. If you did not select a VNET when adding a Cloudflare Tunnel route, the endpoint will be assigned to the default VNET.
  • A pool cannot have multiple endpoints with the same IP address, even when using different virtual networks. You can assign endpoints with overlapping IPs to different pools, as shown in the example diagram.

To get a list of your current virtual networks, use the List virtual networks API operation.

Enable virtual/private IP support by adding the virtual_network_id field to the origins in your API request. Refer to the Cloudflare Load Balancer API documentation for more information on how to create a pool using the API.

The following example adds a Cloudflare Tunnel endpoint to an existing Load Balancer pool:

<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>Load Balancing: Monitors and Pools Write</code>

</details>

Patch Poolbash

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/load_balancers/pools/$POOL_ID" \
    --request PATCH \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "origins": [
                {
                        "name": "server-1",
                        "address": "10.0.0.1",
                        "enabled": true,
                        "weight": 1,
                        "virtual_network_id": "a5624d4e-044a-4ff0-b3e1-e2465353d4b4"
                }
        ]
    }'

2. Create a private load balancer

  1. In the Cloudflare dashboard, go to the Load Balancing page. Go to Load Balancing ↗
  2. Select Create a Load Balancer.
  3. Select Private Load Balancer.
  4. On the next step you can choose to associate this load balancer with either:
  5. A Cloudflare-assigned IP from the 100.112.0.0/16 range
  6. A custom /32 IP in an RFC 1918 range ↗︎
  7. Add a descriptive name to identify your load balancer.
  8. Proceed through the setup.

After completing the setup, you will be redirected to the Load Balancing dashboard. You can locate your load balancer using the search bar or by filtering for Private load balancers. Be sure to note the load balancer IP as it will be required in the following steps.

3. Route the load balancer IP through the Cloudflare One Client

In order for Cloudflare One Clients to connect to your load balancer, the load balancer's IP address must route through the WARP tunnel in your Split Tunnel settings.

  1. In the Cloudflare dashboard ↗︎, go to Zero Trust > Team & Resources > Device profiles.
  2. Find the device profile you would like to modify and select Edit.
  3. Under Split Tunnels, check whether your Split Tunnels mode is set to Exclude or Include.
  4. Select Manage. Depending on the mode:
  5. Exclude mode: Delete the IP range that contains your load balancer IP. For example, if your load balancer has a Cloudflare-assigned CGNAT IP, delete 100.64.0.0/10. We recommend adding back the IPs that are not being used by your load balancer. Note

    Some IPs in the 100.64.0.0/10 range may be reserved for other Zero Trust services such as WARP CGNAT IPs, or Gateway initial resolved IPs if your account uses a legacy or custom range within CGNAT space. These IPs should remain deleted from the Exclude list. - Include mode: Add your load balancer IP.

Cloudflare One Client traffic can now reach your private load balancer. For example, if your load balancer points to a web application, you can test by running curl <load-balancer-IP> from the device. This traffic will be distributed over Cloudflare Tunnel to your private endpoints according to your configured steering method.

4. (Optional) Assign a hostname to the load balancer

If you want your load balancer and its endpoints to be transparently accessible to users via a hostname, you can create a Gateway DNS Override policy that maps the hostname to the load balancer's IP address. This ensures that traffic destined for the hostname resolves to the correct IP.

  1. In the Cloudflare dashboard ↗︎, go to Zero Trust > Traffic policies > Firewall policies > DNS.
  2. Select Add a policy.
  3. In Traffic, create an expression where the Selector equals Host, the Operator equals is, and Value is the hostname you wish to associate with your load balancer. For example,
Selector Operator Value
Host is app.internal.local
4. Set the Action to Override.
5. In Override Hostname, enter your private load balancer IP (for example, 100.112.0.0).

Requests to the hostname will now resolve to your private load balancer.

Was this helpful?

YesNo

On this page

Set up Private Network Load Balancing wi - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/load-balancing/private-network/warp-to-tunnel/#page","headline":"Set up Private Network Load Balancing with Client-to-Tunnel","description":"Load balance WARP client traffic to private origins via Tunnel.","url":"https://developers.cloudflare.com/load-balancing/private-network/warp-to-tunnel/","inLanguage":"en","image":"https://developers.cloudflare.com/load-balancing/private-network/warp-to-tunnel/og.png?v=7b107ba788165184","dateModified":"2026-10-12","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/"},"keywords":["Private networks"]}


description: Additional load balancing features and integrations. title: Additional configuration image: https://developers.cloudflare.com/load-balancing/additional-options/og.png?v=a70becb041c9e98e


Skip to content

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