Can’t access IIS web server on public IP

amazon ec2windows-server-2012

I have a Windows Server 2012 running within the Amazon Cloud.
There, I've added the IIS web server role. Accessing the example page, and my own pages from within that server over the private IP is perfectly fine and working.

However, when I try to get to that server via the public IP from both the server and my own home computer, the connection times out.

I've tried setting the access IP for the web server to the public IP, but that did not work out either.

How can I make it possible to access the site from outside of the Amazon Cloud?

Best Answer

One funny thing about the EC2 public-routed IP addresses is that they aren't associated with the instance except via 1:1 NAT. So, traffic from an instance to its own public IP is in fact sent out to the gateway and routed back to it through NAT. The firewall rules are implemented somewhere in that process if I recall.

This also means that the server doesn't need to explicitly listen on anything but the RFC1918 address it has.

You need to set a firewall rule for the instance which allows inbound HTTP and anything else you might require.