- AWS Networking Cookbook
- Satyajit Das Jhalak Modi
- 262字
- 2021-07-02 19:41:31
How to do it...
- I have created one more EC2 instance as visible in the Instances section of the EC2 console.

EC2 created for NAT
- Click on Elastic IPs in the left menu bar.

Elastic IP dashboard
- Click on Allocate new address.
Elastic IP creation page
- Click on Allocate.

Elastic IP creation success message
- Click on Close. The Elastic IP page will be visible. Choose Elastic IP and click on Actions | Associate address.
Elastic IP Action menu
- Choose Instance in the Resource type. Select Nat Instance from the Instance drop-down menu. Click on Associate. A success message is shown.
Elastic IP association with EC2 instance
- Go to the Instances menu. You can see that the public DNS and IPv4 public IP has changed. You can see Change Source/Dest. Check is true for the instance.

EC2 instance with Elastic IP
- Select Actions | Networking | Change Source/Dest. Check.

Changing Source/Dest Check for NAT instance
- You can see that Change Source/Dest. Check is now false.

NAT instance details
- We need to update the main Route Table attached to the VPC. Let's go back to the VPC dashboard and select our VPC.

VPC dashboard
- Click on the Route Tables starting with rtb.
Main Route Table
- Select the Route Table and navigate to the Routes tab. Click on the Edit button. Add 0.0.0.0/0 in the destination and the NAT instance ID in Target. Click Save.

Attach NAT in main Route Table
推薦閱讀