<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Automatic Restart for VPN Client]]></title><description><![CDATA[<p dir="auto">I have an OpenVPN client running on my network and for some reason it keeps going down (may be inactivity timeout, or may be connectivity issues - for some reason I get momentary disconnections-that's for another thread).</p>
<p dir="auto">Is there a way to have the server restart itself when the connection goes down?</p>
<p dir="auto">At the moment, I have to do this manually which is very inconvenient.</p>
<p dir="auto">Thanks and advance for any suggestions/advice.</p>
]]></description><link>https://forum.netgate.com/topic/124496/automatic-restart-for-vpn-client</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 01:31:33 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/124496.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Dec 2017 05:44:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Tue, 19 Dec 2017 18:55:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/derelict">@<bdi>Derelict</bdi></a>:</p>
<blockquote>
<p dir="auto">I would just remove the entries you do not want there.</p>
<p dir="auto">Double quotation or single quotation characters ("", '') can be used to enclose single parameters containing whitespace, and "#" or ";" characters in the first column can be used to denote comments.<br />
–-<br />
I have never tried embedding comment there. You are welcome to try, of course. The generated config file will be in /var/etc/openvpn.</p>
<p dir="auto">For the benefit of anyone who might actually care comments SORT OF work.</p>
<h1><a class="anchor-offset" name="valid-comment"></a>VALID COMMENT</h1>
<p dir="auto">;VAILID COMMENT<br />
;SCREWS UP;<br />
#SCREWS UP;</p>
<p dir="auto">Don't know if this is a bug, or if this is the way it is supposed to work, but it makes it difficult to comment out/document things for test purposes.  Two semi-colons on a like cause the parser to chuck it's cookies and OpenVPN client won't start due to a syntax error in the config file.</p>
<p dir="auto">As an aside… with no changes, I haven't had a problem for several days... don't know if this is because of the pfSense Update, or if the conditions for failure haven't yet occurred.</p>
<p dir="auto">I just put in the changes as per the post recommended here:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/derelict">@<bdi>Derelict</bdi></a>:</p>
<blockquote>
<p dir="auto">There also appear to be some changes as VPN providers continue to experience growing pains. I found this interesting:</p>
<p dir="auto">https://forum.pfsense.org/index.php?topic=137438.msg754714#msg754714</p>
</blockquote>
<p dir="auto">If I have more problems, I'll post again, and if I remenber, I'll post an update, but no news can be considered to be good news.</p>
</blockquote>
]]></description><link>https://forum.netgate.com/post/741907</link><guid isPermaLink="true">https://forum.netgate.com/post/741907</guid><dc:creator><![CDATA[guardian]]></dc:creator><pubDate>Tue, 19 Dec 2017 18:55:18 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sun, 17 Dec 2017 08:31:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/derelict">@<bdi>Derelict</bdi></a>:</p>
<blockquote>
<p dir="auto"><em><strong>YOU ARE FREE TO TRY SETTING THE LOG DETAIL DOWN AND SEEING IF IT REMOVES ANYTHING IMPORTANT TO YOU!</strong></em></p>
<p dir="auto">Else log to something else and grep out or search for what is important to you.</p>
<p dir="auto">I have zero idea what is important to you.</p>
</blockquote>
<p dir="auto">Sorry I should have been specific - Under normal circumstances I only want logs to give me information to alert me to things that require action - i.e. software/hardware errors or security issues such as unauthorised login attempts etc.</p>
]]></description><link>https://forum.netgate.com/post/741518</link><guid isPermaLink="true">https://forum.netgate.com/post/741518</guid><dc:creator><![CDATA[guardian]]></dc:creator><pubDate>Sun, 17 Dec 2017 08:31:09 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sun, 17 Dec 2017 00:01:41 GMT]]></title><description><![CDATA[<p dir="auto"><em><strong>YOU ARE FREE TO TRY SETTING THE LOG DETAIL DOWN AND SEEING IF IT REMOVES ANYTHING IMPORTANT TO YOU!</strong></em></p>
<p dir="auto">Else log to something else and grep out or search for what is important to you.</p>
<p dir="auto">I have zero idea what is important to you.</p>
]]></description><link>https://forum.netgate.com/post/741491</link><guid isPermaLink="true">https://forum.netgate.com/post/741491</guid><dc:creator><![CDATA[Derelict]]></dc:creator><pubDate>Sun, 17 Dec 2017 00:01:41 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sat, 16 Dec 2017 23:12:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/derelict">@<bdi>Derelict</bdi></a>:</p>
<blockquote>
<p dir="auto">Those log messages are recording the fact that the Status &gt; OpenVPN page or the OpenVPN widget connected, collected the status it needed to display, and disconnected again. They have nothing to do with the actual VPN connections.</p>
</blockquote>
<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/derelict">@<bdi>Derelict</bdi></a> for the insight… (So I assume then that a line starting with ; or # is a comment.)</p>
<p dir="auto">These messages are creating a lot crap in the log files.  Is there any reason those messages need to be there (i.e. <strong>can I get rid of them without missing something important</strong>)?  I have the log level set tot the default.</p>
<p dir="auto">UPDATE: The VPN server hasn't gone down since the upgrade (about 12 hours, but that doesn't really mean much since it could be good for a week and then go out every 4-6 hours for a day or so.  I think the issue is either instability in the cable network, the ISP provided gateway (or possibly the pfSense box…. maybe caused by plugins or firewall rules, or even a flaky NIC port (supposed to be intel, but it's a little box from China, so quality may be an issue).  I have a custom script that pings my web server every 5 minutes to log load stats and response time.</p>
<p dir="auto">To make sure that a "no answer" is really a "No Answer" caused by my server I attempt to connect to 8.8.8.8, 209.244.0.3, 64.6.64.6 on port 53 with  socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port)) and timeout=.4 - if all three attempts fail, then I consider the connection down/too slow for testing.  I get between 2 and 20 of these conditions per day, with the average being about 6-8.</p>
<p dir="auto"><strong>Any clues as to how to troubleshoot/narrow down why the tunnel keeps dropping (or more importantly how to make it restart quickly) would be much appreciated.</strong></p>
]]></description><link>https://forum.netgate.com/post/741490</link><guid isPermaLink="true">https://forum.netgate.com/post/741490</guid><dc:creator><![CDATA[guardian]]></dc:creator><pubDate>Sat, 16 Dec 2017 23:12:48 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sat, 16 Dec 2017 22:57:44 GMT]]></title><description><![CDATA[<p dir="auto">I would just remove the entries you do not want there.</p>
<p dir="auto">–config file<br />
    Load additional config options from file where each line corresponds to one command line option, but with the leading '--' removed.</p>
<p dir="auto">If --config file is the only option to the openvpn command, the --config can be removed, and the command can be given as openvpn file</p>
<p dir="auto">Note that configuration files can be nested to a reasonable depth.</p>
<p dir="auto">Double quotation or single quotation characters ("", '') can be used to enclose single parameters containing whitespace, and "#" or ";" characters in the first column can be used to denote comments.</p>
<p dir="auto">Note that OpenVPN 2.0 and higher performs backslash-based shell escaping for characters not in single quotations, so the following mappings should be observed:</p>
<p dir="auto">\      Maps to a single backslash character ().<br />
    "      Pass a literal doublequote character ("), don't<br />
            interpret it as enclosing a parameter.<br />
    [SPACE] Pass a literal space or tab character, don't<br />
            interpret it as a parameter delimiter.</p>
<p dir="auto">For example on Windows, use double backslashes to represent pathnames:</p>
<p dir="auto">secret "c:\OpenVPN\secret.key"</p>
<p dir="auto">For examples of configuration files, see http://openvpn.net/examples.html</p>
<p dir="auto">Here is an example configuration file:</p>
<p dir="auto">#<br />
    # Sample OpenVPN configuration file for<br />
    # using a pre-shared static key.<br />
    #<br />
    # '#' or ';' may be used to delimit comments.</p>
<p dir="auto"># Use a dynamic tun device.<br />
    dev tun</p>
<p dir="auto"># Our remote peer<br />
    remote mypeer.mydomain</p>
<p dir="auto"># 10.1.0.1 is our local VPN endpoint<br />
    # 10.1.0.2 is our remote VPN endpoint<br />
    ifconfig 10.1.0.1 10.1.0.2</p>
<p dir="auto"># Our pre-shared static key<br />
    secret static.key</p>
<p dir="auto">I have never tried embedding comment there. You are welcome to try, of course. The generated config file will be in /var/etc/openvpn.</p>
]]></description><link>https://forum.netgate.com/post/741489</link><guid isPermaLink="true">https://forum.netgate.com/post/741489</guid><dc:creator><![CDATA[Derelict]]></dc:creator><pubDate>Sat, 16 Dec 2017 22:57:44 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sat, 16 Dec 2017 20:56:52 GMT]]></title><description><![CDATA[<p dir="auto">Those log messages are recording the fact that the Status &gt; OpenVPN page or the OpenVPN widget connected, collected the status it needed to display, and disconnected again. They have nothing to do with the actual VPN connections.</p>
]]></description><link>https://forum.netgate.com/post/741480</link><guid isPermaLink="true">https://forum.netgate.com/post/741480</guid><dc:creator><![CDATA[Derelict]]></dc:creator><pubDate>Sat, 16 Dec 2017 20:56:52 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Sat, 16 Dec 2017 22:21:53 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for this… I suspect that maybe changing the custom parameters as per that post might help... I'll need to experiment.</p>
<p dir="auto"><strong>(Is there any way to comment out items in the custom settings box i.e. put # in front of a command or something similar?)</strong></p>
<p dir="auto">It's certainly not credentials as I stay logged in for hours and sometimes days.</p>
<p dir="auto">I did check the log at Status / System Logs / OpenVPN as you suggested and found tons of entries like this:</p>
<pre><code>
Time	Process	PID	Message
Dec 15 22:04:06	openvpn	38704	MANAGEMENT: Client disconnected
Dec 15 22:04:06	openvpn	38704	MANAGEMENT: CMD 'quit'
Dec 15 22:04:06	openvpn	38704	MANAGEMENT: CMD 'status 2'
Dec 15 22:04:06	openvpn	38704	MANAGEMENT: Client connected from /var/etc/openvpn/server4.sock
Dec 15 22:03:03	openvpn	38704	MANAGEMENT: Client disconnected
Dec 15 22:03:03	openvpn	38704	MANAGEMENT: CMD 'quit'
Dec 15 22:03:03	openvpn	38704	MANAGEMENT: CMD 'status 2'
Dec 15 22:03:03	openvpn	38704	MANAGEMENT: Client connected from /var/etc/openvpn/server4.sock
Dec 15 22:02:00	openvpn	38704	MANAGEMENT: Client disconnected
Dec 15 22:02:00	openvpn	38704	MANAGEMENT: CMD 'quit'
Dec 15 22:02:00	openvpn	38704	MANAGEMENT: CMD 'status 2'
Dec 15 22:02:00	openvpn	38704	MANAGEMENT: Client connected from /var/etc/openvpn/server4.sock
Dec 15 22:00:58	openvpn	38704	MANAGEMENT: Client disconnected
Dec 15 22:00:58	openvpn	38704	MANAGEMENT: CMD 'quit'
Dec 15 22:00:58	openvpn	38704	MANAGEMENT: CMD 'status 2'
Dec 15 22:00:57	openvpn	38704	MANAGEMENT: Client connected from /var/etc/openvpn/server4.sock
</code></pre>
<p dir="auto">The connection is up, and seems to be working - no problems with speed or anything.  Any ideas as to what is happening?  Looks like I have some time of configuration or hardware problem, but I don't have a clue where to start with this.</p>
<p dir="auto">~~Maybe I need to upgrade?</p>
<p dir="auto">2.3.4-RELEASE-p1 (amd64)<br />
built on Fri Jul 14 14:52:43 CDT 2017<br />
FreeBSD 10.3-RELEASE-p19</p>
<p dir="auto">If so 2.3.x or 2.4.x?~~</p>
<p dir="auto">Took a deep breath and jumped feet first…</p>
<p dir="auto">2.4.2-RELEASE-p1 (amd64)<br />
built on Tue Dec 12 13:45:26 CST 2017<br />
FreeBSD 11.1-RELEASE-p6</p>
<p dir="auto">fortunately the upgrade went smoothly.</p>
]]></description><link>https://forum.netgate.com/post/741401</link><guid isPermaLink="true">https://forum.netgate.com/post/741401</guid><dc:creator><![CDATA[guardian]]></dc:creator><pubDate>Sat, 16 Dec 2017 22:21:53 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Restart for VPN Client on Fri, 15 Dec 2017 07:19:13 GMT]]></title><description><![CDATA[<p dir="auto">That depends on why it is failing.</p>
<p dir="auto">Look in <strong>System &gt; Logs, OpenVPN</strong>.</p>
<p dir="auto">An authentication failure (the remote side says, "your password/key/etc is incorrect.") is treated as a hard failure and the client exits. Current pfSense versions include <em>auth-retry nointeract;</em> in the default configuration which changes this behavior. It can be overridden, causing a hard failure, by checking the <strong>Auth-Retry</strong> checkbox in the client configuration.</p>
<p dir="auto">Older versions default to a hard failure in this case which can be overridden by placing <em>auth-retry nointeract;</em> in the custom options of the client configuration.</p>
<p dir="auto">There also appear to be some changes as VPN providers continue to experience growing pains. I found this interesting:</p>
<p dir="auto">https://forum.pfsense.org/index.php?topic=137438.msg754714#msg754714</p>
]]></description><link>https://forum.netgate.com/post/741238</link><guid isPermaLink="true">https://forum.netgate.com/post/741238</guid><dc:creator><![CDATA[Derelict]]></dc:creator><pubDate>Fri, 15 Dec 2017 07:19:13 GMT</pubDate></item></channel></rss>