NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Openvpn at startup

Hey I added a client.conf file in my /etc/openvpn directory

This client.conf allows me to connect to my openvpn server

When I run openvpn client.conf it's working perfectly

Now I want this connection to start automatically at startup. How can I do that?

0 Kudos
Message 1 of 4
(3,777 Views)

I found

Just run

update-rc.d openvpn default

0 Kudos
Message 2 of 4
(3,472 Views)

I suppose that will work but it's not the recommended method. Look at /etc/init.d/vpn and in turn /usr/sbin/vpnctl. IIRC:

  • store everything in /etc/natinst/share/openvpn
  • make sure the directory and all files are owned by openvpn:openvpn and are not world-readable
  • set up the server for TAP mode

The upshot is that, unlike using /etc/openvpn, all of this should work in safemode as well as runmode: /etc/natinst/share is on a separate partition that is read by both runmode and safemode, and safemode has /etc/init.d/vpn and /usr/sbin/vpnctl baked into it. In fact, it's even persisted across reformats, if you specify preserving the network settings.

Message 3 of 4
(3,472 Views)

I have a problem with openvpn startup:
https://forums.ni.com/t5/LabVIEW/OpenVPN-Startup-is-killed-by-CRIO/m-p/3649258/highlight/false#M1024...

 

Could you be more specific with your answer please. Maybe your solution can my problem!

Thanks a lot

0 Kudos
Message 4 of 4
(3,087 Views)