|
| 1 | +--- |
| 2 | +title: 'Tutorial: Configure outbound connectivity with a gateway load balancer' |
| 3 | +titleSuffix: Azure Load Balancer |
| 4 | +description: Learn to configure to configure gateway load balancer using the Azure portal higher scalability and performance with network virtual appliances. |
| 5 | +author: mbender-ms |
| 6 | +ms.author: mbender |
| 7 | +ms.service: load-balancer |
| 8 | +ms.topic: tutorial |
| 9 | +ms.date: 06/15/2023 |
| 10 | +ms.custom: template-tutorial |
| 11 | +--- |
| 12 | + |
| 13 | +# Tutorial: Configure outbound connectivity with a gateway load balancer |
| 14 | + |
| 15 | +Azure Load Balancer consists of Standard, Basic, and Gateway SKUs. Gateway Load Balancer is used for transparent insertion of Network Virtual Appliances (NVA). Use Gateway Load Balancer for scenarios that require high performance and high scalability of NVAs. |
| 16 | + |
| 17 | +In this tutorial, you’ll learn how to: |
| 18 | +> [!div class="checklist"] |
| 19 | +> - Create a new load balancer frontend IP configuration and outbound rule |
| 20 | +> - Chain a load balancer’s frontend or virtual machine’s IP or to a Gateway Load Balancer |
| 21 | +
|
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 25 | +- An existing public standard SKU Azure Load Balancer. For more information on creating a load balancer, see **[Create a public load balancer using the Azure portal](quickstart-load-balancer-standard-public-portal.md)**. |
| 26 | + - For the purposes of this tutorial, the load balancer in the examples is named **myLoadBalancer**. |
| 27 | +- An existing Gateway SKU Azure Load Balancer. For more information on creating a gateway load balancer, see [Create a gateway load balancer using the Azure portal](tutorial-gateway-portal.md). |
| 28 | + - For the purposes of this tutorial, the gateway load balancer in the examples is name **myGatewayLoadBalancer**. |
| 29 | + |
| 30 | +## Chain a virtual machine to Gateway Load Balancer |
| 31 | + |
| 32 | +Gateway Load Balancer can be inserted in the path of outbound traffic by chaining to virtual machine instance level public IPs. This method will secure both inbound and outbound traffic reaching or originating from this virtual machine’s public IP. |
| 33 | + |
| 34 | +In this example, we will chain an existing virtual machine’s public IP to a Gateway Load Balancer. |
| 35 | + |
| 36 | +1. Navigate to your existing virtual machine. In this example, the virtual machine is named myVM1. |
| 37 | + |
| 38 | +1. Make sure your virtual machine has a Standard SKU public IP associated with it. |
| 39 | + 1. Go to **Public IP address > Overview** and confir that the SKU is **Standard**. |
| 40 | + |
| 41 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/confirm-sku.png" alt-text="Screenshot of virtual machine overview highlighting standard sku."::: |
| 42 | + |
| 43 | +1. In the overview blade of the virtual machine, select Networking in Settings. |
| 44 | +1. In Networking, select the name of the network interface attached to the virtual machine. In this example, it's myvm1229. |
| 45 | + |
| 46 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/select-network-interface.png" alt-text="Screenshot of network interface attached to virtual machine."::: |
| 47 | + |
| 48 | +1. In the network interface page, select IP configurations in Settings. |
| 49 | +6. Select myFrontend in Gateway Load balancer. |
| 50 | + |
| 51 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/select-gateway-load-balancer.png" alt-text="Screenshot of gateway load balancer selection in IP configuration settings."::: |
| 52 | + |
| 53 | +1. Select **Save**. |
| 54 | + |
| 55 | +## Create a load balancer frontend |
| 56 | + |
| 57 | +For best practices, we recommend leveraging separate public IPs for inbound and outbound traffic. Reusing the same public IP for inbound and outbound traffic can increase the risk of SNAT exhaustion, as load balancing and inbound NAT rules will decrease the number of available SNAT ports. |
| 58 | + |
| 59 | +1. Navigate to your existing Standard Public Load Balancer and go to the Frontend IP configurations blade under Settings |
| 60 | + |
| 61 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/frontend-settings.png" alt-text="Screenshot of frontend IP configuration."::: |
| 62 | + |
| 63 | +1. Select + Add to create a new frontend IP configuration |
| 64 | + |
| 65 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/add-frontend-ip-configuration.png" alt-text="Screenshot of Add frontend ip configuration screen."::: |
| 66 | + |
| 67 | +1. Enter myOutboundFrontend in Name |
| 68 | +1. Select IPv4 and IP address for IP version and IP type respectively |
| 69 | +1. Select myGatewayLoadBalancerFrontend for Gateway Load balancer |
| 70 | + 1. This step will effectively “chain” this frontend to the Gateway Load Balancer frontend specified. |
| 71 | + 1. Any traffic, inbound or outbound, served by this frontend will be redirected to the Gateway Load Balancer to be inspected by the configured NVAs before being distributed to this load balancer’s backend instances |
| 72 | +1. Select Save. |
| 73 | + |
| 74 | +## Create outbound rule |
| 75 | + |
| 76 | +1. On the load balancer page, select Outbound rules in Settings. |
| 77 | +2. Select + Add in Outbound rules to add a rule. |
| 78 | + |
| 79 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/outbound-rules.png" alt-text="Screenshot of Load Balancer Outbound rules settings."::: |
| 80 | + |
| 81 | +1. Enter or select the following information in **Add outbound rule**: |
| 82 | + |
| 83 | + | Setting | Value | |
| 84 | + | --- | --- | |
| 85 | + | Name | Enter **myOutboundRule**. | |
| 86 | + | IP version | Select **IPv4**. | |
| 87 | + | Frontend IP address | Select the frontend IP address of the load balancer. In this example, it's myOutboundFrontend. | |
| 88 | + | Protocol | Leave the default of **All**. | |
| 89 | + | Idle timeout (minutes) | Enter **4** or your desired value. | |
| 90 | + | TCP Reset | Leave the default of **Enabled**. | |
| 91 | + | Backend pool | Select the backend pool of the load balancer. In this example, it's **myBackendPool**. | |
| 92 | + | **Port allocation** | | |
| 93 | + | Port allocation | Select **Manaually choose number of outbound ports.** | |
| 94 | + | **Outbound ports** | | |
| 95 | + | Choose by | Select **Maximum number of backend instances**. | |
| 96 | + | Ports per instance | Enter the anticipated maximum number of backend instances. In this example, we have **2** backend instances. |
| 97 | + |
| 98 | +1. Select **Add**. |
| 99 | + |
| 100 | + :::image type="content" source="media/gateway-configure-outbound-connectivity/add-outbound-rule.png" alt-text="Screenshot of Add Outbound Rule screen."::: |
| 101 | + |
| 102 | +## Limitations |
| 103 | + |
| 104 | +- Gateway load balancer does not currently support chaining with NAT Gateway. Outbound traffic originating from Azure virtual machines, served through NAT Gateway, will go directly to the Internet. Please note that NAT Gateway will take precedence over any instance-level public IPs or load balancers for outbound traffic. |
| 105 | + - NAT Gateway can be configured for outbound connectivity, in conjunction with a Standard Public Load Balancer and Gateway Load Balancer architecture for inbound connectivity. In this scenario, all inbound traffic will flow as expected through the GWLB to the Standard LB, while outbound traffic will go to the Internet directly. |
| 106 | + - If NVAs need to be inserted for outbound traffic, please leverage the methods described above in this article (eg. chaining an ILPIP or outbound rules LB frontend to a GWLB) |
| 107 | + |
| 108 | +## Clean up resources |
| 109 | + |
| 110 | +When no longer needed, delete the resource group, load balancer, and all related resources. To do so, select the resource group **TutorGwLB-rg** that contains the resources and then select **Delete**. |
| 111 | + |
| 112 | +## Next steps |
| 113 | + |
| 114 | +Create Network Virtual Appliances in Azure. |
| 115 | + |
| 116 | +When creating the NVAs, choose the resources created in this tutorial: |
| 117 | + |
| 118 | +* Virtual network |
| 119 | + |
| 120 | +* Subnet |
| 121 | + |
| 122 | +* Network security group |
| 123 | + |
| 124 | +* Gateway load balancer |
| 125 | + |
| 126 | +Advance to the next article to learn how to create a cross-region Azure Load Balancer. |
| 127 | +> [!div class="nextstepaction"] |
| 128 | +> [Cross-region load balancer](tutorial-cross-region-powershell.md) |
0 commit comments