Skip to content

Commit 7fa45a4

Browse files
author
Jill Grant
authored
Merge pull request #252639 from cherylmc/vpn-forced-tunnel
Add BGP
2 parents 1f3527d + 4f9bf34 commit 7fa45a4

File tree

2 files changed

+37
-46
lines changed

2 files changed

+37
-46
lines changed
Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: 'About forced tunneling for site-to-site'
3-
description: Learn about forced tunneling and split tunneling via UDRs for VPN Gateway site-to-site connections
3+
description: Learn about forced tunneling methods for VPN Gateway site-to-site connections.
44
titleSuffix: Azure VPN Gateway
55
author: cherylmc
66
ms.service: vpn-gateway
77
ms.topic: conceptual
8-
ms.date: 08/04/2023
8+
ms.date: 09/22/2023
99
ms.author: cherylmc
1010
---
1111

@@ -15,46 +15,33 @@ This article helps you understand how forced tunneling works for site-to-site (S
1515

1616
Forced tunneling lets you redirect or "force" all Internet-bound traffic back to your on-premises location via S2S VPN tunnel for inspection and auditing. This is a critical security requirement for most enterprise IT policies. Unauthorized Internet access can potentially lead to information disclosure or other types of security breaches.
1717

18-
In some cases, you may want specific subnets to send and receive Internet traffic directly, without going through an on-premises location for inspection and auditing. One way to achieve this is to specify routing behavior using [custom user-defined routes](../virtual-network/virtual-networks-udr-overview.md#user-defined) (UDRs). After configuring forced tunneling, specify a custom UDR for the subnet(s) for which you want to send Internet traffic directly to the Internet (not to the on-premises location). In this type of configuration, only the subnets that have a specified UDR send Internet traffic directly to the Internet. Other subnets continue to have Internet traffic force-tunneled to the on-premises location.
18+
The following example shows all Internet traffic being forced through the VPN gateway back to the on-premises location for inspection and auditing.
1919

20-
You can also create this type of configuration when working with peered VNets. A custom UDR can be applied to a subnet of a peered VNet that traverses through the VNet containing the VPN Gateway S2S connection.
21-
22-
## Considerations
23-
24-
Forced tunneling is configured using Azure PowerShell. You can't configure forced tunneling using the Azure portal.
25-
26-
* Each virtual network subnet has a built-in, system routing table. The system routing table has the following three groups of routes:
27-
28-
* **Local VNet routes:** Directly to the destination VMs in the same virtual network.
29-
* **On-premises routes:** To the Azure VPN gateway.
30-
* **Default route:** Directly to the Internet. Packets destined to the private IP addresses not covered by the previous two routes are dropped.
31-
32-
* In this scenario, forced tunneling must be associated with a VNet that has a route-based VPN gateway. Your forced tunneling configuration overrides the default route for any subnet in its VNet. You need to set a "default site" among the cross-premises local sites connected to the virtual network. Also, the on-premises VPN device must be configured using 0.0.0.0/0 as traffic selectors.
33-
34-
* ExpressRoute forced tunneling isn't configured via this mechanism, but instead, is enabled by advertising a default route via the ExpressRoute BGP peering sessions. For more information, see the [ExpressRoute Documentation](../expressroute/index.yml).
20+
:::image type="content" source="./media/about-site-to-site-tunneling/forced-tunnel.png" alt-text="Diagram shows forced tunneling." lightbox="./media/about-site-to-site-tunneling/forced-tunnel-high-res.png":::
3521

36-
## Forced tunneling
22+
## Configuration methods for forced tunneling
3723

38-
The following example shows all Internet traffic being forced through the VPN gateway back to the on-premises location for inspection and auditing. Configure [forced tunneling](site-to-site-tunneling.md) by specifying a default site.
24+
There are a few different ways that you can configure forced tunneling.
3925

40-
**Forced tunneling example**
26+
### Configure using BGP
4127

42-
:::image type="content" source="./media/about-site-to-site-tunneling/forced-tunnel.png" alt-text="Diagram shows forced tunneling." lightbox="./media/about-site-to-site-tunneling/forced-tunnel-high-res.png":::
28+
You can configure forced tunneling for VPN Gateway via BGP. You need to advertise a default rout of 0.0.0.0/0 via BGP from your on-premises location to Azure so that all your Azure traffic is sent via the VPN Gateway S2S tunnel.
4329

44-
## Forced tunneling and UDRs
30+
### Configure using Default Site
4531

46-
You may want Internet-bound traffic from certain subnets (but not all subnets) to traverse from the Azure network infrastructure directly out to the Internet. This scenario can be configured using a combination of forced tunneling and virtual network custom user-defined routes. For steps, see [Forced tunneling and UDRs](site-to-site-tunneling.md).
32+
You can configure forced tunneling by setting the Default Site for your route-based VPN gateway. For steps, see [Forced tunneling via Default Site](site-to-site-tunneling.md).
4733

48-
**Forced tunneling and UDRs example**
34+
* You assign a Default Site for the virtual network gateway using PowerShell.
35+
* The on-premises VPN device must be configured using 0.0.0.0/0 as traffic selectors.
4936

50-
:::image type="content" source="./media/about-site-to-site-tunneling/tunnel-user-defined-routing.png" alt-text="Diagram shows split tunneling." lightbox="./media/about-site-to-site-tunneling/tunnel-user-defined-routing-high-res.png":::
37+
## Routing Internet-bound traffic for specific subnets
5138

52-
* **Frontend subnet**: Internet-bound traffic is tunneled directly to the Internet using a custom UDR that specifies this setting. The workloads in the Frontend subnet can accept and respond to customer requests from the Internet directly.
39+
By default, all Internet-bound traffic goes directly to the Internet if you don't have forced tunneling configured. When forced tunneling is configured, all Internet-bound traffic is sent to your on-premises location.
5340

54-
* **Mid-tier and Backend subnets**: These subnets continue to be force tunneled because a default site has been specified for the VPN gateway. Any outbound connections from these two subnets to the Internet are forced or redirected back to an on-premises site via S2S VPN tunnels through the VPN gateway.
41+
In some cases, you may want Internet-bound traffic only from certain subnets (but not all subnets) to traverse from the Azure network infrastructure directly out to the Internet, rather than to your on-premises location. This scenario can be configured using a combination of forced tunneling and virtual network custom user-defined routes (UDRs). For steps, see [Route Internet-bound traffic for specific subnets](site-to-site-tunneling.md#udr).
5542

5643
## Next steps
5744

58-
* See [How to configure forced tunneling for VPN Gateway S2S connections](site-to-site-tunneling.md).
45+
* See [How to configure forced tunneling via Default Site for VPN Gateway S2S connections](site-to-site-tunneling.md).
5946

6047
* For more information about virtual network traffic routing, see [VNet traffic routing](../virtual-network/virtual-networks-udr-overview.md).

articles/vpn-gateway/site-to-site-tunneling.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
---
2-
title: 'Configure forced tunneling for site-to-site connections: PowerShell'
3-
description: Learn how to split or force tunnel traffic for VPN Gateway site-to-site connections using PowerShell.
2+
title: 'Configure forced tunneling for S2S connections - Default Site: PowerShell'
3+
description: Learn how to force tunnel traffic for VPN Gateway site-to-site connections by specifying the Default Site setting - PowerShell. Also learn how to specify Internet-bound traffic routing for specific subnets.
44
titleSuffix: Azure VPN Gateway
55
author: cherylmc
66
ms.service: vpn-gateway
77
ms.custom: devx-track-azurepowershell
88
ms.topic: how-to
9-
ms.date: 08/04/2023
9+
ms.date: 09/22/2023
1010
ms.author: cherylmc
1111
---
12-
# Configure forced tunneling for site-to-site connections
12+
# Configure forced tunneling using Default Site for site-to-site connections
1313

14-
The steps in this article help you configure forced tunneling for site-to-site (S2S) IPsec connections. For more information, see [About forced tunneling for VPN Gateway](about-site-to-site-tunneling.md).
14+
The steps in this article help you configure forced tunneling for site-to-site (S2S) IPsec connections by specifying a Default Site. For information about configuration methods for forced tunneling, including configuring forced tunneling via BGP, see [About forced tunneling for VPN Gateway](about-site-to-site-tunneling.md).
1515

1616
By default, Internet-bound traffic from your VMs goes directly to the Internet. If you want to force all Internet-bound traffic through the VPN gateway to an on-premises site for inspection and auditing, you can do so by configuring **forced tunneling**. After you configure forced tunneling, if desired, you can route Internet-bound traffic directly to the Internet for specified subnets using custom user-defined routes (UDRs).
1717

1818
:::image type="content" source="./media/about-site-to-site-tunneling/tunnel-user-defined-routing.png" alt-text="Diagram shows split tunneling." lightbox="./media/about-site-to-site-tunneling/tunnel-user-defined-routing-high-res.png":::
1919

20-
The following steps help you configure a forced tunneling scenario by specifying a default site. Optionally, using custom UDR, you can route traffic by specifying that Internet-bound traffic from the Frontend subnet goes directly to the Internet, rather than to the on-premises site.
20+
The following steps help you configure a forced tunneling scenario by specifying a Default Site. Optionally, using custom UDR, you can route traffic by specifying that Internet-bound traffic from the Frontend subnet goes directly to the Internet, rather than to the on-premises site.
2121

2222
* The VNet you create has three subnets: Frontend, Mid-tier, and Backend with four cross-premises connections: DefaultSiteHQ, and three branches.
23-
* You specify the default site for your VPN gateway using PowerShell, which forces all Internet traffic back to the on-premises location. The default site can't be configured using the Azure portal.
23+
* You specify the Default Site for your VPN gateway using PowerShell, which forces all Internet traffic back to the on-premises location. The Default Site can't be configured using the Azure portal.
2424
* The Frontend subnet is assigned a UDR to send Internet traffic directly to the Internet, bypassing the VPN gateway. Other traffic is routed normally.
25-
* The Mid-tier and Backend subnets continue to have Internet traffic force tunneled back to the on-premises site via the VPN gateway because a default site is specified.
25+
* The Mid-tier and Backend subnets continue to have Internet traffic force tunneled back to the on-premises site via the VPN gateway because a Default Site is specified.
2626

2727
## Create a VNet and subnets
2828

@@ -114,31 +114,35 @@ In this section, you request a public IP address and create a VPN gateway that's
114114
New-AzVirtualNetworkGateway -Name "VNet1GW" -ResourceGroupName "TestRG1" -Location "EastUS" -IpConfigurations $gwipconfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku VpnGw2 -VpnGatewayGeneration "Generation2"
115115
```
116116

117-
## Configure forced tunneling
117+
## Configure forced tunneling - Default Site
118118

119-
Configure forced tunneling by assigning a default site to the virtual network gateway. If you don't specify a default site, Internet traffic isn't forced through the VPN gateway and will, instead, traverse directly out to the Internet for all subnets (by default).
119+
Configure forced tunneling by assigning a Default Site to the virtual network gateway. If you don't specify a Default Site, Internet traffic isn't forced through the VPN gateway and will, instead, traverse directly out to the Internet for all subnets (by default).
120120

121-
To assign a default site for the gateway, you use the **-GatewayDefaultSite** parameter. Be sure to assign this properly.
121+
To assign a Default Site for the gateway, you use the **-GatewayDefaultSite** parameter. Be sure to assign this properly.
122122

123-
1. First, declare the variables that specify the virtual network gateway information and the local network gateway for the default site, in this case, DefaultSiteHQ.
123+
1. First, declare the variables that specify the virtual network gateway information and the local network gateway for the Default Site, in this case, DefaultSiteHQ.
124124

125125
```azurepowershell-interactive
126126
$LocalGateway = Get-AzLocalNetworkGateway -Name "DefaultSiteHQ" -ResourceGroupName "TestRG1"
127127
$VirtualGateway = Get-AzVirtualNetworkGateway -Name "VNet1GW" -ResourceGroupName "TestRG1"
128128
```
129129

130-
1. Next, set the virtual network gateway default site using [Set-AzVirtualNetworkGatewayDefaultSite](/powershell/module/az.network/set-azvirtualnetworkgatewaydefaultsite).
130+
1. Next, set the virtual network gateway Default Site using [Set-AzVirtualNetworkGatewayDefaultSite](/powershell/module/az.network/set-azvirtualnetworkgatewaydefaultsite).
131131

132132
```azure-powershell-interactive
133133
Set-AzVirtualNetworkGatewayDefaultSite -GatewayDefaultSite $LocalGateway -VirtualNetworkGateway $VirtualGateway
134134
```
135135

136-
At this point, all Internet-bound traffic is now configured to be force tunneled to *DefaultSiteHQ*. Note that the on-premises VPN device must be configured using 0.0.0.0/0 as traffic selectors.
136+
At this point, all Internet-bound traffic is now configured to be force tunneled to *DefaultSiteHQ*. The on-premises VPN device must be configured using 0.0.0.0/0 as traffic selectors.
137137

138138
* If you want to only configure forced tunneling, and not route Internet traffic directly to the Internet for specific subnets, you can skip to the [Establish Connections](#establish-s2s-vpn-connections) section of this article to create your connections.
139139
* If you want specific subnets to send Internet-bound traffic directly to the Internet, continue with the next sections to configure custom UDRs and assign routes.
140140

141-
## Create route tables and routes
141+
## <a name="udr"></a>Route Internet-bound traffic for specific subnets
142+
143+
As an option, if you want Internet-bound traffic to be sent directly to the Internet for specific subnets (rather than to your on-premises network), use the following steps. These steps apply to forced tunneling that has been configured either by specifying a Default Site, or that has been configured via BGP.
144+
145+
### Create route tables and routes
142146

143147
To specify that Internet-bound traffic should go directly to the Internet, create the necessary route table and route. You'll later assign the route table to the Frontend subnet.
144148

@@ -164,7 +168,7 @@ To specify that Internet-bound traffic should go directly to the Internet, creat
164168
| Set-AzRouteTable
165169
```
166170

167-
## Assign routes
171+
### Assign routes
168172

169173
In this section, you assign the route table and routes to the Frontend subnet using the following PowerShell commands: [GetAzRouteTable](/powershell/module/az.network/get-azroutetable), [Set-AzRouteConfig](/powershell/module/az.network/set-azrouteconfig), and [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork).
170174

@@ -183,7 +187,7 @@ In this section, you assign the route table and routes to the Frontend subnet us
183187
Set-AzVirtualNetwork
184188
```
185189

186-
## Establish S2S VPN connections
190+
### Establish S2S VPN connections
187191

188192
Use [New-AzVirtualNetworkGatewayConnection](/powershell/module/az.network/new-azvirtualnetworkgatewayconnection) to establish the S2S connections.
189193

0 commit comments

Comments
 (0)