1 -- Copyright 2011 Manuel Munz <freifunk at somakoma de>
2 -- Licensed to the public under the Apache License 2.0.
4 local uci = require "luci.model.uci".cursor()
6 m = Map("freifunk-policyrouting", translate("Policy Routing"), translate("These pages can be used to setup policy routing for certain firewall zones. "..
7 "This is useful if you need to use your own internet connection for yourself but you don't want to share it with others (thats why it can also be "..
8 "called 'Ego Mode'). Your own traffic is then sent via your internet connection while traffic originating from the mesh will use another gateway in the mesh. "))
11 c = m:section(NamedSection, "pr", "settings", "")
13 local pr = c:option(Flag, "enable", translate("Enable Policy Routing"))
16 local strict = c:option(Flag, "strict", translate("Strict Filtering"), translate("If no default route is received from the mesh network then traffic which belongs to "..
17 "the selected firewall zones is routed via your internet connection as a fallback. If you do not want this and instead block that traffic then you should "..
18 "select this option."))
19 strict.rmempty = false
21 local fallback = c:option(Flag, "fallback", translate("Fallback to mesh"),
22 translate("If your own gateway is not available then fallback to the mesh default gateway."))
23 strict.rmempty = false
25 local zones = c:option(MultiValue, "zones", translate("Firewall zones"), translate("All traffic from interfaces belonging to these zones will be sent via "..
26 "a gateway in the mesh network."))
27 uci:foreach("firewall", "zone", function(section)
28 local name = section.name
29 if not (name == "wan") then