diff --git a/docs/features/vpn.rst b/docs/features/vpn.rst index 81eef151..81b6dfce 100644 --- a/docs/features/vpn.rst +++ b/docs/features/vpn.rst @@ -32,8 +32,9 @@ increase throughput, although in practice the gain is minimal. **Site configuration:** -1) Install ``gluon-web-mesh-vpn-fastd`` in ``site.mk`` +1) Add the feature ``web-mesh-vpn-fastd`` in ``site.mk`` 2) Set ``mesh_vpn.fastd.configurable = true`` in ``site.conf`` +3) Optionally add ``null`` to the ``mesh_vpn.fastd.methods`` table if you want "Performance mode" as default (not recommended) **Gateway configuration:** @@ -54,4 +55,3 @@ socket can be interrogated, after installing for example `socat`. opkg update opkg install socat socat - UNIX-CONNECT:/var/run/fastd.mesh_vpn.socket - diff --git a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua index a41f291e..a6005693 100644 --- a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua +++ b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua @@ -11,6 +11,7 @@ mode.template = "mesh-vpn-fastd" local methods = uci:get('fastd', 'mesh_vpn', 'method') if util.contains(methods, 'null') then + -- performance mode will only be used as default, if it is present in site.mesh_vpn.fastd.methods mode.default = 'performance' else mode.default = 'security' @@ -19,6 +20,8 @@ end function mode:write(data) local site = require 'gluon.site' + -- methods will be recreated and filled with the original values from site.mesh_vpn.fastd.methods + -- if performance mode was selected, and the method 'null' was not present in the original table, it will be added local methods = {} if data == 'performance' then table.insert(methods, 'null')