Skip to content

Commit ffa33d9

Browse files
committed
update article
1 parent 67eb60e commit ffa33d9

File tree

1 file changed

+52
-163
lines changed

1 file changed

+52
-163
lines changed
Lines changed: 52 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,226 +1,115 @@
11
---
2-
title: 'Quickstart: Create and configure Route Server - Azure PowerShell'
3-
description: In this quickstart, you learn how to create and configure an Azure Route Server using Azure PowerShell.
2+
title: 'Quickstart: Create an Azure Route Server - Azure PowerShell'
3+
description: In this quickstart, you learn how to create an Azure Route Server using Azure PowerShell.
44
author: halkazwini
55
ms.author: halkazwini
66
ms.service: azure-route-server
77
ms.topic: quickstart
8-
ms.date: 08/14/2024
8+
ms.date: 09/18/2024
99
ms.custom: devx-track-azurepowershell, mode-api
1010
---
1111

12-
# Quickstart: Create and configure Route Server using Azure PowerShell
12+
# Quickstart: Create an Azure Route Server using Azure PowerShell
1313

14-
This article helps you configure Azure Route Server to peer with a Network Virtual Appliance (NVA) in your virtual network using Azure PowerShell. Route Server learns routes from your NVA and program them on the virtual machines in the virtual network. Azure Route Server also advertises the virtual network routes to the NVA. For more information, see [Azure Route Server](overview.md).
14+
In this quickstart, you learn how to create an Azure Route Server to peer with a Network Virtual Appliance (NVA) in your virtual network using Azure PowerShell.
1515

1616
:::image type="content" source="media/quickstart-configure-route-server-portal/environment-diagram.png" alt-text="Diagram of Route Server deployment environment using the Azure PowerShell." lightbox="media/quickstart-configure-route-server-portal/environment-diagram.png":::
1717

1818
[!INCLUDE [route server preview note](../../includes/route-server-note-preview-date.md)]
1919

2020
## Prerequisites
2121

22-
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
23-
* Make sure you have the latest PowerShell modules, or you can use Azure Cloud Shell in the portal.
24-
* Review the [service limits for Azure Route Server](route-server-faq.md#limitations).
25-
* If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
22+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2623

27-
## Create resource group and a virtual network
24+
- Review the [service limits for Azure Route Server](route-server-faq.md#limitations).
2825

29-
### Create a resource group
26+
- Azure Cloud Shell or Azure PowerShell.
3027

31-
Before you can create an Azure Route Server, you have to create a resource group to host the Route Server. Create a resource group with [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup). This example creates a resource group named **myRouteServerRG** in the **WestUS** location:
28+
The steps in this article run the Azure PowerShell cmdlets interactively in [Azure Cloud Shell](/azure/cloud-shell/overview). To run the cmdlets in the Cloud Shell, select **Open Cloud Shell** at the upper-right corner of a code block. Select **Copy** to copy the code and then paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
3229

33-
```azurepowershell-interactive
34-
$rg = @{
35-
Name = 'myRouteServerRG'
36-
Location = 'WestUS'
37-
}
38-
New-AzResourceGroup @rg
39-
```
40-
41-
### Create a virtual network
30+
You can also [install Azure PowerShell locally](/powershell/azure/install-azure-powershell) to run the cmdlets. If you run PowerShell locally, sign in to Azure using the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet.
4231

43-
Create a virtual network with [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). This example creates a default virtual network named **myVirtualNetwork** in the **WestUS** location: If you already have a virtual network, you can skip to the next section.
32+
## Create a Route Server
4433

45-
```azurepowershell-interactive
46-
$vnet = @{
47-
Name = 'myVirtualNetwork'
48-
ResourceGroupName = 'myRouteServerRG'
49-
Location = 'WestUS'
50-
AddressPrefix = '10.0.0.0/16'
51-
}
52-
$virtualNetwork = New-AzVirtualNetwork @vnet
53-
```
34+
In this section, you create the route server. Before creating it, you create a resource group to host the route server and the other resources. You'll also create a virtual network with a dedicated subnet for the route server.
5435

55-
### Add a dedicated subnet
36+
1. Create a a resource group using [New-AzResourceGroup](/powershell/module/az.Resources/New-azResourceGroup). The following example creates a resource group named **myRouteServerRG** in the **WestUS** region:
5637

57-
Azure Route Server requires a dedicated subnet named *RouteServerSubnet*. The subnet size has to be at least /27 or shorter prefix (such as /26 or /25) or you'll receive an error message when deploying the Route Server. Create a subnet configuration named **RouteServerSubnet** with [Add-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/add-azvirtualnetworksubnetconfig):
38+
```azurepowershell-interactive
39+
# Create a resource group.
40+
New-AzResourceGroup = -Name 'myRouteServerRG' -Location 'WestUS'
41+
```
5842
59-
```azurepowershell-interactive
60-
$subnet = @{
61-
Name = 'RouteServerSubnet'
62-
VirtualNetwork = $virtualNetwork
63-
AddressPrefix = '10.0.0.0/24'
64-
}
65-
$subnetConfig = Add-AzVirtualNetworkSubnetConfig @subnet
43+
1. The route server requires a dedicated subnet named *RouteServerSubnet*. The subnet size has to be at least /27 or shorter prefix (such as /26 or /25) or you'll receive an error message when deploying the route server. Create a subnet configuration for **RouteServerSubnet** using [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig).
6644
67-
$virtualnetwork | Set-AzVirtualNetwork
45+
```azurepowershell-interactive
46+
# Create subnet configuration.
47+
$subnet = New-AzVirtualNetworkSubnetConfig -Name 'RouteServerSubnet' -AddressPrefix '10.0.1.0/27'
48+
```
6849
69-
$vnetInfo = Get-AzVirtualNetwork -Name myVirtualNetwork -ResourceGroupName myRouteServerRG
70-
$subnetId = (Get-AzVirtualNetworkSubnetConfig -Name RouteServerSubnet -VirtualNetwork $vnetInfo).Id
71-
```
50+
1. Create a virtual network using [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork). The following example creates a default virtual network named **myRouteServerVNet** in the **WestUS** region.
7251
73-
## Create the Route Server
52+
```azurepowershell-interactive
53+
# Create a virtual network and place into a variable.
54+
$vnet = New-AzVirtualNetwork -Name 'myRouteServerVNet' -ResourceGroupName 'RouteServerRG' -Location 'WestUS' -AddressPrefix '10.0.0.0/16' -Subnet $subnet
55+
# Place the subnet ID into a variable.
56+
$subnetId = (Get-AzVirtualNetworkSubnetConfig -Name 'RouteServerSubnet' -VirtualNetwork $vnet).Id
57+
```
7458
75-
1. To ensure connectivity to the backend service that manages Route Server configuration, assigning a public IP address is required. Create a Standard Public IP named **RouteServerIP** with [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress):
59+
1. To ensure connectivity to the backend service that manages Route Server configuration, assigning a public IP address is required. Create a Standard Public IP named **RouteServerIP** using [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress).
7660
7761
```azurepowershell-interactive
78-
$ip = @{
79-
Name = 'myRouteServerIP'
80-
ResourceGroupName = 'myRouteServerRG'
81-
Location = 'WestUS'
82-
AllocationMethod = 'Static'
83-
IpAddressVersion = 'Ipv4'
84-
Sku = 'Standard'
85-
}
86-
$publicIp = New-AzPublicIpAddress @ip
62+
# Create a Standard public IP and place it into a variable.
63+
$publicIp = New-AzPublicIpAddress -ResourceGroupName 'RouteServerRG' -Name 'myRouteServerIP' -Location 'WestUS' -AllocationMethod 'Static' -Sku 'Standard' IpAddressVersion = 'Ipv4'
8764
```
88-
89-
2. Create the Azure Route Server with [New-AzRouteServer](/powershell/module/az.network/new-azrouteserver). This example creates an Azure Route Server named **myRouteServer** in the **WestUS** location. The *HostedSubnet* is the resource ID of the RouteServerSubnet created in the previous section.
90-
91-
```azurepowershell-interactive
92-
$rs = @{
93-
RouteServerName = 'myRouteServer'
94-
ResourceGroupName = 'myRouteServerRG'
95-
Location = 'WestUS'
96-
HostedSubnet = $subnetId
97-
PublicIP = $publicIp
98-
}
99-
New-AzRouteServer @rs
65+
66+
1. Create the route server using [New-AzRouteServer](/powershell/module/az.network/new-azrouteserver). The following example creates a route server named **myRouteServer** in the **WestUS** region. The *HostedSubnet* is the resource ID of the RouteServerSubnet created in the previous section.
67+
68+
```azurepowershell-interactive
69+
New-AzRouteServer -RouteServerName 'myRouteServer' -ResourceGroupName 'RouteServerRG' -Location 'WestUS' -HostedSubnet $subnetId -PublicIP $publicIp
10070
```
10171
10272
[!INCLUDE [Deployment note](../../includes/route-server-note-creation-time.md)]
73+
```
10374
104-
## Create BGP peering with an NVA
105-
106-
To establish BGP peering from the Route Server to your NVA use [Add-AzRouteServerPeer](/powershell/module/az.network/add-azrouteserverpeer):
75+
## Set up peering with NVA
10776
108-
The `your_nva_ip` is the virtual network IP assigned to the NVA. The `your_nva_asn` is the Autonomous System Number (ASN) configured in the NVA. The ASN can be any 16-bit number other than the ones in the range of 65515-65520. This range of ASNs is reserved by Microsoft.
77+
In this section, you learn how to configure BGP peering with a network virtual appliance (NVA). Use [Add-AzRouteServerPeer](/powershell/module/az.network/add-azrouteserverpeer) to establish BGP peering from the route server to your NVA. The following example adds a peer named **myNVA** that has an IP address of **10.0.0.4** and an ASN of **65001**. For more information, see [What Autonomous System Numbers (ASNs) can I use?](route-server-faq.md#what-autonomous-system-numbers-asns-can-i-use)
10978
11079
```azurepowershell-interactive
111-
$peer = @{
112-
PeerName = 'myNVA'
113-
PeerIp = 'your_nva_ip'
114-
PeerAsn = 'your_nva_asn'
115-
RouteServerName = 'myRouteServer'
116-
ResourceGroupName = myRouteServerRG'
117-
}
118-
Add-AzRouteServerPeer @peer
80+
Add-AzRouteServerPeer -ResourceGroupName 'RouteServerRG' -RouteServerName 'myRouteServer' -PeerName 'myNVA' -PeerAsn '65001' -PeerIp '10.0.0.4'
11981
```
12082

121-
To set up peering with a different NVA or another instance of the same NVA for redundancy, use the same command as above with different *PeerName*, *PeerIp*, and *PeerAsn*.
122-
12383
## Complete the configuration on the NVA
12484

125-
To complete the configuration on the NVA and enable the BGP sessions, you need the IP and the ASN of Azure Route Server. You can get this information by using [Get-AzRouteServer](/powershell/module/az.network/get-azrouteserver):
85+
To complete the peering setup, you must configure the NVA to establish a BGP session with the route server's peer IPs and ASN. Use [Get-AzRouteServer](/powershell/module/az.network/get-azrouteserver) to get the IP and ASN of the route server.
12686

12787
```azurepowershell-interactive
128-
$routeserver = @{
129-
RouteServerName = 'myRouteServer'
130-
ResourceGroupName = 'myRouteServerRG'
131-
}
132-
Get-AzRouteServer @routeserver
88+
Get-AzRouteServer -ResourceGroupName 'RouteServerRG' -RouteServerName 'myRouteServer'
13389
```
13490

13591
The output looks like the following:
13692

137-
```
138-
RouteServerAsn : 65515
139-
RouteServerIps : {10.5.10.4, 10.5.10.5}
93+
```output
94+
ResourceGroupName Name Location RouteServerAsn RouteServerIps ProvisioningState HubRoutingPreference AllowBranchToBranchTraffic
95+
----------------- ---- -------- -------------- -------------- ----------------- -------------------- --------------------------
96+
RouteServerRG myRouteServer westus 65515 {10.0.1.4, 10.0.1.5} Succeeded ExpressRoute False
14097
```
14198

14299
[!INCLUDE [NVA peering note](../../includes/route-server-note-nva-peering.md)]
143100

144-
## <a name = "route-exchange"></a>Configure route exchange
145-
146-
If you have a virtual network gateway (ExpressRoute or VPN) in the same virtual network, you can enable *BranchToBranchTraffic* to exchange routes between the gateway and the Route Server.
147-
148-
[!INCLUDE [VPN gateway note](../../includes/route-server-note-vpn-gateway.md)]
149-
150-
[!INCLUDE [downtime note](../../includes/route-server-note-vng-downtime.md)]
151-
152-
1. To enable route exchange between Azure Route Server and the gateway(s), use [Update-AzRouteServer](/powershell/module/az.network/update-azrouteserver) with the *-AllowBranchToBranchTraffic* flag:
153-
154-
```azurepowershell-interactive
155-
$routeserver = @{
156-
RouteServerName = 'myRouteServer'
157-
ResourceGroupName = 'myRouteServerRG'
158-
AllowBranchToBranchTraffic
159-
}
160-
Update-AzRouteServer @routeserver
161-
```
162-
163-
2. To disable route exchange between Azure Route Server and the gateway(s), use [Update-AzRouteServer](/powershell/module/az.network/update-azrouteserver) without the *-AllowBranchToBranchTraffic* flag:
164-
165-
```azurepowershell-interactive
166-
$routeserver = @{
167-
RouteServerName = 'myRouteServer'
168-
ResourceGroupName = 'myRouteServerRG'
169-
}
170-
Update-AzRouteServer @routeserver
171-
```
172-
173-
## Troubleshooting
174-
175-
Use the [Get-AzRouteServerPeerAdvertisedRoute](/powershell/module/az.network/get-azrouteserverpeeradvertisedroute) to view routes advertised by the Azure Route Server.
176-
177-
```azurepowershell-interactive
178-
$remotepeer = @{
179-
RouteServerName = 'myRouteServer'
180-
ResourceGroupName = 'myRouteServerRG'
181-
PeerName = 'myNVA'
182-
}
183-
Get-AzRouteServerPeerAdvertisedRoute @remotepeer
184-
```
185-
186-
Use the [Get-AzRouteServerPeerLearnedRoute](/powershell/module/az.network/get-azrouteserverpeerlearnedroute) to view routes learned by the Azure Route Server.
187-
188-
```azurepowershell-interactive
189-
$remotepeer = @{
190-
RouteServerName = 'myRouteServer'
191-
ResourceGroupName = 'myRouteServerRG'
192-
PeerName = 'myNVA'
193-
}
194-
Get-AzRouteServerPeerLearnedRoute @remotepeer
195-
```
196101
## Clean up resources
197102

198-
If you no longer need the Azure Route Server, use the first command to remove the BGP peering, and then the second command to remove the Route Server.
199-
200-
1. Remove the BGP peering between Azure Route Server and an NVA with [Remove-AzRouteServerPeer](/powershell/module/az.network/remove-azrouteserverpeer):
103+
When no longer needed, delete the resource group and all of the resources it contains using [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup).
201104

202105
```azurepowershell-interactive
203-
$remotepeer = @{
204-
PeerName = 'myNVA'
205-
RouteServerName = 'myRouteServer'
206-
ResourceGroupName = 'myRouteServerRG'
207-
}
208-
Remove-AzRouteServerPeer @remotepeer
209-
```
210-
211-
2. Remove the Azure Route Server with [Remove-AzRouteServer](/powershell/module/az.network/remove-azrouteserver):
212-
213-
```azurepowershell-interactive
214-
$routeserver = @{
215-
RouteServerName = 'myRouteServer'
216-
ResourceGroupName = 'myRouteServerRG'
217-
}
218-
Remove-AzRouteServer @routeserver
106+
# Delete the resource group and all the resources it contains.
107+
Remove-AzResourceGroup -Name 'RouteServerRG' -Force
219108
```
220109

221-
## Next steps
110+
## Next step
222111

223112
After you've created the Azure Route Server, continue on to learn more about how Azure Route Server interacts with ExpressRoute and VPN Gateways:
224113

225114
> [!div class="nextstepaction"]
226-
> [Azure ExpressRoute and Azure VPN support](expressroute-vpn-support.md)
115+
> [Configure peering between a route server and NVA](peer-route-server-with-virtual-appliance.md)

0 commit comments

Comments
 (0)