Configure routing preference to influence route selection using PowerShell
Learn how to use routing preference setting in Azure Route Server to influence its route learning and selection. For more information, see Routing preference.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- An Azure route server. If you need to create a Route Server, see Create and configure Azure Route Server.
- Azure Cloud Shell or Azure PowerShell installed locally.
View routing preference configuration
Use Get-AzRouteServer to view the current routing preference configuration.
# Get the Route Server.
Get-AzRouteServer -ResourceGroupName 'myResourceGroup'
In the output, you can see the current routing preference setting under HubRoutingPreference:
ResourceGroupName Name Location RouteServerAsn RouteServerIps ProvisioningState HubRoutingPreference
----------------- ---- -------- -------------- -------------- ----------------- --------------------
myResourceGroup myRouteServer eastus 65515 {10.1.1.5, 10.1.1.4} Succeeded ExpressRoute
Note
The default routing preference setting is ExpressRoute.
Configure routing preference
Use Update-AzRouteServer to configure routing preference.
# Change the routing preference to AS Path.
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ASPath' -ResourceGroupName 'myResourceGroup'
# Change the routing preference to VPN Gateway.
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'VpnGateway' -ResourceGroupName 'myResourceGroup'
# Change the routing preference to ExpressRoute.
Update-AzRouteServer -RouteServerName 'myRouteServer' -HubRoutingPreference 'ExpressRoute' -ResourceGroupName 'myResourceGroup'
Important
Include -AllowBranchToBranchTraffic parameter to enable route exchange (branch-to-branch) even if it was enabled before running the Update-AzRouteServer cmdlet. For more information, see Configure route exchange.
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for