firewall: use multiports instead of openning port by port

This commit is contained in:
Jérôme Schneider 2013-08-30 19:41:20 +02:00
parent bb7b95c78d
commit 11827cd6d1
1 changed files with 2 additions and 4 deletions

View File

@ -109,10 +109,8 @@ open_port()
fi
source=$1
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 --dport $port -m state --state NEW -j ACCEPT
critical_return
done
$IPTABLES -A INPUT -i $WAN_INT -p $proto -s $source -d $destination -m multiport --dports $ports -m state --state NEW -j ACCEPT
critical_return
}
port_redirection()