1

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.

Security settings

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)
migu
  • 183
  • 1
  • 1
  • 6
  • I had a look at that article. There's a specific problem with the firewall on EC2 (I already know that the port is running as outlined in my question) but I have no idea how it could be fixed since all the settings are correct. I'll change the title of the question. – migu Mar 19 '17 at 00:56
  • 1
    If your local curl doesn't work it's not security groups or nacls, it's something on your instance. Look at iptables and the listening application. Use Nginx or Apache and their sample pages as something known good. – Tim Mar 19 '17 at 01:34
  • @Tim Thanks. I'm a bit lost to be honest, not experienced with Linux. I've added the `iptables` output to the question and just tried a fresh new instance, same problem. Is it a problem with the service I'm running on port 8545 (https://github.com/ethereum/go-ethereum)? – migu Mar 19 '17 at 04:43
  • @Tim I installed Apache and I can load the page so it must be the service I'm running on port 8545. – migu Mar 19 '17 at 04:53
  • @Tim The problem was indeed with the service and I managed to get it working. I'll delete this question as it doesn't really belong in this forum anymore. Thanks for your help. – migu Mar 19 '17 at 04:58
  • 1
    Sometimes it's the simplest thing. There's no need to delete the question, it might help someone else in future. – Tim Mar 19 '17 at 05:10

0 Answers0