Port forwarding and double-NAT

Hi! I’ve started using Syncthing and it’s just awesome) But there is one issue. I have home local network with two machines and a laptop at my work. All of them don’t have “white” IP address, so I have to use global discovery server (I use default one). At first try, home and work couldn’t discover each other at all. Then I made 22000 port forwarding on my router to one of my home machines and then laptop started sync with no problems. But it still doesn’t see second home machine. It’s impossible to forward same 22000 port to both machines, so I decided to set up different ports for them: home machine A has 22001 and home machine B has 22002. Router set up for port forwarding 22001 and 22002 to corresponding local IP addresses. Laptop still has 22000 port. And in this case laptop doesn’t see any of home machines again. If I change laptop port to 22001 it discovers machine A, if 22002 - machine B. But how force it to see both machines at the same time? I wish for advantage of simultaneous downloading from both nodes, not from just only one.

I use latest OS X on all 3 machines, latest version of Syncthing and Airport Extreme as a home router and a 3G modem with laptop. None of the machines has “white” IP address.

You have to make sure that syncthings listen address port matches the port being forwarded.

You can simply aet one listen address to 22000 and forward 22000, the other to 22001 and forward 22001.

Yes, it’s exactly what I did. Machine A: home, “Sync Protocol Listen Addresses” in Syncthing preferences set up to 22001, IP address is 10.0.1.11, router port forwarding set up to 22001>10.0.1.11:22001. Machine B: home, “Sync Protocol Listen Addresses” in Syncthing preferences set up to 22002, IP address is 10.0.1.12, router port forwarding set up to 22002>10.0.1.11:22002. Laptop: work, “Sync Protocol Listen Addresses” in Syncthing preferences set up to:

  1. 22000 - laptop sees no home machines
  2. 22001 - laptop sees only machine A
  3. 22002 - laptop sees only machine B

And I need laptop to see both A and B…

The listen address of the laptop has no effect which machines it sees.

Make sure global discovery is enabled on all devices, and that all devices have dynamic as one of the addresses they are available on (so that discovery would be performed), alternatively, you can hard code the public addresses of the devices with the relevant ports through the device edit modal.

Oh, you was right! Changed laptop listen address back to 22000 and after a little time it discovered both machines. There is a big latency on my work, so I think it was just a lag. Sorry for mislead, problem is solved (and actually wasn’t a Syncthing problem).