AWS EC2 instance public ipv4 and DNS address not working

0

Hello, I have created an EC2 instance in which I have attached the default VPC and default security group (In the security group, I have added an inbound rule for all traffic also), but I don't know why public ipv4 and DNS are not opening, it shows the site can't be reached! and when I clicked on Actions-> Monitor and troubleshoot -> Get instance screenshot -: In that, it displays my private IP address, and login (check below image). Can someone guide me to where I am doing wrong?

Enter image description here

已提問 2 年前檢視次數 2647 次
2 個答案
2
已接受的答案

Few things to check:

  • The route table that's associated with your instance’s subnet has a default route (0.0.0.0/0) pointing to an IGW (internet gateway)
  • The internet gateway thats associated with the route isn't deleted.
  • The internet gateway is attached to the VPC
  • The security group that's attached to the instance’s elastic network interface has the required rules to allow access
  • The network access control list (network ACL) that is associated with the instance's subnet has rules allowing both outbound and inbound traffic to the internet.

On a side note - Is there a reason you want to use the default VPC? I'd highly encourage to move away from default VPC as it's not recommended and is a bad practice to use mainly for security reasons.

profile pictureAWS
專家
已回答 2 年前
profile pictureAWS
專家
已審閱 2 年前
  • Hello, I have created my own VPC with one subnet and created Internet Gateway and attach VPC to it. After creating, Internet Gateway I created Route table and in that, I have added subnet in subnet association, also add 0.0.0.0/0 with internet gateway in edit routes. In Network ACLs, there are two inbound rules and two outbound rules that is default. After that, I created EC2 instance and selected that VPC and created new security group with HTTP, HTTPS, SSH, RDP all ports are opened. But when I copied Public IPv4 address and opened in browser it display's site can't be reached.

0

Is it possible that you added a private subnet to the default VPC and created the EC2 machine in your private subnet?

profile pictureAWS
專家
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南