* Fixed firewall scripts
[project/luci.git] / src / ffluci / model / cbi / admin_network / firewall.lua
1 -- ToDo: Translate, Add descriptions and help texts
2 m = Map("luci_fw", "Firewall")
3
4 s = m:section(TypedSection, "rule")
5 s.addremove = true
6
7 chain = s:option(ListValue, "chain", "Kette")
8 chain:value("forward", "Forward")
9 chain:value("input", "Input")
10 chain:value("output", "Output")
11 chain:value("prerouting", "Prerouting")
12 chain:value("postrouting", "Postrouting")
13
14 s:option(Value, "iface", "Eingangsschnittstelle").optional = true
15 s:option(Value, "oface", "Ausgangsschnittstelle").optional = true
16
17 proto = s:option(ListValue, "proto", "Protokoll")
18 proto.optional = true
19 proto:value("")
20 proto:value("tcp", "TCP")
21 proto:value("udp", "UDP")
22
23 s:option(Value, "source", "Quelladresse").optional = true
24 s:option(Value, "destination", "Zieladresse").optional = true
25
26 sport = s:option(Value, "sport", "Quellport")
27 sport.optional = true
28 sport:depends("proto", "tcp")
29 sport:depends("proto", "udp")
30
31 dport = s:option(Value, "dport", "Zielport")
32 dport.optional = true
33 dport:depends("proto", "tcp")
34 dport:depends("proto", "udp")
35
36 tosrc = s:option(Value, "tosrc", "Neue Quelladresse [SNAT]")
37 tosrc.optional = true
38 tosrc:depends("jump", "SNAT")
39
40 tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]")
41 tosrc.optional = true
42 tosrc:depends("jump", "DNAT")
43
44 jump = s:option(ListValue, "jump", "Aktion")
45 jump.rmempty = true
46 jump:value("", "")
47 jump:value("ACCEPT", "annehmen (ACCEPT)")
48 jump:value("REJECT", "zurückweisen (REJECT)")
49 jump:value("DROP", "verwerfen (DROP)")
50 jump:value("LOG", "protokollieren (LOG)")
51 jump:value("DNAT", "Ziel umschreiben (DNAT) [nur Prerouting]")
52 jump:value("MASQUERADE", "maskieren (MASQUERADE) [nur Postrouting]")
53 jump:value("SNAT", "Quelle umschreiben (SNAT) [nur Postrouting]")
54
55
56 add = s:option(Value, "command", "Eigener Befehl")
57 add.size = 50
58 add.rmempty = true
59
60 return m