Feature #3473

Allow configuration of OpenVPN keepalive

Added by B. Derman over 5 years ago. Updated 3 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


The keepalive option is always added to an OpenVPN server configuration.

There are many scenarios where this is not wanted and will prevent the required behavior. In my case, when working with iOS VPN on demand rule-driven behavior, the keepalive had to be removed (by commenting out line 453 in

What's even worse is that, with the keepalive option configured, you can't even add options such as ping, ping-exit and inactive (i.e., via OpenVPN's "Advanced configuration") because the server fails to start when you do, citing a conflict with the keepalive option.

I'd suggest that the keepalive option should be an optional item configured via the GUI. A more complete/useful strategy would be to allow configuration of all of the following via the GUI:
- keepalive & both time parameters (should be mutually exclusive with ping/ping-exit)
- ping with time parameter
- ping exit with time parameter
- inactive with time parameter
along with a checkbox-type option to also push any of these to the client.


#1 Updated by B. Derman over 5 years ago

Oh, ping-restart should also be added to the list.

#2 Updated by Chris Buechler over 4 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from keepalive always added to OpenVPN server configuration to Allow configuration of OpenVPN keepalive
  • Affected Version deleted (2.1)
  • Affected Architecture deleted (i386)

#3 Updated by Renato Botelho over 2 years ago

  • Assignee set to Renato Botelho
  • Target version set to 2.4.0

#4 Updated by Jim Pingle almost 2 years ago

  • Target version changed from 2.4.0 to 2.4.1

#5 Updated by Jim Pingle over 1 year ago

  • Target version changed from 2.4.1 to 2.4.2

#6 Updated by Jim Pingle over 1 year ago

  • Target version changed from 2.4.2 to 2.4.3

#7 Updated by Jim Pingle over 1 year ago

  • Target version changed from 2.4.3 to 2.4.4

#8 Updated by Steve Beaver 10 months ago

  • Target version changed from 2.4.4 to 48

#9 Updated by IT Sex 6 months ago

Ran into the problem. Found out that you can comment-out or change the way the keepalive directive is added to new openVPN configurations using pfSense's Diagnostics>Edit File feature. Browse to /etc/inc/ and open /etc/inc/, then find "keepalive" to see the line of the pfSense script where it is added. Adding a # to the argument (changing it to "#keepalive 10 60\n") and saving the script seems like the minimum-impact way to disable keepalive, and worked to let me add ping to my configs.

Just for clarity, this seems to keep pfSense from adding the keepalive directive to any (new?) openVPN (client?) configurations. It could break stuff that depends on that, although in my experience running openVPN clients without keepalive works just fine, and you should be able to add in back in manually with the advanced settings option. I did try looking for the openVPN config files themselves, but it looks like those are generated only temporarily (using the script edited above) when you run them.

#10 Updated by Jim Pingle 3 months ago

  • Target version changed from 48 to 2.5.0

Also available in: Atom PDF