<%# Opennet Firmware Copyright 2010 Rene Ejury Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -%> <% local uci = require "luci.model.uci" local cursor = uci.cursor() %> <%+header%> <% function show_portmap(src_zone) %>
<% local t = {} cursor:foreach("firewall", "redirect", function(s) if src_zone == s.src then t[#t +1] = s end end) for index = 1, #t do local s = t[index] %> <% end %>
<%:Source-Port%> <%:Target-Address%> <%:Target-Port%>
<%=s.src_dport%>
<%=s.dest_ip%>
<%=s.dest_port%>
" title="Del" name="<%=src_zone%>_del_section" />
<% end %>

<%:Portmapping - Forwarding of Ports%>

<% if cursor:get("network", "on_vpn") then %>

<%:Forwarding from the Internet through your OpenVPN tunnel%>

<% require("luci.sys") function split(str) local t = { } str:gsub("%S+", function (w) table.insert(t, w) end) return t end data = split(luci.sys.exec("/usr/sbin/on_portcalc.sh")) %>
<% if data[1] and data[1] ~= "" then print(luci.i18n.stringf([[Based on your Certificate (%s), the ports from %s to %s are forwarded through the VPN-Tunnel to your Access-Point - you should enter those as your source-ports.]], data[1], data[2], data[3])) end %> <%:The target should be an IP-Address in your local network. Additionally you can enter the target port in the related field.%>
<% show_portmap("on_vpn") %>
<% end %>

<%:Forwarding from Opennet%>

<%:The following ports will be forwarded from Opennet (usually WIFI) to computers in your local network. They are usually not reachable directly from the Internet.%>
<% show_portmap("opennet") %>

<%:Forwarding from DHCP-wireless network%>

<%:The following ports will be forwarded from computers connected to your WIFI (and not running olsr) to computers in your local network.%>
<% show_portmap("local") %>

<%:Forwarding from Internet (WAN-connector)%>

<%:The follwing ports will be forwarded from Internet (your WAN connector) to your local network. If Internet is connected to your WAN, these ports are directly reachable from the outside.%>
<% show_portmap("wan") %>
<%+footer%>