How to connect to a node behind NAT?



I have several nodes behind NAT. How do I connect to these nodes from other network? I know I can connect using “ipfs swarm connect “multiaddress” “, what address I shall use to connect them?




Ideally, your NAT would support Upnp or something like that (some kind of port-mapping API). However, if it doesn’t, you can enable the experimental AutoRelay feature ( After an initial delay on start, this will automatically detect that your node is unreachable (behind a NAT) and connect to one of our relays.

1 Like

my understanding is autorelay is done by ipfs itself. my question is how do I explicitly connect to a node behind NAT? using “ipfs swarm connect”.

my use case is, I want to save a list of connected nodes and connect to them explicitly next time instead of waiting ipfs discover them.



Did you find a solution then? I’m trying to solve a similar problem, but can’t figure out what to pass to the “ipfs swarm connect” command.