<%+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 function splitstring(inputstr, sep) if inputstr == nil then return "" end if sep == nil then sep = "%s" end local t={} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end return t 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"> " data-optional="false">
<%:Server IP will be set for proxy and VPN%>
<%:A second server's IP can be set for dual IPv4/IPv6 server if WAN IPv6 are set%>

" 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_lan.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_wan.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%>
<% ipv6list = uci:get_list("network",ifname,"ip6addr") for key, value in pairs(ipv6list) do %>

<%:Set an IP in the same network as the modem%>
<% end if table.getn(ipv6list) ~= 0 then %>
" data-type="ip6addr">
<%:Set here IP of the modem%>
<% else %>

<%:Set an IP in the same network as the modem%>
" data-type="ip6addr">
<%:Set here IP of the modem%>
<% end %>
">
">
">
">
">
<% if uci:get("openmptcprouter",ifname,"multipathvpn") == "1" then %>

<%:Only one interface must be set as "Master", this should be the most stable interface.%>
<% 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%>