Openvpn client log file

anderswo picture anderswo · Oct 6, 2016 · Viewed 25.2k times · Source

I have set up a openvpn client (version 2.3.12) on a Raspberry Pi (Raspbian 7 whezzy) and I configured a vpntest.conf file in the folder /etc/openvpn. The connection is working when I call it with sudo openvpn /etc/openvpn/vpntest.conf

But when I set autostart in /etc/default/openvpn to AUTOSTART="vpntest" the connection is not working. Is there any log file I can check for what is wrong? I get nothing for grep vpn /var/log/syslog

Answer

akgren_soar picture akgren_soar · Oct 21, 2016

You can output the logs by changing the OPTARGS value in /etc/default/openvpn

# Append output to /var/log/syslog
OPTARGS="--syslog"

# Output to /var/log/my_openvpn_log. Existing contents of /var/log/my_openvpn_log will be deleted
OPTARGS="--log /var/log/my_openvpn_log"

# Append output to /var/log/my_openvpn_log
OPTARGS="--log-append /var/log/my_openvpn_log"