Static IP on "base" LAN - Dynamic IP elsewhere

It would be fantastic should the ability to set a static IP on say a notebook, laptop or a mobile device when one is at base LAN - while being capable of switching to a dynamic IP when elsewhere.

By base LAN I am referring to a network you are often connected to such as your home locality.

elsewhere - well - is elsewhere… LTE, public hotspots, friends or family networks etc.

The way this could be implemented would be by using the self-check that the global discovery already seems to do (correct me if I am mistaken) to find the IP of the network you are currently on. If it matches a preset “base” IP it switches to home lan with static IP’s. The standard mode would be the global discovery and only if detected on a home network switched to the preset static IP.

Potentially the ability to add more “base LAN’s” so that one can have a network at work, home and educational institution etc.

I would love to code this feature myself but I am only just learning to program - but it seems to me that this should be fully possible to implement and at that a rather useful feature :slight_smile:

It would - again correct my lack of understanding if I am wrong - negate the need for open ports in the router, allow users to use hardcoded local firewalls and increase the speed of discovery along with being less dependent on a 3rd party service to the network.

Possibly this could be a feature one could switch on and off. Or possibly even a plugin if you have plans to make syncthing modular.

Hope this can be used for something or at least inspire!

Cheers,

You could probably get very close to this by adding multiple addresses for the device, i.e. 192.168.0.46, 10.0.2.3, dynamic. The addresses will be attempted in order, with “dynamic” meaning local or global discovery.

Not sure how any of this affects the need for open ports etc though.

Yeah I think this is already in place and defined by the order of addresses.

Huh - it certainly seems that this is already implemented. Different than what I had in mind yet in a way smarter: Simpler. :slight_smile: Then the issue is if this becomes a common tool at it becomes to crowded at given networks… But thats an issue for the future :smile:

Thanks,

I don’t see how the size of the network could affect this.

The more users there are the larger the chance of the static IP being taken on a foreign network, with the given port open on syncthing. Albeit a bit far out. Forgive me :slight_smile: I am quite a beginner at this networking…!

That’s irrelevant, as we would disconnect from the user if we realize that he has a different device id, and try the next address.

Ah 'ight, of course.