OMVEXTRAS - OpenVPN - change wish

  • Hello, community!

    I want to use OMVExtras OpenVPN, but I need to use UDP + bridge mode + TAP adapter (all clients are Windows machines, no Android). All I want is L2 networking over VPN. When I try to modify server.conf, it change back to TUN every time I commit any change over configuration webpage. Can anyone help what can I edit so my change to TAP persist - or better, is there any possibility that we can get this setting available and working over web config?


    Thank you!


    Best regards, Jan

  • jimmy_cr

    Changed the title of the thread from “OMVEXTRAS - OpenVpn - TAP adapter + bridge mode” to “OMVEXTRAS - OpenVpn - TAP adapter + bridge mode (OMV 5.5.15-1)”.
  • I will try to answer myself :) It's nearly impossible to fullfill my wish without tweaking plugin itself :). I found where I can change all settings, but after every plugin upgrade it reverts to "default state". I am asking thich changes because sometimes we need to connect two or more clients together without need to access internal network of OMV. So I would like to to ask "ryecoaaron" kindly (I think he's the one who can help), if there's possibility to modify OMVExtras-OpenVPN plugin like this:


    - add selection for TUN / TAP device


    config for TUN:

    Code
    dev tun
    persist-tun

    config for TAP ("persist-tun" shouldn't be in config)

    Code
    dev tap


    - split "Default gateway" setting to "Default gateway" and "Static route" (static route is doing troubles - someone mentioned it on "github issues" also). I'm almost 99% sure, that you do not need to add line push "route $vpn_network $vpn_mask" also (I never used this).


    - add option to use "Duplicate CN" - so user can connect several times using only 1 certificate. Disvantage is, your IP address will not persist on every reconnect. ("duplicate-cn" and "ifconfig-pool-persist" cannot be used together)


    config for "Duplicate CN" enabled

    Code
    duplicate-cn

    config for "Duplicate CN" disabled

    Code
    ifconfig-pool-persist ipp.txt

    - everything else we can do using "Extra options" field I think (per user folders with push directives, etc).



    Thank you for your effort!


    Best regards, Jan

  • jimmy_cr

    Changed the title of the thread from “OMVEXTRAS - OpenVpn - TAP adapter + bridge mode (OMV 5.5.15-1)” to “OMVEXTRAS - OpenVPN - change wish”.
  • So I would like to to ask "ryecoaaron" kindly (I think he's the one who can help), if there's possibility to modify OMVExtras-OpenVPN plugin like this:

    Those are a lot of changes to a plugin I don't use and can't test. I minimally ported it to OMV 5.x but really don't want to start making big changes. If you submit a pull request, I would prefer that.

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I am a little bit "n00b" using github :) I can try rework script and post it here maybe, but never did anything like this on github :-/

    I guess I don't need a github pull request. I just really need the code changes. The plugin's web interface needs to be changed as well.

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Changed everything I found - attached. If its possible to prepare "testing" version and help me how to install it, I can do tests as well for you!


    Thanks!!


    edit: not translated to all languages :-/

  • You also need a migration file in /usr/share/openmediavault/confdb/migrations.d/ to add the new database fields when updating to this version. See https://github.com/OpenMediaVa…vault/confdb/migrations.d as an example.

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • f its possible to prepare "testing" version and help me how to install it, I can do tests as well for you!


    Thanks!!


    edit: not translated to all languages :-/

    I can create a testing version.


    Language translation is automated. The translations should be entered on transifex. - https://www.transifex.com/openmediavault-plugin-developers/

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • As i can see, there is a check if "new" variable exists or not. If not, create with default value - am I right?

    yep.

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Here we go (added 3 variables):

  • Error #0:
    RuntimeException: Failed to index key 'device' of 'device.0' because it has no children. in /usr/share/php/openmediavault/dictionary.inc:145
    Stack trace:
    #0 /usr/share/php/openmediavault/config/configobject.inc(194): OMV\Dictionary->set('device.0', 'tun')
    #1 /usr/share/php/openmediavault/config/configobject.inc(272): OMV\Config\ConfigObject->set('device.0', 'tun', false)
    #2 /usr/share/php/openmediavault/config/configobject.inc(234): OMV\Config\ConfigObject->setFlatAssoc(Array, false, false)
    #3 /usr/share/php/openmediavault/config/database.inc(99): OMV\Config\ConfigObject->setAssoc(Array, false)
    #4 /usr/share/openmediavault/engined/module/openvpn.inc(68): OMV\Config\Database->get('conf.service.op...')
    #5 /usr/share/openmediavault/engined/rpc/services.inc(60): OMV\Engined\Module\OpenVpn->getStatus()
    #6 [internal function]: Engined\Rpc\Services->getStatus(Array, Array)
    #7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
    #8 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('getStatus', Array, Array)
    #9 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Services', 'getStatus', Array, Array, 1)
    #10 {main}

  • I forgot that device is a reserved word. I will have to change that. What is a different descriptive word for device in this plugin?

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • how about change everything to "device_type" or maybe better "device_ovpn"

    I will change to deviceovpn (underscores and dashes can be troublesome).

    omv 5.6.0 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.5.3
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!