Configure routing preference to influence route selection using the Azure CLI
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).
Important
Routing preference is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
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 CLI installed locally.
View routing preference configuration
Use az network routeserver show to view the current route server configuration including its routing preference setting.
# Show the Route Server configuration.
az network routeserver show --resource-group 'myResourceGroup' --name 'myRouteServer'
In the output, you can see the current routing preference setting in front of "hubRoutingPreference":
{
"allowBranchToBranchTraffic": false,
"etag": "W/\"00000000-1111-2222-3333-444444444444\"",
"hubRoutingPreference": "ExpressRoute",
"id": "/subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualHubs/myRouteServer",
"kind": "RouteServer",
"location": "eastus",
"name": "myRouteServer",
"provisioningState": "Succeeded",
"resourceGroup": "myResourceGroup",
"routeTable": {
"routes": []
},
"routingState": "Provisioned",
"sku": "Standard",
"tags": {},
"type": "Microsoft.Network/virtualHubs",
"virtualHubRouteTableV2s": [],
"virtualRouterAsn": 65515,
"virtualRouterAutoScaleConfiguration": {
"minCapacity": 2
},
"virtualRouterIps": [
"10.1.1.5",
"10.1.1.4"
]
}
Note
The default routing preference setting is ExpressRoute.
Configure routing preference
Use az network routeserver update to update routing preference setting.
# Change the routing preference to AS Path.
az network routeserver update --name 'myRouteServer' --hub-routing-preference 'ASPath' --resource-group 'myResourceGroup'
# Change the routing preference to VPN Gateway.
az network routeserver update --name 'myRouteServer' --hub-routing-preference 'VpnGateway' --resource-group 'myResourceGroup'
# Change the routing preference to ExpressRoute.
az network routeserver update --name 'myRouteServer' --hub-routing-preference 'ExpressRoute' --resource-group 'myResourceGroup'
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