You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/nat-gateway/tutorial-hub-spoke-route-nat.md
+100-2Lines changed: 100 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -901,7 +901,6 @@ A Windows Server 2022 virtual machine is used to test the outbound internet traf
901
901
902
902
# [**CLI**](#tab/cli)
903
903
904
-
905
904
Use [az network nsg create](/cli/azure/network/nsg?view=azure-cli-latest#az_network_nsg_create) to create the network security group.
906
905
907
906
```azurecli-interactive
@@ -1224,6 +1223,37 @@ Create a route table to force all outbound internet and inter-spoke traffic thro
1224
1223
1225
1224
# [**CLI**](#tab/cli)
1226
1225
1226
+
Use [az network route-table create](/cli/azure/network/route-table?view=azure-cli-latest#az_network_route_table_create) to create the route table.
1227
+
1228
+
```azurecli-interactive
1229
+
az network route-table create \
1230
+
--resource-group test-rg \
1231
+
--name route-table-nat-spoke-2 \
1232
+
--location westus2
1233
+
```
1234
+
1235
+
Use [az network route-table route create](/cli/azure/network/route-table/route?view=azure-cli-latest#az_network_route_table_route_create) to create the route in the route table.
1236
+
1237
+
```azurecli-interactive
1238
+
az network route-table route create \
1239
+
--resource-group test-rg \
1240
+
--route-table-name route-table-nat-spoke-2 \
1241
+
--name default-via-nat-spoke-2 \
1242
+
--address-prefix 0.0.0.0/0 \
1243
+
--next-hop-type VirtualAppliance \
1244
+
--next-hop-ip-address 10.0.0.10
1245
+
```
1246
+
1247
+
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet?view=azure-cli-latest#az_network_vnet_subnet_update) to associate the route table with the subnet.
1248
+
1249
+
```azurecli-interactive
1250
+
az network vnet subnet update \
1251
+
--resource-group test-rg \
1252
+
--vnet-name vnet-spoke-2 \
1253
+
--name subnet-private \
1254
+
--route-table route-table-nat-spoke-2
1255
+
```
1256
+
1227
1257
---
1228
1258
1229
1259
## Create spoke two test virtual machine
@@ -1281,6 +1311,53 @@ Create a Windows Server 2022 virtual machine for the test virtual machine in spo
1281
1311
1282
1312
# [**CLI**](#tab/cli)
1283
1313
1314
+
1315
+
Use [az network nsg create](/cli/azure/network/nsg?view=azure-cli-latest#az_network_nsg_create) to create the network security group.
1316
+
1317
+
```azurecli-interactive
1318
+
az network nsg create \
1319
+
--resource-group test-rg \
1320
+
--name nsg-spoke-2 \
1321
+
--location eastus2
1322
+
```
1323
+
1324
+
Use [az network nsg rule create](/cli/azure/network/nsg/rule?view=azure-cli-latest#az_network_nsg_rule_create) to create an inbound NSG rule for HTTP.
1325
+
1326
+
```azurecli-interactive
1327
+
az network nsg rule create \
1328
+
--resource-group test-rg \
1329
+
--nsg-name nsg-spoke-2 \
1330
+
--name allow-http \
1331
+
--priority 1000 \
1332
+
--direction Inbound \
1333
+
--access Allow \
1334
+
--protocol Tcp \
1335
+
--destination-port-ranges 80
1336
+
```
1337
+
1338
+
Use [az network nic create](/cli/azure/network/nic?view=azure-cli-latest#az_network_nic_create) to create the network interface.
1339
+
1340
+
```azurecli-interactive
1341
+
az network nic create \
1342
+
--resource-group test-rg \
1343
+
--name nic-1 \
1344
+
--vnet-name vnet-1 \
1345
+
--subnet subnet-private \
1346
+
--network-security-group nsg-spoke-2
1347
+
```
1348
+
1349
+
Use [az vm create](/cli/azure/vm?view=azure-cli-latest#az_vm_create) to create the Windows Server 2022 virtual machine.
1350
+
1351
+
```azurecli-interactive
1352
+
az vm create \
1353
+
--resource-group test-rg \
1354
+
--name vm-spoke-2 \
1355
+
--image Win2022Datacenter \
1356
+
--size Standard_DS2_v2 \
1357
+
--admin-username azureuser \
1358
+
--nics nic-1
1359
+
```
1360
+
1284
1361
---
1285
1362
1286
1363
Wait for the virtual machine to finish deploying before continuing to the next steps.
@@ -1328,6 +1405,18 @@ IIS is installed on the Windows Server 2022 virtual machine to test outbound int
1328
1405
1329
1406
# [**CLI**](#tab/cli)
1330
1407
1408
+
Use [az vm extension set](/cli/azure/vm/extension?view=azure-cli-latest#az_vm_extension_set) to install IIS on the virtual machine.
0 commit comments