oktober 12, 2016 door Tim
1. Let’s use the urls above as a reference of our next steps
2. For PPTP setup reproduce every step but replace l2tp with pptp
Need openvpn? : http://der-zyklop.de/blog/the-reconnection-of-vpn-profile-onsynology-nas-has-failed
3. We need to connect to our Diskstation via SSH on Mac open Terminal and type:
ssh -l root 192.168.x.x
*replace ip with your Diskstation IP address & insert your Diskstation password
4. To find your config ID needed below, type:
* at the top of the response you should see something like [l1430610050] in this case id is: l1430610050
5. Now let’s create a new script and open it with the text-editor vi
chmod +x /usr/l2tpVPNreconnect
* vi editor has 2 modes edit/preview to switch in between them hit “a” for edit, “esc” to exit edit mode & “o” for the new line. Other useful commands are: once you hit “esc” type:
“:x!” for exit & save
“:q!” for exit without save
if ifconfig | grep -q "inet addr:10."
echo "L2TP VPN is Running"
echo conf_id=YOURCONFID > /usr/syno/etc/synovpnclient/vpnc_connecting
echo conf_name=YOUR_VPN_NAME >> /usr/syno/etc/synovpnclient/vpnc_connecting
echo proto=l2tp >> /usr/syno/etc/synovpnclient/vpnc_connecting
synovpnc reconnect --protocol=l2tp --name=YOUR_VPN_NAME
* Replace YOURCONFID and YOUR_VPN_NAME with your stuff and save the file by hitting ESC and then type : x! and hit ENTER
6. To test your script, type:
7. Now you can edit a cron manually as Nils did or use build in Task Scheduler to run your script…I gonna use task scheduler for this example.
8. Access Task Scheduler -> Go to Control Panel -> System Tab -> Task Scheduler
9. Hit Create & Select User-defined Script
10. Add the task name & in the Run Command textarea paste this:
11. Schedule Tab -> Run Daily, First run (stick next hour of your time) & Frequency every hour.