I'm trying to create my own chain so I have a VM which is the main node that will mine all the time, so that I don't lose the chain if all the nodes are off. I want also to make my friends able to mine and send transactions on this chain, but the problem appears when I try add a new node using admin.addPeer() and this node is on a different network from the VM network. I am able to connect two nodes if they are on the same network but I'm not able to connect two different nodes if they are on different networks. How can I achieve that? I think my problem is when I make the full URL using the enode, because I'm using the IP address of the node which is an internal IP, how can I make a full URL using external and internal IP address. Also, I don't have any access to the router, so I cannot configure it.

  • The VMs need access to each other through an IP address. If that's not possible (due to a NAT for example) then I don't think you can link them. Commented Mar 7, 2020 at 13:09
  • I cannot even connect two nodes which are running on two different computers and they are connected in two different networks. I'm only able to connect these two nodes if they are connecting to the same network.
    – Akef
    Commented Mar 8, 2020 at 13:34
  • If the nodes cannot talk to each other then you will not be able to sync them. In your case a vpn might be a solution.
    – Ismael
    Commented Mar 8, 2020 at 20:05
  • I'm using a VPN to connect to the VM, but I'm not able to connect the node which is stored on my computer with the node which is stored on the VM.
    – Akef
    Commented Mar 9, 2020 at 8:33
  • After admin.addPeer(), can you see the new node if you list them with admin.peers? If you just add a peer, admin.addPeer() will not give you an error if it's unreachable at the moment. Commented Mar 13, 2020 at 15:27

1 Answer 1


When you first start up geth, you will see on the right on some line enode://[whatever]. Copy paste the enode with the enode part down to the ip. Now replace the local ip with your external ip, then go to your other node and in the JS console, type admin.addPeer("[the enode with the externalip]").

Please delete the [ and ].

They now should be connected

  • I put the external IP but they didn't connect to each other, I think the external IP is not enough, there should be something else to distinguish the machine on the network, like port. However, I open the port using the command --port and I used a distinguish port but it didn't work also, it seems that I should configure the port on the router. Anyway, I don't have access to the router's settings.
    – Akef
    Commented Mar 16, 2020 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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