go-libp2p-kad-dht icon indicating copy to clipboard operation
go-libp2p-kad-dht copied to clipboard

LAN DHT contains peers that really don't belong

Open Stebalien opened this issue 5 years ago • 2 comments

Node in question (mars):

/ip4/104.131.131.82/tcp/4001
/ip4/104.131.131.82/udp/4001/quic
/ip4/127.0.0.1/tcp/4001
/ip4/127.0.0.1/udp/4001/quic

Node in LAN DHT (FRA gateway)

{
	"ID": "QmbUa4f2y1yqAwFBPS61A818xFoqVAPbbJPXti5wjV3Tdd",
	"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDP6cvd8whA2YsYk0cScwrN1WZkN3Wq+kRpnYusLsknytBQ/+GoYj16YKFI8TN+htRnpVX1rqyPhDTiZadr3mRdtpuZmORtQzxq257/8ptToBuHxSXevWZQSHdoxNunKtIbIgGlCJW6EQXSlYTcyOBgiZL/Elyw1/JBoeMq8sZP7b3GT3VEk8wjiBbwNVVFaVOK9fwVBbxiYW8zW0Y0pJ6LcNl3WZPXlj4sGhdpU6T0j7iRGuY9/RFbg/4aOzV1cEQrLizq/rqYJEjlJxDC5zPDmiVbAAVcXT9HDdk3R+SAzAlQnQp3pYfGJgH02CDTBMyCUbzVr9m+TPLPqlt5efWtAgMBAAE=",
	"Addresses": [
		"/ip4/136.144.49.67/tcp/4001",
		"/ip6/2604:1380:40b0:c00::1/udp/4001/quic",
		"/ip4/136.144.49.67/tcp/4002/ws",
		"/ip4/136.144.49.67/udp/4001/quic",
		"/ip6/2604:1380:40b0:c00::1/tcp/4002/ws",
		"/ip6/2604:1380:40b0:c00::1/tcp/4001"
	],
	"AgentVersion": "go-ipfs/0.6.0-dev/f346f1a",
	"ProtocolVersion": "ipfs/0.1.0"
}

These nodes are on different subnets but we're classifying them as if they're on the same LAN for some reason.

Stebalien avatar May 13 '20 23:05 Stebalien

I could imagine either that there's some odd OS thing where when you ask for the route to the 136. IP, you could imagine a routing setup potentially where the local machine doesn't know it's default gateway in a way that it doesn't fill it in. That would probably be a bug.

It may also be a logic issue in the fact that the local node doesn't have a v6 address, so when asking "what's your route to this v6 address" the routing answer of "no route" is interpreted as "no gateway" which might classify it as "lan"

willscott avatar May 14 '20 20:05 willscott

The machine does have an IPv6 addr, it's just not advertised. I tried checking ip route get and I got a gateway for both.

Note, this is a freebsd machine if that helps? I realize there is little to go on.

It's also a bootstrapper so it's getting a lot of connections.

Stebalien avatar May 14 '20 22:05 Stebalien