Skip to content

Commit a8071e2

Browse files
Merge pull request #198338 from cherylmc/advertise
Add portal steps
2 parents 40940eb + 1a73c0e commit a8071e2

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed
257 KB
Loading

articles/vpn-gateway/vpn-gateway-p2s-advertise-custom-routes.md

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
title: 'Advertise custom routes for point-to-site VPN Gateway clients'
33
titleSuffix: Azure VPN Gateway
44
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
65
author: cherylmc
7-
86
ms.service: vpn-gateway
97
ms.topic: how-to
10-
ms.date: 07/21/2021
8+
ms.date: 05/16/2022
119
ms.author: cherylmc
12-
1310
---
1411

1512
# Advertise custom routes for P2S VPN clients
1613

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.
1815

1916
:::image type="content" source="./media/vpn-gateway-p2s-advertise-custom-routes/custom-routes.png" alt-text="Diagram of advertising custom routes.":::
2017

21-
## <a name="advertise"></a>Advertise custom routes
18+
## <a name="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+
## <a name="powershell"></a>PowerShell
2230

2331
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).
2432

@@ -29,50 +37,52 @@ To advertise custom routes, use the `Set-AzVirtualNetworkGateway cmdlet`. The fo
2937
Pinging table.by4prdstr05a.store.core.windows.net [13.88.144.250] with 32 bytes of data:
3038
```
3139
32-
2. Run the following PowerShell commands:
40+
1. Run the following PowerShell commands:
3341
3442
```azurepowershell-interactive
3543
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
3644
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute 13.88.144.250/32
3745
```
3846
39-
3. To add multiple custom routes, use a comma and spaces to separate the addresses. For example:
47+
1. To add multiple custom routes, use a comma and spaces to separate the addresses. For example:
4048
4149
```azurepowershell-interactive
4250
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute x.x.x.x/xx , y.y.y.y/yy
4351
```
4452
45-
## <a name="forced-tunneling"></a>Advertise custom routes - forced tunneling
46-
47-
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>
57-
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute 0.0.0.0/1 , 128.0.0.0/1
58-
```
59-
60-
## <a name="view"></a>View custom routes
53+
### <a name="view"></a>View custom routes
6154
6255
Use the following example to view custom routes:
6356
6457
```azurepowershell-interactive
6558
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
6659
$gw.CustomRoutes | Format-List
6760
```
68-
## <a name="delete"></a>Delete custom routes
61+
62+
### <a name="delete"></a>Delete custom routes
6963

7064
Use the following example to delete custom routes:
7165

7266
```azurepowershell-interactive
7367
$gw = Get-AzVirtualNetworkGateway -Name <name of gateway> -ResourceGroupName <name of resource group>
7468
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute @0
7569
```
70+
71+
## <a name="forced-tunneling"></a>Forced tunneling
72+
73+
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>
83+
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gw -CustomRoute 0.0.0.0/1 , 128.0.0.0/1
84+
```
85+
7686
## Next steps
7787

7888
For more P2S routing information, see [About point-to-site routing](vpn-gateway-about-point-to-site-routing.md).

0 commit comments

Comments
 (0)