0
votes

My application is working fine on the Amazon EC2 Windows Server. But when I am trying to access the same through the elastic public IP, it is not accessible. I have seen the inbound configurations and the ports(HTTP,HTTPS,SSH) are enabled. Infact, I added a rule to All Traffic from Anywhere. But no success.

Firewall ports are open in host server. The URL is accessible from private IP from other EC2 machines in same network

http://3.45.54.89:8080/My-App/ ----> Public IP- Not Working

http://10.0.2.23:8080/My-App/ ----> Private IP - Working

Please guide. Stuck Badly in this

1
Does the instance have a internet gateway in the route table of the instances subnet? - Chris Williams
Yes Chris. There is an internet gateway attached - Ranjith

1 Answers

1
votes

The fact that you can access the port from within the network points out that you indeed have a rule somewhere in the VPC that is blocking the connection from outside the network.

Here are the components you need to access a resource inside a VPC from outside the VPC:

  1. Internet Gateway: This is the entry point into the VPC. Seems like this is already working as expected as you can access the instance in the first place.
  2. (optionally) Bastion host: If the resource you are trying to connect to is in a private subnet you need a bastion host in the public subnet. Read more about it here.
  3. NACL: If you have not changed the defaults, this should allow the requests to flow through. Note that NACL are stateless i.e. you need to allow both inbound and outbound.
  4. Security Group: As the final layer, the security group should allow the traffic on the ports, to the appropriate cidr block.

Based on the scenario you have described, my guess is that your instance is in a private subnet. If it is, then you need to route the requests through something in the public subnet.