twardakm / synology-ddns-vpn

How to configure Synology with DDNS and VPN
36 stars 2 forks source link

Alternate Approach #2

Open C2BB opened 1 year ago

C2BB commented 1 year ago

Figured I'd share an alternate approach; if your using OpenVPN you can modify the OVPN file and add the routes there using the name, I do this for plex as well:

route plex.tv 255.255.255.255 192.168.50.1 route app.plex.tv 255.255.255.255 192.168.50.1 route my.plexapp.com 255.255.255.255 192.168.50.1 route myplex.tv 255.255.255.255 192.168.50.1 route synology.me 255.255.255.255 192.168.50.1 route ddns.synology.com 255.255.255.255 192.168.50.1 route checkip.digitalocean.synology.com 255.255.255.255 192.168.50.1

sfreek76 commented 11 months ago

Hi do you mind to help me out a little and tell me where to put the route in my .ovpn-file? Many thanks in advance!

EDIT: OK; this does not seem to work either, still got DNS Problem

Flop2691 commented 8 months ago

Hi, thanks for the tip with the "route" instruction, the DDNS + OVPN combination works perfectly now! A few domain names concerning me were missing for everything to work perfectly. Otherwise, my NAS regularly associated DDNS with my VPN's IP address (it was random, about every other time) and it updated like 15 times a day. Since I added the missing domain names, my NAS only associates the IP address (the correct one) with DDNS once a day. No need for a static route anymore!

Here is the content of my .ovpn file:

route account.synology.com 255.255.255.255 192.168.1.1
route ddns.synology.com 255.255.255.255 192.168.1.1
route checkip.synology.com 255.255.255.255 192.168.1.1
route checkip.dyndns.org 255.255.255.255 192.168.1.1
route checkipv6.synology.com 255.255.255.255 192.168.1.1

I used this Synology help page to determine the domain names to add (the DDNS and External IP Analyzer part): https://kb.synology.com/en-global/DSM/tutorial/What_websites_does_Synology_NAS_connect_to_when_running_services_or_updating_software

@sfreek76 Regarding the location of these instructions, I'm at NordVPN and personally I added them just after the "remote-cert-tls server" instruction, but I don't know if the location is really important.

Thanks to @twardakm and @C2BB for giving me all this information. After several months of partial unavailability of my NAS, my NAS is finally fully reachable at any time!

Suzaru commented 8 months ago

Hi, thanks for the tip with the "route" instruction, the DDNS + OVPN combination works perfectly now! A few domain names concerning me were missing for everything to work perfectly. Otherwise, my NAS regularly associated DDNS with my VPN's IP address (it was random, about every other time) and it updated like 15 times a day. Since I added the missing domain names, my NAS only associates the IP address (the correct one) with DDNS once a day. No need for a static route anymore!

Here is the content of my .ovpn file:

route account.synology.com 255.255.255.255 192.168.1.1
route ddns.synology.com 255.255.255.255 192.168.1.1
route checkip.synology.com 255.255.255.255 192.168.1.1
route checkip.dyndns.org 255.255.255.255 192.168.1.1
route checkipv6.synology.com 255.255.255.255 192.168.1.1

I used this Synology help page to determine the domain names to add (the DDNS and External IP Analyzer part): https://kb.synology.com/en-global/DSM/tutorial/What_websites_does_Synology_NAS_connect_to_when_running_services_or_updating_software

@sfreek76 Regarding the location of these instructions, I'm at NordVPN and personally I added them just after the "remote-cert-tls server" instruction, but I don't know if the location is really important.

Thanks to @twardakm and @C2BB for giving me all this information. After several months of partial unavailability of my NAS, my NAS is finally fully reachable at any time!

You are an absolute god. The Static Routes were a good start, but this is genius. Works like a charm too. I suggest for anyone trying this: Generate a usual OVPN file with your provider. Delete the VPN Profile in Synology you had until now. Import the fresh one to confirm it's working. When you got it working, delete the profile in synology again and edit in @Flop2691 s custom routes. Create a new VPN profile with these genius edits and voila. Your DDNS should now be your real IP. Absolute genius.

Edit: To confirm your DSM is indeed properly in your VPN you can use download station and "ipleak.net" (the torrent part). Add the magnet link to your download station and check the IP. Should be your VPN IP and not your actual one.

Rammz86 commented 7 months ago

This worked great! Many thanks all!!

aguyisok commented 5 months ago

@C2BB @Flop2691 ~ thx guys.. this still working great. no need to mess with anything else to get VPN going.. much appreciated.