How to correctly set up discovery/NAT for static IPs?

Hey there. I’m still trying to wrap my head around global and local discovery while trying to set up Syncthing on a VPS.

Here are the facts:

  • I have a VPS running on some server, somewhere
  • Said VPS is globally accessible via IPv4 and IPv6 address
  • Said VPS has port 22000 open, and Syncthing is accessible via this port
  • Said VPS does not have any other peers on its local network; I only rent one VPS from the provider
  • Said VPS is not behind NAT; the IP addresses are expected to stay static, forever

Given all that, do I understand it correctly, that:

  1. I don’t need global discovery, because I can just specify the IP addresses of this node on my other devices? But I guess it’s still useful to have it turned on, just so that I don’t have to type those addresses by hand :slight_smile:
  2. I don’t need local discovery, because there is simply nothing to discover, as my VPS is “alone” on its network? Isn’t local discovery just a waste of CPU power, in this case? Should I turn it off?
  3. I don’t need NAT-PMP/UPnP, because the IP addresses are static.

Are these theses correct? Or, to phrase the questions I have differently, is there a recommended Syncthing setup for globally accessible remote servers?

Sorry if this is a noob question (I couldn’t find much on the forum) and thanks in advance :slight_smile:

Depends on what other devices you want the VPS to be connected with. If these are similar VPS’es, then statements 1, 2 and 3 are correct.

If your other clients have dynamic IPs, and/or are behind NAT, the statements 1,2 and 3 are still correct, if outbound connections from these clients to the VPS are sufficient (once connected, sync will go both ways obviously).

If you want clients with dynamic IPs to be (inbound) connectible from the VPS, then enable global discovery. If these clients are behind NAT then NAT-PMP/UPnP will help opening a port and making the client reachable.

If you need to use relaying, either configure a static relay on either side or turn on global discovery.

You’re right that with a VPS on a static public IP, you can usually skip local discovery and NAT-PMP/UPnP. Global discovery isn’t strictly necessary if you hardcode the address, but it can still be handy for dynamic peers or if you don’t want to maintain address lists manually. Relays only matter if one side can’t make a direct connection.