1

I've started three Ethereum nodes using Geth, and they happen to be on the same node. I've specified the ports (30401, 30402, 30403) and used the --nodiscover options.

On each of the nodes, I've added the peers using the enodes (using static-nodes.json) using the external IPs:

enode1@18.222.108.246:30401
enode2@18.222.108.246:30402
enode2@18.222.108.246:30403

However, when I attach into the console and observe the peers, I notice that the port number has changed in the enode specification. Also, the local addresses are correct, the remote address have port numbers changed.

enode://enode2@18.222.108.246:30402
    network: {
      inbound: true,
      localAddress: "192.168.144.4:52594",
      remoteAddress: "18.222.108.246:30402",
      static: false,
      trusted: false
    },

enode://enode1@18.222.106.246:46636
    network: {
      inbound: true,
      localAddress: "192.168.144.4:30401",
      remoteAddress: "18.222.108.246:46636",
      static: false,
      trusted: false
    },

Does anyone know why the remote port numbers are different? Are the local and remote addresses two ends of a TCP connection?

closed as off-topic by Ismael, Briomkez, flygoing, shane, Rosco Kalis Feb 6 at 10:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Ethereum, the decentralized application platform and smart contract enabled blockchain, within the scope defined in the help center." – Ismael, Briomkez, flygoing, shane, Rosco Kalis
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    It is the nature how IP (internet protocol) works. When you connect to a remote server an unused random local port is assigned to the connection, so the remote server will send their replies to the local port. – Ismael Feb 4 at 7:25

Browse other questions tagged or ask your own question.