Autostart VPN server at server reboot on Debian 8

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Ammar
Posts: 3
Joined: Sat Jul 29, 2017 11:54 am

Autostart VPN server at server reboot on Debian 8

Post by Ammar » Sat Jul 29, 2017 12:00 pm

I have followed all the steps to set up the VPN server but on softether's official guide, the startup script is for RHEL OS's but after searching online, i've found the "update-rc.d vpnserver defaults". This works on Ubuntu 14.01 LTS but the VPN server doesn't start on Debian 8. Any help would be highly appreciated.


Ammar
Posts: 3
Joined: Sat Jul 29, 2017 11:54 am

Re: Autostart VPN server at server reboot on Debian 8

Post by Ammar » Sat Jul 29, 2017 9:04 pm

raafat wrote:
>
> https://www.digitalocean.com/community/ ... l-examples
Thanks for your reply but I've already tried that before posting. I couldn't understand anything about the Debian version as it's so confusing.

rclub
Posts: 2
Joined: Mon Aug 13, 2018 1:06 am

Re: Autostart VPN server at server reboot on Debian 8

Post by rclub » Mon Aug 13, 2018 1:23 am

Ammar,
I was having trouble getting vpnserver to auto start as well. A few years ago I was able to install vpnserver and worked flawlessly following instructions at: http://tomearp.blogspot.com/2013/11/set ... ether.html - but recently I updated raspbian and reinstalled latest softether and could not get the vpnserver to start automatically.

Admittedly, I am the furthest thing from a Linux expert , barely a novice - but while researching this issue I came across a site that gave instructions on how to auto start a different VPN - https://2ellsblog.wordpress.com/2016/02 ... up-script/

based on that, my solution which appears to work (can't confirm this is the 'best' way or if it will cause any issues)

- Still use the startup script detailed in Tom's Blog using the /etc/init.d/vpnserver script
- Not sure if needed, but I added a 10 second delay(sleep 10) to the script near the top between : # description: SoftEther VPN Server
sleep 10
DAEMON=/usr/local/vpnserver/vpnserver
- then open rc.local using: sudo nano /etc/rc.local
- scroll down to the bottom of the script, and just above the line exit 0 - add: /etc/init.d/vpnserver start

this worked for me...

rclub
Posts: 2
Joined: Mon Aug 13, 2018 1:06 am

Re: Autostart VPN server at server reboot on Debian 8

Post by rclub » Mon Aug 13, 2018 1:25 am

disregard my post, does not apply to debian - was for raspbian

qupfer
Posts: 198
Joined: Wed Jul 10, 2013 2:07 pm

Re: Autostart VPN server at server reboot on Debian 8

Post by qupfer » Tue Aug 14, 2018 12:48 pm

Debian 8 includes systemd? If yes, you should create a service file and enable it:

qupfer@vpn ~ % cat /etc/systemd/system/vpn.service
[Unit]
Description=SoftEther VPN Server daemon
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/vpnserver start
ExecStop=/usr/local/bin/vpnserver stop

[Install]
WantedBy=multi-user.target





and activate it with:
systemctl enable vpn.service
systemctl start vpn.service

Ammar
Posts: 3
Joined: Sat Jul 29, 2017 11:54 am

Re: Autostart VPN server at server reboot on Debian 8

Post by Ammar » Tue Aug 14, 2018 1:37 pm

Thanks for the reply. I'll try it out. Cheers!

Post Reply