|
|
@@ -138,7 +138,7 @@ _init(){
|
|
|
}
|
|
|
|
|
|
_unblock(){
|
|
|
- ipset create -! $scanset hash:ip hashsize $scanmaxelems timeout $scanttl maxelem $scanmaxelems forceadd counters
|
|
|
+ ipset create -! $scanset hash:ip hashsize $scanmax timeout $scanttl maxelem $scanmax forceadd counters
|
|
|
${iptables} -N FWUNBLOCK
|
|
|
${iptables} -A FWUNBLOCK -i ${wan} -m set --match-set $scanset src -j LOG --log-prefix "UNBLOCK: " --log-level 7
|
|
|
${iptables} -A FWUNBLOCK -i ${wan} -m set --match-set $scanset src -j SET --del-set $scanset src
|
|
|
@@ -146,10 +146,10 @@ _unblock(){
|
|
|
}
|
|
|
|
|
|
_whitenets() {
|
|
|
- ipset create -! $whiteset hash:net hashsize 4096 timeout $whitettl maxelem $whitemaxelems
|
|
|
+ ipset create -! $whitenetset hash:net hashsize 4096 timeout $whitenetttl maxelem $whitenetmax
|
|
|
while read -r net ; do
|
|
|
[[ "$net" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}/[0-9]{1,}$ ]] || continue
|
|
|
- ipset -! add $whiteset $net timeout 0
|
|
|
+ ipset -! add $whitenetset $net timeout 0
|
|
|
done < $confd/WHITE.nets
|
|
|
}
|
|
|
|
|
|
@@ -194,13 +194,13 @@ lan() {
|
|
|
}
|
|
|
|
|
|
badips() {
|
|
|
- ipset create -! $banset hash:ip hashsize $badmaxelems timeout $banttl maxelem $badmaxelems
|
|
|
+ ipset create -! $badset hash:ip hashsize $badmax timeout $badttl maxelem $badmax
|
|
|
${iptables} -N FWBAD
|
|
|
if $logbad ; then
|
|
|
_droplog "BAD"
|
|
|
- ${iptables} -A FWBAD -i ${wan} -m set --match-set $banset src -m conntrack --ctstate NEW -j BADLOGDROP
|
|
|
+ ${iptables} -A FWBAD -i ${wan} -m set --match-set $badset src -m conntrack --ctstate NEW -j BADLOGDROP
|
|
|
fi
|
|
|
- ${iptables} -A FWBAD -i ${wan} -m set --match-set $banset src -m conntrack --ctstate NEW -j ENDRESET
|
|
|
+ ${iptables} -A FWBAD -i ${wan} -m set --match-set $badset src -m conntrack --ctstate NEW -j ENDRESET
|
|
|
${iptables} -A INPUT -j FWBAD
|
|
|
}
|
|
|
|
|
|
@@ -213,7 +213,7 @@ scanips() {
|
|
|
${iptables} -A INPUT -j FWSCAN
|
|
|
}
|
|
|
|
|
|
-white() {
|
|
|
+whitenets() {
|
|
|
_whitenets
|
|
|
${iptables} -N FWFILTERED
|
|
|
while read -r port ; do
|
|
|
@@ -224,8 +224,8 @@ white() {
|
|
|
[[ "$port" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
${iptables} -A FWFILTERED -p tcp -m conntrack --ctstate NEW --ctproto TCP --dport $port -j ACCEPT
|
|
|
done < $confd/WHITE.tcp
|
|
|
- ${iptables} -A INPUT -i ${wan} -p udp -m set --match-set $whiteset src -m conntrack --ctstate NEW --ctproto UDP -j FWFILTERED
|
|
|
- ${iptables} -A INPUT -i ${wan} -p tcp -m set --match-set $whiteset src -m conntrack --ctstate NEW --ctproto TCP -j FWFILTERED
|
|
|
+ ${iptables} -A INPUT -i ${wan} -p udp -m set --match-set $whitenetset src -m conntrack --ctstate NEW --ctproto UDP -j FWFILTERED
|
|
|
+ ${iptables} -A INPUT -i ${wan} -p tcp -m set --match-set $whitenetset src -m conntrack --ctstate NEW --ctproto TCP -j FWFILTERED
|
|
|
}
|
|
|
|
|
|
public() {
|