I'm new to AWS and set up an AMI instance. I then linked the instance to a "Test" security group to allow all incoming traffic.
When I'm logged in, I can see that the port is running
[ec2-user@ip-1-2-3-4 ~]$ sudo netstat -tnlp | grep :8545
tcp 0 0 127.0.0.1:8545 0.0.0.0:* LISTEN 2802/build/bin/geth
If I try to call the port from within the server using the IP that appears under IPv4 Public IP
in the EC2 dashboard, I get a Connection refused
:
[ec2-user@ip-1-2-3-4 ~]$ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":1}' http://11.222.333.444:8545
curl: (7) Failed to connect to 11.222.333.444 port 8545: Connection refused
All outbound traffic is allowed and I'm getting the same result on my local machine with the firewall disabled.
How can I open the port so I can make my second call from any machine?
Edit
I've added the iptables
output:
[ec2-user@ip-1-2-3-4 ~]$ sudo iptables -L | grep policy
Chain INPUT (policy ACCEPT)
Chain FORWARD (policy ACCEPT)
Chain OUTPUT (policy ACCEPT)