[Ethereum] How to connect private nodes over the Internet

nodesprivate-blockchain

I have looked at dozens of similar questions about this, but none seems to have this particular problem. I have created a private network of three nodes on three different machines using geth1.5.5. When I take any two of them to a friend's house and connect via wifi, I can use admin.addPeer() with the sub-net address to connect them together and they sync up nicely and mine for each other, everything.

BUT when the machines are on different (xfinitywifi) routers and I try to connect with admin.addPeer() using an external IP address, they never connect. I have tried these machines with geth connecting to the mainnet and testnet and they have no trouble discovering peers there. So it's not as if xfinitywifi is blocking the nodes. The private net uses nodiscovery and they have the same networkid and genesis block – after all, they work fine on the same subnet. So what can possibly be the difference?? I use a web page to find my external IP on each machine, so I don't see how I can get that wrong. I have tried different listening ports, but again, that doesn't seem to do anything and the nodes work when on the same subnet. Anybody have any ideas?

Best Answer

In your router forward the external IP to your local geth machine IP with port 8545. For example, if your external IP is xxx.xxx.xxx.xxx forward that to your local machine IP 192.168.0.100 and port to 8545. It will allow others in public network to communicate to your device using external IP.

Related Topic