|
| 1 | +--- |
| 2 | +title: Configure load balancing and outbound rules by using the Azure portal |
| 3 | +titleSuffix: Azure Load Balancer |
| 4 | +description: This article shows how to configure load balancing and outbound rules in Standard Load Balancer by using the Azure portal. |
| 5 | +services: load-balancer |
| 6 | +author: asudbring |
| 7 | +ms.service: load-balancer |
| 8 | +ms.topic: article |
| 9 | +ms.date: 09/24/2019 |
| 10 | +ms.author: allensu |
| 11 | + |
| 12 | +--- |
| 13 | +# Configure load balancing and outbound rules in Standard Load Balancer by using the Azure portal |
| 14 | + |
| 15 | +This article shows you how to configure outbound rules in Standard Load Balancer by using the Azure portal. |
| 16 | + |
| 17 | +The load balancer resource contains two front ends and their associated rules. You have one front end for inbound traffic and another front end for outbound traffic. |
| 18 | + |
| 19 | +Each front end references a public IP address. In this scenario, the public IP address for inbound traffic is different from the address for outbound traffic. The load-balancing rule provides only inbound load balancing. The outbound rule controls the outbound network address translation (NAT) for the VM. |
| 20 | + |
| 21 | +The scenario uses two back-end pools: one for inbound traffic and one for outbound traffic. These pools illustrate capability and provide flexibility for the scenario. |
| 22 | + |
| 23 | +If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin. |
| 24 | + |
| 25 | +## Sign in to Azure |
| 26 | + |
| 27 | +Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.com). |
| 28 | + |
| 29 | +## Create a load balancer |
| 30 | + |
| 31 | +In this section, you create a load balancer that will load balance virtual machines. You can create a public load balancer or an internal load balancer. When you create a public load balancer, you create a new Public IP address that is configured as the frontend for the load balancer. The frontend will be named **LoadBalancerFrontEnd** by default. |
| 32 | + |
| 33 | +1. On the top left-hand side of the screen, select **Create a resource** > **Networking** > **Load Balancer**. |
| 34 | +2. In the **Basics** tab of the **Create load balancer** page, enter, or select the following information: |
| 35 | + |
| 36 | + | Setting | Value | |
| 37 | + | --- | --- | |
| 38 | + | Subscription | Select your subscription. | |
| 39 | + | Resource group | Select **Create new** and type **myResourceGroupSLB** in the text box.| |
| 40 | + | Name | **myLoadBalancer** | |
| 41 | + | Region | Select **West Europe**. | |
| 42 | + | Type | Select **Public**. | |
| 43 | + | SKU | Select **Standard** or **Basic**. Microsoft recommends Standard for production workloads. | |
| 44 | + | Public IP address | Select **Create new**. If you have an existing Public IP you would like to use, select **Use existing**. Existing public IP must be **Standard** SKU. Basic public IPs aren't compatible with **Standard** SKU load balancer. | |
| 45 | + | Public IP address name | Type **myPublicIP** in the text box.| |
| 46 | + | Availability zone | Select **Zone-redundant** to create a resilient Load Balancer. To create a zonal Load Balancer, select a specific zone from 1, 2, or 3 | |
| 47 | + |
| 48 | +3. Accept the defaults for the rest of the configuration. |
| 49 | +4. Select **Review + create** |
| 50 | + |
| 51 | + > [!IMPORTANT] |
| 52 | + > The rest of this quickstart assumes that **Standard** SKU is chosen during the SKU selection process above. |
| 53 | +
|
| 54 | +5. In the **Review + create** tab, select **Create**. |
| 55 | + |
| 56 | +  |
| 57 | + |
| 58 | +## Create load balancer resources |
| 59 | + |
| 60 | +In this section, you configure load balancer settings for a backend address pool, a health probe, and specify a balancer rule. |
| 61 | + |
| 62 | +### Create a backend pool |
| 63 | + |
| 64 | +A backend address pool contains the IP addresses of the virtual NICs in the backend pool. Create the backend address pool **myBackendPool** to include virtual machines for load-balancing internet traffic. |
| 65 | + |
| 66 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 67 | +2. Under **Settings**, select **Backend pools**, then select **Add**. |
| 68 | +3. On the **Add a backend pool** page, for name, type **myBackendPool**, as the name for your backend pool, and then select **Add**. |
| 69 | + |
| 70 | +### Create a health probe |
| 71 | + |
| 72 | +A health probe is used to monitor the status of your app. The health probe adds or removes VMs from the load balancer based on their response to health checks. Create a health probe **myHealthProbe** to monitor the health of the VMs. |
| 73 | + |
| 74 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 75 | +2. Under **Settings**, select **Health probes**, then select **Add**. |
| 76 | + |
| 77 | + | Setting | Value | |
| 78 | + | ------- | ----- | |
| 79 | + | Name | Enter **myHealthProbe**. | |
| 80 | + | Protocol | Select **HTTP**. | |
| 81 | + | Port | Enter **80**.| |
| 82 | + | Interval | Enter **15** for number of **Interval** in seconds between probe attempts. | |
| 83 | + | Unhealthy threshold | Select **2** for number of **Unhealthy threshold** or consecutive probe failures that must occur before a VM is considered unhealthy.| |
| 84 | + | | | |
| 85 | +4. Select **OK**. |
| 86 | + |
| 87 | +### Create a load balancer rule |
| 88 | +A load balancer rule is used to define how traffic is distributed to the VMs. |
| 89 | + |
| 90 | +You define the: |
| 91 | + - Frontend IP configuration for the incoming traffic. |
| 92 | + - The backend IP pool to receive the traffic. |
| 93 | + - The required source and destination port. |
| 94 | + |
| 95 | +In the following section, you create a: |
| 96 | + - Load balancer rule **myHTTPRule** for listening to port 80. |
| 97 | + - Frontend **LoadBalancerFrontEnd**. |
| 98 | + - Backend address pool **myBackEndPool** also using port 80. |
| 99 | + |
| 100 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 101 | +2. Under **Settings**, select **Load balancing rules**, then select **Add**. |
| 102 | +3. Use these values to configure the load-balancing rule: |
| 103 | + |
| 104 | + | Setting | Value | |
| 105 | + | ------- | ----- | |
| 106 | + | Name | Enter **myHTTPRule**. | |
| 107 | + | Protocol | Select **TCP**. | |
| 108 | + | Port | Enter **80**.| |
| 109 | + | Backend port | Enter **80**. | |
| 110 | + | Backend pool | Select **myBackendPool**.| |
| 111 | + | Health probe | Select **myHealthProbe**. | |
| 112 | + | Create implicit outbound rules | Select **No**. We'll create outbound rules in a later section using a dedicated public IP. | |
| 113 | +4. Leave the rest of the defaults and then select **OK**. |
| 114 | + |
| 115 | +## Create outbound rule configuration |
| 116 | +Load balancer outbound rules configure outbound SNAT for VMs in the backend pool. |
| 117 | + |
| 118 | +### Create an outbound public IP address and frontend |
| 119 | + |
| 120 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 121 | + |
| 122 | +2. Under **Settings**, select **Frontend IP configuration**, then select **Add**. |
| 123 | + |
| 124 | +3. Use these values to configure the frontend IP configuration for outbound: |
| 125 | + |
| 126 | + | Setting | Value | |
| 127 | + | ------- | ----- | |
| 128 | + | Name | Enter **LoadBalancerFrontEndOutbound**. | |
| 129 | + | IP version | Select **IPv4**. | |
| 130 | + | IP type | Select **IP address**.| |
| 131 | + | Public IP address | Select **Create new**. In the **Add a public IP address**, enter **myPublicIPOutbound**. Select **OK**. | |
| 132 | + |
| 133 | +4. Select **Add**. |
| 134 | + |
| 135 | +### Create an outbound backend pool |
| 136 | + |
| 137 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 138 | + |
| 139 | +2. Under **Settings**, select **Backend pools**, then select **Add**. |
| 140 | + |
| 141 | +3. On the **Add a backend pool** page, for name, type **myBackendPoolOutbound**, as the name for your backend pool, and then select **Add**. |
| 142 | + |
| 143 | +### Create outbound rule |
| 144 | + |
| 145 | +1. Select **All services** in the left-hand menu, select **All resources**, and then select **myLoadBalancer** from the resources list. |
| 146 | + |
| 147 | +2. Under **Settings**, select **Outbound rules**, then select **Add**. |
| 148 | + |
| 149 | +3. Use these values to configure the outbound rules: |
| 150 | + |
| 151 | + | Setting | Value | |
| 152 | + | ------- | ----- | |
| 153 | + | Name | Enter **myOutboundRule**. | |
| 154 | + | Frontend IP address | Select **LoadBalancerFrontEndOutbound**. | |
| 155 | + | Idle timeout (minutes) | Move slider to **15 minutes.| |
| 156 | + | TCP Reset | Select **Enabled**.| |
| 157 | + | Backend pool | Select **myBackendPoolOutbound** | |
| 158 | + | Port allocation -> Port allocation | Select **Manually choose number of outbound ports** | |
| 159 | + | Outbound ports -> Choose by | Select **Ports per instance** | |
| 160 | + | Outbound ports -> Ports per instance | Enter **10,000**. | |
| 161 | + |
| 162 | +4. Select **Add**. |
| 163 | + |
| 164 | +## Clean up resources |
| 165 | + |
| 166 | +When no longer needed, delete the resource group, load balancer, and all related resources. Select the resource group **myResourceGroupSLB** that contains the load balancer, and then select **Delete**. |
| 167 | + |
| 168 | +## Next steps |
| 169 | + |
| 170 | +In this article: |
| 171 | + - You created a standard load balancer. |
| 172 | + - Configured both inbound and outbound load-balancer traffic rules. |
| 173 | + - Configured a health probe for the VMs in the back-end pool. |
| 174 | + |
| 175 | +To learn more, continue to the [tutorials for Azure Load Balancer](tutorial-load-balancer-standard-public-zone-redundant-portal.md). |
0 commit comments