Configure and manage Azure Route Server

In this article, you learn how to configure and manage Azure Route Server using the Azure portal, PowerShell, or Azure CLI.

Prerequisites

Add a peer

In this section, you learn how to add a BGP peering to your route server to peer with a network virtual appliance (NVA).

Use Add-AzRouteServerPeer cmdlet to add a new peer to the route server.

Add-AzRouteServerPeer -PeerName 'myNVA' -PeerAsn '65001' -PeerIp '10.0.0.4' -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'
Parameter Value
-PeerName A name to identify the peer. It doesn't have to be the same name of the NVA.
-PeerAsn The Autonomous System Number (ASN) of the NVA. For more information, see What Autonomous System Numbers (ASNs) can I use?
-PeerIp The private IP address of the NVA.
-ResourceGroupName The resource group name of your route server.
-RouteServerName The route server name. This parameter is required when there are more than one route server in the same resource group.

After you successfully add the peer NVA, you must configure the NVA to establish a BGP session with the route server's peer IPs and ASN. Use Get-AzRouteServer cmdlet to find the route server's peer IPs and ASN:

Get-AzRouteServer -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'
Parameter Value
-ResourceGroupName The resource group name of your route server.
-RouteServerName The route server name. You need this parameter when there are more than one route server in the same resource group.

Important

We recommend peering each NVA with both route server instances to ensure that virtual network routes are advertised over the NVA connections and achieve high availability.

Configure route exchange

In this section, you learn how to enable exchanging routes between your route server and the virtual network gateway (ExpressRoute or VPN) that exists in the same virtual network.

Important

The Azure VPN gateway must be configured in active-active mode and have the ASN set to 65515. It's not a requirement to have BGP enabled on the VPN gateway to communicate with the route server.

Warning

When you create or delete a route server in a virtual network that contains a virtual network gateway (ExpressRoute or VPN), expect downtime until the operation is complete. If you have an ExpressRoute circuit connected to the virtual network where you're creating or deleting the route server, the downtime doesn't affect the ExpressRoute circuit or its connections to other virtual networks.

Use Update-AzRouteServer cmdlet to enable or disable route exchange between the route server and the virtual network gateway.

Update-AzRouteServer -RouteServerName 'myRouteServer' -ResourceGroupName 'myResourceGroup' -AllowBranchToBranchTraffic 1
Parameter Value
-RouteServerName The route server name.
-ResourceGroupName The resource group name of your route server.
-AllowBranchToBranchTraffic The route exchange parameter. Accepted values: 1 and 0.

To disable route exchange, set the -AllowBranchToBranchTraffic parameter to 0.

Use Get-AzRouteServer cmdlet to verify the configuration.

Configure routing preference

In this section, you learn how to configure route preference to influence the route learning and selection of your route server.

Use Update-AzRouteServer cmdlet to configure the routing preference setting of your route server.

Update-AzRouteServer -RouteServerName 'myRouteServer' -ResourceGroupName 'myResourceGroup' -HubRoutingPreference 'ASPath'
Parameter Value
-RouteServerName The route server name.
-ResourceGroupName The resource group name of your route server.
-HubRoutingPreference The routing preference. Accepted values: ExpressRoute (default), VpnGateway, and ASPath.

Use Get-AzRouteServer cmdlet to verify the configuration.

View a peer

In this section, you learn how to view the details of a peer.

Use Get-AzRouteServerPeer cmdlet to view a route server peering.

Get-AzRouteServerPeer -PeerName 'myNVA' -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'
Parameter Value
-PeerName The peer name.
-ResourceGroupName The resource group name of your route server.
-RouteServerName The route server name.

View advertised and learned routes

In this section, you learn how to view the route server's advertised and learned routes.

Use the Get-AzRouteServerPeerAdvertisedRoute cmdlet to view routes advertised by a route server.

Get-AzRouteServerPeerAdvertisedRoute -PeerName 'myNVA' -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'

Use the Get-AzRouteServerPeerLearnedRoute cmdlet to view routes learned by a route server.

Get-AzRouteServerPeerLearnedRoute -PeerName 'myNVA' -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'
Parameter Value
-PeerName The peer name.
-ResourceGroupName The resource group name of your route server.
-RouteServerName The route server name.

Delete a peer

In this section, you learn how to delete an existing peering with a network virtual appliance (NVA).

Use Remove-AzRouteServerPeer cmdlet to delete a route server peering.

Get-AzRouteServerPeer -PeerName 'myNVA' -ResourceGroupName 'myResourceGroup' -RouteServerName 'myRouteServer'
Parameter Value
-PeerName The peer name.
-ResourceGroupName The resource group name of your route server.
-RouteServerName The route server name.

Delete a route server

In this section, you learn how to delete an existing route server.

Use Remove-AzRouteServer cmdlet to delete a route server.

Remove-AzRouteServer -RouteServerName 'myRouteServer' -ResourceGroupName 'myResourceGroup'
Parameter Value
-RouteServerName The route server name.
-ResourceGroupName The resource group name of your route server.