-1
  • i've an elastic IP associated with my instance
  • i've security group of instance permits incoming connections
  • my instance firewall permits incoming connections
  • my application listens
  • i allowed specifically the Echo Request protocol in the ICMP inbound traffic of my EC2 instances.

In the past I could ping the domain name linked to my machine.

After looking for where the error could have come from I realized that in elastic IP there was no NAT Gateway associated.

enter image description here

I can't remember if this is necessary or not ? i guess this issue is coming from here .

olibruno
  • 31
  • 1
  • 5
  • The issue is only with ping? What about any other connections, e.g. ssh? NAT is not needed. – Marcin May 23 '21 at 01:04

1 Answers1

0

Function of NAT gateway is to enable instance in a private subnet to connect to the internet and prevent the internet from initiating a connection with those instance. NAT gateway need elastic IP. So if you have an NAT gateway configured then one EIP should be attached with it. In your case this EIP is attached to an EC2 instance not to NAT gateway thats why it showing no NAT gateway attached.

Your issue might be with security group rules. Check your SG. To exactly answer your question please add more information in your question like..Where your instance launched. In public subnet or in private subnet ? Have you attached EIP to instance launched in private subnet ? What is the inbound rules configured in SG ? what is the command you are using ?

Update: Instance were launched in private subnet. After adding routes for IGW in the route table of the subnet, this issue has been resolved

Jyothish
  • 1,031
  • 1
  • 9
  • 19
  • the instance EC2 is launched on public subnet **18.198.xx.xx**. A screenshot of [my rules configured in SG](https://ibb.co/vXdVdmc) – olibruno May 23 '21 at 09:07
  • . When i try to go to the url https://xxx.io i got cant connec to to the website. If i try with **ping** i've nothing. – olibruno May 23 '21 at 09:14
  • thanks for your explication regarding the NAT I wasn't sure – olibruno May 23 '21 at 09:14
  • >>>When i try to go to the url xxx.io i got cant connec to to the website. able to connect or not ? You can also refer this question and its answer https://stackoverflow.com/questions/60909867/cannot-ping-aws-ec2-instance-with-public-ip?rq=1 – Jyothish May 23 '21 at 09:28
  • i m not able to connect – olibruno May 23 '21 at 10:09
  • on **route table** of my **VPC** i added **0.0.0.0/0 igw-075e207db11ddf858** an now i get _503 Service Temporarily Unavailable_ – olibruno May 23 '21 at 11:00
  • After adding the route on my VPC and start the instance . It works . – olibruno May 23 '21 at 11:29
  • I'm glad to hear that. So your instance were launched in private subnet earlier. Now it is in public subnet. – Jyothish May 23 '21 at 11:33