<% local fw = require "luci.model.firewall".init() local nw = require "luci.model.network".init() local zones = fw:get_zones() local keys, vals, a, k, v = {}, {} for k, v in ipairs(nw:get_interfaces()) do for k, a in ipairs(v:ipaddrs()) do keys[#keys+1] = a:host():string() vals[#vals+1] = '%s (%s)' %{ a:host(), v:shortname() } end end %>
<% if #zones > 1 then %>
<%:New source NAT%>:
<%:Name%>
<%:Source zone%>
<%:Destination zone%>
<%:To source IP%>
<%:To source port%>
0, "data-choices", { keys, vals }) %> />
<% else %> <% end %>