From: Dmitry Lebkov <dima@sakhalin.ru> To: community@altlinux.ru Subject: Re: [Comm] Re: Помогите разобраться с iptables Date: Sun, 30 May 2004 23:12:57 +1100 Message-ID: <20040530231257.0c94bd97.dima@sakhalin.ru> (raw) In-Reply-To: <20040530125925.48283460@juveman.pyat.atom.ru> On Sun, 30 May 2004 12:59:25 +0400 Juveman <juveman@atom.ru> wrote: > > > > У тебя REJECT-правило, отвергающее все tcp-пакеты применяется раньше > > чем '-m state'. Приведи /etc/sysconfig/iptables вот к такому виду: > > > > # Generated by iptables-save v1.2.9 on Sat May 29 20:53:21 2004 > > *filter > > :INPUT DROP [0:0] > > :FORWARD DROP [0:0] > > :OUTPUT DROP [0:0] > > [0:0] -A INPUT -i lo -j ACCEPT > > [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT > > [0:0] -A INPUT -p tcp -m multiport --sports 20,21,80 -j ACCEPT > > [0:0] -A INPUT -p tcp -j REJECT --reject-with icmp-port-unreachable > > [0:0] -A OUTPUT -o lo -j ACCEPT > > [0:0] -A OUTPUT -p tcp -m multiport -s 10.0.222.8 --dports 20,21,80 -j Упустил я одно правило ... %) [0:0] -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT С ним всё работает как задумывалось. Специально проверил ... %) > > ACCEPT COMMIT > > # Completed on Sat May 29 20:53:21 2004 > > > > и всё будет работать так, как ты пытаешся сделать. Т.е. для хоста > > 10.0.222.8 будет разрешен tcp-трафик протоколов HTTP и FTP (в том > > числе и passive FTP), а всё остальное - запрещено. > > > Сделал все по этому примеру. Перестало работать вообще все. Видимо дело в > запрещенных исходящих udp и icmp соединениях. > Добавляю к этому еще 2 правила: > iptables -A OUTPUT -p UDP -j ACCEPT > iptables -A OUTPUT -p ICMP -j ACCEPT Все правильно - разговор был о разрешении _только_ FTP и HTTP. Просто при настройке правил ты должен четко представлять, какой трафик генерит твой хост в штатном режиме и как работает тот или иной протокол (Hint: tcpdump is your friend ;) Т.е. однозначно необходимо разрешать DNS (tcp/udp 53), имеет смысл разрешить отправку icmp-unreachable-* сообщений и т.д. Вобщем, http://gazette.linux.ru.net/rus/articles/iptables-tutorial.html вдумчиво читать до появления ясности ... ;) -- WBR, Dmitry Lebkov
prev parent reply other threads:[~2004-05-30 12:12 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-05-30 8:59 ` Juveman 2004-05-30 12:12 ` Dmitry Lebkov [this message]
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=20040530231257.0c94bd97.dima@sakhalin.ru \ --to=dima@sakhalin.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