Azure – Networking – Part 30 – Configure Azure Virtual Network NAT Gateway In Azure Portal




Hello Friends,

Hope you all are doing good. In our last article we have discussed about, another Azure Networking Service Network Address Translation Gateway (NAT Gateway). Today in this article we will continue with NAT service and see how to configure NAT Gateway in Azure portal.



Tool Installation Articles :

  1. Configure Azure Command Line Interface ( Azure CLI) On Windows
  2. Configure PowerShell For Microsoft Azure Az Module On Windows

Previous Azure Series :

  1. Learn Basics Of Azure Networking In 100 Hours
  2. Learn Basics Of Microsoft Azure Storage services
  3. Learn Basic Of Azure Active Directory And Azure Identity And Access Management
  4. Azure DevOps – Learn at one place
  5. Learn Basics Of Lift-And-Shift Migration To Azure

If you have missed our previous articles on Azure Networking, please check it in following links.

Part 1 – Basics of Azure Networking

  • *
  • *
  • *

Part 23 – Azure Load Balancer -Configure Basic Load Balancer – 1

Part 24 – Azure Load Balancer – Configure Basic Load Balancer – 2

Part 25 – Azure Load Balancer – Configure Basic Load Balancer -3

Part 26 – Azure Load Balancer – Outbound Connectivity

Part 27 – Azure Load Balancer – Outbound Rule – Lab Exercise

Part 28 – Azure Virtual Network NAT (Network Address Translation)

Part 29 – Azure Virtual Network NAT Gateway

Next Article : Part 31 – Azure Front Door

Configure Azure NAT Gateway

In our previous two article we have gone through the theory part of NAT service of Azure. As we discuss, in this article we will go through the lab exercise.

Scenario

In this exercise, we will configure two VM and one virtual machine (Manas-Jump-Server) will have a public IP to connect through RDP session and it will act as a jump server of the other virtual machine (Private-server), which does not have a public IP but we can use Azure backbone network and use it’s private IP to connect the VM. The next step is to try to get the public IP of the private server and note the IP address and we will see Azure automatically assign a public IP to the private server.

Now Configure Azure NAT Gateway by assign a new public IP to it and associate the NAT Gateway to the subnet which host our Private-Server virtual machine. Then again check the public IP of the Private-Server. Here we will see that, it shows the public IP of NAT Gateway. It means that all resource under the subnet, which is associated with the NAT Gateway, can use the same Public IP assign to NAT Gateway to communicate with internet. Let’s check this scenario

Lab Exercise

In the above we saw, we need to configure following resources.

  1. One Virtual Network (NAT-RG-Vnet)
  2. Two Subnet (JumpServer-Subnet and PrivateServer-Subnet)
  3. Two Virtual machine (Manas-Jump-Server and Private-Server) in both subnet

In the following figure we can see our both VM are ready.

Figure 1 : Azure Networking – NAT Gateway – VM Configuration

As showing in the following figure, Manas-Jump-Server hosted under JumpServer-Subnet and it has it’s own public IP address and the public IP is under same subnet as the virtual machine.

Figure 2 : Azure Networking – NAT Gateway– Jump Server VM with Public IP

Below we can see the Private-Server VM, which is hosted by PrivateServer-Subnet and the VM does not have a public IP. We will use it’s private IP address 10.0.1.5 to connect the server from the above jump server.

Figure 3 : Azure Networking – NAT Gateway-Private Server VM without Public IP

Now we need to connect the Manas-Jump-Server VM using it’s public IP as showing in the following figure.

Figure 4 : Azure Networking – NAT Gateway–Connecting private server using private IP from Jump Server

Now from the jump server connect PrivateServer VM using its private IP address ( 10.0.1.5). We can connect using private IP because both are under same Vnet and it uses the Azure backbone network as showing in the following figure.

Figure 5 : Azure Networking – NAT Gateway–Connecting private server using private IP from Jump Server 1

Now let’s check the public IP address of the server. As showing in the following figure the public IP address is 13.92.135.63 without Azure NAT Gateway.

Figure 6 : Azure Networking – NAT Gateway–Checking The Public IP Of The Private Server When No NAT Gateway

The next step is to configure NAT Gateway as showing in the following igure.

Figure 7 : Azure Networking – NAT Gateway–Configuring NAT Gateway 1

In the Basics tab, we can set Resource group, NAT Gateway Name, Region, Availability Zone etc. as showing in the following figure.

Figure 8 : Azure Networking – NAT Gateway–Configuring NAT Gateway 2

Next is to configure Outbound IP. It is most important part of the configuration. Here we need to assign a public IP or a public IP prefix to the NAT Gateway. We can choose the existing Public IP other wise we can create a new Public IP from here as showing in the following figures.

Figure 9 : Azure Networking – NAT Gateway–Configuring NAT Gateway 3- Configure Public IP for NAT Gateway
Figure 10 : Azure Networking – NAT Gateway–Configuring NAT Gateway 4

Next is to configure Subnets. One NAT gateway can be have multiple subnet but at least one subnet is must when we configure a NAT gateway and later we can add more subnet if we want. There are few condition, which is required for a subnet to fulfil otherwise the subnet will not be visible under available subnets. Following figure showing all the conditions.

Here I have configured my PrivateServer -Subnet as the Jumpserver-Subnet does not fulfil the requirement as it has one basic public IP which is associated with jump server.

Figure 12 : Azure Networking – NAT Gateway– Configure Subnet -Configuring NAT Gateway 6

Once it we review the configuration , let’s click Create button to finish the configuration.

Figure 13 : Azure Networking – NAT Gateway–Configuring NAT Gateway 7

After we configured the NAT Gateway, if we go to the Outbound IP of the NAT Gateway, we can see the Public IP address assigned to it. In our case it is 23.96.124.56 s showing in the following figures.

Figure 14 : Azure Networking – NAT Gateway–Configuring NAT Gateway 8
Figure 15 : Azure Networking – NAT Gateway–Configuring NAT Gateway 9

Now all set to test our NAT Gateway configuration. Let’s connect our Private-Server (10.0.1.5) and test the public IP of the virtual machine in same way we did earlier. Now we can see in the following figure the Public IP address is same as the public IP address (23.96.124.56) of the NAT Gateway.

So it is tested that once we attached one NAT Gateway to a subnet, then all resources under the subnet, uses NAT Gateway public IP to communicate with Internet as showing in the following figure.

Figure 7 : Azure Networking – NAT Gateway–Checking Public IP With NAT Gateway

With the above information, I am concluding this article. I hope this is informative to you. Please let me know if I missed anything important or if my understanding is not up to the mark.

Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. In our next article we will continue with new Azure Service.

Next Article : Part 31 – Azure Front Door

If you have any suggestion / feedback / doubt, you are most welcome. Stay tuned on Knowledge-Junction, will come up with more such articles.

Thanks for reading 🙂

Manas Ranjan Moharana

I'm a proud Indian, Son, Husband, Father, Author, Blogger, Self motivated person. I lives in Pune, Maharashtra and working for TietoEvry.pvt.ltd, to build Azure Solutions and Share Point Solutions.Microsoft certified Professional with 14 years of IT experience. Interest in learning and sharing something new, to be healthy.

You may also like...

2 Responses

  1. March 10, 2022

    […] you all are doing good. In our last article we have discussed on how to configure NAT Gateway in Azure portal. Today in this article we will start with a new Azure network service Azure Front […]

  2. March 14, 2022

    […] Part 30 – Configure Azure Virtual Network NAT Gateway In Azure Portal […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: