Project

General

Profile

Actions

Bug #14140

closed

OpenVPN Custom Options removes newline before push statements

Added by Nick Maludy about 1 year ago. Updated about 1 year ago.

Status:
Not a Bug
Priority:
Normal
Assignee:
-
Category:
OpenVPN
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Release Notes:
Default
Affected Plus Version:
23.01
Affected Architecture:

Description

Hello,

I'm setting up an OpenVPN server and need to pass in some additional option in two places:

1. VPN -> OpenVPN -> Server -> <edit server> -> Advanced Configuration -> Custom options
2. VPN -> OpenVPN -> Client Specific Overrides -> <edit override> -> Client Settings -> Advanced

In both of these cases, i need to add a statement similar to:

push "route-gateway 192.168.x.1"

If you do this and save the server, it removes the newline before and after that statement.
Example: if i put the following in Client Specific Overrides:

ifconfig-push 192.168.x.3 255.255.255.0
push "route-gateway 192.168.x.1"

When i save, go away from the page and edit again, it looks like:

ifconfig-push 192.168.x.3 255.255.255.0push "route-gateway 192.168.x.1"

Oddly enough this same thing happens if i make changes to the server, without touching the client specific overrides, it seems to rewrite the overrides and removes the newlines.

This can be verified by looking at the files on the file system:
- /var/etc/openvpn/server1/csc/<client specific override name>

Let me know if there is other help or steps i can provide to aide in debugging.

So far it's 100% reproducible.


Files

Screenshot from 2023-03-25 08-39-35.png (23.7 KB) Screenshot from 2023-03-25 08-39-35.png Server settings Chris W, 03/25/2023 09:42 AM
Screenshot from 2023-03-25 08-38-22.png (24.2 KB) Screenshot from 2023-03-25 08-38-22.png Client Specific Overrides before saving Chris W, 03/25/2023 09:42 AM
Screenshot from 2023-03-25 08-38-38.png (24 KB) Screenshot from 2023-03-25 08-38-38.png Client Specific Overrides after saving Chris W, 03/25/2023 09:42 AM
Actions #1

Updated by Nick Maludy about 1 year ago

Sorry, i forgot to describe WHY this is a problem.

The issue is that the invalid formatting of the options will cause the OpenVPN server to fail to start and/or Client Specific Overrides to be silently discarded due to syntax errors.

Example:
- Edit server config
- Add in some settings

route 10.19.0.0 255.255.255.0
push "route-gateway 192.168.x.1"

- Save server
- Edit server
- The settings in Advanced now look like

route 10.19.0.0 255.255.255.0push "route-gateway 192.168.x.1"

- Save server
- OpenVPN server fails to start due to syntax error in the config file

So, if you go in and edit the server for any reason, you have to make sure (every time) that you go back and fix the Advanced settings.

This same thing happens in Client Specific Overrides, the consequence here is that the overrides silently fail because the csc/ file has a syntax error.

Actions #2

Updated by Chris W about 1 year ago

I'm not able to reproduce this on the server settings, but can on the Client Specific Overrides page. After saving and leaving the page, then coming back, server settings remain as the first image above. The other two are before and after of the Client Specific Overrides page.

Did you upgrade to 23.01 from CE or any previous Plus version, or is your firewall running a new installation of 23.01?

Actions #3

Updated by Chris W about 1 year ago

  • Status changed from New to Confirmed
Actions #4

Updated by Jim Pingle about 1 year ago

  • Status changed from Confirmed to Not a Bug

Not a bug. Statements must be separated with a semicolon , not a newline.

This is stated clearly in the description on the custom options box.

Actions

Also available in: Atom PDF