Page MenuHomeVyOS Platform

Double quotes in openvpn-option
Closed, InvalidPublic

Description

options like --push in openvpn requires quotes
example:

--push "redirect-private local"

but the vyos command
set interfaces openvpn vtun0 openvpn-option OPTIONS
does not permit to use double quotes!

example:
set interfaces openvpn vtun0 openvpn-option "--push "redirect-private local""
and escape sequences, like \" or \' , are not admitted...
please can you fix it? I need of "redirect-private" option...

Details

Difficulty level
Easy (less than an hour)

Event Timeline

syncer claimed this task.
syncer edited projects, added VyOS 1.1.x; removed VyOS 2.0.x, VyOS 1.1.x (1.1.8).
syncer added a subscriber: syncer.

It works perfectly without double quotes

openvpn vtun0 {
        local-port 443
        mode server
        openvpn-option "--push redirect-gateway def1"
        protocol tcp-passive
        server {
            name-server 8.8.8.8
            push-route 0.0.0.0/0
            subnet 192.168.255.0/24
        }

no, here we have "double (double quotes)"

set interfaces openvpn vtun0 openvpn-option "--push "redirect-private local""

we have 4 double quotes!

So, I don't see an issue - don't use double quotes
you perfectly fine to specify several openvpn-option statements

@oliveriandrea what happens when you use double-quotes for vyos-config and single-quotes for the statement within? Can you also test out the other possible combinations; eg. "--with-escaping-the \"inner quotes\""; this is just for reference (I agree with @syncer recommendations for now). I would be especially interested in if they are treated differently by the tab-completion feature as IIRC it generates somewhat broken suggestions (vyos@vyos #delete openvpn-opt<tab> .. ).

No additional information was provided