title | titlesuffix | description | author | ms.author | ms.service | ms.topic | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|
Quickstart: Create a NAT gateway - Azure portal |
Azure NAT Gateway |
This quickstart shows how to create a NAT gateway by using the Azure portal. |
asudbring |
allensu |
azure-nat-gateway |
quickstart |
06/20/2023 |
template-quickstart, FY23 content-maintenance, linux-related-content |
In this quickstart, learn how to create a NAT gateway by using the Azure portal. The NAT Gateway service provides outbound connectivity for virtual machines in Azure.
:::image type="content" source="./media/quickstart-create-nat-gateway-portal/nat-gateway-qs-resources.png" alt-text="Diagram of resources created in nat gateway quickstart." lightbox="./media/quickstart-create-nat-gateway-portal/nat-gateway-qs-resources.png":::
- An Azure account with an active subscription. Create an account for free.
Sign in to the Azure portal with your Azure account.
[!INCLUDE virtual-network-create-with-nat-bastion.md]
[!INCLUDE create-test-virtual-machine-linux.md]
In this section, you test the NAT gateway. You first discover the public IP of the NAT gateway. You then connect to the test virtual machine and verify the outbound connection through the NAT gateway.
-
In the search box at the top of the portal, enter Public IP. Select Public IP addresses in the search results.
-
Select public-ip-nat.
-
Make note of the public IP address:
:::image type="content" source="./media/quickstart-create-nat-gateway-portal/find-public-ip.png" alt-text="Discover public IP address of NAT gateway" border="true":::
-
In the search box at the top of the portal, enter Virtual machine. Select Virtual machines in the search results.
-
Select vm-1.
-
On the Overview page, select Connect, then select the Bastion tab.
-
Select Use Bastion.
-
Enter the username and password entered during VM creation. Select Connect.
-
In the bash prompt, enter the following command:
curl ifconfig.me
-
Verify the IP address returned by the command matches the public IP address of the NAT gateway.
azureuser@vm-1:~$ curl ifconfig.me 203.0.113.0.25
[!INCLUDE portal-clean-up.md]
For more information on Azure NAT Gateway, see:
[!div class="nextstepaction"] Azure NAT Gateway overview