Giter VIP home page Giter VIP logo

synology-vpn-reconnect's Introduction

Archived! I recommend looking at Gluetun if you are able to run Docker. It does a much better job at handling a VPN.

Synology VPN Reconnect Script

I noticed my VPN sometimes stopped responding (403 errors outbound, etc). So I made a 'simple' bash script. This script is tested on DSM 6.0.2-8451 Update 4 in combination with the OpenVPN protocol, but should also work on DSM 6.1+.

This script works fine with sudo-enabled users (admin by default) from the command line, but will you will need to set the user to 'root' when running as scheduled task (see step 5 of the installation) since sudo requires you to re-enter your password on every run!

Instructions and changelog

See detailed instructions in the wiki

Issues or improvements?

Got an issue with this script and the wiki doesn't contain the required information to solve your problem? Please create a new issue report.

Since I'm new to Bash scripting you might locate some possible improvements. If you do, please don't hesitate to create an issue and/or create a pull-request.

synology-vpn-reconnect's People

Contributors

dcr-nl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cake654326 dotdd

synology-vpn-reconnect's Issues

Telegram notification

Any chance you could add telegram api as a notification to your script? The log file is handy, but one still need to login in DSM to see the logs. Some kind of notification e.g. Telegram could help to quicker respond and spot VPN connection problems.

Thanks for the great script!

Scripted stopped working (unknown reason)

Hi,

I have been using your script for some time now. It has worked flawlessly since the beginning but the last week (or two) it would not reconnect my openvpn connection to PIA. Reconnecting from the control panel of my Synology DS215+ works however.

Has something changed in the way Synology treats vpn connections? Is there some modification I can perform on the script to make it work again (scripting skills are close to zero ;))?

Looking foward!

Regards,

Sjonnie

Last part of the log file:
`'kill client ...OK
get arguemnt protocol: openvpn
get arguemnt name: PIA_OpenVPN
Reconnect [PIA_OpenVPN] ... failed
Retry(1)...failed
[INFO] VPN check: End
[INFO] VPN check: Start [2018-07-17 10:04:24 +02]
[INFO] VPN check: Running with user with sufficient privileges
[INFO] VPN check: Interface tun0 is up
[WARN] VPN check: Skipping IP check; no domain defined
[INFO] VPN check: VPN not allowed to connect to URL: https://www.cnbc.com/
[INFO] VPN check: VPN not allowed to connect to URL: https://www.nbc.com/
[INFO] VPN check: VPN not allowed to connect to URL: https://tweakers.net/
[WARN] VPN check: VPN needs to be reconnected. Cause: "Not allowed to connect to any of the specified URLs"

kill client ...OK`'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.