I am trying to setup a private network and trying to connect peers. Currently I'm trying it on my laptop and virtual machine(VM) runing on the same laptop (both of them are connected to internet). I init genesis file on my VM, start geth. Then init my genesis file on laptop(same copy of file), start geth.

With help of admin.addPeer("enode://....@[ip]:30303") i add peers on both machines.

admin.peersCount returns 0


1 Answer 1


The main way to create a private network is to :

  1. Create a bootnode
  2. Run geth with --bootnodes "< bootnode enode URL>" On both VM and PM.
  3. You can check if your peers are added automatically, or add them manually using admin.addPeer()

If this fails to make nodes connect, it is probably a network problem and you will need to diagnose that yourself (probably your VM and laptop don't share a local network that differentiates between them, internet doesn't since they both have the same gateway external IP).

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.