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/load-balancer/tutorial-load-balancer-port-forwarding-portal.md
+81-80Lines changed: 81 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,28 @@
1
1
---
2
-
title: "Tutorial: Configure port forwarding - Azure portal"
2
+
title: "Tutorial: Create a single instance inbound NAT rule - Azure portal"
3
3
titleSuffix: Azure Load Balancer
4
-
description: This tutorial shows how to configure port forwarding using Azure Load Balancer to create connections to VMs in an Azure virtual network.
4
+
description: This tutorial shows how to configure port forwarding using Azure Load Balancer to create a connection to a single virtual machine in an Azure virtual network.
5
5
author: asudbring
6
6
ms.author: allensu
7
7
ms.service: load-balancer
8
8
ms.topic: tutorial
9
-
ms.date: 12/06/2021
9
+
ms.date: 03/08/2022
10
10
ms.custom: template-tutorial
11
11
---
12
12
13
+
# Tutorial: Create a single instance inbound NAT rule using the Azure portal
13
14
14
-
15
-
# Tutorial: Configure port forwarding in Azure Load Balancer using the Azure portal
16
-
17
-
Port forwarding lets you connect to virtual machines (VMs) in an Azure virtual network by using an Azure Load Balancer public IP address and port number.
15
+
Inbound NAT rules allow you to connect to virtual machines (VMs) in an Azure virtual network by using an Azure Load Balancer public IP address and port number.
18
16
19
17
For more information about Azure Load Balancer rules, see [Manage rules for Azure Load Balancer using the Azure portal](manage-rules-how-to.md).
20
18
21
19
In this tutorial, you learn how to:
22
20
23
21
> [!div class="checklist"]
24
-
> * Create a virtual network and virtual machines.
25
-
> * Create a NAT gateway for outbound internet access for the backend pool.
26
-
> * Create a standard SKU public load balancer with frontend IP, health probe, backend configuration, load-balancing rule, and inbound NAT rules.
27
-
> * Install and configure a web server on the VMs to demonstrate the port forwarding and load-balancing rules.
22
+
> * Create a virtual network and virtual machines
23
+
> * Create a standard SKU public load balancer with frontend IP, health probe, backend configuration, load-balancing rule, and inbound NAT rules
24
+
> * Create a NAT gateway for outbound internet access for the backend pool
25
+
> * Install and configure a web server on the VMs to demonstrate the port forwarding and load-balancing rules
28
26
29
27
## Prerequisites
30
28
@@ -38,9 +36,9 @@ A virtual network and subnet is required for the resources in the tutorial. In t
38
36
39
37
2. In the search box at the top of the portal, enter **Virtual machine**. Select **Virtual machines** in the search results.
40
38
41
-
3. In **Virtual machines**, select **+ Create** > **Virtual machine**.
| Azure Spot instance | Leave the default of unchecked. |
57
56
| Size | Select a VM size. |
@@ -96,52 +95,14 @@ A virtual network and subnet is required for the resources in the tutorial. In t
96
95
| Authentication type |**SSH public key**|
97
96
| SSH public key source | Select **Use existing key stored in Azure**. |
98
97
| Stored Keys | Select **myKey**. |
98
+
|**Inbound port rules**||
99
+
| Public inbound ports | Select **None**. |
99
100
|**Networking**||
100
101
|**Network interface**||
101
102
| Public IP | Select **None**. |
102
103
| NIC network security group | Select **Advanced**. |
103
104
| Configure network security group | Select the existing **myNSG**|
104
105
105
-
## Create NAT gateway
106
-
107
-
In this section, you'll create a NAT gateway for outbound internet access for resources in the virtual network.
108
-
109
-
For more information about outbound connections and Azure Virtual Network NAT, see [Using Source Network Address Translation (SNAT) for outbound connections](load-balancer-outbound-connections.md) and [What is Virtual Network NAT?](../virtual-network/nat-gateway/nat-overview.md).
110
-
111
-
1. In the search box at the top of the portal, enter **NAT gateway**. Select **NAT gateways** in the search results.
112
-
113
-
2. In **NAT gateways**, select **+ Create**.
114
-
115
-
3. In **Create network address translation (NAT) gateway**, enter or select the following information:
116
-
117
-
| Setting | Value |
118
-
| ------- | ----- |
119
-
|**Project details**||
120
-
| Subscription | Select your subscription. |
121
-
| Resource group | Select **TutorialLBPF-rg**. |
122
-
|**Instance details**||
123
-
| NAT gateway name | Enter **myNATgateway**. |
124
-
| Availability zone | Select **None**. |
125
-
| Idle timeout (minutes) | Enter **15**. |
126
-
127
-
4. Select the **Outbound IP** tab or select the **Next: Outbound IP** button at the bottom of the page.
128
-
129
-
5. In **Outbound IP**, select **Create a new public IP address** next to **Public IP addresses**.
130
-
131
-
6. Enter **myNATGatewayIP** in **Name** in **Add a public IP address**.
132
-
133
-
7. Select **OK**.
134
-
135
-
8. Select the **Subnet** tab or select the **Next: Subnet** button at the bottom of the page.
136
-
137
-
9. In **Virtual network** in the **Subnet** tab, select **myVNet**.
138
-
139
-
10. Select **myBackendSubnet** under **Subnet name**.
140
-
141
-
11. Select the blue **Review + create** button at the bottom of the page, or select the **Review + create** tab.
142
-
143
-
12. Select **Create**.
144
-
145
106
## Create load balancer
146
107
147
108
You'll create a load balancer in this section. The frontend IP, backend pool, load-balancing, and inbound NAT rules are configured as part of the creation.
@@ -159,17 +120,16 @@ You'll create a load balancer in this section. The frontend IP, backend pool, lo
159
120
| Resource group | Select **TutorialLBPF-rg**. |
160
121
|**Instance details**||
161
122
| Name | Enter **myLoadBalancer**|
162
-
| Region | Select **(US) West US 2**. |
163
-
| Type | Select **Public**. |
123
+
| Region | Select **West US 2**. |
164
124
| SKU | Leave the default **Standard**. |
125
+
| Type | Select **Public**. |
165
126
| Tier | Leave the default **Regional**. |
166
127
167
-
168
128
4. Select **Next: Frontend IP configuration** at the bottom of the page.
169
129
170
130
5. In **Frontend IP configuration**, select **+ Add a frontend IP**.
171
131
172
-
6. Enter **LoadBalancerFrontend** in **Name**.
132
+
6. Enter **myFrontend** in **Name**.
173
133
174
134
7. Select **IPv4** or **IPv6** for the **IP version**.
175
135
@@ -227,12 +187,12 @@ You'll create a load balancer in this section. The frontend IP, backend pool, lo
227
187
| ------- | ----- |
228
188
| Name | Enter **myHTTPRule**|
229
189
| IP Version | Select **IPv4** or **IPv6** depending on your requirements. |
230
-
| Frontend IP address | Select **LoadBalancerFrontend**. |
190
+
| Frontend IP address | Select **myFrontend**. |
191
+
| Backend pool | Select **myBackendPool**. |
231
192
| Protocol | Select **TCP**. |
232
193
| Port | Enter **80**. |
233
194
| Backend port | Enter **80**. |
234
-
| Backend pool | Select **myBackendPool**. |
235
-
| Health probe | Select **Create new**. </br> In **Name**, enter **myHealthProbe**. </br> Select **HTTP** in **Protocol**. </br> Leave the rest of the defaults, and select **OK**. |
195
+
| Health probe | Select **Create new**. </br> In **Name**, enter **myHealthProbe**. </br> Select **TCP** in **Protocol**. </br> Leave the rest of the defaults, and select **OK**. |
236
196
| Session persistence | Select **None**. |
237
197
| Idle timeout (minutes) | Enter or select **15**. |
238
198
| TCP reset | Select **Enabled**. |
@@ -250,17 +210,16 @@ You'll create a load balancer in this section. The frontend IP, backend pool, lo
250
210
| Setting | Value |
251
211
| ------- | ----- |
252
212
| Name | Enter **myNATRuleVM1-221**. |
253
-
| Frontend IP address | Select **LoadBalancerFrontend**. |
254
-
| Service | Select **Custom**. |
255
-
| Protocol | Leave the default of **TCP**. |
256
-
| Idle timeout (minutes) | Enter or select **15**. |
257
-
| TCP Reset | Select **Enabled**. |
258
-
| Port | Enter **221**. |
259
213
| Target virtual machine | Select **myVM1**. |
260
214
| Network IP configuration | Select **ipconfig1 (10.1.0.4)**. |
261
-
| Port mapping | Select **Custom**. |
215
+
| Frontend IP address | Select **myFrontend**. |
216
+
| Frontend Port | Enter **221**. |
217
+
| Service Tag | Select **Custom**. |
218
+
| Backend port | Enter **22**. |
219
+
| Protocol | Leave the default of **TCP**. |
220
+
| TCP Reset | Leave the default of unchecked. |
221
+
| Idle timeout (minutes) | Leave the default **4**. |
262
222
| Floating IP | Leave the default of **Disabled**. |
263
-
| Target port | Enter **22**. |
264
223
265
224
28. Select **Add**.
266
225
@@ -271,24 +230,64 @@ You'll create a load balancer in this section. The frontend IP, backend pool, lo
271
230
| Setting | Value |
272
231
| ------- | ----- |
273
232
| Name | Enter **myNATRuleVM2-222**. |
274
-
| Frontend IP address | Select **LoadBalancerFrontend**. |
275
-
| Service | Select **Custom**. |
276
-
| Protocol | Leave the default of **TCP**. |
277
-
| Idle timeout (minutes) | Enter or select **15**. |
278
-
| TCP Reset | Select **Enabled**. |
279
-
| Port | Enter **222**. |
280
233
| Target virtual machine | Select **myVM2**. |
281
234
| Network IP configuration | Select **ipconfig1 (10.1.0.5)**. |
282
-
| Port mapping | Select **Custom**. |
235
+
| Frontend IP address | Select **myFrontend**. |
236
+
| Frontend Port | Enter **222**. |
237
+
| Service Tag | Select **Custom**. |
238
+
| Backend port | Enter **22**. |
239
+
| Protocol | Leave the default of **TCP**. |
240
+
| TCP Reset | Leave the default of unchecked. |
241
+
| Idle timeout (minutes) | Leave the default **4**. |
283
242
| Floating IP | Leave the default of **Disabled**. |
284
-
| Target port | Enter **22**. |
285
243
286
244
31. Select **Add**.
287
245
288
246
32. Select the blue **Review + create** button at the bottom of the page.
289
247
290
248
33. Select **Create**.
291
249
250
+
## Create NAT gateway
251
+
252
+
In this section, you'll create a NAT gateway for outbound internet access for resources in the virtual network.
253
+
254
+
For more information about outbound connections and Azure Virtual Network NAT, see [Using Source Network Address Translation (SNAT) for outbound connections](load-balancer-outbound-connections.md) and [What is Virtual Network NAT?](../virtual-network/nat-gateway/nat-overview.md).
255
+
256
+
1. In the search box at the top of the portal, enter **NAT gateway**. Select **NAT gateways** in the search results.
257
+
258
+
2. In **NAT gateways**, select **+ Create**.
259
+
260
+
3. In **Create network address translation (NAT) gateway**, enter or select the following information:
261
+
262
+
| Setting | Value |
263
+
| ------- | ----- |
264
+
|**Project details**||
265
+
| Subscription | Select your subscription. |
266
+
| Resource group | Select **TutorialLBPF-rg**. |
267
+
|**Instance details**||
268
+
| NAT gateway name | Enter **myNATgateway**. |
269
+
| Region | Select **West US 2**. |
270
+
| Availability zone | Select **None**. |
271
+
| Idle timeout (minutes) | Enter **15**. |
272
+
273
+
4. Select the **Outbound IP** tab or select the **Next: Outbound IP** button at the bottom of the page.
274
+
275
+
5. In **Outbound IP**, select **Create a new public IP address** next to **Public IP addresses**.
276
+
277
+
6. Enter **myNATGatewayIP** in **Name** in **Add a public IP address**.
278
+
279
+
7. Select **OK**.
280
+
281
+
8. Select the **Subnet** tab or select the **Next: Subnet** button at the bottom of the page.
282
+
283
+
9. In **Virtual network** in the **Subnet** tab, select **myVNet**.
284
+
285
+
10. Select **myBackendSubnet** under **Subnet name**.
286
+
287
+
11. Select the blue **Review + create** button at the bottom of the page, or select the **Review + create** tab.
288
+
289
+
12. Select **Create**.
290
+
292
291
## Install web server
293
292
294
293
In this section, you'll SSH to the virtual machines through the inbound NAT rules and install a web server.
@@ -297,7 +296,9 @@ In this section, you'll SSH to the virtual machines through the inbound NAT rule
297
296
298
297
2. Select **myLoadBalancer**.
299
298
300
-
3. In the **Overview** page of **myLoadBalancer**, make note of the **Public IP address**. In this example, it's **20.190.2.163**.
299
+
3. Select **Fronted IP configuration** in **Settings**.
300
+
301
+
3. In the **Frontend IP configuration**, make note of the **IP address** for **myFrontend**. In this example, it's **20.99.165.176**.
301
302
302
303
:::image type="content" source="./media/tutorial-load-balancer-port-forwarding-portal/get-public-ip.png" alt-text="Screenshot of public IP in Azure portal.":::
303
304
@@ -306,7 +307,7 @@ In this section, you'll SSH to the virtual machines through the inbound NAT rule
306
307
5. At your prompt, open an SSH connection to **myVM1**. Replace the IP address with the address you retrieved in the previous step and port **221** you used for the myVM1 inbound NAT rule. Replace the path to the .pem with the path to where the key file was downloaded.
@@ -324,7 +325,7 @@ In this section, you'll SSH to the virtual machines through the inbound NAT rule
324
325
8. At your prompt, open an SSH connection to **myVM2**. Replace the IP address with the address you retrieved in the previous step and port **222** you used for the myVM2 inbound NAT rule. Replace the path to the .pem with the path to where the key file was downloaded.
0 commit comments