From: "Alexey S. Kuznetsov" <buster@vostok.net.ua> To: Ivanov Maxim <community@altlinux.ru> Subject: Re[3]: [Comm] IPtables вопрос Date: Thu, 11 Nov 2004 16:34:26 +0200 Message-ID: <1724778480.20041111163426@vostok.net.ua> (raw) In-Reply-To: <1492128671.20041111171725@amos.ru> Hello! Вы писали 11 листопада 2004 р., 16:17:25: > Здравствуйте, Alexey. > Вы писали 11 ноября 2004 г., 16:33:04: >> Hello! >> Вы писали 11 листопада 2004 р., 15:22:41: >>> Здравствуйте, community. >>> На серваке (он же шлюз в интернет) есть почтовый сервер - две сетвухи >>> - eth0 и eth1 - соответственно вовнутрь и наружу. >>> Хочу сделать так, чтобы только этот сервер и только он мог ходить по >>> 25 порту (SMTP), принимать запросы на 110-й (POP3) только изнутри сети >>> и убивать все остальные запросы на eth1 относительно коннекта на >>> 110-й порт. >>> пишу: >>> $IPT -A INPUT -p TCP -i $LOCAL_IFACE --destination-port 25 -j ACCEPT >>> $IPT -A INPUT -p TCP -i $LOCAL_IFACE --destination-port 110 -j ACCEPT >>> $IPT -A INPUT -p TCP -i $INET_IFACE --destination-port 25 -j ACCEPT >>> $IPT -A INPUT -p TCP -i $INET_IFACE --destination-port 110 -j DROP >>> Но закралась подленькая мыслишка: а не требуется ли еще и переброс >>> портов делать с внешнего интерфейса на внутренний? Ну типа >>> $IPT -A FORWARD -p TCP -i $INET_IFACE --destanation-port 25 \ >>> --destanation 192.168.0.65 -j ACCEPT >>> $IPT -A FORWARD -p TCP -i $INET_IFACE --destanation-port 25 ACCEPT >>> $IPT -t NAT -A PREROUTING -p TCP -i $INET_IFACE -dport 25:25 \ >>> --to-destination 192.168.0.65:25 >>> $IPT -t NAT -A PREROUTING -p TCP -i $LOCAL_IFACE -dport 25:25 \ >>> --destination $INET_ADDRESS -j DNAT --to-destination 192.168.0.65:25 >>> Это часом уже не бред попер? >> пиши iptables -A INPUT -s !$INT_NET -d $INT_IP -p tcp --dport 25 -j ACCEPT >> -//- --dport 110 -j ACCEPT > Тут точно ACCEPT а не DROP или REJECT ??? Это 110-й порт... сори немного не так. я ошибся выше: 1. iptables -A INPUT -s $INT_NET -d $INT_IP -p tcp --dport 25 -j ACCEPT 2. iptables -A INPUT -s $INT_NET -d $INT_IP -p tcp --dport 110 -j ACCEPT 3. iptables -A INPUT -s 0/0 -d $INET_IP -p tcp --dport 25 -j ACCEPT 4. iptables -A INPUT -s 0/0 -d $INET_IP -p tcp --dport 110 -j REJECT а после этих правил можешь всем всё закрывать по этим портам. >> iptables -A input -s 0/0 -d $INET_IP -p tcp --dport 25 -j ACCEPT >> iptables -A input -s 0/0 -d $INET_IP -p tcp --dport 110 -j REJECT -- Sincerely, Alexey S. Kuznetsov AK2351-RIPE
prev parent reply other threads:[~2004-11-11 14:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-11-11 13:22 Ivanov Maxim 2004-11-11 13:33 ` Alexey S. Kuznetsov 2004-11-11 14:17 ` Re[2]: " Ivanov Maxim 2004-11-11 14:24 ` Re[3]: " Ivanov Maxim 2004-11-11 15:05 ` Dmitry Lebkov 2004-11-11 14:34 ` Alexey S. Kuznetsov [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=1724778480.20041111163426@vostok.net.ua \ --to=buster@vostok.net.ua \ --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