-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 doesn't work in ipfs when using swarm key #7067
Comments
With swarm key:
Without swarm key:
|
Note: QUIC does not work with private networks at the moment. |
Which version worked? |
Both the experiments are on the same version. Its the latest version. I updated using homebrew. I was able to bind to /ip4/106.51.29.204/tcp/21683 without the swarm key. But with the swarm key, it was not able to bind to this address. QUIC I just enabled to check if it makes any difference. Without the swarm key, its able to bind using TCP. So I am guessing this shouldn't make a difference? |
You said you upgraded from a previous version and it worked there, that's why I asked. Did this not work before? |
No.. sorry for the confusion... It was not working in the older version (v0.4.21) also. I tried updating to see if the latest version (v0.4.23) has this fixed. But no luck. Before the lockdown, we did not have too many problems connecting while working together. Since the lockdown; the true power of P2P is being tested. Now we are not able to directly connect to each other. We have to work around this by using a relay. But then, we don't want other nodes to use their bandwidth for transfers ideally. Since filing this bug, I just tried cloning the master and building from scratch. And that seems to work as expected. I can see NAT traversal happening. Not sure if the autonat_svc has some fixes which might have solved this. |
A quick fix would be a static forwarding of a port to a private network IP and adding the public IP or a DynDNS hostname with the static forwarding port to the bootstrap-list. :) |
The autonat service does have some fixes, but I don't actually think that's related. We discover the external address through a different mechanism (observed addresses sent back in the "identify" handshake). AutoNAT is just used to determine if your node can actually be reached at one of your guessed addresses. Note: It could also have to do with how many nodes you have running. We require that three peers observe the same external address before we start advertising it. |
@Stebalien I think that's the problem. We don't have enough bootstrap nodes it seems! The problem goes away when we bootstrap with IPFS bootstrap addresses. With the swarm key, as we don't connect to the bootstrap peers, we just don't have enough peers. That's why we are not able to see the address. I could not find this in the documentation anywhere. I was not completely aware of how this works. One thing I have observed is the EnableAutoNATService enabled/disabled doesn't really affect the behavior? Maybe a good time to clarify the use of this config param. Closing the issue |
Yep: libp2p/go-libp2p#559 |
@Stebalien so after setting up more bootstrap nodes, I was able to get my node to advertise the public IP. But I am still not able to connect with other peers directly. My home router shows its public IP as 10.243... This means there is another level of NAT between me and my service provider. Even after setting up port forwarding rules in my router, I have the same result. Been reading about this, and it seems ipfs has still not solved this problem completely? I am able to connect using the alternative, which is p2p-circuit, but this is not the ideal solution for us. Is there anything else I can try to make this work? My config doesn't have the websocket listener. Will the ws transport in libp2p help solve this? I want to use go-ipfs and not the js version. I am living in India... The extra level of NAT seems to be a common problem here. This would be a huge blocker for us. Any help would be highly appreciated! |
Is there some kind of doc for this? Or even example project? |
Correct. The ideal solution would be for ISPs to not do that but that's harder. However, you might be able to convince your ISP to give you a public address, or convince them to forward a port for you. However, that depends on your ISP. Alternatively, IPv6 may work (if supported by your ISP). You may be able to open a port in your router for IPv6. Our current port-forwarding protocols don't support ipv6 but a contributor has been working on that (libp2p/go-nat#17). We've been slowly working towards a middle-ground where one would use a relay to setup the connection then switch to a direct connection. However, we have a ways to go there. For example, our relay transport really doesn't scale well.
Unfortunately, it won't help. |
I'm using go-ipfs version: 0.6.0 (ipfs.exe version). When I start ipfs daemon, I can see the list addresses along with quic addresses too. But when I add my swarm.key for private connection and then run the ipfs daemon, I don't find the quic addresses listening. In version 0.5.0 then mentioned that QUIC still doesn't work with private networks. But in version 0.6.0, I didn't find any particular details if it fixed or still the same as version 0.5.0. Can you please clarify on this? Thank you |
Our QUIC transport does not currently support private networks, and will be disabled when private networks are enabled. A change to this will be noted in the release notes when it happens. |
Version information:
config file. Enabled AutoNAT. Also enabled quic.
Description:
According to bug 6251, AutoNAT should work when using a swarm key. However, I don't see this happening.
Whereas when I don't use swarm key, I see the NAT traversal happening.
Please try to include:
-->
I was using an older version to get this feature working for p2p file sharing. I tried updating to the latest public release and still doesn't work. Let me know if you need any other information.
The text was updated successfully, but these errors were encountered: