Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

unable to get openvpn to start on boot (RASBIAN)


  • Please log in to reply
5 replies to this topic

#1 K12RiV

K12RiV

  • Members
  • 67 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:11 PM

Posted 31 July 2016 - 11:24 PM

Ive spent a few weeks trying to tackle this issue on looked on-line and couldn't find any possible way to set this up.

Openvpn connects flawlessly when run manually via sudo openvpn /etc/openvpn/US\ Midwest.conf and there is absolutely no logs saved by openvpn (at least not anywhere i could find on my system). Im using the raspberry pi

client
dev tun
proto udp
remote us-midwest.privateinternetaccess.com 1198
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
tls-client
remote-cert-tls server
auth-user-pass /mnt/data/Backup/pass.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.rsa.2048.pem
ca /etc/openvpn/ca.rsa.2048.crt
disable-occ

^^^ this is the conf file  i am useing and i have edited /etc/default/openvpn and uncommented AUTOSTART="all"

checking syslog just says unable to connect but doesn't give any hint to why.
 


Edited by K12RiV, 31 July 2016 - 11:26 PM.


BC AdBot (Login to Remove)

 


#2 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,445 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:12:11 AM

Posted 02 August 2016 - 11:55 AM

Hmm... I don't have a lot of experience with openvpn... but if it works manually and not automatically, then at least you know its not the config file. Seems all you have to do is use that "AUTOSTART" line. Have you rebooted since uncommenting that line?


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#3 K12RiV

K12RiV
  • Topic Starter

  • Members
  • 67 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:11 PM

Posted 02 August 2016 - 01:44 PM

Yes it has been rebooted but there is no change it just doesn't want to connect. I have to manually connect it after every boot

#4 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,445 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:12:11 AM

Posted 02 August 2016 - 01:47 PM

Have you looked in /var/log just to see if openvpn is putting its own log file instead of going to syslog?


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#5 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,445 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:12:11 AM

Posted 02 August 2016 - 01:49 PM

You could also just run a cron job on a script to get it to run at startup. Here is an example of someone doing that. A little farther down someone shows how to get it working.


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#6 sinister_midget

sinister_midget

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:11 AM

Posted 02 August 2016 - 05:05 PM

It sounds like the startup file is running before the internet connection is ready. One way I found to get around that sort of thing is to number a script higher. For instance, if the startup file is something like "S10openvpn" than changing it to a higher number will make it run later, such as "S50openvpn"

 

BTW the startups numbered like that are actually only links to the original startups. There are copies of some in each runlevel (/etc/rcX.d where "X" is the runlevel)

 

Since I've never used openvpn on a computer (just Android, manually turning vpns on and off when I need them) I'm just making those numbers up for illustration purposes. You'll need to look and see how the startup scripts are actually configured and work with that. A number like 50 might be too high or too low depending on networking startup and connection.

 

That's my best guess since I don't have access to all of the information involved.

 

Another way I've used when I didn't want to dig too deep and spend a lot of time on something is to have the startup script not run at all, then call it from /etc/rc.local. That gets run last, so there's a much better chance everything will be going by the time it gets run. The reason for not running it at all from the stand runlevel call when doing it this way is to prevent it running and failing the first time and possibly taking so long to pass or fail that it prevents it from running from rc.local.


Edited by sinister_midget, 02 August 2016 - 05:06 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users