Skip to content

Commit 59ed841

Browse files
committed
cli fixes after testing
1 parent 5d2eb0a commit 59ed841

File tree

1 file changed

+42
-43
lines changed

1 file changed

+42
-43
lines changed

articles/nat-gateway/tutorial-hub-spoke-route-nat.md

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ All outbound internet traffic traverses the NAT gateway to the internet. Use the
9090

9191
Use [az group create](/cli/azure/group#az_group_create) to create a resource group.
9292

93-
```azurecli-interactive
93+
```azurecli
9494
az group create \
9595
--name test-rg \
9696
--location eastus2
9797
```
9898

9999
Use [az network public-ip create](/cli/azure/network/public-ip#az_network_public_ip_create) to create a public IP address for the NAT gateway.
100100

101-
```azurecli-interactive
101+
```azurecli
102102
az network public-ip create \
103103
--resource-group test-rg \
104104
--name public-ip-nat \
@@ -109,7 +109,7 @@ az network public-ip create \
109109

110110
Use [az network nat gateway create](/cli/azure/network/nat/gateway#az_network_nat_gateway_create) to create the NAT gateway.
111111

112-
```azurecli-interactive
112+
```azurecli
113113
az network nat gateway create \
114114
--resource-group test-rg \
115115
--name nat-gateway \
@@ -203,7 +203,7 @@ It takes a few minutes for the bastion host to deploy. When the virtual network
203203

204204
Use [az network vnet create](/cli/azure/network/vnet#az_network_vnet_create) to create the virtual network.
205205

206-
```azurecli-interactive
206+
```azurecli
207207
az network vnet create \
208208
--resource-group test-rg \
209209
--name vnet-hub \
@@ -213,7 +213,7 @@ az network vnet create \
213213

214214
Use [az network vnet subnet create](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_create) to create the subnets.
215215

216-
```azurecli-interactive
216+
```azurecli
217217
az network vnet subnet create \
218218
--resource-group test-rg \
219219
--vnet-name vnet-hub \
@@ -236,8 +236,7 @@ az network vnet subnet create \
236236

237237
Use [az network public-ip create](/cli/azure/network/public-ip#az_network_public_ip_create) to create a public IP address for the Azure Bastion host.
238238

239-
```azurecli-interactive
240-
# Create public IP for Bastion
239+
```azurecli
241240
az network public-ip create \
242241
--resource-group test-rg \
243242
--name public-ip-bastion \
@@ -248,7 +247,7 @@ az network public-ip create \
248247

249248
Use [az network bastion create](/cli/azure/network/bastion#az_network_bastion_create) to create the Azure Bastion host.
250249

251-
```azurecli-interactive
250+
```azurecli
252251
az network bastion create \
253252
--resource-group test-rg \
254253
--name bastion \
@@ -320,7 +319,7 @@ The private key will download to your local machine. The private key is needed i
320319

321320
Use [az network nsg create](/cli/azure/network/nsg#az_network_nsg_create) to create the network security group.
322321

323-
```azurecli-interactive
322+
```azurecli
324323
az network nsg create \
325324
--resource-group test-rg \
326325
--name nsg-nva \
@@ -329,7 +328,7 @@ az network nsg create \
329328

330329
Use [az network nic create](/cli/azure/network/nic#az_network_nic_create) to create the network interface.
331330

332-
```azurecli-interactive
331+
```azurecli
333332
az network nic create \
334333
--resource-group test-rg \
335334
--name nic-public \
@@ -340,7 +339,7 @@ az network nic create \
340339

341340
Use [az vm create](/cli/azure/vm#az_vm_create) to create the virtual machine. The command will generate SSH keys for the virtual machine for login. Make note of the location of the private key. The private key is needed in later steps for connecting to the virtual machine with Azure Bastion.
342341

343-
```azurecli-interactive
342+
```azurecli
344343
az vm create \
345344
--resource-group test-rg \
346345
--name vm-nva \
@@ -413,7 +412,7 @@ The IP configuration of the primary network interface of the virtual machine is
413412

414413
Use [az network nic update](/cli/azure/network/nic#az_network_nic_update) to enable IP forwarding on the primary network interface.
415414

416-
```azurecli-interactive
415+
```azurecli
417416
az network nic update \
418417
--resource-group test-rg \
419418
--name nic-public \
@@ -422,7 +421,7 @@ az network nic update \
422421

423422
Use [az network nic ip-config update](/cli/azure/network/nic/ip-config#az_network_nic_ip_config_update) to statically set the private IP address of the virtual machine.
424423

425-
```azurecli-interactive
424+
```azurecli
426425
az network nic ip-config update \
427426
--resource-group test-rg \
428427
--nic-name nic-public \
@@ -433,7 +432,7 @@ az network nic ip-config update \
433432

434433
Use [az network nic create](/cli/azure/network/nic#az_network_nic_create) to create the secondary network interface.
435434

436-
```azurecli-interactive
435+
```azurecli
437436
az network nic create \
438437
--resource-group test-rg \
439438
--name nic-private \
@@ -444,15 +443,15 @@ az network nic create \
444443

445444
Use [az vm deallocate](/cli/azure/vm#az_vm_deallocate) to shutdown and deallocate the virtual machine.
446445

447-
```azurecli-interactive
446+
```azurecli
448447
az vm deallocate \
449448
--resource-group test-rg \
450449
--name vm-nva
451450
```
452451

453452
Use [az vm nic add](/cli/azure/vm/nic#az_vm_nic_add) to attach the secondary network interface to the virtual machine.
454453

455-
```azurecli-interactive
454+
```azurecli
456455
az vm nic add \
457456
--resource-group test-rg \
458457
--vm-name vm-nva \
@@ -461,7 +460,7 @@ az vm nic add \
461460

462461
Use [az vm start](/cli/azure/vm#az_vm_start) to start the virtual machine.
463462

464-
```azurecli-interactive
463+
```azurecli
465464
az vm start \
466465
--resource-group test-rg \
467466
--name vm-nva
@@ -608,7 +607,7 @@ Route tables are used to overwrite Azure's default routing. Create a route table
608607
609608
Use [az network route-table create](/cli/azure/network/route-table#az_network_route_table_create) to create the route table.
610609
611-
```azurecli-interactive
610+
```azurecli
612611
az network route-table create \
613612
--resource-group test-rg \
614613
--name route-table-nat-hub \
@@ -617,7 +616,7 @@ az network route-table create \
617616
618617
Use [az network route-table route create](/cli/azure/network/route-table/route#az_network_route_table_route_create) to create the route in the route table.
619618
620-
```azurecli-interactive
619+
```azurecli
621620
az network route-table route create \
622621
--resource-group test-rg \
623622
--route-table-name route-table-nat-hub \
@@ -629,7 +628,7 @@ az network route-table route create \
629628
630629
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) to associate the route table with the subnet.
631630
632-
```azurecli-interactive
631+
```azurecli
633632
az network vnet subnet update \
634633
--resource-group test-rg \
635634
--vnet-name vnet-hub \
@@ -695,7 +694,7 @@ Create another virtual network in a different region for the first spoke of the
695694
696695
Use [az network vnet create](/cli/azure/network/vnet#az_network_vnet_create) to create the virtual network.
697696
698-
```azurecli-interactive
697+
```azurecli
699698
az network vnet create \
700699
--resource-group test-rg \
701700
--name vnet-spoke-1 \
@@ -705,7 +704,7 @@ az network vnet create \
705704
706705
Use [az network vnet subnet create](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_create) to create the subnet.
707706
708-
```azurecli-interactive
707+
```azurecli
709708
az network vnet subnet create \
710709
--resource-group test-rg \
711710
--vnet-name vnet-spoke-1 \
@@ -761,7 +760,7 @@ A virtual network peering is used to connect the hub to spoke one and spoke one
761760
762761
Use [az network vnet peering create](/cli/azure/network/vnet/peering#az_network_vnet_peering_create) to create the peering from the hub to spoke one.
763762
764-
```azurecli-interactive
763+
```azurecli
765764
# Create peering from hub to spoke one
766765
az network vnet peering create \
767766
--name vnet-hub-to-vnet-spoke-1 \
@@ -848,7 +847,7 @@ Create a route table to force all inter-spoke and internet egress traffic throug
848847
849848
Use [az network route-table create](/cli/azure/network/route-table#az_network_route_table_create) to create the route table.
850849
851-
```azurecli-interactive
850+
```azurecli
852851
az network route-table create \
853852
--resource-group test-rg \
854853
--name route-table-nat-spoke-1 \
@@ -857,7 +856,7 @@ az network route-table create \
857856
858857
Use [az network route-table route create](/cli/azure/network/route-table/route#az_network_route_table_route_create) to create the route in the route table.
859858
860-
```azurecli-interactive
859+
```azurecli
861860
az network route-table route create \
862861
--resource-group test-rg \
863862
--route-table-name route-table-nat-spoke-1 \
@@ -869,7 +868,7 @@ az network route-table route create \
869868
870869
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) to associate the route table with the subnet.
871870
872-
```azurecli-interactive
871+
```azurecli
873872
az network vnet subnet update \
874873
--resource-group test-rg \
875874
--vnet-name vnet-spoke-1 \
@@ -938,7 +937,7 @@ A Windows Server 2022 virtual machine is used to test the outbound internet traf
938937
939938
Use [az network nsg create](/cli/azure/network/nsg#az_network_nsg_create) to create the network security group.
940939
941-
```azurecli-interactive
940+
```azurecli
942941
az network nsg create \
943942
--resource-group test-rg \
944943
--name nsg-spoke-1 \
@@ -947,7 +946,7 @@ az network nsg create \
947946
948947
Use [az network nsg rule create](/cli/azure/network/nsg/rule#az_network_nsg_rule_create) to create an inbound NSG rule for HTTP.
949948
950-
```azurecli-interactive
949+
```azurecli
951950
az network nsg rule create \
952951
--resource-group test-rg \
953952
--nsg-name nsg-spoke-1 \
@@ -961,7 +960,7 @@ az network nsg rule create \
961960
962961
Use [az network nic create](/cli/azure/network/nic#az_network_nic_create) to create the network interface.
963962
964-
```azurecli-interactive
963+
```azurecli
965964
az network nic create \
966965
--resource-group test-rg \
967966
--name nic-1 \
@@ -972,7 +971,7 @@ az network nic create \
972971
973972
Use [az vm create](/cli/azure/vm#az_vm_create) to create the Windows Server 2022 virtual machine.
974973
975-
```azurecli-interactive
974+
```azurecli
976975
az vm create \
977976
--resource-group test-rg \
978977
--name vm-spoke-1 \
@@ -1031,7 +1030,7 @@ IIS is installed on the Windows Server 2022 virtual machine to test outbound int
10311030
10321031
Use [az vm extension set](/cli/azure/vm/extension#az_vm_extension_set) to install IIS on the virtual machine.
10331032
1034-
```azurecli-interactive
1033+
```azurecli
10351034
az vm extension set \
10361035
--publisher Microsoft.Compute \
10371036
--version 1.8 \
@@ -1099,7 +1098,7 @@ Create the second virtual network for the second spoke of the hub and spoke netw
10991098
11001099
Use [az network vnet create](/cli/azure/network/vnet#az_network_vnet_create) to create the virtual network.
11011100
1102-
```azurecli-interactive
1101+
```azurecli
11031102
az network vnet create \
11041103
--resource-group test-rg \
11051104
--name vnet-spoke-2 \
@@ -1109,7 +1108,7 @@ az network vnet create \
11091108
11101109
Use [az network vnet subnet create](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_create) to create the subnet.
11111110
1112-
```azurecli-interactive
1111+
```azurecli
11131112
az network vnet subnet create \
11141113
--resource-group test-rg \
11151114
--vnet-name vnet-spoke-2 \
@@ -1173,7 +1172,7 @@ Create a two-way virtual network peer between the hub and spoke two.
11731172
11741173
Use [az network vnet peering create](/cli/azure/network/vnet/peering#az_network_vnet_peering_create) to create the peering from the hub to spoke two.
11751174
1176-
```azurecli-interactive
1175+
```azurecli
11771176
# Create peering from hub to spoke two
11781177
az network vnet peering create \
11791178
--name vnet-hub-to-vnet-spoke-2 \
@@ -1260,7 +1259,7 @@ Create a route table to force all outbound internet and inter-spoke traffic thro
12601259
12611260
Use [az network route-table create](/cli/azure/network/route-table#az_network_route_table_create) to create the route table.
12621261
1263-
```azurecli-interactive
1262+
```azurecli
12641263
az network route-table create \
12651264
--resource-group test-rg \
12661265
--name route-table-nat-spoke-2 \
@@ -1269,7 +1268,7 @@ az network route-table create \
12691268
12701269
Use [az network route-table route create](/cli/azure/network/route-table/route#az_network_route_table_route_create) to create the route in the route table.
12711270
1272-
```azurecli-interactive
1271+
```azurecli
12731272
az network route-table route create \
12741273
--resource-group test-rg \
12751274
--route-table-name route-table-nat-spoke-2 \
@@ -1281,7 +1280,7 @@ az network route-table route create \
12811280
12821281
Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) to associate the route table with the subnet.
12831282
1284-
```azurecli-interactive
1283+
```azurecli
12851284
az network vnet subnet update \
12861285
--resource-group test-rg \
12871286
--vnet-name vnet-spoke-2 \
@@ -1349,7 +1348,7 @@ Create a Windows Server 2022 virtual machine for the test virtual machine in spo
13491348
13501349
Use [az network nsg create](/cli/azure/network/nsg#az_network_nsg_create) to create the network security group.
13511350
1352-
```azurecli-interactive
1351+
```azurecli
13531352
az network nsg create \
13541353
--resource-group test-rg \
13551354
--name nsg-spoke-2 \
@@ -1358,7 +1357,7 @@ az network nsg create \
13581357
13591358
Use [az network nsg rule create](/cli/azure/network/nsg/rule#az_network_nsg_rule_create) to create an inbound NSG rule for HTTP.
13601359
1361-
```azurecli-interactive
1360+
```azurecli
13621361
az network nsg rule create \
13631362
--resource-group test-rg \
13641363
--nsg-name nsg-spoke-2 \
@@ -1372,7 +1371,7 @@ az network nsg rule create \
13721371
13731372
Use [az network nic create](/cli/azure/network/nic#az_network_nic_create) to create the network interface.
13741373
1375-
```azurecli-interactive
1374+
```azurecli
13761375
az network nic create \
13771376
--resource-group test-rg \
13781377
--name nic-1 \
@@ -1383,7 +1382,7 @@ az network nic create \
13831382
13841383
Use [az vm create](/cli/azure/vm#az_vm_create) to create the Windows Server 2022 virtual machine.
13851384
1386-
```azurecli-interactive
1385+
```azurecli
13871386
az vm create \
13881387
--resource-group test-rg \
13891388
--name vm-spoke-2 \
@@ -1442,7 +1441,7 @@ IIS is installed on the Windows Server 2022 virtual machine to test outbound int
14421441
14431442
Use [az vm extension set](/cli/azure/vm/extension#az_vm_extension_set) to install IIS on the virtual machine.
14441443
1445-
```azurecli-interactive
1444+
```azurecli
14461445
az vm extension set \
14471446
--publisher Microsoft.Compute \
14481447
--version 1.8 \
@@ -1564,7 +1563,7 @@ Use Microsoft Edge to connect to the web server on **vm-spoke-1** you installed
15641563
15651564
Use [az group delete](/cli/azure/group#az_group_delete) to delete the resource group.
15661565
1567-
```azurecli-interactive
1566+
```azurecli
15681567
az group delete \
15691568
--name test-rg \
15701569
--yes \

0 commit comments

Comments
 (0)