etclabscore / core-geth

A highly configurable Go implementation of the Ethereum protocol.
https://etclabscore.github.io/core-geth
GNU Lesser General Public License v3.0
270 stars 149 forks source link

BUG: Wrong Use of local private IP(192.168.x.x) as fromIP in Ping message of Node Discovery Protocol #633

Open learnerLj opened 5 months ago

learnerLj commented 5 months ago

Our tool finds that a client CoreGeth/ETCMCgethNode/v1.12.19-stable-78c91330/windows-amd64/go1.20.7 ends node discovery Ping message whose fromIP is 192.168.x.x. But the actual public IP of it is 94.226.x.x when our tool replys Ping to it. I guess the it is the NAT or the setupPortMapping that trigger the problem.

See also,

Peer Info:

{
  "_id": {
    "$oid": "663724e98953aead4bc00ce2"
  },
  "moment": {
    "$date": "2024-05-05T06:19:21.752Z"
  },
  "ip": "192.168.0.229",
  "udp": 30305,
  "tcp": 30305,
  "id": "037adb9cbdd98c7dfee10b44ab7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "peerType": {
    "$numberLong": "2"
  },
  "clientId": "CoreGeth/ETCMCgethNode/v1.12.19-stable-78c91330/windows-amd64/go1.20.7",
  "caps": [
    {
      "name": "eth",
      "version": {
        "$numberLong": "66"
      }
    },
    {
      "name": "eth",
      "version": {
        "$numberLong": "67"
      }
    },
    {
      "name": "eth",
      "version": {
        "$numberLong": "68"
      }
    },
    {
      "name": "snap",
      "version": {
        "$numberLong": "1"
      }
    }
  ],
  "networkID": {
    "$numberLong": "1"
  },
  "genesisHash": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
  "forkID": "be46d57c/0",
  "isConnected": true
}

image