<%# updateFW.htm -%> <% local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") local dns_host = "www.ingeteam.com" local ping_host = "www.ingeteam.com" local route_host = "www.ingeteam.com" local chp = require "luci.model.charging_points" local path = luci.dispatcher.context.requestpath local user, serialnumber, hw_model = chp.whoami(path) local cl = path[1] local fs = require "nixio.fs" local utl = require "luci.util" local mUtl = require "luci.moreUtils" local sn = mUtl.get_serialnumber() local model = mUtl.model(path[3] or sn) local master = mUtl.identify_pseudo_maestre(path[3] or sn ) local method if master == true then method = "uci" else method = path[3].."/uci" end local ifaces = utl.ubus(method,"get",{config = "network", type = "interface"}) local routes = utl.ubus(method,"get",{config = "network", type = "route"}) if ifaces and ifaces.values then ifaces = ifaces.values end for k, v in pairs (ifaces) do if string.find(k, "plc") or string.find(k, "usb") or string.find(k, "loopback") then ifaces[k] = nil end end if routes and routes.values then routes = routes.values end local count = 0; for k , v in pairs (ifaces) do count = count+1 end -%> <%+header%>

<%:Routes%> - <%=path[3]%>

<%:Here you can configure static routes for the different interfaces. The IP of the gateway must correspond with the IP of the chosen interface or leave it empty if net is directly connected.%>
<%:Static Routes%>
<%for k , v in pairs (routes) do %> <%end%>
<%:Interface%> <%:Target%> <%:Netmask%> <%:Gateway%> <%:%>

<%+footer%>