Skip to content

Commit 21cf88f

Browse files
[Magic WAN] update Azure instructions
This updates the Azure instructions to: - use the Active/Active configuration on the Azure Virtual Gateway - use bidirectional health checks with a custom target equal to the Customer endpoint These changes are unlocked by the completion of RM-19633. (The work is done, and shipped, even if the RM is not yet closed)
1 parent 17fe459 commit 21cf88f

File tree

1 file changed

+63
-54
lines changed

1 file changed

+63
-54
lines changed

src/content/docs/magic-wan/configuration/manually/third-party/azure/azure-vpn-gateway.mdx

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ title: Microsoft Azure VPN Gateway
55

66
This tutorial provides information on how to connect Cloudflare Magic WAN to your Azure Virtual Network, using the Azure Virtual Network Gateway.
77

8-
:::note
9-
This configuration guide applies to Azure Virtual Network Gateway in an Active/Standby configuration. Active/Active configuration is not currently supported.
10-
:::
11-
128
## Prerequisites
139

1410
You will need to have an existing Resource group, Virtual Network, and Virtual Machine created in your Azure account. Refer to [Microsoft's documentation](https://learn.microsoft.com/en-us/azure/virtual-network/) to learn more on how to create these.
1511

16-
## Configure Azure
12+
## Configure Azure Virtual Network Gateway
1713

1814
### 1. Create a Gateway subnet
1915

@@ -32,6 +28,20 @@ The Virtual Network Gateway is used to form the tunnel to the devices on your pr
3228
This configuration guide applies to Azure Virtual Network Gateway which includes the functionality found in the Azure VPN Gateway.
3329
:::
3430

31+
:::note
32+
Active/Active and Active/Standby configurations are both supported. Two Azure public IP addresses, and two Magic WAN IPsec tunnels, are required for the Active/Active configuration.
33+
:::
34+
35+
#### Active/Active connfiguration
36+
37+
1. Create a Virtual Network Gateway.
38+
2. Create two new public IP addresses or use existing IPs. Take note of the public IP addresses assigned to the Virtual Network Gateway as these will be the **Customer endpoint** for Magic WAN's IPsec tunnels configuration.
39+
3. Navigate to the Virtual Network Gateway created earier.
40+
4. In **Configuration**, enable **Active-active mode** and disable **Gateway Private IPs**.
41+
5. Select **Create**.
42+
43+
#### Active/Standby connfiguration
44+
3545
1. Create a Virtual Network Gateway.
3646
2. Create a new public IP address or use an existing IP. Take note of the public IP address assigned to the Virtual Network Gateway as this will be the **Customer endpoint** for Magic WAN's IPsec tunnels configuration.
3747
3. Select the resource group and VNET you have already created.
@@ -42,7 +52,33 @@ This configuration guide applies to Azure Virtual Network Gateway which includes
4252
The time it takes for Azure to fully provision the Virtual Network Gateway depends on the deployment region.
4353
:::
4454

45-
### 3. Create a Local Network Gateway
55+
## Configure Magic WAN
56+
57+
1. Create an [IPsec tunnel](/magic-wan/configuration/manually/how-to/configure-tunnels/#add-tunnels) in the Cloudflare dashboard.
58+
2. Make sure you have the following settings:
59+
1. **Interface address**: As the Azure Local Network Gateway will only permit specifying the lower IP address in a `/31` subnet, add the upper IP address within the `/31` subnet selected in [step 4 of the Configure Azure section](#4-configure-local-network-gateway-for-magic-ipsec-tunnel-health-checks). Refer to [Tunnel endpoints](/magic-wan/configuration/manually/how-to/configure-tunnels/) for more details.
60+
2. **Customer endpoint**: The Public IP associated with your Azure Virtual Network Gateway. For example, `40.xxx.xxx.xxx`.
61+
3. **Cloudflare endpoint**: Use the Cloudflare anycast address you have received from your account team. This will also be the IP address corresponding to the Local Network Gateway in Azure. For example, `162.xxx.xxx.xxx`.
62+
4. **Health check rate**: Leave the default option (Medium) selected.
63+
5. **Health check type**: Leave the default option (Reply) selected.
64+
6. **Health check direction**: Leave default option (Bidirectional) selected.
65+
7. **Health check target**: Select **Custom**.
66+
8. **Target address**: Enter the same address that is used in the **Customer endpoint** field.
67+
9. **Add pre-shared key later**: Select this option to create a PSK that will be used later in Azure.
68+
10. **Replay protection**: **Enable**.
69+
3. If using the Active/Active configuration, click **+ Add IPsec tunnel** and repeat step 2 to create the secoind Magic WAN IPsec tunnel. Use the same **Cloudflare endpoint** as for the first tunnel.
70+
4. **Add Tunnels**
71+
5. Edit the tunnel(s); **Generate a new pre-shared key** amd copy the generated key. If using the Active/Active configuration, **Change to a new custom pre-shared key
72+
** on the second tunnel and use the PSK generated for the first tunnel.
73+
6. Create static routes for your Azure Virtual Network subnets, specifying the newly created tunnel as the next hop.
74+
75+
:::note
76+
Both tunnels in an Active/Active configuration must use the same **Cloudflare endpoint**, because an Active/Active Azure VPN connection creates two tunnels to the same remote address.
77+
:::
78+
79+
## Complete the Azure Configuration
80+
81+
### 1. Create a Local Network Gateway
4682

4783
The Local Network Gateway typically refers to your on-premises location. In this case, the Local Network Gateway represents the Cloudflare side of the connection.
4884

@@ -53,25 +89,25 @@ We recommend creating a Local Network Gateway for your Cloudflare IPsec tunnel.
5389
3. In **Address space(s)**, specify the address range of any subnets you wish to access remotely through the Magic WAN connection. For example, if you want to reach a network with an IP range of `192.168.1.0/24`, and this network is connected to your Magic WAN tenant, you would add `192.168.1.0/24` to the local network gateway address space.
5490
4. Go to the **Advanced** tab > **BGP settings**, and make sure you select **No**.
5591

56-
### 4. Configure Local Network Gateway for Magic IPsec tunnel health checks
92+
:::note
93+
A single Cloudflare anycast address must be used in both Active/Active and Active/Standby configurations.
94+
:::
5795

58-
Magic WAN uses [Tunnel Health Checks](/magic-wan/reference/tunnel-health-checks/) to ensure the tunnel is available.
96+
### 2. Configure Local Network Gateway for Magic IPsec tunnel health checks
5997

60-
Tunnel health checks make use of ICMP probes sent from the Cloudflare side of the Magic IPsec tunnel to the remote endpoint (Azure).
98+
Magic WAN uses [Tunnel Health Checks](/magic-wan/reference/tunnel-health-checks/) to monitor whether a tunnel is available.
6199

62-
There is an important distinction between how to configure Cloudflare and Azure to support the health checks:
100+
Tunnel health checks make use of ICMP probes sent from the Cloudflare side of the Magic IPsec tunnel to the remote endpoint (Azure). Probes are sent from the tunnel's interface address, which you specify in two places:
63101

64-
- Magic IPsec Tunnel configuration settings requires specifying a discrete IP address (`/31` netmask recommended)
65-
- Azure Local Network Gateway settings require specifying a subnet (in CIDR notation)
102+
1. **Cloudflare Dashboard:** In your Magic IPsec tunnel configuration as the address of the virtual tunnel interface (VTI) (so that Cloudflare knows what address to send probes from). _Cloudflare requires this address in CIDR notation with a `/31` netmask._
103+
2. **Azure Portal:** In your VPN site's address space (so that Azure routes probe responses back over the tunnel). _Azure requires this address in CIDR notation with a `/32` netmask._
66104

67105
Cloudflare recommends customers select a unique `/31` subnet ([RFC 1918 - Address Allocation for Private Internets](https://datatracker.ietf.org/doc/html/rfc1918)) for each IPsec tunnel which is treated as a Point-to-Point Link and provides the ideal addressing scheme to satisfy both requirements.
68106

69107
Example:
70-
71-
```txt
72-
10.252.3.54/31 - Define as the subnet (in CIDR notation) in Azure Local Network Gateway in the Azure Portal.
73-
10.252.3.55/31 - Define as the discrete IP Address assigned to the Interface Address (VTI - Virtual Tunnel Interface) of the Magic IPsec Tunnel in the Cloudflare Dashboard (see Configure Magic WAN below).
74-
```
108+
- Select 169.254.251.137/31 as your unique point-to-point link subnet.
109+
- In the Cloudflare dashboard, set 169.254.251.137/31 as your tunnel's **IPv4 Interface address**. (See Configure Magic WAN below.)
110+
- In the Azure portal, add 169.254.251.137/32 to your Local Network Gateway's **Address space**.
75111

76112
:::note
77113
It is important to ensure the subnet selected for the Interface Address does not overlap with any other subnet.
@@ -85,10 +121,15 @@ To configure the Address Space for the Local Network Gateway to support Tunnel H
85121

86122
1. Edit the Local Network Gateway configured in the previous section.
87123
2. Select **Connections**.
88-
3. Add the`/31` subnet in CIDR notation (for example, `10.252.3.54/31`) under **Address Space(s)**.
124+
3. Add the Interface Address of the Magic IPsec Tunnel from the Cloudflare Dashboard in CIDR notation (for example, `10.252.3.55/32`) under **Address Space(s)**.
125+
4. If using an Active/Active configuration, add the Interface Address of the second Magic IPsec Tunnel from the Cloudflare Dashboard in CIDR notation (for example, `10.252.3.55/32`) under **Address Space(s)**.
89126
4. Select **Save**.
90127

91-
### 5. Create an IPsec VPN Connection
128+
:::note
129+
The Magic IPsec Tunnel Interface Address should be entered as a `/31` in the Cloudflare Dashboard, but as a `/32` when configuring the Local Network Gateway Address Space(s) in the Azure portal.
130+
:::
131+
132+
### 3. Create an IPsec VPN Connection
92133

93134
Choose the following settings when creating your VPN Connection:
94135

@@ -100,13 +141,13 @@ Choose the following settings when creating your VPN Connection:
100141
1. **IKE Phase 1**
101142
1. **Encryption**: _GCMAES256_ or _AES256_
102143
2. **Integrity/PRF**: _SHA256_
103-
3. **DH Group**: _DHGroup20_
144+
3. **DH Group**: _DHGroup14_
104145
2. **IKE Phase 2(IPsec)**
105146
1. **IPsec Encryption**: _GCMAES256_ or _AES256_
106147
2. **IPsec Integrity**: _SHA256_
107148
3. **PFS Group**: _PFS2048_
108149
3. **IPsec SA lifetime in KiloBytes**: `0`
109-
4. **IPsec SA lifetime in seconds**: `28800`
150+
4. **IPsec SA lifetime in seconds**: `27000`
110151
5. **Use policy based traffic selector**: **Disable**
111152
6. **DPD timeout in seconds**: `45`
112153
7. **Connection mode**: **Default**
@@ -115,7 +156,7 @@ Choose the following settings when creating your VPN Connection:
115156

116157
Repeat this process to define the settings for the Connection to the Local Network Gateway that corresponds to the redundant Cloudflare anycast IP address.
117158

118-
### 6. Route all Internet traffic through Magic WAN and Cloudflare Gateway
159+
### 4. Route all Internet traffic through Magic WAN and Cloudflare Gateway
119160

120161
Cloudflare Zero Trust customers can route Internet-bound traffic through Magic WAN to the Internet through Cloudflare Gateway.
121162

@@ -156,20 +197,6 @@ curl https://ipinfo.io
156197
ICMP (ping/traceroute) will work to remote Magic WAN sites, but is not forwarded to the Internet. Please ensure you validate connectivity via HTTP.
157198
:::
158199

159-
## Configure Magic WAN
160-
161-
1. Create an [IPsec tunnel](/magic-wan/configuration/manually/how-to/configure-tunnels/#add-tunnels) in the Cloudflare dashboard.
162-
2. Make sure you have the following settings:
163-
1. **Interface address**: As the Azure Local Network Gateway will only permit specifying the lower IP address in a `/31` subnet, add the upper IP address within the `/31` subnet selected in [step 4 of the Configure Azure section](#4-configure-local-network-gateway-for-magic-ipsec-tunnel-health-checks). Refer to [Tunnel endpoints](/magic-wan/configuration/manually/how-to/configure-tunnels/) for more details.
164-
2. **Customer endpoint**: The Public IP associated with your Azure Virtual Network Gateway. For example, `40.xxx.xxx.xxx`.
165-
3. **Cloudflare endpoint**: Use the Cloudflare anycast address you have received from your account team. This will also be the IP address corresponding to the Local Network Gateway in Azure. For example, `162.xxx.xxx.xxx`.
166-
4. **Health check rate**: Leave the default option (Medium) selected.
167-
5. **Health check type**: Leave the default option (Reply) selected.
168-
6. **Health check direction**: Leave default option.
169-
7. **Add pre-shared key later**: Select this option to create a PSK that will be used later in Azure.
170-
8. **Replay protection**: **Enable**.
171-
3. Create static routes for your Azure Virtual Network subnets, specifying the newly created tunnel as the next hop.
172-
173200
## Validate connectivity and disable Azure Virtual Network Gateway anti-replay protection
174201

175202
Once you have determined that connectivity has been established, Cloudflare recommends you disable anti-replay protection for the Azure Virtual Network Gateway site-to-site VPN connection. This can be accomplished through Microsoft Azure API.
@@ -354,21 +381,3 @@ curl --location --request PUT \
354381
```
355382

356383
6. Leave the replay protection setting checked in the Cloudflare dashboard, and wait several minutes before validating connectivity again.
357-
358-
## Tunnel health checks and Azure
359-
360-
We have identified cases where the IPsec Tunnels configured on the Azure Virtual Network Gateway need to be restarted one time before the tunnel health checks start passing.
361-
362-
### Restart Azure tunnels
363-
364-
1. Open the Virtual Network Gateway.
365-
2. Go to **Settings** > **Connections**.
366-
3. Open the properties of the tunnel.
367-
4. Go to **Help** > **Reset**.
368-
5. Select **Reset**.
369-
370-
It may take several minutes for the tunnels to reset from the Azure side. Monitor the [tunnel health checks section](/magic-wan/configuration/common-settings/check-tunnel-health-dashboard/) in the Cloudflare dashboard to determine the status.
371-
372-
:::note
373-
Tunnel Health Check percentages are calculated over a one hour period.
374-
:::

0 commit comments

Comments
 (0)