I have a Synology router and 2 Internet connections (one with Starlink and the other with Proximus). Thanks to the option on the Synology router, I automatically switch from one Internet connection to the other if one or the other is no longer available.
The problem is that my Proximus connection is a very small connection with a limited quota, and I want to stay as much as possible on the Starlink connection, which is unlimited, but how do I know when I'm switching from one to the other? I find myself unknowingly on Proximus for days and nights at the risk of running out of my quota.
So I created a little tool that installs on Synology (with the .Net Core 6.0 package installed) and sends me an email when it detects that I'm on another Internet IP address! So the balancing is done without my knowledge! Very handy!
Here's how it works:
2024-02-04 17:52:24.8188 INFO DetectChangeIp.Program Previous IP found: '0.0.0.0' loaded. 2024-02-04 17:52:26.9158 INFO DetectChangeIp.Program Detecting new change of Ip Address : 245.xxx.xxx.xxx - SPACEX-STARLINK
2024-02-04 17:55:26.9158 INFO DetectChangeIp.Program Detecting new change of Ip Address : 114.xxx.xxx.xxx - Proximus NV
There is a Windows version if you don't have a Synology NAS, and a Linux version.
On Synology
You can run the LINUX version on Synology via a startup task
1) Make sure the ".Net 6" package is installed on your Synology.
2) Download the Linux version of the application and copy all the files to a directory of your choice on your Synology (e.g. "/homes/[your synology username]/DetectChangeIp").
3) You need to set the execution permissions on the "DetectChangeIp" file, you can do this in "File Station" by right-clicking on the file, then "Properties" under the "Permission" tab, check all the boxes (or do it viat ssh with the command "chmod +rwx DetectChangeIp")
4) On your Synology, open the "Control Panel" then "Task Scheduler".
5) Create a new "triggered" task, a window will open, select "Startup" next to "Event", it will launch the DetectChangeIp app as soon as Synology starts up
6) Under the "Task settings" tab, note the path where the "DetectChangeIp" file is located, for example: /volume1/homes/[your synology username]/DetectChangeIp/DetectChangeIp
That's it! For the 1st time, execute the task yourself manually using the "Execute" button. You can see the logs if the app is running correctly using the "Action" > "Display results" button.
As a 'Service' on Windows
1) Make sure you have the .Net Core 6.0 runtime.
2) To install a console app as a service, use nssm: https://nssm.cc/download
3) Copy the nssm file to C:\Windows\System32
4) Download the Windows version of DetectChangeIp and copy it into one of your directories
5) Open a prompt command and type: nssm install DetectChangeIpService "C:\chemin\vers\DetectChangeIp.exe".
Now, if you want to stop your service, you can type: nssm stop DetectChangeIpService
* nssm restart DetectChangeIpService
* nssm remove DetectChangeIpService confirm
Download
For Windows: DetectChangeIp_Windows.zip
For Linux or Synology: DetectChangeIp_Linux-X64.zip
Please note that for Windows or Linux (and Synology) you must first install the .Net 6 Runtime (https://dotnet.microsoft.com/en-us/download/dotnet/6.0).