<%+header%> <% local uci = require("luci.model.uci").cursor() local net = require "luci.model.network".init() local fs = require "nixio.fs" local sys = require "luci.sys" local ut = require "luci.util" local ifaces = sys.net:devices() menuentry = uci:get("openmptcprouter","settings","menu") or "openmptcprouter" function device_notvirtual(dev) for _, iface in ipairs(net:get_networks()) do local ifacen = iface:name() local ifacename = uci:get("network",ifacen,"ifname") local ifacetype = uci:get("network",ifacen,"type") or "" local ifaceproto = uci:get("network",ifacen,"proto") or "" --if ifacename == dev and (ifacetype == "macvlan" or ifacetype == "bridge" or ifaceproto == "6in4") then if ifacename == dev and (ifacetype == "macvlan" or ifaceproto == "6in4") then return false end end return true end %> <% if stderr and #stderr > 0 then %>
<%=pcdata(stderr)%>
<% end %>

<%:Wizard%>

<%:Server settings%> <% nbserver=0 uci:foreach("openmptcprouter","server", function(s) nbserver=nbserver+1 end) uci:foreach("openmptcprouter","server", function(s) servername = s[".name"] %>

<%=servername%>

" data-optional="false">
<%:Server IP will be set for proxy and VPN%>

" data-optional="false">
<%:API username to retrieve personnalized settings from the server.%>
" data-optional="false">
<%:Key to configure and retrieve others keys from Server and to set server settings from OpenMPTCProuter.%>
<% if nbserver > 1 then %>
checked<% end %>/>
<%:Only one server can be master, else all servers are set as backup.%>
<% end %>
checked<% end %>/>
<% end) %>
<%:Common server settings%>

<%:LAN interfaces settings%> <% for _, iface in ipairs(net:get_networks()) do local ifname = iface:name() local firewall_lan = luci.util.trim(luci.sys.exec("uci -q get firewall.@zone[0].network | grep " .. ifname)) if firewall_lan ~= "" then %>

<%=ifname%>

">
<%:Label for the interface%>
<% findproto = 0 %>
<%:You can use DHCP if you have multiple real ethernet ports.%>
<% if uci:get("network",ifname,"type") ~= "bridge" then %>

<%:Choose physical interface.%>
<% end %>
" data-type="ip4addr">
" data-type="ip4addr">
<% end end %>
<%:Interfaces settings%>
<%:You must disable DHCP on your modems and set IP in different networks.%>
<% for _, iface in ipairs(net:get_networks()) do local ifname = iface:name() local firewall_wan = luci.util.trim(luci.sys.exec("uci -q get firewall.@zone[1].network | grep " .. ifname)) if firewall_wan ~= "" then -- local multipath = uci:get("network",ifname,"multipath") -- local multipathvpn = uci:get("openmptcprouter",ifname,"multipathvpn") -- local vpn = uci:get("openmptcprouter",ifname,"vpn") -- if (multipath ~= nil and multipath ~= "off" and vpn ~= "1") or multipathvpn == "1" then %>

<%=ifname%>

">
<%:Label for the interface%>

<%:Choose MacVLAN if you want to create a virtual interface based on a physical interface.%>

<%:Choose physical interface.%>
<% findproto = 0 %>
<%:You can use DHCP if you have multiple real ethernet ports. Select other if you want to use another protocol available in Network Interfaces page.%>

<%:Choose physical interface.%>
" data-type="ip4addr">
<%:Set an IP in the same network as the modem%>
" data-type="ip4addr">
" data-type="ip4addr">
<%:Set here IP of the modem%>
">
">
">
">
">
<% if uci:get("openmptcprouter",ifname,"multipathvpn") == "1" then %>
<% else %>
<% end %> <% local download = "0" local upload = "0" download = uci:get("network",ifname,"downloadspeed") or "0" upload = uci:get("network",ifname,"uploadspeed") or "0" --if download == "0" or upload == "0" then -- if nixio.fs.access("/etc/init.d/sqm") then -- download = uci:get("sqm",ifname,"download") -- upload = uci:get("sqm",ifname,"upload") -- else -- download = uci:get("qos",ifname,"download") -- upload = uci:get("qos",ifname,"upload") -- end --end %>
checked<% end %> />
<%:You can enable MPTCP over VPN if your provider filter Multipath TCP.%>
checked<% end %> />
<%:You should disable SQM for LTE or any interfaces with variable speed.%>

<%:Used by Glorytun UDP and SQM/QoS if enabled. 0 to use default value.%>

<%:Used by Glorytun UDP and SQM/QoS if enabled. 0 to use default value.%>
<% end end %>
<%:Select the device you want to base the interface on.%>
<%+footer%>