|
1 | 1 | ---
|
2 |
| -title: #Required; page title is displayed in search results. Include the brand. |
3 |
| -description: #Required; article description that is displayed in search results. |
4 |
| -author: #Required; your GitHub user alias, with correct capitalization. |
5 |
| -ms.author: #Required; microsoft alias of author; optional team alias. |
6 |
| -ms.service: #Required; service per approved list. slug assigned by ACOM. |
7 |
| -ms.topic: tutorial #Required; leave this attribute/value as-is. |
8 |
| -ms.date: #Required; mm/dd/yyyy format. |
9 |
| -ms.custom: template-tutorial #Required; leave this attribute/value as-is. |
| 2 | +title: 'Tutorial: Migrate a virtual machine public IP address to NAT gateway' |
| 3 | +titleSuffix: Azure Virtual Network NAT |
| 4 | +description: Learn how to migrate your virtual machine public IP to a Virtual Network NAT gateway. |
| 5 | +author: asudbring |
| 6 | +ms.author: allensu |
| 7 | +ms.service: virtual-network |
| 8 | +ms.subservice: nat |
| 9 | +ms.topic: tutorial |
| 10 | +ms.date: 2/07/2022 |
| 11 | +ms.custom: template-tutorial |
10 | 12 | ---
|
11 | 13 |
|
12 |
| -<!-- |
13 |
| -Remove all the comments in this template before you sign-off or merge to the |
14 |
| -main branch. |
15 |
| ---> |
| 14 | +# Tutorial: Migrate a virtual machine public IP address to Azure Virtual Network NAT |
16 | 15 |
|
17 |
| -<!-- |
18 |
| -This template provides the basic structure of a tutorial article. |
19 |
| -See the [tutorial guidance](contribute-how-to-mvc-tutorial.md) in the contributor guide. |
| 16 | +In this article, you'll learn how to migrate your virtual machine's public IP address to a NAT gateway. You'll learn how to remove the IP address from the virtual machine. You'll reuse the IP address from the virtual machine for the NAT gateway. |
20 | 17 |
|
21 |
| -To provide feedback on this template contact |
22 |
| -[the templates workgroup](mailto:[email protected]). |
23 |
| ---> |
| 18 | +Azure Virtual Network NAT is the recommended method for outbound connectivity. A NAT gateway is a fully managed and highly resilient Network Address Translation (NAT) service. A NAT gateway doesn't have the same limitations of SNAT port exhaustion as default outbound access. A NAT gateway replaces the need for a public IP address assigned to a virtual machine for outbound connectivity. |
24 | 19 |
|
25 |
| -<!-- 1. H1 |
26 |
| -Required. Start with "Tutorial: ". Make the first word following "Tutorial: " a |
27 |
| -verb. |
28 |
| ---> |
| 20 | +For more information about Azure Virtual Network NAT, see [What is Azure Virtual Network NAT](nat-overview.md) |
29 | 21 |
|
30 |
| -# Tutorial: <do something with X> |
| 22 | +In this tutorial, you learn how to: |
31 | 23 |
|
32 |
| -<!-- 2. Introductory paragraph |
33 |
| -Required. Lead with a light intro that describes, in customer-friendly language, |
34 |
| -what the customer will learn, or do, or accomplish. Answer the fundamental “why |
35 |
| -would I want to do this?” question. Keep it short. |
36 |
| ---> |
| 24 | +> [!div class="checklist"] |
| 25 | +> * Remove the public IP address from the virtual machine. |
| 26 | +> * Associate the public IP address from the virtual machine with a NAT gateway. |
37 | 27 |
|
38 |
| -[Add your introductory paragraph] |
| 28 | +## Prerequisites |
39 | 29 |
|
40 |
| -<!-- 3. Tutorial outline |
41 |
| -Required. Use the format provided in the list below. |
42 |
| ---> |
| 30 | +* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
43 | 31 |
|
44 |
| -In this tutorial, you learn how to: |
| 32 | +* An Azure Virtual Machine with a public IP address assigned to it's network interface. For more information on creating a virtual machine with a public IP, see [Quickstart: Create a Windows virtual machine in the Azure portal](../../virtual-machines/windows/quick-create-portal.md). |
| 33 | + |
| 34 | + * For the purposes of this article, the example virtual machine is named **myVM**. The example public IP address is named **myPublicIP**. |
45 | 35 |
|
46 |
| -> [!div class="checklist"] |
47 |
| -> * All tutorials include a list summarizing the steps to completion |
48 |
| -> * Each of these bullet points align to a key H2 |
49 |
| -> * Use these green checkboxes in a tutorial |
| 36 | +> [!NOTE] |
| 37 | +> Removal of the public IP address prevents direct connections to the virtual machine from the internet. RDP or SSH access won't function to the virtual machine after you complete this migration. To securely manage virtual machines in your subscription, use Azure Bastion. For more information on Azure Bastion, see [What is Azure Bastion?](../../bastion/bastion-overview.md). |
50 | 38 |
|
51 |
| -<!-- 4. Prerequisites |
52 |
| -Required. First prerequisite is a link to a free trial account if one exists. If there |
53 |
| -are no prerequisites, state that no prerequisites are needed for this tutorial. |
54 |
| ---> |
| 39 | +## Remove public IP from virtual machine |
55 | 40 |
|
56 |
| -## Prerequisites |
| 41 | +In this section, you'll learn how to remove the public IP address from the virtual machine. |
| 42 | + |
| 43 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 44 | + |
| 45 | +2. In the search box at the top of the portal, enter **Virtual machine**. Select **Virtual machines**. |
| 46 | + |
| 47 | +3. In **Virtual machines**, select **myVM** or your virtual machine. |
| 48 | + |
| 49 | +4. In the **Overview** of **myVM**, select **Public IP address**. |
| 50 | + |
| 51 | + :::image type="content" source="./media/tutorial-migrate-ilip-nat/select-public-ip.png" alt-text="Screenshot of virtual machines public IP address."::: |
| 52 | + |
| 53 | +5. In **myPublicIP**, select the **Overview** page in the left-hand column. |
| 54 | + |
| 55 | +6. In **Overview**, select **Dissociate**. |
| 56 | + |
| 57 | + :::image type="content" source="./media/tutorial-migrate-ilip-nat/remove-public-ip.png" alt-text="Screenshot of virtual machines public IP address overview and removal of IP address."::: |
| 58 | + |
| 59 | +7. Select **Yes** in **Dissociate public IP address**. |
| 60 | + |
| 61 | +### (Optional) Upgrade IP address |
| 62 | + |
| 63 | +The NAT gateway resource in Azure Virtual Network NAT requires a standard SKU public IP address. In this section, you'll upgrade the IP you removed from the virtual machine in the previous section. If the IP address you removed is already a standard SKU public IP, you can proceed to the next section. |
| 64 | + |
| 65 | +1. In the search box at the top of the portal, enter **Public IP**. Select **Public IP addresses**. |
| 66 | + |
| 67 | +2. In **Public IP addresses**, select **myPublicIP** or your basic SKU IP address. |
57 | 68 |
|
58 |
| -- <!-- An Azure account with an active subscription. [Create an account for free] |
59 |
| - (https://azure.microsoft.com/free/?WT.mc_id=A261C142F). --> |
60 |
| -- <!-- prerequisite 2 --> |
61 |
| -- <!-- prerequisite n --> |
| 69 | +3. In the **Overview** of **myPublicIP**, select the IP address upgrade banner. |
62 | 70 |
|
63 |
| -<!-- 5. H2s |
64 |
| -Required. Give each H2 a heading that sets expectations for the content that follows. |
65 |
| -Follow the H2 headings with a sentence about how the section contributes to the whole. |
66 |
| ---> |
| 71 | + :::image type="content" source="./media/tutorial-migrate-ilip-nat/select-upgrade-banner.png" alt-text="Screenshot of public IP address upgrade banner."::: |
67 | 72 |
|
68 |
| -## [Section 1 heading] |
69 |
| -<!-- Introduction paragraph --> |
| 73 | +4. In **Upgrade to Standard SKU**, select the box next to **I acknowledge**. Select the **Upgrade** button. |
70 | 74 |
|
71 |
| -1. Sign in to the [<service> portal](url). |
72 |
| -1. <!-- Step 2 --> |
73 |
| -1. <!-- Step n --> |
| 75 | + :::image type="content" source="./media/tutorial-migrate-ilip-nat/upgrade-public-ip.png" alt-text="Screenshot of upgrade public IP address selection."::: |
74 | 76 |
|
75 |
| -## [Section 2 heading] |
76 |
| -<!-- Introduction paragraph --> |
77 |
| -1. <!-- Step 1 --> |
78 |
| -1. <!-- Step 2 --> |
79 |
| -1. <!-- Step n --> |
| 77 | +5. When the upgrade is complete, proceed to the next section. |
| 78 | +## Create NAT gateway |
80 | 79 |
|
81 |
| -## [Section n heading] |
82 |
| -<!-- Introduction paragraph --> |
83 |
| -1. <!-- Step 1 --> |
84 |
| -1. <!-- Step 2 --> |
85 |
| -1. <!-- Step n --> |
| 80 | +In this section, you’ll create a NAT gateway with the IP address you previously removed from the virtual machine. You'll assign the NAT gateway to your pre-created subnet within your virtual network. The subnet name for this example is **default**. |
86 | 81 |
|
87 |
| -<!-- 6. Clean up resources |
88 |
| -Required. If resources were created during the tutorial. If no resources were created, |
89 |
| -state that there are no resources to clean up in this section. |
90 |
| ---> |
| 82 | +1. In the search box at the top of the portal, enter **NAT gateway**. Select **NAT gateways**. |
| 83 | + |
| 84 | +2. In **NAT gateways**, select **+ Create**. |
| 85 | + |
| 86 | +3. In **Create network address translation (NAT) gateway**, enter or select the following information. |
| 87 | + |
| 88 | + | Setting | Value | |
| 89 | + | ------- | ----- | |
| 90 | + | **Project details** | | |
| 91 | + | Subscription | Select your subscription. | |
| 92 | + | Resource group | Select **Create new**. </br> Enter **myResourceGroup**. </br> Select **OK**. | |
| 93 | + | **Instance details** | | |
| 94 | + | NAT gateway name | Enter **myNATgateway**. | |
| 95 | + | Region | Select the region of your virtual network. In this example, it's **West US 2**. | |
| 96 | + | Availability zone | Leave the default of **None**. | |
| 97 | + | Idle timeout (minutes) | Enter **10**. | |
| 98 | + |
| 99 | +4. Select the **Outbound IP** tab, or select **Next: Outbound IP** at the bottom of the page. |
| 100 | + |
| 101 | +5. In **Public IP addresses** in the **Outbound IP** tab, select the IP address from the previous section in **Public IP addresses**. In this example, it's **myPublicIP**. |
| 102 | + |
| 103 | +6. Select the **Subnet** tab, or select **Next: Subnet** at the bottom of the page. |
| 104 | + |
| 105 | +7. In the pull-down box for **Virtual network**, select your virtual network. |
| 106 | + |
| 107 | +8. In **Subnet name**, select the checkbox for your subnet. In this example, it's **default**. |
| 108 | + |
| 109 | +9. Select the **Review + create** tab, or select **Review + create** at the bottom of the page. |
| 110 | + |
| 111 | +10. Select **Create**. |
91 | 112 |
|
92 | 113 | ## Clean up resources
|
93 | 114 |
|
94 |
| -If you're not going to continue to use this application, delete |
95 |
| -<resources> with the following steps: |
| 115 | +If you're not going to continue to use this application, delete the NAT gateway with the following steps: |
| 116 | + |
| 117 | +1. From the left-hand menu, select **Resource groups**. |
96 | 118 |
|
97 |
| -1. From the left-hand menu... |
98 |
| -1. ...click Delete, type...and then click Delete |
| 119 | +2. Select the **myResourceGroup** resource group. |
99 | 120 |
|
100 |
| -<!-- 7. Next steps |
101 |
| -Required: A single link in the blue box format. Point to the next logical tutorial |
102 |
| -in a series, or, if there are no other tutorials, to some other cool thing the |
103 |
| -customer can do. |
104 |
| ---> |
| 121 | +3. Select **Delete resource group**. |
| 122 | + |
| 123 | +4. Enter **myResourceGroup** and select **Delete**. |
105 | 124 |
|
106 | 125 | ## Next steps
|
107 | 126 |
|
108 |
| -Advance to the next article to learn how to create... |
109 |
| -> [!div class="nextstepaction"] |
110 |
| -> [Next steps button](contribute-how-to-mvc-tutorial.md) |
| 127 | +In this article, you learned how to: |
111 | 128 |
|
112 |
| -<!-- |
113 |
| -Remove all the comments in this template before you sign-off or merge to the |
114 |
| -main branch. |
115 |
| ---> |
| 129 | +* Remove a public IP address from a virtual machine. |
| 130 | + |
| 131 | +* Create a NAT gateway and use the public IP address from the virtual machine for the NAT gateway resource. |
| 132 | + |
| 133 | +For more information about NAT gateway and the connectivity benefits it provides, see [Design virtual networks with NAT gateway](nat-gateway-resource.md). Any virtual machine created within this subnet, won't require a public IP address and will automatically have outbound connectivity. |
| 134 | + |
| 135 | +Advance to the next article to learn how to migrate default outbound access to Azure Virtual Network NAT: |
| 136 | +> [!div class="nextstepaction"] |
| 137 | +> [Migrate outbound access to NAT gateway](tutorial-migrate-outbound-nat.md) |
0 commit comments