firewall: use multiports instead of openning port by port
This commit is contained in:
parent
bb7b95c78d
commit
11827cd6d1
6
firewall
6
firewall
|
@ -109,10 +109,8 @@ open_port()
|
||||||
fi
|
fi
|
||||||
source=$1
|
source=$1
|
||||||
log_action_msg "Open port(s) $ports from $source to $destination for protocol $proto"
|
log_action_msg "Open port(s) $ports from $source to $destination for protocol $proto"
|
||||||
for port in $(echo $ports | sed 's/,/ /g'); do
|
$IPTABLES -A INPUT -i $WAN_INT -p $proto -s $source -d $destination -m multiport --dports $ports -m state --state NEW -j ACCEPT
|
||||||
$IPTABLES -A INPUT -i $WAN_INT -p $proto -s $source -d $destination --dport $port -m state --state NEW -j ACCEPT
|
critical_return
|
||||||
critical_return
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
port_redirection()
|
port_redirection()
|
||||||
|
|
Reference in New Issue