-
Notifications
You must be signed in to change notification settings - Fork 957
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
AutoNAT: how to handle non-global IP addresses? #2514
Comments
On the initial PR for AutoNAT we had a discussion about whether to filter out non-global IP-Addresses or not (#2262 (comment)). Initially we had it as well, but the complexity of the filter logic triggered a discussion about whether it is necessary at all in the first place. I was in favor of also considering non-public IP-Addresses for probes, because of:
Admittedly that's probably a very rare case, and your issue happens much more often.There was also the same discussion in go-autonat and they decided to filter out non-global IP-Addreses as well: libp2p/go-libp2p-autonat#60.
Otherwise I can create a PR for this, but not sure when that will be.
👍 Good idea. What do you think @mxinden? |
While I haven’t yet had the time to fully understand AutoNAT, I can add a data point: private networks with an “interesting” structure are quite common in the environments where we deploy libp2p-based applications (which is in factories, on the shop floor). We try to push people towards end-to-end connectivity at least within a factory site, but that’s not always successful. |
|
👍 for a config flag filtering out non-global IP addresses by default.
Agreed. Good call out. Contributions are most welcome. Also I am happy to do it as a follow-up to the rust-libp2p patch.
Just to confirm, with a config flag your use-case would be covered as well, right? @rkuhn?
Let us know if you need any help, e.g. via a draft pull request. |
As I said, I was just providing a data point — I should probably add that IT security requirements tend to contain a growing portion of “security theatre” and cargo cult, which lead to NAT because people confuse “firewall” with “address translation”. A config option would solve the libp2p part, but it adds the ongoing maintenance cost of more tests and PR discipline, to keep the less commonly used setting working. I can’t decide whether it’ll be an overall win in the grand scheme of things :-) |
Currently, AutoNAT seems to consider private IP addresses as possible external addresses when two peers run in the same private network. In my case, this is one computer where I run multiple instances of my code, but it is conceivable that the same happens when separate machines run in the same private network (i.e. behind the same router or within some corporate network).
I don't really know which behavior would be most appropriate. My initial guess is that non-public IP-Adresses (i.e. those for which
Ipv4Addr::is_global()
orIpv6Addr::is_global()
returnsfalse
) should not be considered as candidates for probes, but I don't know yet whether there are use cases where private IP addresses are valid external addresses (is multi-layered NAT a thing?).If people see this as a valid concern, it should probably be communicated to the libp2p AutoNAT spec team for inclusion in the spec.
The text was updated successfully, but these errors were encountered: