From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 29 Sep 2003 23:54:56 +0400 (MSD) From: "unix9" Sender: unix9@yandex.ru Message-Id: <3F788E10.000001.28585@camay.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] Errors-To: unix9@yandex.ru To: community@altlinux.ru X-source-ip: 217.151.66.165 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 8bit Subject: [Comm] =?koi8-r?b?SVBUQUJMRVMsINLB2sLP0iDP28nCz8s=?= X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.1.2 Precedence: list Reply-To: community@altlinux.ru List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2003 19:55:06 -0000 Archived-At: List-Archive: List-Post: Я тут впервые настраиваю шлюз (файрволл и нат, на машине также есть почтовый сервер, днс-сервер и веб) При запуске скрипта выходит такое сообщение Bad argument `бродкастовый адрес' Bad argument `ACCEPT' Bad argument `ESTABLISHIED,RELATED' Warning: wierd character in interface `eth0-j' (No aliases, :, ! or *). Bad argument `tcp_packets' Warning: wierd character in interface `eth0-j' (No aliases, :, ! or *). Bad argument `udp_packets' Bad argument `ACCEPT' Знатоки подобных вещей объясните где я не прав? Вот сам скрипт #!/bin/sh # Internet Configuration" INET_IP="реальный адрес" INET_IFACE="eth0" INET_BROADCAST="бродкастовый адрес" # LAN Configuration LAN IP="192.168.100.6" LAN_IP_RANGE="192.168.100.0/24" LAN_BROADCAST_ADDRESS="192.168.100.250" LAN_IFACE="eth1" #Localhost Configuration LO_IFACE="lo" LO_IP="127.0.0.1" #IPTABLES IPTABLES="/sbin/iptables" # Module loading /sbin/modprobe ip_tables /sbin/modprobe ip_conntrack /sbin/modprobe iptable_filter /sbin/modprobe iptable_mangle /sbin/modprobe iptable_nat /sbin/modprobe ipt_LOG /sbin/modprobe ipt_limit /sbin/modprobe ipt_state # proc set up # #proc "1" > /proc/sys/net/ipv4/ip_forward # Rules $IPTABLES -P INPUT DROP $IPTABLES -P OUTPUT DROP $IPTABLES -P FORWARD DROP # Create bad tcp packets $IPTABLES -N bad_tcp_packets $IPTABLES -N allowed $IPTABLES -N tcp_packets $IPTABLES -N udp_packets $IPTABLES -N icmp_packets $IPTABLES -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \ --log-prefix "New not syn:" $IPTABLES -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP $IPTABLES -A allowed -p tcp --syn -j ACCEPT $IPTABLES -A allowed -p tcp -m state --state ESTABLISHED, RELATED -j ACCEPT $IPTABLES -A allowed -p tcp -j DROP # TCP Rules $IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 21 -j allowed $IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 22 -j allowed $IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 80 -j allowed $IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 110 -j allowed $IPTABLES -A tcp_packets -p tcp -s 0/0 --dport 113 -j allowed # UDP ports $IPTABLES -A udp_packets -p udp -s 0/0 --source-port 2074 -j ACCEPT $IPTABLES -A udp_packets -p udp -s 0/0 --source-port 4000 -j ACCEPT $IPTABLES -A udp_packets -p udp -i $INET_IFACE -d -d $INET_BROADCAST \ --destination-port 135:139 -j DROP $IPTABLES -A udp_packets -p udp -i $INET_IFACE -d 255.255.255.255 \ --destination-port 67:68 -j DROP # ISMP rules $IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 8 -j ACCEPT $IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 11 -J ACCEPT $IPTABLES -A icmp_packets -p icmp -s 0/0 --icmp-type 0 -j ACCEPT #INPUT chain #BAD TCP packets $IPTABLES -A INPUT -p tcp -j bad_tcp_packets #Rules for special $IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LO_IP -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LAN_IP -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $INET_IP -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LAN_IFACE -d $LAN_BROADCAST_ADDRESS -j ACCEPT #Rules for incoming from Internet $IPTABLES -A INPUT -p ALL -d $INET_IP -m state ESTABLISHIED, RELATED \ -j ACCEPT $IPTABLES -A INPUT -p tcp -i $INET_IFACE-j tcp_packets $IPTABLES -A INPUT -p udp -i $INET_IFACE-j udp_packets $IPTABLES -A INPUT -p -i $INET_IFACE -d 224.0.0.0/8 -j DROP #Log $IPTABLES -A INPUT -m limit --limit 3/minute --limit-burst 3 -J LOG \ --log-level DEBUG --log-prefix "IPT INPUT packet died:" #Forward chain $IPTABLES -A FORWARD -p tcp -J bad_tcp_packets $IPTABLES -A FORWARD -i $LAN_IFACE -j ACCEPT $IPTABLES -A FORWARD -m state --state ESTABLISHIED, RELATED -j ACCEPT #Log $IPTABLES -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \ --log-level DEBUG --log-prefix "IPT FORWARD packets died: " #Badtcppacketswe don`t wont $IPTABLES -A OUTPUT -p ALL -s $LO_IP -j ACCEPT $IPTABLES -A OUTPUT -p ALL -s $LAN_IP -j ACCEPT $IPTABLES -A OUTPUT -p ALL -s $INET_IP -j ACCEPT $IPTABLES -A OUTPUT -m limit --limit 3/minite --limit-burst 3 -j LOG \ --log-level DEBUG --log-prefix "IPT OUTPUT packet died: " $IPTABLES -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE $IPTABLES -t nat -A POSTROUTING -s 192.168.100.0/24 --out-interface eth0 -j SNAT --to-source $INET_IP