Skip to content

Commit 5ca4030

Browse files
committed
update article
1 parent 3f468a9 commit 5ca4030

File tree

1 file changed

+67
-156
lines changed

1 file changed

+67
-156
lines changed
Lines changed: 67 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: 'Quickstart: Create and configure Route Server - Azure CLI'
3-
description: In this quickstart, you learn how to create and configure an Azure Route Server using Azure CLI.
2+
title: 'Quickstart: Create an Azure Route Server - Azure CLI'
3+
description: In this quickstart, you learn how to create an Azure Route Server using the Azure CLI.
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/23/2024
99
ms.custom: mode-api, devx-track-azurecli
1010
ms.devlang: azurecli
1111
---
1212

13-
# Quickstart: Create and configure Route Server using Azure CLI
13+
# Quickstart: Create an Azure Route Server using the Azure CLI
1414

15-
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 will also advertise the virtual network routes to the NVA. For more information, see [Azure Route Server](overview.md).
15+
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 the Azure CLI.
1616

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

@@ -21,200 +21,111 @@ This article helps you configure Azure Route Server to peer with a Network Virtu
2121
## Prerequisites
2222

2323
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
24-
- The steps in this article run the Azure CLI commands interactively in [Azure Cloud Shell](/azure/cloud-shell/overview). To run the commands in the Cloud Shell, select **Open Cloudshell** at the upper-right corner of a code block. Select **Copy** to copy the code, and paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal. You can also [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. If you run Azure CLI locally, sign in to Azure using the [az login](/cli/azure/reference-index#az-login) command.
25-
- Review the [service limits for Azure Route Server](route-server-faq.md#limitations).
2624

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

29-
### Create a resource group
27+
- Azure Cloud Shell or Azure CLI.
3028

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 [az group create](/cli/azure/group#az-group-create). This example creates a resource group named **myRouteServerRG** in the **westus** location:
29+
The steps in this article run the Azure CLI commands interactively in [Azure Cloud Shell](/azure/cloud-shell/overview). To run the commands in the Cloud Shell, select **Open Cloud Shell** at the upper-right corner of a code block. Select **Copy** to copy the code, and paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
3230

33-
```azurecli-interactive
34-
az group create \
35-
--name myRouteServerRG \
36-
--location westus
37-
```
31+
You can also [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. If you run Azure CLI locally, sign in to Azure using the [az login](/cli/azure/reference-index#az-login) command.
3832

39-
### Create a virtual network
33+
## Create a route server
4034

41-
Create a virtual network with [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create). This example creates a default virtual network named **myVirtualNetwork**. If you already have a virtual network, you can skip to the next section.
42-
43-
```azurecli-interactive
44-
az network vnet create \
45-
--name myVirtualNetwork \
46-
--resource-group myRouteServerRG \
47-
--address-prefix 10.0.0.0/16
48-
```
35+
In this section, you create a route server. Prior to creating the route server, create a resource group to host all resources including the route server. You'll also need to create a virtual network with a dedicated subnet for the route server.
4936

50-
### Add a dedicated subnet
37+
1. Create a resource group using [az group create](/cli/azure/group#az-group-create). The following example creates a resource group named **RouteServerRG** in the **WestUS** region:
5138

52-
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), otherwise you might receive an error message when deploying the Route Server. Create a subnet configuration named **RouteServerSubnet** with [az network vnet subnet create](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-create):
39+
```azurecli-interactive
40+
az group create --name 'RouteServerRG' --location 'westus'
41+
```
5342
54-
1. Run the following command to add the *RouteServerSubnet* to your virtual network.
43+
1. Create a virtual network using [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create). The following example creates a default virtual network named **myRouteServerVNet** in the **WestUS** region with **RouteServerSubnet** subnet. 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.
5544
56-
```azurecli-interactive
57-
az network vnet subnet create \
58-
--name RouteServerSubnet \
59-
--resource-group myRouteServerRG \
60-
--vnet-name myVirtualNetwork \
61-
--address-prefix 10.0.0.0/24
45+
```azurecli-interactive
46+
# Create a virtual network and a route server subnet.
47+
az network vnet create --resource-group 'RouteServerRG' --name 'myRouteServerVNet' --subnet-name 'RouteServerSubnet' --subnet-prefixes '10.0.1.0/27'
48+
# Place the subnet ID into a variable.
49+
subnetId=$(az network vnet subnet show --name 'RouteServerSubnet' --resource-group 'RouteServerRG' --vnet-name 'myRouteServerVNet' --query id -o tsv)
6250
```
6351
64-
1. Make note of the RouteServerSubnet ID. To obtain and store the resource ID of the *RouteServerSubnet* to the `subnet_id` variable, use [az network vnet subnet show](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-show):
65-
66-
```azurecli-interactive
67-
subnet_id=$(az network vnet subnet show \
68-
--name RouteServerSubnet \
69-
--resource-group myRouteServerRG \
70-
--vnet-name myVirtualNetwork \
71-
--query id -o tsv)
72-
73-
echo $subnet_id
74-
```
75-
76-
## Create the Route Server
77-
78-
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 [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create):
52+
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 [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create).
7953
8054
```azurecli-interactive
81-
az network public-ip create \
82-
--name RouteServerIP \
83-
--resource-group myRouteServerRG \
84-
--version IPv4 \
85-
--sku Standard
55+
# Create a Standard public IP.
56+
az network public-ip create --resource-group 'RouteServerRG' --name 'RouteServerIP' --sku Standard --version 'IPv4'
8657
```
8758
88-
2. Create the Azure Route Server with [az network routeserver create](/cli/azure/network/routeserver#az-network-routeserver-create). This example creates an Azure Route Server named **myRouteServer**. The *hosted-subnet* is the resource ID of the RouteServerSubnet created in the previous section.
59+
1. Create the route server using [az network routeserver create](/cli/azure/network/routeserver#az-network-routeserver-create) command. 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 steps.
8960
9061
```azurecli-interactive
91-
az network routeserver create \
92-
--name myRouteServer \
93-
--resource-group myRouteServerRG \
94-
--hosted-subnet $subnet_id \
95-
--public-ip-address RouteServerIP
62+
# Create the route server.
63+
az network routeserver create --name 'myRouteServer' --resource-group 'RouteServerRG' --hosted-subnet $subnetId --public-ip-address 'RouteServerIP'
9664
```
9765
9866
[!INCLUDE [Deployment note](../../includes/route-server-note-creation-time.md)]
9967
100-
## Create BGP peering with an NVA
101-
102-
Use [az network routeserver peering create](/cli/azure/network/routeserver/peering#az-network-routeserver-peering-create) to establish BGP peering between the Route Server and the NVA:
68+
## Set up peering with NVA
10369
104-
The `peer-ip` is the virtual network IP assigned to the NVA. The `peer-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.
70+
In this section, you learn how to configure BGP peering with a network virtual appliance (NVA). Use [az network routeserver peering create](/cli/azure/network/routeserver/peering#az-network-routeserver-peering-create) command 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)
10571
10672
```azurecli-interactive
107-
az network routeserver peering create \
108-
--name myNVA \
109-
--peer-ip 192.168.0.1 \
110-
--peer-asn 65501 \
111-
--routeserver myRouteServer \
112-
--resource-group myRouteServerRG
73+
az network routeserver peering create --name 'myNVA' --peer-ip '10.0.0.4' --peer-asn '65001' --routeserver 'myRouteServer' --resource-group 'RouteServerRG'
11374
```
11475

115-
To set up peering with a different NVA or another instance of the same NVA for redundancy, use the previous command with different *PeerName*, *PeerIp*, and *PeerAsn*.
116-
11776
## Complete the configuration on the NVA
11877

119-
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 [az network routeserver show](/cli/azure/network/routeserver#az-network-routeserver-show):
120-
121-
```azurecli-interactive
122-
az network routeserver show \
123-
--name myRouteServer \
124-
--resource-group myRouteServerRG
125-
```
126-
127-
The output will look like the following example:
78+
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 [az network routeserver show](/cli/azure/network/routeserver#az-network-routeserver-show) command to get the IP and ASN of the route server.
12879

80+
```azurecli-interactive
81+
az network routeserver show --resource-group 'RouteServerRG' --name 'myRouteServer'
12982
```
130-
RouteServerAsn : 65515
131-
132-
RouteServerIps : {10.5.10.4, 10.5.10.5} "virtualRouterAsn": 65515,
133-
134-
"virtualRouterIps": [
135-
136-
"10.0.0.4",
137-
138-
"10.0.0.5"
139-
140-
],
14183

84+
The output should look similar to the following example:
85+
86+
```output
87+
{
88+
"allowBranchToBranchTraffic": false,
89+
"etag": "W/\"aaaa0000-bb11-2222-33cc-444444dddddd\"",
90+
"hubRoutingPreference": "ExpressRoute",
91+
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/RouteServerRG/providers/Microsoft.Network/virtualHubs/myRouteServer",
92+
"kind": "RouteServer",
93+
"location": "westus",
94+
"name": "myRouteServer",
95+
"provisioningState": "Succeeded",
96+
"resourceGroup": "RouteServerRG",
97+
"routeTable": {
98+
"routes": []
99+
},
100+
"routingState": "Provisioned",
101+
"sku": "Standard",
102+
"type": "Microsoft.Network/virtualHubs",
103+
"virtualHubRouteTableV2s": [],
104+
"virtualRouterAsn": 65515,
105+
"virtualRouterAutoScaleConfiguration": {
106+
"minCapacity": 2
107+
},
108+
"virtualRouterIps": [
109+
"10.0.1.4",
110+
"10.0.1.5"
111+
]
112+
}
142113
```
143114

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

146-
## Configure route exchange
147-
148-
If you have a virtual network gateway (ExpressRoute or VPN) in the same virtual network, you can enable *b2b traffic* to exchange routes between the gateway and the Route Server.
149-
150-
[!INCLUDE [VPN gateway note](../../includes/route-server-note-vpn-gateway.md)]
151-
152-
[!INCLUDE [downtime note](../../includes/route-server-note-vng-downtime.md)]
153-
154-
1. To enable route exchange between Azure Route Server and the gateways, use [az network routerserver update](/cli/azure/network/routeserver#az-network-routeserver-update) with the `--allow-b2b-traffic` flag set to **true**:
155-
156-
```azurecli-interactive
157-
az network routeserver update \
158-
--name myRouteServer \
159-
--resource-group myRouteServerRG \
160-
--allow-b2b-traffic true
161-
```
162-
163-
2. To disable route exchange between Azure Route Server and the gateways, use [az network routerserver update](/cli/azure/network/routeserver#az-network-routeserver-update) with the `--allow-b2b-traffic` flag set to **false**:
164-
165-
```azurecli-interactive
166-
az network routeserver update \
167-
--name myRouteServer \
168-
--resource-group myRouteServerRG \
169-
--allow-b2b-traffic false
170-
```
171-
172-
## Troubleshooting
173-
174-
Use the [az network routeserver peering list-advertised-routes](/cli/azure/network/routeserver/peering#az-network-routeserver-peering-list-advertised-routes) to view routes advertised by the Azure Route Server:
175-
176-
```azurecli-interactive
177-
az network routeserver peering list-advertised-routes \
178-
--name myNVA \
179-
--routeserver myRouteServer \
180-
--resource-group myRouteServerRG
181-
```
117+
## Clean up resources
182118

183-
Use the [az network routeserver peering list-learned-routes](/cli/azure/network/routeserver/peering#az-network-routeserver-peering-list-learned-routes) to view routes learned by the Azure Route Server:
119+
When no longer needed, delete the resource group and all of the resources it contains using [az group delete](/cli/azure/group#az-group-delete) command.
184120

185121
```azurecli-interactive
186-
az network routeserver peering list-learned-routes \
187-
--name myNVA \
188-
--routeserver myRouteServer
189-
--resource-group myRouteServerRG \
122+
# Delete the resource group and all the resources it contains.
123+
az group delete --name 'myResourceGroup' --yes --no-wait
190124
```
191125

192-
[!INCLUDE [azure-cli-troubleshooting.md](~/reusable-content/ce-skilling/azure/includes/azure-cli-troubleshooting.md)]
193-
194-
## Clean up resources
195-
196-
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.
197-
198-
1. Remove the BGP peering between Azure Route Server and an NVA with [az network routeserver peering delete](/cli/azure/network/routeserver/peering#az-network-routeserver-peering-delete):
199-
200-
```azurecli-interactive
201-
az network routeserver peering delete \
202-
--name myNVA \
203-
--routeserver myRouteServer \
204-
--resource-group myRouteServerRG
205-
```
206-
207-
2. Remove the Azure Route Server with [az network routeserver delete](/cli/azure/network/routeserver#az-network-routeserver-delete):
208-
209-
```azurecli-interactive
210-
az network routeserver delete \
211-
--name myRouteServer \
212-
--resource-group myRouteServerRG
213-
```
214-
215126
## Next step
216127

217128
Continue to learn more about how Azure Route Server interacts with ExpressRoute and VPN Gateways:
218129

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

0 commit comments

Comments
 (0)