Had only one public subnet to VPC, and added NAT gateway to that public subnet instance, but i'm not able access the instance using NAT ip address

679 views Asked by At

I had only one public subnet to VPC,and added NAT gateway to that public subnet, but i'm not able access the instance using NAT ip address.

@1)I'm able to ping the instance, with public Ip address(added icmp to security group), but by using NAT elastic IP address i'm not able to ping.

@2)Does NAT is applicable for single public subnet or not. My goal is to translate the ip address attached to public subnet instance.

3

There are 3 answers

5
Kyle Finley On BEST ANSWER

I believe you are using the wrong service for what you are trying to do.

The AWS service NAT Gateway is for routing outbound traffic from a private subnet to the internet. It does not route inbound requests.

0
forzagreen On

Make sure you have:

  1. Internet Gateway for your VPC (docs).
  2. A public IPv4 for your instance.

NAT Gateway (docs) is used for services inside a private subnet (which is inside a VPC) to send requests from inside the subnet to internet. The source address being the Elastic IP.

Internet Gateway is used for all the VPC to establish a basic level of internet connectivity. It takes care of routing to your EC2 instances that have a public IP.

0
user10747682 On

I have solution on this, give NAT gateway private IP to private server @ DNS place, then you will get internet access. if you want to test u need to have one server with public IP, then take remote of 2nd(private server) and Test it will work. for any other info https://www.youtube.com/channel/UCEYPy7Dt4UJa_UvUrsRmjoQ https://www.linkedin.com/in/mohan-reddy-79a57014b/