* applications/luci-fw: Added support for customizing inter-device routing
[project/luci.git] / applications / luci-fw / src / model / cbi / admin_network / firewall.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 m = Map("luci_fw", "Firewall", [[Mit Hilfe der Firewall können Zugriffe auf das Netzwerk
3 erlaubt, verboten oder umgeleitet werden.]])
4
5 s = m:section(TypedSection, "rule")
6 s.addremove = true
7 s.anonymous = true
8
9 chain = s:option(ListValue, "chain", "Kette")
10 chain:value("forward", "Forward")
11 chain:value("input", "Input")
12 chain:value("output", "Output")
13 chain:value("prerouting", "Prerouting")
14 chain:value("postrouting", "Postrouting")
15
16 iface = s:option(ListValue, "iface", "Eingangsschnittstelle")
17 iface.optional = true
18
19 oface = s:option(ListValue, "oface", "Ausgangsschnittstelle")
20 oface.optional = true
21
22 for k, v in pairs(ffluci.model.uci.sections("network")) do
23         if v[".type"] == "interface" and k ~= "loopback" then
24                 iface:value(k)
25                 oface:value(k)
26         end
27 end
28
29 proto = s:option(ListValue, "proto", "Protokoll")
30 proto.optional = true
31 proto:value("")
32 proto:value("tcp", "TCP")
33 proto:value("udp", "UDP")
34
35 s:option(Value, "source", "Quelladresse").optional = true
36 s:option(Value, "destination", "Zieladresse").optional = true
37 s:option(Value, "mac", "MAC-Adresse").optional = true
38
39 sport = s:option(Value, "sport", "Quellport")
40 sport.optional = true
41 sport:depends("proto", "tcp")
42 sport:depends("proto", "udp")
43
44 dport = s:option(Value, "dport", "Zielport")
45 dport.optional = true
46 dport:depends("proto", "tcp")
47 dport:depends("proto", "udp")
48
49 tosrc = s:option(Value, "tosrc", "Neue Quelladresse [SNAT]")
50 tosrc.optional = true
51 tosrc:depends("jump", "SNAT")
52
53 tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]")
54 tosrc.optional = true
55 tosrc:depends("jump", "DNAT")
56
57 jump = s:option(ListValue, "jump", "Aktion")
58 jump.rmempty = true
59 jump:value("", "")
60 jump:value("ACCEPT", "annehmen (ACCEPT)")
61 jump:value("REJECT", "zurückweisen (REJECT)")
62 jump:value("DROP", "verwerfen (DROP)")
63 jump:value("LOG", "protokollieren (LOG)")
64 jump:value("DNAT", "Ziel umschreiben (DNAT) [nur Prerouting]")
65 jump:value("MASQUERADE", "maskieren (MASQUERADE) [nur Postrouting]")
66 jump:value("SNAT", "Quelle umschreiben (SNAT) [nur Postrouting]")
67
68
69 add = s:option(Value, "command", "Eigener Befehl")
70 add.size = 50
71 add.rmempty = true
72
73 return m