3

I'm trying to understand the peer discovery process, especially for a private network with majority of the nodes having dynamic IP addresses and behind typical wifi router firewall. If I run a Geth node with --nodiscovery flag, the node will only call out/connect to other peers, not accept calls from peers, correct? Isn't my firewall already doing that? And those peers my node calls out to must have port 30303 open, and they must be in discovery mode, correct? If my node is in NOdiscovery mode, I need a bootnode list or manually add (via file or CLI) static nodes in a private network, correct? Basically, if a new private network was created, some of the nodes would have to be in discovery mode and/or have port 30303 open on the WAN side, or the network would fail, correct? And does a private network have to supply a bootnode list everytime I restart Geth?

9
  • study this question" ethereum.stackexchange.com/questions/29029/…
    – Nulik
    Commented Nov 19, 2017 at 15:53
  • I found this dissection of ping pong ocalog.com/post/10 but I still don't really understand the nodiscovery option. Does it set the node so it ignores all PINGs? Commented Nov 20, 2017 at 6:01
  • no exactly. --no-discovery tells your node to stop PINGing other nodes. But if your node was discovered by other nodes. they will save your IP in the database, and they will PING your node and it will respond with a PONG. After PONG they will try to connect but connection won't succeed since the blockchain's genesis block is different. These nodes will ping you forever generating traffic. Use tcpdump and verbosity.debug=6 to see what happens at networking layer.
    – Nulik
    Commented Nov 20, 2017 at 21:34
  • This is very odd. I am yet to use tcpdump or wireshark. I have a private PoA network setup inside my LAN. 7 nodes, and 1 bootnode. They all sync up and work fine, but I never turned up the verbosity to 4. While my private network was running, I released renewed my WAN IP address, but even then I still got random connections trying to handshake with my private network. Maybe I don't understand firewalls or UDP completely, but I thought my router firewall blocked all incoming PINGs. It seems more like my nodes are trying to call out. But I haven't done tcpdump yet Commented Nov 26, 2017 at 9:43
  • if you ever run geth from your net to connect to Ethereum's main net, just once, for example for testing, you will pollute your IP addresses with discovery protocol, other nodes will try to connect to you.Also, your router may have UPnP enabled and your node may be discovered this way.
    – Nulik
    Commented Nov 26, 2017 at 12:12

1 Answer 1

1

The --nodiscover option works the other way. If you run geth with this option, the geth node will not search for any peer and not connect to any peer. So yes, you will need a bootnode list or add peers manually if you use the --nodiscover option. However, you need it for your node, not for the others.

As far as I know, you cannot hold back other nodes from connecting to your node, besides changing or blocking the port used for peer discovery. The default for that port is 30303, that's right, you can change it with the --port option.

To answer your question: --nodiscover is not redundant behind a firewall without port forwarding, since it achieves a different goal.

2
  • My firewall blocks all the ports, so I am holding back other nodes from connecting to my node. From the Go-Ethereum documentation "Geth continuously attempts to connect to other nodes on the network until it has peers. If you have UPnP enabled on your router or run ethereum on an Internet-facing server, it will also accept connections from other nodes" Commented Nov 20, 2017 at 5:43
  • I kinda get it now. There's been issues with folks private networks trying to connect with the mainnet, mine included. I have to use --nodiscover to prevent this. Commented Nov 27, 2017 at 9:45

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.