How to connect to a node behind NAT?

#1

Hi,

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?

Thanks

Jeff

#2

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 (https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#autorelay). 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
#3

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.

thanks

#4

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.