The automatic reconnection of VPN profile on Synology NAS has failed

Een reactie plaatsen

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? :

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:

cat /usr/syno/etc/synovpnclient/l2tp/l2tpclient.conf

* 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

touch /usr/l2tpVPNreconnect
chmod +x /usr/l2tpVPNreconnect
vi /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
exit 0

* 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.

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen. logo

Je reageert onder je account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )


Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s

Deze site gebruikt Akismet om spam te bestrijden. Ontdek hoe de data van je reactie verwerkt wordt.


oktober 2016

Blog Stats

  • 228.387 hits
%d bloggers liken dit: