Solving networking issues with running a Base Node in the same environment as an Ethereum Node

You can use 172.17.0.1:<port> to access services on a localhost on Ubuntu. For this to work, you’ll need to ensure that the L1 is listening on address 0.0.0.0 and not 127.0.0.1

If you have done the above and it still doesn’t work you can try to debug this with telnet and netcat, example below:

# In a terminal session outside of docker, listen for TCP connections with netcat
nc -l 0.0.0.0 2222

# In a second terminal session, start geth, connect to it and install telnet
docker-compose up -d geth
docker-compose exec geth bash
apt-get update && apt-get install telnet

# Test connectivity to the external host
telnet 172.17.0.1 2222

# if it works you'll see
Trying 172.17.0.1...
Connected to 172.17.0.1.
Escape character is '^]'.

# if it doesn't work you'll see
root@5bf3a5ac38c2:/app# telnet 172.17.0.1 3333
Trying 172.17.0.1...
telnet: Unable to connect to remote host: Connection refused

If you can try using 172.17.0.1:<port> and if that doesn’t work please share the output from the telnet/netcat test.

Thanks to Danyal Prout for this answer.


@wbnns | AboutFarcasterGitHubNotionX