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
|
||||
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()
|
||||
|
|
Reference in New Issue