Amazon Virtual Private Cloud-3

Network Address Translation Devices
Although network address translation occurs at the Internet gateway, there are two other resources that can also perform NAT.
■ NAT gateway
■ NAT instance
AWS calls these NAT devices. The purpose of a NAT device is to allow an instance to access the Internet while preventing hosts on the Internet from reaching the instance directly. This is useful when an instance needs to go out to the Internet to fetch updates or to upload data but does not need to service requests from clients. When you use a NAT device, the instance needing Internet access does not have a public IP address allocated to it. Incidentally, this makes it impossible for hosts on the Internet to reach it directly. Instead, only the NAT device is configured with a public IP. Additionally, the NAT device has an interface in a public subnet. Multiple instances can use the same NAT device, thus sharing the same public IP address for outbound connections. The function that NAT devices perform is also called port address translation (PAT).

Configuring Route Tables to Use NAT Devices
Instances that use the NAT device must send Internet-bound traffic to it, while the NAT device must send Internet-bound traffic to an Internet gateway. Hence, the NAT device and the instances that use it must use different default routes. Furthermore, they must also use different route tables and hence must reside in separate subnets.

Also read this topic: Introduction to Cloud Computing and AWS -1

NAT Gateway
A NAT gateway is a NAT device managed by AWS. Like an Internet gateway, it’s a one-size- fits-all resource. It doesn’t come in a variety of flavors, and there’s nothing to manage or access. It automatically scales to accommodate your bandwidth requirements. You set it and forget it. When you create a NAT gateway, you must assign it an EIP. A NAT gateway can reside in only one subnet, which must be a public subnet for it to access the Internet. AWS selects a private IP address from the subnet and assigns it to the NAT gateway. For redundancy, you may create additional NAT gateways in different availability zones. After creating a NAT gateway, you must create a default route to direct Internet-bound traffic from your instances to the NAT gateway. The target you specify will be the NAT gateway ID, which follows the format nat-0750b9c8de7e75e9f. If you use multiple NAT gateways, you can create multiple default routes, each pointing to a different NAT gateway as the target. Because a NAT gateway doesn’t use an ENI, you can’t apply a security group to it. You can, however, apply a NACL to the subnet that it resides in.

NAT Instance
A NAT instance is a normal EC2 instance that uses a preconfigured Linux-based AMI. You have to perform the same steps to launch it as you would any other instance. It functions like a NAT gateway in many respects, but there are some key differences. Unlike a NAT gateway, a NAT instance doesn’t automatically scale to accommodate increased bandwidth requirements. Therefore, it’s important that you select an appropriately robust instance type. If you choose an instance type that’s too small, you must manually upgrade to a larger instance type. Also, a NAT instance has an ENI, so you must apply a security group to it. You also must remember to assign it a public IP address. Lastly, you must disable the source/destination check on the NAT instance’s ENI. This allows the NAT instance to receive traffic addressed to an IP other than its own, and it also allows the instance to send traffic using a source IP that it doesn’t own. One advantage of a NAT instance is that you can use it as a bastion host, sometimes called a jump host, to connect to instances that don’t have a public IP. You can’t do this with a NAT gateway. You must create a default route to direct Internet-bound traffic to the NAT instance. The target of the default route will be the NAT instance’s ID, which follows the format i-0a1674fe5671dcb00. If you want to guard against instance or availability zone failures, it’s not as simple as just spinning up another NAT instance. You cannot create multiple default routes pointing to different NAT instances. If you need this level of resiliency, you’re better off using NAT gateways instead.

VPC Peering
You can configure VPC peering to allow instances in one VPC to communicate with VPCs in another over the private AWS network. You may want to do this if you have instances in different regions that need to communicate. You may also want to connect your instances to another AWS customer’s instances. To enable VPC peering, you must set up a VPC peering connection between two VPCs. A VPC peering connection is a point-to-point connection between two and only two VPCs. You can have at most one peering connection between a pair of VPCs. Also, peered VPCs must not have overlapping CIDR blocks. With one exception, a VPC peering connection allows only instance-to-instance communication. This means an instance in one VPC can use the peering connection only to connect to another instance in the peered VPC. You can’t use it to share Internet gateways or NAT devices. You can, however, use it to share a Network Load Balancer (NLB). If you have more than two VPCs you need to connect, you must create a peering connection between each pair. You cannot daisy-chain VPC peering connections together and route through them. This configuration is called transitive routing. To use a peering connection, you must create new routes in both VPCs to allow traffic to travel in both directions. For each route, the destination prefix should exist within the destination VPC. The target of each route must be the peering connection’s identifier The destination CIDR doesn’t need to exactly match that of the destination VPC. If you want to enable peering only between specific subnets, you can specify the subnet CIDR instead. Inter-region VPC peering is not available for some AWS regions. Peering connections
between regions have a maximum transmission unit (MTU) of 1500 bytes and do not support IPv6.

People also ask this Questions

  1. What is a defense in depth security strategy how is it implemented?
  2. What is AWS Solution Architect?
  3. What is the role of AWS Solution Architect?
  4. Is AWS Solution Architect easy?
  5. What is AWS associate solutions architect?
  6. Is AWS Solutions Architect Associate exam hard?

Infocerts, 5B 306 Riverside Greens, Panvel, Raigad 410206 Maharashtra, India
Contact us – https://www.infocerts.com

Linkedin - Free social media icons

Leave a Comment

Your email address will not be published. Required fields are marked *

Open Whatsapp chat
Whatsapp Us
Chat with us for faster replies.