Skip to content

Commit dc039d3

Browse files
committed
Add PowerShell versions
format Update howto-virtual-hub-routing-preference.md
1 parent 9a0b5cb commit dc039d3

File tree

9 files changed

+175
-25
lines changed

9 files changed

+175
-25
lines changed

articles/virtual-wan/TOC.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,17 @@
224224
- name: Routing
225225
items:
226226
- name: Configure virtual hub routing
227-
href: how-to-virtual-hub-routing.md
227+
items:
228+
- name: Azure portal
229+
href: how-to-virtual-hub-routing.md
230+
- name: Azure PowerShell
231+
href: how-to-virtual-hub-routing-powershell.md
228232
- name: Configure virtual hub routing preference
229-
href: howto-virtual-hub-routing-preference.md
233+
items:
234+
- name: Azure portal
235+
href: howto-virtual-hub-routing-preference.md
236+
- name: Azure PowerShell
237+
href: howto-virtual-hub-routing-preference-powershell.md
230238
- name: View virtual hub effective routes
231239
href: effective-routes-virtual-hub.md
232240
- name: How to configure routing intent and policies
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: 'How to configure virtual hub routing: Azure PowerShell'
3+
titleSuffix: Azure Virtual WAN
4+
description: Learn how to configure Virtual WAN virtual hub routing using Azure PowerShell.
5+
services: virtual-wan
6+
author: cherylmc
7+
8+
ms.service: virtual-wan
9+
ms.topic: how-to
10+
ms.date: 10/26/2022
11+
ms.author: cherylmc
12+
13+
---
14+
# How to configure virtual hub routing - Azure PowerShell
15+
16+
A virtual hub can contain multiple gateways such as a site-to-site VPN gateway, ExpressRoute gateway, point-to-site gateway, and Azure Firewall. The routing capabilities in the virtual hub are provided by a router that manages all routing, including transit routing, between the gateways using Border Gateway Protocol (BGP). The virtual hub router also provides transit connectivity between virtual networks that connect to a virtual hub and can support up to an aggregate throughput of 50 Gbps. These routing capabilities apply to customers using **Standard** Virtual WANs. For more information, see [About virtual hub routing](about-virtual-hub-routing.md).
17+
18+
This article helps you configure virtual hub routing using Azure PowerShell. You can also configure virtual hub routing using the [Azure portal steps](how-to-virtual-hub-routing.md).
19+
20+
## Create a route table
21+
22+
1. Get the virtual hub details to create route table.
23+
24+
```azurepowershell-interactive
25+
$virtualhub = Get-AzVirtualHub -ResourceGroupName "[resource group name]" -Name "[virtualhub name]"
26+
```
27+
28+
1. Get VNet connection details to be used as next hop.
29+
30+
```azurepowershell-interactive
31+
$hubVnetConnection = Get-AzVirtualHubVnetConnection -Name "[HubconnectionName]" -ParentResourceName "[Hub Name]" -ResourceGroupName "[resource group name]"
32+
```
33+
34+
1. Create a route to be associated with the virtual hub $virtualhub. The **-NextHop** is the virtual network connection $hubVnetConnection. Nexthop can be list of virtual network connections or Azure Firewall.
35+
36+
```azurepowershell-interactive
37+
$route = New-AzVHubRoute -Name "[Route Name]" -Destination “[@("Destination prefix")]” -DestinationType "CIDR" -NextHop $hubVnetConnection.Id -NextHopType "ResourceId"
38+
```
39+
40+
1. Create the route table using the route object created in the previous step, $route, and associate it to the virtual hub $virtualhub.
41+
42+
```azurepowershell-interactive
43+
New-AzVHubRouteTable -Name "testRouteTable" -ParentObject $virtualhub -Route @($route) -Label @("testLabel")
44+
```
45+
46+
## Delete a route table
47+
48+
```azurepowershell-interactive
49+
Remove-AzVirtualHubRouteTable -ResourceGroupName "[resource group name]" -HubName "virtualhubname" -Name "routeTablename"
50+
```
51+
52+
## Update a route table
53+
54+
The steps in this section help you update a route table. For example, update an existing route's next hop to an existing Azure Firewall.
55+
56+
```azurepowershell-interactive
57+
$firewall = Get-AzFirewall -Name "[firewall name]]" -ResourceGroupName "[resource group name]"
58+
$newroute = New-AzVHubRoute -Name "[Route Name]" -Destination @("0.0.0.0/0") -DestinationType "CIDR" -NextHop $firewall.Id -NextHopType "ResourceId"
59+
Update-AzVHubRouteTable -ResourceGroupName "[resource group name]" -VirtualHubName ["virtual hub name"] -Name ["route table name"] -Route @($newroute)
60+
```
61+
62+
## Configure routing for a virtual network connection
63+
64+
The steps in this section help you set up routing configuration for a virtual network connection. For example, adding static routes to an NVA appliance.
65+
66+
* For this configuration, the route name should be the same as the one you used when you added a route earlier. Otherwise, you'll create two routes in the routing table: one without an IP address and one with an IP address.
67+
* The destination prefix can be one CIDR or multiple ones. For a single CIDR, use this format: `@("10.19.2.0/24")`. For multiple CIDRs, use this format: `@("10.19.2.0/24", "10.40.0.0/16")`.
68+
69+
1. Define a static route to an NVA IP address.
70+
71+
```azurepowershell-interactive
72+
$staticRoute = New-AzStaticRoute -Name "[Route Name]" -A-AddressPrefix "[@("Destination prefix")]" -NextHopIpAddress "[Destination NVA IP address]" -NextHopIpAddress "[Destination NVA IP address]"
73+
```
74+
75+
1. Define routing configuration.
76+
77+
```azurepowershell-interactive
78+
$associatedTable = Get-AzVHubRouteTable -ResourceGroupName "[resource group name]" -VirtualHubName $virtualhub.Name -Name "defaultRouteTable"
79+
$propagatedTable = Get-AzVHubRouteTable -ResourceGroupName "[resource group name]" -VirtualHubName $virtualhub.Name -Name "noneRouteTable"
80+
$updatedRoutingConfiguration= New-AzRoutingConfiguration -AssociatedRouteTable $associatedTable.Id -Label @("testLabel") -Id @($propagatedTable.Id) -StaticRoute @($staticRoute)
81+
```
82+
83+
1. Update the existing virtual network connection.
84+
85+
```azurepowershell-interactive
86+
Update-AzVirtualHubVnetConnection -ResourceGroupName "[resource group name]" -VirtualHubName $virtualhub.Name -Name "[Virtual hub connection name]" -RoutingConfiguration $updatedRoutingConfiguration
87+
```
88+
89+
1. Verify static route on the virtual network connection.
90+
91+
```azurepowershell-interactive
92+
Get-AzVirtualHubVnetConnection -ResourceGroupName "[Resource group]" -VirtualHubName "[virtual hub name]" -Name "[Virtual hub connection name]"
93+
```
94+
95+
## Next steps
96+
97+
* For more information about virtual hub routing, see [About virtual hub routing](about-virtual-hub-routing.md).
98+
* For more information about Virtual WAN, see the [Virtual WAN FAQ](virtual-wan-faq.md).

articles/virtual-wan/how-to-virtual-hub-routing.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
---
2-
title: 'How to configure virtual hub routing'
2+
title: 'How to configure virtual hub routing: Azure portal'
33
titleSuffix: Azure Virtual WAN
4-
description: Learn how to configure Virtual WAN virtual hub routing.
4+
description: Learn how to configure Virtual WAN virtual hub routing using the Azure portal.
55
services: virtual-wan
66
author: cherylmc
77

88
ms.service: virtual-wan
99
ms.topic: how-to
10-
ms.date: 10/18/2022
10+
ms.date: 10/26/2022
1111
ms.author: cherylmc
1212

1313
---
14-
# How to configure virtual hub routing
14+
# How to configure virtual hub routing - Azure portal
1515

16-
A virtual hub can contain multiple gateways such as a site-to-site VPN gateway, ExpressRoute gateway, point-to-site gateway, and Azure Firewall. The routing capabilities in the virtual hub are provided by a router that manages all routing, including transit routing, between the gateways using Border Gateway Protocol (BGP). This router also provides transit connectivity between virtual networks that connect to a virtual hub and can support up to an aggregate throughput of 50 Gbps. These routing capabilities apply to customers using **Standard** Virtual WANs. For more information, see [About virtual hub routing](about-virtual-hub-routing.md).
16+
A virtual hub can contain multiple gateways such as a site-to-site VPN gateway, ExpressRoute gateway, point-to-site gateway, and Azure Firewall. The routing capabilities in the virtual hub are provided by a router that manages all routing, including transit routing, between the gateways using Border Gateway Protocol (BGP). The virtual hub router also provides transit connectivity between virtual networks that connect to a virtual hub and can support up to an aggregate throughput of 50 Gbps. These routing capabilities apply to customers using **Standard** Virtual WANs. For more information, see [About virtual hub routing](about-virtual-hub-routing.md).
17+
18+
This article helps you configure virtual hub routing using Azure portal. You can also configure virtual hub routing using the [Azure PowerShell steps](how-to-virtual-hub-routing-powershell.md).
1719

1820
## Create a route table
1921

@@ -49,7 +51,7 @@ In the Azure portal, go to your **Virtual HUB -> Route Tables** page. To open th
4951

5052
## Delete a route table
5153

52-
In the Azure portal, go to your **Virtual HUB -> Route Tables** page. Select the checkbox for route table that you want to delete. Click **"…"**, and then select **Delete**. You can't delete a Default or None route table. However, you can delete all custom route tables.
54+
In the Azure portal, go to your **Virtual HUB -> Route Tables** page. Select the checkbox for route table that you want to delete. Click **"…"**, and then select **Delete**. You can't delete a Default or None route table. However, you can delete all custom route tables.
5355

5456
## View effective routes
5557

@@ -59,11 +61,11 @@ In the Azure portal, go to your **Virtual HUB -> Route Tables** page. Select the
5961

6062
:::image type="content" source="./media/how-to-virtual-hub-routing/effective-routes.png" alt-text="Screenshot of Effective Routes page." lightbox="./media/how-to-virtual-hub-routing/effective-routes.png":::
6163

62-
## <a name="routing-configuration"></a>Set up routing configuration for a virtual network connection
64+
## <a name="routing-configuration"></a>Configure routing for a virtual network connection
6365

6466
[!INCLUDE [Connect](../../includes/virtual-wan-connect-vnet-hub-include.md)]
6567

6668
## Next steps
6769

68-
For more information about virtual hub routing, see [About virtual hub routing](about-virtual-hub-routing.md).
69-
For more information about Virtual WAN, see the [FAQ](virtual-wan-faq.md).
70+
* For more information about virtual hub routing, see [About virtual hub routing](about-virtual-hub-routing.md).
71+
* For more information about Virtual WAN, see the [Virtual WAN FAQ](virtual-wan-faq.md).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: 'Configure virtual hub routing preference: Azure PowerShell'
3+
titleSuffix: Azure Virtual WAN
4+
description: Learn how to configure Virtual WAN virtual hub routing preference using Azure PowerShell.
5+
author: cherylmc
6+
ms.service: virtual-wan
7+
ms.topic: conceptual
8+
ms.date: 10/26/2022
9+
ms.author: cherylmc
10+
---
11+
# Configure virtual hub routing preference - Azure PowerShell
12+
13+
The following steps help you configure virtual hub routing preference settings using Azure PowerShell. You can also configure these settings using the [Azure portal](howto-virtual-hub-routing-preference.md). For information about this feature, see [Virtual hub routing preference](about-virtual-hub-routing-preference.md).
14+
15+
## Prerequisite
16+
17+
If you're using Azure PowerShell locally from your computer, verify that your az.network module version is 4.19.0 or above.
18+
19+
## Configure
20+
21+
To configure virtual hub routing preference for an existing virtual hub, use the following steps.
22+
23+
1. (Optional) Check the current HubRoutingPreference for an existing virtual hub.
24+
25+
```azurepowershell-interactive
26+
Get-AzVirtualHub -ResourceGroupName "[resource group name]" -Name "[virtual hub name]" | select-object HubRoutingPreference
27+
```
28+
29+
1. Update the current HubRoutingPreference for an existing virtual hub. The preference can be either VpnGateway, or ExpressRoute. The following example sets the hub routing preference to VpnGateway.
30+
31+
```azurepowershell-interactive
32+
Update-AzVirtualHub -ResourceGroupName "[resource group name]" -Name "[virtual hub name]" -HubRoutingPreference "VpnGateway"
33+
```
34+
35+
1. After the settings have saved, you can verify the configuration by running the following PowerShell command for virtual hub.
36+
37+
```azurepowershell-interactive
38+
Get-AzVirtualHub -ResourceGroupName "[resource group name]" -Name "[virtual hub name]" | select-object HubRoutingPreference
39+
```
40+
41+
## Next steps
42+
43+
To learn more about virtual hub routing preference, see [About virtual hub routing preference](about-virtual-hub-routing-preference.md).

articles/virtual-wan/howto-virtual-hub-routing-preference.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
---
2-
title: 'Configure virtual hub routing preference'
2+
title: 'Configure virtual hub routing preference: Azure portal'
33
titleSuffix: Azure Virtual WAN
4-
description: Learn how to configure Virtual WAN virtual hub routing preference.
4+
description: Learn how to configure Virtual WAN virtual hub routing preference using the Azure portal.
55
author: cherylmc
66
ms.service: virtual-wan
77
ms.topic: conceptual
8-
ms.date: 05/30/2022
8+
ms.date: 10/26/2022
99
ms.author: cherylmc
1010
---
11-
# Configure virtual hub routing preference
11+
# Configure virtual hub routing preference - Azure portal
1212

13-
The following steps help you configure virtual hub routing preference settings. For information about this feature, see [Virtual hub routing preference](about-virtual-hub-routing-preference.md).
13+
The following steps help you configure virtual hub routing preference settings. For information about this feature, see [Virtual hub routing preference](about-virtual-hub-routing-preference.md). You can also configure these settings using the [Azure PowerShell](howto-virtual-hub-routing-preference-powershell.md).
1414

15+
## New virtual hub
1516

16-
## Configure
17+
You can configure a new virtual hub to include the virtual hub routing preference setting by using the [Azure portal]( https://portal.azure.com/). Follow the steps in the [Tutorial: Create a site-to-site connection](virtual-wan-site-to-site-portal.md) article.
1718

18-
You can configure a new virtual hub to include the virtual hub routing preference setting by using the [Azure Preview portal]( https://portal.azure.com/?feature.virtualWanRoutingPreference=true#home). Follow the steps in the [Tutorial: Create a site-to-site connection](virtual-wan-site-to-site-portal.md) article.
19+
## Existing virtual hub
1920

2021
To configure virtual hub routing preference for an existing virtual hub, use the following steps.
2122

22-
1. Open the [Azure Preview portal]( https://portal.azure.com/?feature.virtualWanRoutingPreference=true#home). You can't use the regular Azure portal yet for this feature.
23+
1. Open the [Azure portal]( https://portal.azure.com/).
2324

24-
1. Go to your virtual WAN. In the left pane, under the **Connectivity** section, click **Hubs** to view the list of hubs. Select **… > Edit virtual hub** to open the **Edit virtual hub** dialog box.
25+
1. Go to your virtual WAN. In the left pane, click **Hubs** to view the list of hubs.
2526

26-
:::image type="content" source="./media/howto-virtual-hub-routing-preference/edit-virtual-hub.png" alt-text="Screenshot shows select Edit virtual hub." lightbox="./media/howto-virtual-hub-routing-preference/edit-virtual-hub-expand.png":::
27-
28-
You can also click on the hub to open the virtual hub, and then under virtual hub resource, click the **Edit virtual hub** button.
27+
1. Click the hub that you want to configure. On the **Virtual HUB** page, click **Edit virtual hub**.
2928

3029
:::image type="content" source="./media/howto-virtual-hub-routing-preference/hub-edit.png" alt-text="Screenshot shows Edit virtual hub." lightbox="./media/howto-virtual-hub-routing-preference/hub-edit.png":::
3130

32-
1. On the **Edit virtual hub** page, select from the dropdown to configure the field **Hub routing preference**. To determine the setting to use, see [About virtual hub routing preference](about-virtual-hub-routing-preference.md).
31+
1. On the **Edit virtual hub** page, select from the dropdown to configure **Hub routing preference**. To determine the setting to use, see [About virtual hub routing preference](about-virtual-hub-routing-preference.md).
3332

3433
Click **Confirm** to save the settings.
3534

36-
:::image type="content" source="./media/howto-virtual-hub-routing-preference/select-preference.png" alt-text="Screenshot shows the dropdown showing ExpressRoute, VPN, and AS PATH." lightbox="./media/howto-virtual-hub-routing-preference/select-preference.png":::
35+
:::image type="content" source="./media/howto-virtual-hub-routing-preference/select.png" alt-text="Screenshot shows the dropdown showing ExpressRoute, VPN, and AS PATH options." lightbox="./media/howto-virtual-hub-routing-preference/select.png":::
3736

3837
1. After the settings have saved, you can verify the configuration on the **Overview** page for the virtual hub.
3938

Binary file not shown.
Binary file not shown.
Binary file not shown.
268 KB
Loading

0 commit comments

Comments
 (0)