* Fixed firewall scripts
This commit is contained in:
parent
799de8987c
commit
e9ff9dd994
3 changed files with 6 additions and 15 deletions
|
@ -15,12 +15,14 @@ apply_portfw() {
|
||||||
|
|
||||||
if ([ "$proto" == "tcpudp" ] || [ "$proto" == "tcp" ]); then
|
if ([ "$proto" == "tcpudp" ] || [ "$proto" == "tcp" ]); then
|
||||||
iptables -t nat -A luci_prerouting -i "$iface" -p tcp --dport "$dport" -j DNAT --to "$to"
|
iptables -t nat -A luci_prerouting -i "$iface" -p tcp --dport "$dport" -j DNAT --to "$to"
|
||||||
iptables -A luci_forward -i "$iface" -p tcp -d "$ip" "$ports" -j ACCEPT
|
iptables -t nat -A luci_postrouting -p tcp -d "$ip" $ports -j MASQUERADE
|
||||||
|
iptables -A luci_forward -i "$iface" -p tcp -d "$ip" $ports -j ACCEPT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ([ "$proto" == "tcpudp" ] || [ "$proto" == "udp" ]); then
|
if ([ "$proto" == "tcpudp" ] || [ "$proto" == "udp" ]); then
|
||||||
iptables -t nat -A luci_prerouting -i "$iface" -p udp --dport "$dport" -j DNAT --to "$to"
|
iptables -t nat -A luci_prerouting -i "$iface" -p udp --dport "$dport" -j DNAT --to "$to"
|
||||||
iptables -A luci_forward -i "$iface" -p udp -d "$ip" "$ports" -j ACCEPT
|
iptables -t nat -A luci_postrouting -p udp -d "$ip" $ports -j MASQUERADE
|
||||||
|
iptables -A luci_forward -i "$iface" -p udp -d "$ip" $ports -j ACCEPT
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,9 +68,6 @@ apply_rule() {
|
||||||
config_get jump "$cfg" jump
|
config_get jump "$cfg" jump
|
||||||
[ -n "$jump" ] && cmd="$cmd -j $jump"
|
[ -n "$jump" ] && cmd="$cmd -j $jump"
|
||||||
|
|
||||||
config_get state "$cfg" state
|
|
||||||
[ -n "$state" ] && cmd="$cmd -m state --state $state"
|
|
||||||
|
|
||||||
config_get command "$cfg" command
|
config_get command "$cfg" command
|
||||||
[ -n "$command" ] && cmd="$cmd $command"
|
[ -n "$command" ] && cmd="$cmd $command"
|
||||||
|
|
||||||
|
|
|
@ -20,3 +20,4 @@ config event uci_oncommit
|
||||||
option wireless "/etc/init.d/network restart"
|
option wireless "/etc/init.d/network restart"
|
||||||
option olsrd "/etc/init.d/olsrd restart"
|
option olsrd "/etc/init.d/olsrd restart"
|
||||||
option dhcp "/etc/init.d/dhcp restart"
|
option dhcp "/etc/init.d/dhcp restart"
|
||||||
|
option luci_fw "/etc/init.d/luci_fw restart"
|
|
@ -41,15 +41,6 @@ tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]")
|
||||||
tosrc.optional = true
|
tosrc.optional = true
|
||||||
tosrc:depends("jump", "DNAT")
|
tosrc:depends("jump", "DNAT")
|
||||||
|
|
||||||
|
|
||||||
state = s:option(MultiValue, "state", "Status")
|
|
||||||
state.optional = true
|
|
||||||
state.delimiter = ","
|
|
||||||
state:value("NEW", "neu")
|
|
||||||
state:value("ESTABLISHED", "etabliert")
|
|
||||||
state:value("RELATED", "zugehörig")
|
|
||||||
state:value("INVALID", "ungültig")
|
|
||||||
|
|
||||||
jump = s:option(ListValue, "jump", "Aktion")
|
jump = s:option(ListValue, "jump", "Aktion")
|
||||||
jump.rmempty = true
|
jump.rmempty = true
|
||||||
jump:value("", "")
|
jump:value("", "")
|
||||||
|
|
Loading…
Reference in a new issue