Проблема в том, что не работает код:
IPT=`which iptables`
INET_IFACE="eth0"
CLOSEPORTS="630,640,783,3310,10000"
UNPRIPORTS="1024:65535"
SSH="22"
$IPT -A INPUT -p tcp -m tcp -i $INET_IFACE --dport 27015 --sport $UNPRIVPORTS -j ACCEPT
$IPT -A OUTPUT -p tcp -m tcp -o $INET_IFACE --dport $UNPRIVPORTS --sport 27015 -j ACCEPT ! --syn
$IPT -A INPUT -p tcp -m tcp -i $INET_IFACE --dport 27016 --sport $UNPRIVPORTS -j ACCEPT
$IPT -A OUTPUT -p tcp -m tcp -o $INET_IFACE --dport $UNPRIVPORTS --sport 27016 -j ACCEPT ! --syn
Ошибки:
# $IPT -A INPUT -p tcp -m tcp -i $INET_IFACE --dport 27015 --sport $UNPRIVPORTS -j ACCEPT
iptables v1.4.21: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
# $IPT -A OUTPUT -p tcp -m tcp -o $INET_IFACE --dport $UNPRIVPORTS --sport 27015 -j ACCEPT ! --syn
iptables v1.4.21: invalid port/service `--sport' specified
Try `iptables -h' or 'iptables --help' for more information.
# $IPT -A INPUT -p tcp -m tcp -i $INET_IFACE --dport 27016 --sport $UNPRIVPORTS -j ACCEPT
iptables v1.4.21: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
# $IPT -A OUTPUT -p tcp -m tcp -o $INET_IFACE --dport $UNPRIVPORTS --sport 27016 -j ACCEPT ! --syn
iptables v1.4.21: invalid port/service `--sport' specified
Try `iptables -h' or 'iptables --help' for more information.
centos, iptables