<?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[How to reset Racoon service from command line]]></title><description><![CDATA[<p dir="auto">How can I reset the Racoon service from the command line? I'd like to schedule it to reset every night as it seems to prevent a problem where certain users can make a tunnel but can't send data over it.</p>
<p dir="auto">(I know I should look for a solution in stead of a workaround but there's some reasons I don't. I can elaborate on them if you wish.)</p>
]]></description><link>https://forum.netgate.com/topic/21876/how-to-reset-racoon-service-from-command-line</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 02:18:36 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/21876.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Mar 2010 10:39:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to reset Racoon service from command line on Thu, 04 Mar 2010 19:46:27 GMT]]></title><description><![CDATA[<p dir="auto">Like a charm, thank you!</p>
]]></description><link>https://forum.netgate.com/post/225048</link><guid isPermaLink="true">https://forum.netgate.com/post/225048</guid><dc:creator><![CDATA[Vorkbaard]]></dc:creator><pubDate>Thu, 04 Mar 2010 19:46:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Thu, 04 Mar 2010 00:43:07 GMT]]></title><description><![CDATA[<p dir="auto">It helps when I read the code properly… :)</p>
<p dir="auto">This works, I tested it just now:</p>
<pre><code>#!/usr/local/bin/php -q
require_once('vpn.inc');

vpn_ipsec_force_reload();
?&gt;
</code></pre>
]]></description><link>https://forum.netgate.com/post/224922</link><guid isPermaLink="true">https://forum.netgate.com/post/224922</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Thu, 04 Mar 2010 00:43:07 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 21:57:09 GMT]]></title><description><![CDATA[<p dir="auto">Same result, sorry. Feel free to try again and I'll happily keep testing but I understand if you have better things to do :)</p>
<p dir="auto">Thanks again jimp!</p>
]]></description><link>https://forum.netgate.com/post/224914</link><guid isPermaLink="true">https://forum.netgate.com/post/224914</guid><dc:creator><![CDATA[Vorkbaard]]></dc:creator><pubDate>Wed, 03 Mar 2010 21:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 21:43:43 GMT]]></title><description><![CDATA[<p dir="auto">Try this:</p>
<pre><code>#!/usr/local/bin/php -q
require_once('vpn.inc');
require_once('config.inc');

vpn_ipsec_configure();
?&gt;
</code></pre>
<p dir="auto">I don't have a spare box with any active IPsec tunnels to try at the moment, but I can see why it might fail without that other file included. (I thought it was pulled in by one of the other files but it may not have been)</p>
]]></description><link>https://forum.netgate.com/post/224909</link><guid isPermaLink="true">https://forum.netgate.com/post/224909</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Wed, 03 Mar 2010 21:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 20:41:48 GMT]]></title><description><![CDATA[<p dir="auto">I've created the script and ran it from the command line; it ran without any problems but it doesn't seem to do anything. Nothing gets logged and my connection doesn't get interrupted.</p>
<p dir="auto">I created the exact same script you wrote up, did the chmod, ran from both SSH connection and the Command-thingie in the web gui, same result, namely nothing.</p>
<p dir="auto">Am I missing something? Resetting the Racoon service via the Services menu tends to disconnect open tunnels. Thanks so much for your help, it's much appreciated!</p>
<p dir="auto">/edit<br />
Hey I found a workaround, I can use wget on my Windows server to spider the reset button. Not very elegant but it takes the pressure off.</p>
]]></description><link>https://forum.netgate.com/post/224906</link><guid isPermaLink="true">https://forum.netgate.com/post/224906</guid><dc:creator><![CDATA[Vorkbaard]]></dc:creator><pubDate>Wed, 03 Mar 2010 20:41:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 14:43:37 GMT]]></title><description><![CDATA[<p dir="auto">Technically yes, but I've not had any such problems with the shrew client. However, I also haven't tried to leave it connected for any length of time.</p>
<p dir="auto">Usually I'll see this kind of thing when connecting to a device like a watchguard firebox, linksys router, etc.</p>
]]></description><link>https://forum.netgate.com/post/224882</link><guid isPermaLink="true">https://forum.netgate.com/post/224882</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Wed, 03 Mar 2010 14:43:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 14:38:19 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your response, jimp. We're using the Shrew Soft vpn client, do you count that as "third party"? I'll try the Prefer Old IPSec SA option first.</p>
]]></description><link>https://forum.netgate.com/post/224880</link><guid isPermaLink="true">https://forum.netgate.com/post/224880</guid><dc:creator><![CDATA[Vorkbaard]]></dc:creator><pubDate>Wed, 03 Mar 2010 14:38:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to reset Racoon service from command line on Wed, 03 Mar 2010 14:22:19 GMT]]></title><description><![CDATA[<p dir="auto">You could try to enable the "Prefer Old IPsec SA" option under System &gt; Advanced. That seems to improve such situations for me when dealing with third-party devices and clients.</p>
<p dir="auto">If you must reset racoon every night, just make up a small PHP shell script to run vpn_ipsec_configure(); and schedule it via cron.</p>
<p dir="auto">Something like this should suffice:</p>
<p dir="auto">/root/resetipsec.php</p>
<pre><code>#!/usr/local/bin/php -q
include 'vpn.inc';

vpn_ipsec_configure();
?&gt;
</code></pre>
<p dir="auto">then chmod a+x /root/resetipsec.php, and try to run it. It should reset all the IPsec tunnels and restart racoon.</p>
<p dir="auto">You can install the cron package and then add a command to run it nightly at whatever time you like.</p>
]]></description><link>https://forum.netgate.com/post/224876</link><guid isPermaLink="true">https://forum.netgate.com/post/224876</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Wed, 03 Mar 2010 14:22:19 GMT</pubDate></item></channel></rss>