Bug #14140
closedOpenVPN Custom Options removes newline before push statements
0%
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
Updated by Nick Maludy 2 months 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.
Updated by Chris W 2 months ago
- File Screenshot from 2023-03-25 08-39-35.png Screenshot from 2023-03-25 08-39-35.png added
- File Screenshot from 2023-03-25 08-38-22.png Screenshot from 2023-03-25 08-38-22.png added
- File Screenshot from 2023-03-25 08-38-38.png Screenshot from 2023-03-25 08-38-38.png added
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?
Updated by Jim Pingle 2 months 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.