March 29, 2021 / Nirav Shah
You can use a NAT instance in a public subnet in your VPC to enable instance in the private subnet to initiate outbound IPv4 traffic to the internet or other AWS services. But prevent the instance from receiving inbound traffic initiated by someone on the internet.
NAT is not supported for IPv4 traffic use on egress only internet gateway.
Step 1: Create VPC (VPC1)
Step 2: Create a public subnet using the VPC.
Step 3: Create a private subnet using the VPC.
Step 4: Create the internet gateway and attach to the newly created VPC (VPC1)
Step 5: Create the routeing table.
Step 6: Edit the route table and attache IG to it.
Step 7: Edit the subnet associations and select public subnet.
Step 8: Launch NAT instance.
Step 9: Select your VPC and public subnet.
Step 10: Select the default option.
Step 11: Launch one Linux instance.
Step 12: Select the private subnet.
Step 13: Now connect the NAT instance and try to access the internet. You are able to access it. Create a .pem file and provide the necessary permissions. And now can have the access to the private Linux instance.
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.