Skip to content

Commit bc33de9

Browse files
authored
Merge pull request #254776 from halkazwini/rs-hrp-ps
Route Server: Updates: Configure routing preference to influence route selection using PowerShell
2 parents ff08fb3 + 8a4ed90 commit bc33de9

File tree

2 files changed

+42
-48
lines changed

2 files changed

+42
-48
lines changed

articles/route-server/TOC.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747
href: troubleshoot-route-server.md
4848
- name: Monitor Route Server
4949
href: monitor-route-server.md
50-
- name: Configure routing preference - Portal
51-
href: hub-routing-preference-portal.md
52-
- name: Configure routing preference - PowerShell
53-
href: hub-routing-preference-powershell.md
50+
- name: Routing preference
51+
items:
52+
- name: Azure portal
53+
href: hub-routing-preference-portal.md
54+
- name: Azure PowerShell
55+
href: hub-routing-preference-powershell.md
5456
- name: Reference
5557
items:
5658
- name: Azure PowerShell
Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
2-
title: Configure routing preference (preview) to influence route selection - PowerShell
2+
title: Configure routing preference - PowerShell
33
titleSuffix: Azure Route Server
44
description: Learn how to configure routing preference (preview) in Azure Route Server using Azure PowerShell to influence its route selection.
55
author: halkazwini
66
ms.author: halkazwini
77
ms.service: route-server
8-
ms.custom: devx-track-azurepowershell
98
ms.topic: how-to
10-
ms.date: 07/31/2023
9+
ms.date: 10/12/2023
10+
ms.custom: devx-track-azurepowershell
11+
12+
#CustomerIntent: As an Azure administrator, I want learn how to use routing preference setting so that I can influence route selection in Azure Route Server by using Azure PowerShell.
1113
---
1214

1315
# Configure routing preference to influence route selection using PowerShell
1416

15-
Learn how to use [routing preference (preview)](hub-routing-preference.md) setting in Azure Route Server to influence its route selection.
17+
Learn how to use routing preference setting in Azure Route Server to influence its route learning and selection. For more information, see [Routing preference (preview)](hub-routing-preference.md).
1618

1719
> [!IMPORTANT]
1820
> Routing preference is currently in PREVIEW.
@@ -21,62 +23,52 @@ Learn how to use [routing preference (preview)](hub-routing-preference.md) setti
2123
## Prerequisites
2224

2325
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
26+
- An Azure route server. If you need to create a Route Server, see [Create and configure Azure Route Server](quickstart-configure-route-server-powershell.md).
2427
- Azure Cloud Shell or Azure PowerShell installed locally.
2528

26-
## Create a virtual network
29+
## View routing preference configuration
2730

28-
Before you can create a virtual network, you have to create a resource group. Use [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup) to create the resource group. This example creates a resource group named **myResourceGroup** in the **EastUS** region.
29-
30-
Use [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) to create the virtual network. This example creates a virtual network named **myVirtualNetwork** in the **EastUS** region. You need a dedicated subnet called **RouteServerSubnet** for the Route Server. Use [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) to create the subnet configuration of RouteServerSubnet.
31+
Use [Get-AzRouteServer](/powershell/module/az.network/get-azrouteserver) to view the current routing preference configuration.
3132

3233
```azurepowershell-interactive
33-
# Create a resource group.
34-
New-AzResourceGroup -Name 'myResourceGroup' -Location 'EastUS'
35-
36-
# Create RouteServerSubnet configuration and place it into a variable.
37-
$subnet = New-AzVirtualNetworkSubnetConfig -Name 'RouteServerSubnet' -AddressPrefix '10.0.1.0/24'
38-
39-
# Create the virtual network and place it into a variable.
40-
$vnet = New-AzVirtualNetwork -Name 'myVirtualNetwork' -ResourceGroupName 'myResourceGroup' -Location 'EastUS' -AddressPrefix '10.0.0.0/16' -Subnet $subnet
41-
42-
# Place the subnet ID into a variable.
43-
$subnetId = (Get-AzVirtualNetworkSubnetConfig -Name RouteServerSubnet -VirtualNetwork $vnet).Id
34+
# Get the Route Server.
35+
Get-AzRouteServer -ResourceGroupName 'myResourceGroup'
4436
```
4537

46-
## Create the Route Server
38+
In the output, you can see the current routing preference setting under **HubRoutingPreference**:
4739

48-
Before you create the Route Server, create a standard public IP using [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress). Then use [New-AzRouteServer](/powershell/module/az.network/new-azrouteserver) to create the route server with a routing preference set to **VpnGateway**. When you choose VpnGateway as a routing preference, Route Server prefers routes learned through VPN/SD-WAN connections over routes learned through ExpressRoute.
40+
```output
41+
ResourceGroupName Name Location RouteServerAsn RouteServerIps ProvisioningState HubRoutingPreference
42+
----------------- ---- -------- -------------- -------------- ----------------- --------------------
43+
myResourceGroup myRouteServer eastus 65515 {10.1.1.5, 10.1.1.4} Succeeded ExpressRoute
44+
```
4945

50-
```azurepowershell-interactive
51-
# Create a standard public IP for the Route Server.
52-
$publicIp = New-AzPublicIpAddress -Name 'RouteServerIP' -IpAddressVersion 'IPv4' -Sku 'Standard' -AllocationMethod 'Static' -ResourceGroupName 'myResourceGroup' -Location 'EastUS'
46+
The default routing preference setting is **ExpressRoute**.
5347

54-
# Create a Route Server with routing preference set to VpnGateway
55-
New-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'VpnGateway' -HostedSubnet $subnetId -PublicIpAddress $publicIp -ResourceGroupName 'myResourceGroup' -Location 'EastUS'
48+
## Configure routing preference
5649

57-
# Create a Route Server with routing preference set to ExpressRoute
58-
New-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ExpressRoute' -HostedSubnet $subnetId -PublicIpAddress $publicIp -ResourceGroupName 'myResourceGroup' -Location 'EastUS'
50+
Use [Update-AzRouteServer](/powershell/module/az.network/update-azrouteserver) to configure routing preference.
5951

60-
# Create a Route Server with routing preference set to ASPath
61-
New-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ASPath' -HostedSubnet $subnetId -PublicIpAddress $publicIp -ResourceGroupName 'myResourceGroup' -Location 'EastUS'
52+
```azurepowershell-interactive
53+
# Change the routing preference to AS Path (with branch-to-branch enabled).
54+
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ASPath' -ResourceGroupName 'myResourceGroup' -AllowBranchToBranchTraffic
6255
```
6356

64-
## Update routing preference
65-
66-
To update the routing preference of an existing Route Server, use [Update-AzRouteServer](/powershell/module/az.network/update-azrouteserver). This example updates the routing preference to AS Path.
67-
6857
```azurepowershell-interactive
69-
# Change the routing preference to AS Path.
70-
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ASPath' -ResourceGroupName 'myResourceGroup'
71-
72-
# Change the routing preference to VPN Gateway.
73-
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'VPNGateway' -ResourceGroupName 'myResourceGroup'
58+
# Change the routing preference to VPN Gateway (with branch-to-branch enabled).
59+
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'VpnGateway' -ResourceGroupName 'myResourceGroup' -AllowBranchToBranchTraffic
60+
```
7461

75-
# Change the routing preference to ExpressRoute.
76-
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ExpressRoute' -ResourceGroupName 'myResourceGroup'
62+
```azurepowershell-interactive
63+
# Change the routing preference to ExpressRoute (with branch-to-branch enabled).
64+
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ExpressRoute' -ResourceGroupName 'myResourceGroup' -AllowBranchToBranchTraffic
7765
```
7866

79-
## Next steps
67+
> [!IMPORTANT]
68+
> If you don't include ***-AllowBranchToBranchTraffic*** parameter, **route exchange (branch-to-branch)** will be disabled even if it was enabled before running the **Update-AzRouteServer** cmdlet.
69+
70+
## Related content
8071

81-
- To learn more about configuring Azure Route Servers, see [Create and configure Route Server using Azure PowerShell](quickstart-configure-route-server-powershell.md).
82-
- To learn more about Azure Route Server, see [Azure Route Server FAQ](route-server-faq.md).
72+
- [Create and configure Route Server](quickstart-configure-route-server-powershell.md)
73+
- [Monitor Azure Route Server](monitor-route-server.md)
74+
- [Azure Route Server FAQ](route-server-faq.md)

0 commit comments

Comments
 (0)