- Newest
- Most votes
- Most comments
Hi,
I hope that I understand your issue correctly.
Theory: The public network should be used as public one, so should have InternetGateway. The private network should be used as private one, so should not have InternetGateway.
Now, if you setup like above, once you will put machine into public network and assign public IP you should be able to connect, of couse if you have proper SecurityGroup in-place. If you put machine into private network, even if you assign public IP it won't be accessible due missing InternetGateway in that network. NAT gateway is only for outgoing connection, should be placed into public network and then allow machines from private network to reach internet (if proper routing is done). Anyway NAT Gateway is for outgoing connection only, you won't reach any machine from outside using NAT Gateway.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html
Thanks,
Hi David
Website on which EC2? Public - check security groups- that allow http traffic. Private thru Public - may require little magic with reverseproxy on Public one
Thanks,
Hi Marcin,
54.1**.2**.7* i use this thing to open ec2. I've checked my SG, I didn't touch the outbound rules. Inbound rules, i choose all trafic and http can connect from anywhere.
Ensure your security groups allow correct ports or http and https to your ec2.
Hi David,
So one by one: Check that http service is up, in LISTEN mode on EC2 level:
ss -l | grep -e http
you can check it also using on EC2 level:
curl http://127.0.0.1
and see that this connect.
If doesn't run, you need to start http server.
Then check that SecurityGroup is really connected to the specific EC2. Ensure that you have not blocked traffic by NACL by mistake on VPC level.
Thanks
Relevant content
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago
Thank you so much for your support. I'm sorry for my missing information. I opened the EC2 with attached to Public subnet and using InternetGateway. For public subnet, I've already assigned the enable auto-assign public IPv4 address. For the EC2 attached with private subnet, I will use EC2 public to call it. I can connect both by SSH but open the website doesn't work. So, I guess EC2 are healthy at this time.