Skip to content

Commit a35d4d9

Browse files
angelampcostaOxyjun
authored andcommitted
[LB] Updates magic wan docs (cloudflare#22849)
* Updates magic wan docs * Corrects typo * Apply suggestions from code review Co-authored-by: Jun Lee <[email protected]> --------- Co-authored-by: Jun Lee <[email protected]>
1 parent 3c75bb8 commit a35d4d9

File tree

1 file changed

+33
-36
lines changed

1 file changed

+33
-36
lines changed

src/content/docs/load-balancing/private-network/magic-wan.mdx

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,51 @@ sidebar:
66

77
---
88

9-
Consider the following steps to learn how to configure Private Network Load Balancing solution, using [Magic WAN](/magic-wan/) as the on-ramp and off-ramp to securely connect to your private or internal services. This is currently an API only feature.
9+
Consider the following steps to learn how to configure Private Network Load Balancing solution, using [Magic WAN](/magic-wan/) as the on-ramp and off-ramp to securely connect to your private or internal services.
1010

11-
## 1. Configure a virtual network for Magic WAN
11+
One of the pre-requisites to using Private Network Load Balancing (PNLB) with Magic WAN is having Magic WAN set up in your account and having completed onboarding. You can connect with a Magic WAN Connector, or your own hardware via an IPsec or GRE tunnel. Check out the [Magic WAN documentation](/magic-wan/get-started/) for more details or to get started.
1212

13-
1. Create and [configure virtual networks](/cloudflare-one/connections/connect-networks/private-net/cloudflared/tunnel-virtual-networks/#create-a-virtual-network) using either the Cloudflare UI or the Cloudflare API.
13+
## 1. Create Load Balancer Pools
1414

15-
2. Set your virtual network as the default. Your load balancer will use the `default` virtual network. In the [API](/api/resources/zero_trust/subresources/networks/subresources/virtual_networks/methods/create/), specify the default virtual network by setting `is_default_network = true`.
15+
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.
1616

17-
3. Retrieve the ID of the virtual network you created. To get the VNET ID, send a `GET` request to the following API endpoint:
17+
:::note
18+
Endpoints accessed via Magic WAN must be accessible in and assigned to the default VNET.
19+
:::
1820

19-
```txt
20-
https://api.cloudflare.com/client/v4/accounts/{account_id}/teamnet/virtual_networks?is_default=true
21-
```
21+
:::caution
22+
The IP destination addresses must also be routable in your Magic WAN configuration. Please contact your Cloudflare account team to confirm that the addresses are available in your configuration.
23+
:::
2224

23-
The VNET ID value will be used to ensure that your load balancer is properly integrated with the specified virtual network.
25+
Pools can be created using either the Cloudflare dashboard or the API. Refer to the [Create a pool](/load-balancing/pools/create-pool/#create-a-pool) documentation section for more information.
2426

25-
## 2. Configure an Account Load Balancer
27+
## 2. Create an Account Load Balancer with a Private IP
2628

27-
1. Once you have your [VNets configured](/load-balancing/private-network/magic-wan/#1-configure-a-virtual-network-for-magic-wan), you need to make sure that the [pools](/load-balancing/pools/create-pool/) you will be using with your load balancer are configured with the default VNet value in the **Virtual Network** field.
29+
1. Go to **Load Balancing** at the account level and select **Create a Load Balancer**.
30+
2. Select **Private Load Balancer**.
31+
3. On the next step you can choose to associate this load balancer with either:
32+
- A CGNAT IP from the Cloudflare range or
33+
- A custom [RFC1918 address](https://datatracker.ietf.org/doc/html/rfc1918).
34+
4. Add a descriptive name to identify your Load Balancer.
35+
5. Proceed through the setup.
2836

29-
2. Next, create an Account Load Balancer by sending a `POST` request to the following API endpoint. The request body should be structured similarly to a Zone Load Balancer. Refer to the [Cloudflare API documentation](/api/resources/load_balancers/methods/create/) for details on the required fields and their formats. Make sure that the pools you are using in your load balancer have the default VNET configured (previous step).
37+
After selecting an IP address and 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 assigned IP address, as it will be required in the following steps.
3038

31-
```txt
32-
https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers
33-
```
39+
:::note
40+
Traffic from your load balancer will appear to originate from one of Cloudflare’s IP addresses. These IP addresses must be whitelisted to ensure proper traffic flow. Ensure your routing is properly configured to return traffic to your Magic WAN tunnels and not the public Internet. Private Load Balancers created with a Cloudflare private IP address will receive an address in the CGNAT range 100.112.64.0/16
41+
:::
3442

35-
To retrieve a list of all created Account Load Balancers, send a `GET` request to the same endpoint.
43+
## 3. FQDN override (optional)
3644

37-
3. The `tunnel_id` parameter of the created Load Balancer is necessary for subsequent requests, so make sure to save the `tunnel_id` when you receive it in the response of the `POST` request. You can also retrieve the `tunnel_id` from the `GET` request if you need it for future operations.
45+
If you want your load balancer and its endpoints to be transparently accessible to users via a hostname, you can create a DNS record in your internal DNS system or create an override in Cloudflare that maps the hostname to the Load Balancer's IP address. This ensures that traffic destined for the hostname resolves to the correct IP.
3846

39-
## 3. Deploy route to access LB
47+
To create the override, follow these steps:
4048

41-
To access the new load balancer, you need to create a tunnel route. This will be done automatically for you, but in case you would need to create one yourself or add an additional one, you need to:
49+
1. In **Gateway**, select **Firewall policies**.
50+
2. In the **DNS** tab, create an override where:
51+
- The **Selector** equals `Host`
52+
- The **Operator** equals `is`
53+
- The **Value** is the hostname you wish to associate with your load balancer.
54+
3. Set the **Action** to _Override_, and in **Override Hostname**, enter the IP address of your Private Load Balancer.
4255

43-
1. Use the `tunnel_id` of the Account Load Balancer, retrieved in the previous step. By using the `tunnel_id` of the Account Load Balancer and assigning a private network IP we are making the Load Balancer available at that IP address on the associated virtual network.
44-
45-
2. To create a route for your Load Balancer, send a [`POST`](/api/resources/zero_trust/subresources/networks/subresources/routes/methods/create/) request to following endpoint with this sample body:
46-
47-
```bash
48-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/teamnet/routes \
49-
--header "X-Auth-Email: <EMAIL>" \
50-
--header "X-Auth-Key: <API_KEY>" \
51-
--header "Content-Type: application/json" \
52-
--data '{
53-
"comment": "Example comment - account load balancing",
54-
"network": "<PRIVATE_IP/CIDR_MASK>,
55-
"tunnel_id": "<TUNNEL_ID>"
56-
}'
57-
```
58-
59-
After completing these steps, the load balancer should be deployed with the selected private IP address and available to traffic on the same virtual network.
56+
Requests to the hostname will now resolve to your private load balancer.

0 commit comments

Comments
 (0)