can't get openvpn to start at boot...

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
farscape1a
Posts: 6
Joined: Mon Jul 27, 2020 2:37 pm
Has thanked: 0
Been thanked: 0

can't get openvpn to start at boot...

Post by farscape1a »

good morning everyone. i can't get openvpn to start at boot. i was able to do so at one time (and again on a different FreeBSD-based OS), but i can't seem to get it to go. these are the notes that i kept that worked last time as well as with the other BSD-based OS. if i perform a "sudo service openvpn start", it works fine. i'm not sure what i did or didn't do, so i'm open to any/all suggestions.

thanks everyone!




sudo pkg install openvpn

sudo mkdir /usr/local/etc/openvpn

rename .ovpn file to openvpn.conf

sudo nano /usr/local/etc/openvpn/cred.conf and fill with VPN credentials

sudo chmod 400 /usr/local/etc/openvpn/cred.conf

sudo chown root /usr/local/etc/openvpn/cred.conf

nano openvpn.conf and add these lines:
auth-nocache
auth-user-pass cred.conf

sudo mv openvpn.conf /usr/local/etc/openvpn/

sudo nano /etc/resolv.conf and add VPN DNS server IP addresses

Disable DNS rewriting resolv.conf:
chflags schg /etc/resolv.conf

(Enable DNS rewriting resolv.conf if needed: chflags 0 /etc/resolv.conf)

sudo openvpn --config /usr/local/etc/openvpn/openvpn.conf --daemon

Add openvpn_enable="YES" to /etc/rc.conf

sudo service openvpn start

curl ipecho.net/plain ; echo to see if the new IP matches your VPN service

check ipleak.net for confirmation

reboot and check again

User avatar
ericbsd
Developer
Posts: 1627
Joined: Mon Nov 19, 2012 7:54 pm
Has thanked: 57 times
Been thanked: 87 times

Re: can't get openvpn to start at boot...

Post by ericbsd »

farscape1a wrote:
Mon Oct 05, 2020 9:17 am
Add openvpn_enable="YES" to /etc/rc.conf
GhostBSD uses OpenRC init instead of FreeBSD init.

To start a service at boot you to the this:

Code: Select all

sudo rc-update add openvpn default

Post Reply