From: "Прокопьев Евгений" <john@rmts.donpac.ru> To: community@altlinux.ru Subject: [Comm] Что не так в настройках firewall Date: Tue, 17 Sep 2002 10:41:01 +0400 Message-ID: <3D86CE7D.2020800@rmts.donpac.ru> (raw) Здравствуйте! Не могу подключиться ни к одному сайту с помощью links, поиск имени чужого сайта с помощью nslookup тоже ничего не дает. С опущенным firewall все нормально Вот скрипт firewall. Если что не так, не бейте, почти все содрано с linux.yaroslavl.ru #!/bin/sh # # file /etc/sysconfig/iptable_ppp.sh - Initial IP Firewall script for 2.4.x # # Author: Vladimir Kholmanov, changes Eugene Prokopiev # use at your own risk # ################################################################################ EXTERNAL_IFACE="ppp0" INTERNAL_IFACE="eth0" LOCAL_IFACE="lo" IPTABLES="/sbin/iptables" ################################################################################ # Проверка зависимостей в загружаемых IPTables modules # /sbin/depmod -a # ################################################################################ # Устанавливаем default policies для INPUT, FORWARD и OUTPUT chains # $IPTABLES -P INPUT DROP $IPTABLES -P OUTPUT ACCEPT $IPTABLES -P FORWARD DROP ################################################################################ # Создаем дочерние chains для ICMP, TCP и UDP протоколов. # $IPTABLES -N icmp_in_ppp $IPTABLES -N tcp_in_ppp $IPTABLES -N udp_in_ppp ################################################################################ # Загружаем ICMP rules для входящих потоков # $IPTABLES -A icmp_in_ppp -p ICMP --icmp-type 3 -j ACCEPT $IPTABLES -A icmp_in_ppp -p ICMP --icmp-type 0 -j ACCEPT $IPTABLES -A icmp_in_ppp -p ICMP --icmp-type 11 -j ACCEPT $IPTABLES -A icmp_in_ppp -m limit --limit 6/minute --limit-burst 1 -p ICMP --icmp-type 8 -j ACCEPT $IPTABLES -A icmp_in_ppp -m limit --limit 2/minute --limit-burst 4 -j LOG --log-prefix "ICMP in ppp died: " $IPTABLES -A icmp_in_ppp -p ICMP -j DROP ################################################################################ # Загружаем TCP rules для входящих потоков # $IPTABLES -A tcp_in_ppp -p TCP --syn --dport 80 -j ACCEPT $IPTABLES -A tcp_in_ppp -p TCP --syn --dport 22 -j ACCEPT $IPTABLES -A tcp_in_ppp -p TCP --syn --dport 53 -j ACCEPT $IPTABLES -A tcp_in_ppp -p TCP --syn --dport 6000 -j DROP $IPTABLES -A tcp_in_ppp -p TCP --syn --dport 1024:65535 -j ACCEPT $IPTABLES -A tcp_in_ppp -p TCP -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A tcp_in_ppp -m limit --limit 2/minute --limit-burst 4 -j LOG --log-prefix "TCP in ppp died: " $IPTABLES -A tcp_in_ppp -p TCP -j DROP ################################################################################ # Загружаем UDP rules для входящих потоков # $IPTABLES -A udp_in_ppp -p UDP --dport 53 -j ACCEPT $IPTABLES -A tcp_in_ppp -p UDP --dport 1024:65535 -j ACCEPT $IPTABLES -A udp_in_ppp -m limit --limit 3/minute --limit-burst 6 -j LOG --log-prefix "UDP in ppp died: " $IPTABLES -A udp_in_ppp -p UDP -j DROP ################################################################################ # INPUT chain # # Регистрируем и удаляем "проблемные" TCP пакеты. # $IPTABLES -A INPUT -i $EXTERNAL_IFACE -p tcp ! --syn -m state --state NEW -j LOG --log-prefix "New not syn:" $IPTABLES -A INPUT -i $EXTERNAL_IFACE -p tcp ! --syn -m state --state NEW -j DROP ################################################################################ # "Направляющие" для локальных и "перенаправляющие" для inet пакетов rules. # $IPTABLES -A INPUT -p TCP -i $LOCAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p TCP -i $INTERNAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p TCP -i $EXTERNAL_IFACE -j tcp_in_ppp $IPTABLES -A INPUT -p UDP -i $LOCAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p UDP -i $INTERNAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p UDP -i $EXTERNAL_IFACE -j udp_in_ppp $IPTABLES -A INPUT -p ICMP -i $LOCAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p ICMP -i $INTERNAL_IFACE -j ACCEPT $IPTABLES -A INPUT -p ICMP -i $EXTERNAL_IFACE -j icmp_in_ppp ################################################################################ # Регистрирующее rule для "неохваченных" пакетов. # $IPTABLES -A INPUT -m limit --limit 3/minute --limit-burst 6 -j LOG --log-prefix "IP INPUT packet died: " ################################################################################ # Корректировка уязвимости NAT # $IPTABLES -A OUTPUT -m state -p icmp --state INVALID -j DROP -- С уважением, Прокопьев Евгений
next reply other threads:[~2002-09-17 6:41 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-09-17 6:41 Прокопьев Евгений [this message] 2002-09-17 7:46 ` [Comm] Настройка безопасности Alex 2002-09-17 8:58 ` [Comm] Что не так в настройках firewall Alexander Vasiliev 2002-09-17 9:26 ` Прокопьев Евгений
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3D86CE7D.2020800@rmts.donpac.ru \ --to=john@rmts.donpac.ru \ --cc=community@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git