-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipfs id
show non-exist addresses
#5411
Comments
I'm pretty sure this is intended behavior so that your node can find peers on the local network. If you want to disable this behavior, you might want to look at the server profile option: using either |
So, the Note: the (closing as a duplicate) |
I might miss something important. The network is NATed, the public address is NOT on my computer, so |
If it's NATed, you may have multiple addresses:
You'll see (1) because that's the address your machine knows about (by default). You may see (2) because we use ask the router to open a port for us and forward it to (1). If this succeeds, we'll add this address and port to your known addresses. |
As I mentioned in my first post, I see 4 addresses with public IPs. Two of them are created because of NAT, the other two are the so-called "OwnObservedAddrs". They have right port numbers but wrong IP addresses, so I'm wondering if this is intended or a bug. |
The wrong IPs? I see public |
Note: You are correct, we also record addresses other peers see us using. One of those random ports is probably the bug I mentioned but the others are likely ports other peers have recently observed us using. Basically, we locally pick a consistent source port (using reuseport) for all outbound connections. When this happens, some NATs (I've been told), will map this to a consistent external port (and, depending on the firewall configuration, may allow incoming traffic). (we do need to get better about when to keep these observed addresses as we're currently pretty liberal) |
I should have posted the original logs earlier :)
And
The question is, where
these two addresses come from. |
Ah, I see. Yeah, that's interesting. |
Turns out the 4001 port mapping is created when my node tried to connect to an outside node, so is observed by peers. I add a patch to handle this situation better: libp2p/go-libp2p#411. |
Version information:
go-ipfs version: 0.4.18-dev-
Repo version: 7
System version: amd64/darwin
Golang version: go1.11
Type:
bug or intended?
Description:
Say
192.168.x.x
is my internal IP,xx.xx.xx.xx
is my public IP,QmXXXXXX
is my ipfs node ID.When run
ipfs id
, I observed addresses likeAmong them, two addresses are generated because of NAT, but the other two, are actually bound to my internal IP,
192.168.x.x:4001
and192.168.x.x:50119
, not the public IP.I'd like to know if this is the intended behavior. A short explanation would be welcomed.
The text was updated successfully, but these errors were encountered: