Open In App

How To Connect Internet and Other Networks Using NAT Devices?

Last Updated : 16 Jul, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

NAT is a special concept that falls under the topic of the Amazon Web Service. Network Address Translation or NAT is the gateway of the cloud platform in AWS. Earlier, the Network Address Translation was valid in some locations around the globe. But with time, the space of the service has increased. Now, this service can be accessed on every continent in the world. The Network Address Translation method is sometimes referred to as the devices, as the system can be deployed only on the machine where the AWS is enabled. Having one AWS account is mandatory to handle such elements.

The Network Address Translation is present inside the Virtual Private Cloud of AWS. Earlier, the user should launch one instance in the Network Address Translation & then the Network Address Translation gateway will be opened for the operations. But now, the system has completely changed. The Network Address Translation can be easily connected to the internet using the subnets present in the AWS. And that subnet will be present under the Virtual Private Cloud. In NAT Gateway one can find any two types of connectivity. Based on those connectivities, we can classify some of the subnets.

Public Connectivity

It is the default connectivity present in the AWS NAT Gateway. But the connection process is quite tricky. The private instances that have been created in the account can be added to the Public connection. In that case, the inbound connections can be received by the machine to the instances. That is the reason, the use of the Public subnet is very rare in the NAT. In the case of the Public connection, a static workflow should be followed. In Public connection, a public NAT gateway should be created using the public instances. Using that method, one can way the NAT gateway traffic to the internet gateway. But it is a quite difficult step to move on. The same type of operation can be done in other connectivities which is quite easy to do. We should use the private subnet then.

Private Connectivity

It is the most useful connectivity that is used in the NAT Gateway. Here, the instances that are created in the Private mode can be attached to the internet using the Network Address Translation. It helps to connect all other Virtual Private Connections present on the device which we term as the On-Premise connection through the NAT. In Public connectivity, one can pass the traffic from the Network Address Translation Gateway to the Virtual Private Gateway. But for that purpose, one should attach an Internet Gateway to the NAT for a better experience. Also, private connectivity is more dynamic in the field of NAT. That is the reason, NAT Gateway with a private subnet works way better than the public subnet.

Basics of Network Address Translation

NAT gateway can be developed by providing a specific location zone in the AWS account. And one thing that should keep in mind is that the working of a NAT gateway in one specific location & time zone will be different from another location & time zone NAT gateway. So, the development of the NAT gateway should be done properly in the AWS.

Also, there is a specific number of NAT gateways that can be developed in one special time & location zone. But, one can connect one NAT gateway with another NAT gateway that is present in another time zone. But if anyone NAT gateway resource availability gets down, then the other NAT gateway will show disconnected on the network.

There are also some basic details of the NAT gateway present that should be noted down. The basics of NAT gateway are the following:

  • Supported Protocol: TCP, UDP, ICMP
  • Supported Traffic: IPv4 or IPv6
  • Supported Bandwidth Range: 5 GBps to 100 GBps
  • Number Of Packets: 1 Million per second
  • Number Of Simultaneous Connections: Up to 55,000
  • Range Of Port Number: 1024–65535

Connecting To The Internet Using NAT

Establishing The Network Address Translation (NAT)

Step 1: At first log in to the AWS account & then search for the VPC in the search bar. The list of best matches will be available as a result. Click on the VPC option present there.

Step 2: Under the VPC window, search for the left-hand sidebar. Inside that search bar, many more options will be present. Find out & click on the option NAT Gateways.

 

Step 3: Inside the new window, a special section for the NAT gateways will be present. Click on the Create NAT Gateway button to move ahead.

NAT gateways dashboard

 

Step 4: In the next window, a few pieces of information need to be filled out. The Name of the NAT should be provided along with the required Subnet. 

Note: For the subnet, one dropdown option will be present. And one default subnet will be there inside that dropdown option. The Private Default Subnet should be chosen for moving ahead. Else, in the Public Subnet, the NAT connection will not work. The subnet should be chosen & placed in that field.

NAT gateway settings

 

Step 5: Another piece of information needs to be filled out. The Elastic IP Address should be provided there. For getting the IP Address, click on the Allocate Elastic IP button present there.

Note: The allocation of Elastic IP Address is not free in cost. AWS will consume some fees for the usage of the Elastic IP Address. As much the IP Address will be used, the amount will be increased simultaneously.

Allocate Elastic IP

 

Step 6: Now, the Elastic IP Address will be allocated & the result will be shown at the top side of the screen. The details will be filled up automatically inside of that field of Elastic IP Address. 

Elastic IP Address

 

Step 7: Scroll down the window a bit, and at the lower side of the screen one button will be present as Create NAT Gateway. Click on that button to allocate the NAT Gateway.

Creating a NAT gateway

 

Step 8: It will take some time to complete the process. After completion of the process, the detail tab of the NAT Gateway will be available.

NAT gateway details

 

Hence, we have successfully established the Network Address Translation gateway in the AWS.

Connection To The Subnet

Step 1: After a successful establishment of the NAT gateway in the AWS, a Route Table option will be available just beneath the section. Click on the Route Table Link.

Route Table

 

Step 2: In the newly opened window, you will find an option Edit Routes inside of the Route tab. Click on it to make the necessary changes.

Edit routes

 

Step 3: Now, some changes need to be made in the next window. Provide the Destination as 0.0.0.0/0 & choose the Target from the dropdown menu. The established NAT subnet is now present there. After those sections, click on the Save Routes button.

Save rules

 

Step 4: Now, it will be again back to the Route Page. The newly added route is now present. So, the connection is done with the NAT gateway.

 One thing should keep in mind that, the NAT connection can only be possible if the Private Subnet has chosen while establishing the connection. If the Public Subnet has been chosen during the establishment time, the NAT connection is not possible.

internet ip address

 

Step 5: Now, for verification purposes, the terminal in the AWS can be opened on the device. The following command needs to be executed in the terminal. If the command is providing the Connected output, then the connection is made successfully.

Command: wget google.com

Acessing internet  from private server

 

These simple steps will help to create the Network Address Translation or NAT in the AWS which will be connected to the internet using the proper private subnet allocated in the process. 

Hence, we have successfully connected to the internet using the NAT gateways & the subnets in the AWS.

Delete A NAT Gateway:

Step 1: After login to the AWS account, search for the VPC in the Search Bar. Then, click on the best-matched option.

Step 2: In the VPC window, on the left-hand side, click on the NAT Gateways.

NAT Gate way

 

Step 3: Select the NAT Gateway that should be deleted & click on the Actions menu above. Click on the Delete NAT Gateway to move further.

select NAT Gateway

 

Step 4: A popup message will arrive & click on the Delete NAT Gateway.

Click on delete NAT gateway

 

Step 5: The NAT Gateway will be marked as Deleting now.

Deleting NAT gateway

 

Hence, we have successfully deleted a NAT Gateway in AWS.

Pricing Of NAT Gateway

One thing should be cleared before concluding that, the use of NAT gateway is not free of cost. For using the NAT gateway, one should pay some dollars to AWS. AWS charges individuals based on their hourly use of NAT Gateway. Along with the hourly usage of NAT Gateway, the additional charges are applied by calculating the use of the GB internet.

In AWS, different time & location has different amount of cost. For India, the Asia Pacific (Mumbai) region will work which has the price of $0.056 for using one hour. The same price is taken by sharing 1 GB of data in this region. Suppose, in one hour 1 GB data is transferred to any destination. So, one has to pay $0.056 + $0.056 = $0.112 amount to AWS.

Note: AWS counts any partially used hour as a full hour. So, if 15 mins are used in NAT Gateway, the AWS will count it as one hour of use. So, it is recommended to delete the NAT Gateway after the use is completed.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads