Iptables – Cannot open port 1337

amazon-amiamazon-web-servicesfirewalliptables

I am struggling with iptables firewall to open port 1337 externally.
My iptables file looks like this:

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 1337 -j ACCEPT
COMMIT
*filter
:INPUT ACCEPT [353:23420]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [246:30708]
COMMIT

Locally, I get my response. Remotely I don't.
I tried to save, stop and start iptables, but it does not fix my issue.

Best Answer

Federico is right. AWS has security groups assigned to each EC2 instance. These can be set to protocols or custom port/port ranges and set to allow your IP, custom IP or all. It'll always require a CIDR value if I recall, but if it's just you it'll tack on a /32 at the end of your IP address. Go to your main dashboard, locate the line that has your instance, and click on the security group to navigate to it.

If this doesn't work please provide a traceroute.

Example of what a security group (not yours per-se) looks like: here's a so-so example of what a security group looks like