Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bgp12

#1
18.7 Legacy Series / Re: Reconnect OpenVPN client
June 21, 2018, 08:42:34 PM
Thank you! Yes. GW monitoring is/was set to see RTT thru the connection.

Also, is there a way to use configctl openvpn reload to only restart a specific client, instead of the service?
#2
18.7 Legacy Series / Reconnect OpenVPN client
June 08, 2018, 02:11:04 AM
Hi All!

I was having a problem with my openvpn client not reconnecting after a dropped connection and searched around for a simple solution. Not much info (for V18.x) but was able to find all of the info in various places around the net.

Thanks to this site for the basic instructions.

#!/usr/bin/env sh
VPNSRCIP="$(/sbin/ifconfig ovpnc1 | grep 'inet ' | cut -f1 -d '-' | awk '{ print $2}')"
VPNGWIP="$(/sbin/ifconfig ovpnc1 | grep 'inet ' | cut -d ' ' -f 4)"
if /sbin/ping -S "${VPNSRCIP}" -c 3 "${VPNGWIP}"; then
    # Success, Nothing to do
    exit 0
else
    # Fail, Reconnect VPN
    configctl openvpn reload
fi

exit 1


I have a basic OpenVPN client setup that connects to a random server, so this snippet works well with my config.

It would be nice to see a simple feature to click a checkbox to do gateway monitoring in the client settings.

Hope this helps with auto-reconnecting an OpenVPN client or for restarting the OpenVPN service (both well hidden online and in the forums).