Page 1 of 1

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

Posted: Mon Oct 05, 2020 9:17 am
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

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

Posted: Mon Oct 05, 2020 5:44 pm
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