<%# 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() require("luci.model.opennet.funcs") %> <%+header%> <% function show_portmap(src_zone, min_port, max_port) %>
<% 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" />
value="<%=min_port%>"<% end %> <% if min_port then %>min="<%=min_port%>"<% end %> <% if max_port then %>max="<%=max_port%>"<% end %> />
<% end %>

<%:Portmapping - Forwarding of Ports%>

<% if on_bool_function("is_function_available", {"get_client_cn"}) then %>

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

<% local portrange = tab_split(on_function("get_mig_port_forward_range")) local client_cn = on_function("get_client_cn") if not is_string_empty(client_cn) then %> <%=luci.i18n.translatef('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.', client_cn, portrange[1], portrange[2])%> <% 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_function("get_variable", {"ZONE_TUNNEL"}), portrange[1], portrange[2]) %>
<% 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. This section might contain forwardings for Free Internet Access (Wifidog, port 67) and Internet Sharing (Usergateway Forwarding, ports 1600 and 123).%>
<% show_portmap(on_function("get_variable", {"ZONE_MESH"})) %>

<%: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(on_function("get_variable", {"ZONE_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(on_function("get_variable", {"ZONE_WAN"})) %>
<%+footer%>