Why do I have empty OpenVPN client or server definitions

From PFSenseDocs
Jump to: navigation, search

NOTE: This particular issue has been fixed and worked around in current versions of pfSense, but still may apply to other similar cases.

Occasionally, an empty client or server definition may be found in the OpenVPN configuration of a firewall. It will appear as an empty line, and cannot be edited or deleted via the WebGUI.

Inside config.xml, it will appear as an empty definition like so:

<openvpnclient>
        <config/>
</openvpnclient>
<openvpnserver>
        <config/>
</openvpnserver>

This may be remedied by unsetting the offending definitions. In the following example, there is a blank client and blank server entry, adjust it as needed to fit a particular problem.

  • Navigate to Diagnostics > Command
  • Enter the following in PHP Execute in the Command text area:
unset($GLOBALS["config"]["installedpackages"]["openvpnserver"]["config"][0]);
unset($GLOBALS["config"]["installedpackages"]["openvpnclient"]["config"][0]);
write_config();
  • Click Execute

A reboot is recommended after running this, as the active tunnels will no longer match up their configurations with their processes.