We can add a route for our NAT instance as follows:
- Go to the VPC dashboard.
- Click on Route Tables.
- Select the main route table for our VPC.
- Click on the Routes tab.
- Click on Edit routes.
- Click on Add route and do the following:
- Set Destination to 0.0.0.0/0.
- From the drop-down menu for Target, click on Instance and then select our NAT instance.
- Click on Save routes:
We should get a success message.
- Log in to the EC2 instance in the public subnet. From there, log in to the private EC2 instance. You can refer to the Launching an EC2 instance into a VPC recipe for the exact steps.
- Try running any ...