1

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?

  • What does admin.nodeInfo returns when geth cannot connect to another instance? Check if it has resolved your ip. My guess is geth is not able to resolve your ip. You can set your external ip with a geth option --nat extip:<ipaddress>. – Ismael Nov 14 '17 at 3:20
  • admin.nodeInfo returns ip: "::", listenAddr: "[::]:30303" – islandBilly Nov 14 '17 at 16:01
  • admin.nodeInfo returns ip: "::", listenAddr: "[::]:30303" whether I use that nat option or not. There is a display that says "...network port tcp:30303 could not be mapped: no UPnP or NAT-PMP router discovered" when I don't use that nat option. Then when I do use it, I get "... mapped network port tcp:30303 -> 30303 (ethereum p2p) using ExtIP(73.61.21.157)" but still no connection to my other private network node. But why can geth connect and sync with the test or main nets? – islandBilly Nov 14 '17 at 16:15
  • Mainnet works because it connects to a set of predefined nodes that are listenings for new connections. It appears you do not get your own external ip but all clients in an xfinitywifi node are sharing the same ip. Sorry, but I don't know about xfinitywifi to help you there. – Ismael Nov 14 '17 at 16:51
0

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.

  • Since I am usually connecting away from home, I'm using xfinitywifi and have no control over the router, but port forwarding is not necessary for the node to connect on the main or test nets via discovery. Could it be that I should set up a bootnode for my private network? – islandBilly Nov 12 '17 at 17:05
  • For private network, you have to do port forward else if your ping your public IP it won't forward the request to the desired machine. – Karthikeyan Thangavel Nov 13 '17 at 2:56
0

Well, it looks like the answer lies in the xfinitywifi router settings (which of course I can't change). I can't forward the external IP to my internal one, so nobody can initiate a connection to my geth node, BUT I can initiate a connection to someone else's geth node, and it can send back responses that reach me. That is why I can connect to the ethereum mainnet or testnet. If I set up a bootnode on a server that will expose it, then I should be able to connect to my various private nodes, or rather, they can connect to it and so to each other.

0

You'll need to start a bootstrap node that others can use to find each other in your network and/or over the internet. The clean way is to configure and run a dedicated bootnode:

Hope below link is the exact solution for your need...

https://github.com/ethereum/go-ethereum/wiki/Private-network

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.