You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/vpn-gateway/vpn-gateway-p2s-advertise-custom-routes.md
+35-25Lines changed: 35 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,31 @@
2
2
title: 'Advertise custom routes for point-to-site VPN Gateway clients'
3
3
titleSuffix: Azure VPN Gateway
4
4
description: Learn how to advertise custom routes to your VPN Gateway point-to-site clients. This article includes steps for VPN client forced tunneling.
5
-
services: vpn-gateway
6
5
author: cherylmc
7
-
8
6
ms.service: vpn-gateway
9
7
ms.topic: how-to
10
-
ms.date: 07/21/2021
8
+
ms.date: 05/16/2022
11
9
ms.author: cherylmc
12
-
13
10
---
14
11
15
12
# Advertise custom routes for P2S VPN clients
16
13
17
-
You may want to advertise custom routes to all of your point-to-site VPN clients. For example, when you have enabled storage endpoints in your VNet and want the remote users to be able to access these storage accounts over the VPN connection. You can advertise the IP address of the storage end point to all your remote users so that the traffic to the storage account goes over the VPN tunnel, and not the public Internet. You can also use custom routes in order to configure forced tunneling for VPN clients.
14
+
You may want to advertise custom routes to all of your point-to-site VPN clients. For example, when you have enabled storage endpoints in your VNet and want the remote users to be able to access these storage accounts over the VPN connection. You can advertise the IP address of the storage end point to all your remote users so that the traffic to the storage account goes over the VPN tunnel, and not the public Internet. You can also use custom routes in order to configure [forced tunneling](#forced-tunneling) for VPN clients.
18
15
19
16
:::image type="content" source="./media/vpn-gateway-p2s-advertise-custom-routes/custom-routes.png" alt-text="Diagram of advertising custom routes.":::
20
17
21
-
## <aname="advertise"></a>Advertise custom routes
18
+
## <aname="portal"></a>Azure portal
19
+
20
+
You can advertise custom routes using the Azure portal on the point-to-site configuration page. You can also view and modify/delete custom routes as needed using these steps. If you want to configure forced tunneling, see the [Forced tunneling](#forced-tunneling) section in this article.
21
+
22
+
:::image type="content" source="./media/vpn-gateway-p2s-advertise-custom-routes/additional-routes.png" alt-text="Screenshot showing additional routes in the portal." lightbox= "./media/vpn-gateway-p2s-advertise-custom-routes/additional-routes.png":::
23
+
24
+
1. Go to the virtual network gateway.
25
+
1. Select **Point-to-site configuration** in the left pane.
26
+
1. On the Point-to-site configuration page, add the routes. Don't use any spaces.
27
+
1. Select **Save** at the top of the page.
28
+
29
+
## <aname="powershell"></a>PowerShell
22
30
23
31
To advertise custom routes, use the `Set-AzVirtualNetworkGateway cmdlet`. The following example shows you how to advertise the IP for the [Contoso storage account tables](https://contoso.table.core.windows.net).
24
32
@@ -29,50 +37,52 @@ To advertise custom routes, use the `Set-AzVirtualNetworkGateway cmdlet`. The fo
29
37
Pinging table.by4prdstr05a.store.core.windows.net [13.88.144.250] with 32 bytes of data:
30
38
```
31
39
32
-
2. Run the following PowerShell commands:
40
+
1. Run the following PowerShell commands:
33
41
34
42
```azurepowershell-interactive
35
43
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
You can direct all traffic to the VPN tunnel by advertising 0.0.0.0/1 and 128.0.0.0/1 as custom routes to the clients. The reason for breaking 0.0.0.0/0 into two smaller subnets is that these smaller prefixes are more specific than the default route that may already be configured on the local network adapter and as such will be preferred when routing traffic.
48
-
49
-
> [!NOTE]
50
-
> Internet connectivity is not provided through the VPN gateway. As a result, all traffic bound for the Internet is dropped.
51
-
>
52
-
53
-
1. To enable forced tunneling, use the following commands:
54
-
55
-
```azurepowershell-interactive
56
-
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
You can direct all traffic to the VPN tunnel by advertising 0.0.0.0/1 and 128.0.0.0/1 as custom routes to the clients. The reason for breaking 0.0.0.0/0 into two smaller subnets is that these smaller prefixes are more specific than the default route that may already be configured on the local network adapter and, as such, will be preferred when routing traffic.
74
+
75
+
> [!NOTE]
76
+
> Internet connectivity is not provided through the VPN gateway. As a result, all traffic bound for the Internet is dropped.
77
+
>
78
+
79
+
To enable forced tunneling, use the following commands:
80
+
81
+
```azurepowershell-interactive
82
+
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
0 commit comments