64

The geth CLI options suggest that per default the client listens on TCP port 30303. This page, additionally suggests that UDP port 30301 is used for node discovery.

Is this all that is required or are there any additional ports in use?

1 Answer 1

68

Ethereum clients use a listener (TCP) port and a discovery (UDP) port, both on 30303 by default.

If you need to run JSON-RPC, you'll also need TCP port 8545. Note that JSON-RPC port should not be opened to the outside world, because from there you can do admin operations.

All client's ports can be customized from the default.

If you want geth/eth to find UPnP, you'll also want that enabled on your router. That's just so it can listen on a port, not necessary if you've already manually opened/routed them.

About the wiki page you linked, it reports actually just an example:

If the TCP and UDP (discovery) ports differ, the UDP port is specified as query parameter discport.

In the following example, the node URL describes a node with IP address 10.3.58.6, TCP listening port 30303 and UDP discovery port 30301.

I think this misunderstanding is spreading also because of the behavior of the bootnode util. In fact, it uses 30301 as default UDP discovery port.

Note: geth will use IPv6 as a priority if it is available which may cause problems if you assume it is listening to the IPv4 address.

4
  • 4
    Make sure you allow outbound over TCP/30303 too. Commented Oct 18, 2016 at 5:52
  • 1
    I have both of those ports opened and yet I cannot sync. It appears that geth is attempting to connect to peers through other TCP ports. See ethereum.stackexchange.com/questions/26652/…
    – manuhalo
    Commented Sep 19, 2017 at 12:02
  • 2
    And make sure you activelly block inbount JSON-RPC (8545) etherscan.io/address/…
    – jsbueno
    Commented Dec 7, 2017 at 15:04
  • 3
    So, is TCP 30303 required to be open for INCOMMING connection when simply running the geth client? I just want to have the most current blockchain state / data on my local system, I have no interest in mining. Do I still have to open 30303 for incomming traffic?
    – omni
    Commented Nov 22, 2020 at 17:59

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.