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
A virtual network is needed for the resources that are in the backend pool of the gateway load balancer. Use [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) to create the virtual network. Use [New-AzBastion](/powershell/module/az.network/new-azbastion) to deploy a bastion host for secure management of resources in virtual network.
Use the following example to create a network security group. You'll configure the NSG rules needed for network traffic in the virtual network created previously.
261
+
262
+
Use [New-AzNetworkSecurityRuleConfig](/powershell/module/az.network/new-aznetworksecurityruleconfig) to create rules for the NSG. Use [New-AzNetworkSecurityGroup](/powershell/module/az.network/new-aznetworksecuritygroup) to create the NSG.
263
+
264
+
```azurepowershell-interactive
265
+
## Create rule for network security group and place in variable. ##
In this section, you create a gateway load balancer and configure it with a backend pool and frontend IP configuration. The backend pool is associated with the existing load balancer created in the prerequisites.
195
308
196
309
# [Azure portal](#tab/azureportal)
@@ -268,6 +381,96 @@ Traffic destined for the backend instances is routed with a load-balancing rule.
268
381
269
382
# [Azure PowerShell](#tab/azurepowershell/)
270
383
384
+
## Create Gateway Load Balancer
385
+
386
+
In this section, you'll create the configuration and deploy the gateway load balancer. Use [New-AzLoadBalancerFrontendIpConfig](/powershell/module/az.network/new-azloadbalancerfrontendipconfig) to create the frontend IP configuration of the load balancer.
387
+
388
+
You'll use [New-AzLoadBalancerTunnelInterface](/powershell/module/az.network/new-azloadbalancerfrontendipconfig) to create two tunnel interfaces for the load balancer.
389
+
390
+
Create a backend pool with [New-AzLoadBalancerBackendAddressPoolConfig](/powershell/module/az.network/new-azloadbalancerbackendaddresspoolconfig) for the NVAs.
391
+
392
+
A health probe is required to monitor the health of the backend instances in the load balancer. Use [New-AzLoadBalancerProbeConfig](/powershell/module/az.network/new-azloadbalancerprobeconfig) to create the health probe.
393
+
394
+
Traffic destined for the backend instances is routed with a load-balancing rule. Use [New-AzLoadBalancerRuleConfig](/powershell/module/az.network/new-azloadbalancerruleconfig) to create the load-balancing rule.
395
+
396
+
To create the deploy the load balancer, use [New-AzLoadBalancer](/powershell/module/az.network/new-azloadbalancer).
397
+
398
+
```azurepowershell-interactive
399
+
## Place virtual network configuration in a variable for later use. ##
400
+
$net = @{
401
+
Name = 'myVNet'
402
+
ResourceGroupName = 'TutorGwLB-rg'
403
+
}
404
+
$vnet = Get-AzVirtualNetwork @net
405
+
406
+
## Create load balancer frontend configuration and place in variable. ##
407
+
$fe = @{
408
+
Name = 'myFrontend'
409
+
SubnetId = $vnet.subnets[0].id
410
+
}
411
+
$feip = New-AzLoadBalancerFrontendIpConfig @fe
412
+
413
+
## Create backend address pool configuration and place in variable. ##
## Create the load balancer rule and place in variable. ##
448
+
$para = @{
449
+
Name = 'myLBRule'
450
+
Protocol = 'All'
451
+
FrontendPort = '0'
452
+
BackendPort = '0'
453
+
FrontendIpConfiguration = $feip
454
+
BackendAddressPool = $bepool
455
+
Probe = $healthprobe
456
+
}
457
+
$rule = New-AzLoadBalancerRuleConfig @para
458
+
459
+
## Create the load balancer resource. ##
460
+
$lb = @{
461
+
ResourceGroupName = 'TutorGwLB-rg'
462
+
Name = 'myLoadBalancer-gw'
463
+
Location = 'eastus'
464
+
Sku = 'Gateway'
465
+
LoadBalancingRule = $rule
466
+
FrontendIpConfiguration = $feip
467
+
BackendAddressPool = $bepool
468
+
Probe = $healthprobe
469
+
}
470
+
New-AzLoadBalancer @lb
471
+
472
+
```
473
+
271
474
---
272
475
273
476
## Add network virtual appliances to the Gateway Load Balancer backend pool
@@ -282,6 +485,47 @@ Deploy NVAs through the Azure Marketplace. Once deployed, add the virtual machin
282
485
283
486
# [Azure PowerShell](#tab/azurepowershell/)
284
487
488
+
In this example, you'll chain the frontend of a standard load balancer to the gateway load balancer.
489
+
490
+
You'll add the frontend to the frontend IP of an existing load balancer in your subscription.
491
+
492
+
Use [Set-AzLoadBalancerFrontendIpConfig](/powershell/module/az.network/set-azloadbalancerfrontendipconfig) to chain the gateway load balancer frontend to your existing load balancer.
493
+
494
+
```azurepowershell-interactive
495
+
## Place the gateway load balancer configuration into a variable. ##
496
+
$par1 = @{
497
+
ResourceGroupName = 'TutorGwLB-rg'
498
+
Name = 'myLoadBalancer-gw'
499
+
}
500
+
$gwlb = Get-AzLoadBalancer @par1
501
+
502
+
## Place the existing load balancer into a variable. ##
503
+
$par2 = @{
504
+
ResourceGroupName = 'CreatePubLBQS-rg'
505
+
Name = 'myLoadBalancer'
506
+
}
507
+
$lb = Get-AzLoadBalancer @par2
508
+
509
+
## Place the existing public IP for the existing load balancer into a variable.
510
+
$par3 = @{
511
+
ResourceGroupName = 'CreatePubLBQS-rg'
512
+
Name = 'myPublicIP'
513
+
}
514
+
$publicIP = Get-AzPublicIPAddress @par3
515
+
516
+
## Chain the gateway load balancer to your existing load balancer frontend. ##
## Chain load balancer frontend to Gateway Load Balancer
@@ -337,6 +581,47 @@ Use [az network lb frontend-ip update](/cli/azure/network/lb/frontend-ip#az-netw
337
581
338
582
# [Azure PowerShell](#tab/azurepowershell/)
339
583
584
+
In this example, you'll chain the frontend of a standard load balancer to the gateway load balancer.
585
+
586
+
You'll add the frontend to the frontend IP of an existing load balancer in your subscription.
587
+
588
+
Use [Set-AzLoadBalancerFrontendIpConfig](/powershell/module/az.network/set-azloadbalancerfrontendipconfig) to chain the gateway load balancer frontend to your existing load balancer.
589
+
590
+
```azurepowershell-interactive
591
+
## Place the gateway load balancer configuration into a variable. ##
592
+
$par1 = @{
593
+
ResourceGroupName = 'TutorGwLB-rg'
594
+
Name = 'myLoadBalancer-gw'
595
+
}
596
+
$gwlb = Get-AzLoadBalancer @par1
597
+
598
+
## Place the existing load balancer into a variable. ##
599
+
$par2 = @{
600
+
ResourceGroupName = 'CreatePubLBQS-rg'
601
+
Name = 'myLoadBalancer'
602
+
}
603
+
$lb = Get-AzLoadBalancer @par2
604
+
605
+
## Place the existing public IP for the existing load balancer into a variable.
606
+
$par3 = @{
607
+
ResourceGroupName = 'CreatePubLBQS-rg'
608
+
Name = 'myPublicIP'
609
+
}
610
+
$publicIP = Get-AzPublicIPAddress @par3
611
+
612
+
## Chain the gateway load balancer to your existing load balancer frontend. ##
@@ -396,6 +681,39 @@ Use [az network lb frontend-ip update](/cli/azure/network/nic/ip-config#az-netwo
396
681
397
682
# [Azure PowerShell](#tab/azurepowershell/)
398
683
684
+
Alternatively, you can chain a VM's NIC IP configuration to the gateway load balancer.
685
+
686
+
You'll add the gateway load balancer's frontend to an existing VM's NIC IP configuration.
687
+
688
+
Use [Set-AzNetworkInterfaceIpConfig](/powershell/module/az.network/set-aznetworkinterfaceipconfig) to chain the gateway load balancer frontend to your existing VM's NIC IP configuration.
689
+
690
+
```azurepowershell-interactive
691
+
## Place the gateway load balancer configuration into a variable. ##
692
+
$par1 = @{
693
+
ResourceGroupName = 'TutorGwLB-rg'
694
+
Name = 'myLoadBalancer-gw'
695
+
}
696
+
$gwlb = Get-AzLoadBalancer @par1
697
+
698
+
## Place the existing NIC into a variable. ##
699
+
$par2 = @{
700
+
ResourceGroupName = 'MyResourceGroup'
701
+
Name = 'myNic'
702
+
}
703
+
$nic = Get-AzNetworkInterface @par2
704
+
705
+
## Chain the gateway load balancer to your existing VM NIC. ##
@@ -417,6 +735,12 @@ When no longer needed, you can use the [az group delete](/cli/azure/group#az-gro
417
735
418
736
# [Azure PowerShell](#tab/azurepowershell/)
419
737
738
+
When no longer needed, you can use the [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) command to remove the resource group, load balancer, and the remaining resources.
739
+
740
+
```azurepowershell-interactive
741
+
Remove-AzResourceGroup -Name 'TutorGwLB-rg'
742
+
```
743
+
420
744
---
421
745
422
746
## Next steps
@@ -435,4 +759,4 @@ When creating the NVAs, choose the resources created in this tutorial:
435
759
436
760
Advance to the next article to learn how to create a cross-region Azure Load Balancer.
0 commit comments