ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] IPtables вопрос
@ 2004-11-11 13:22 Ivanov Maxim
  2004-11-11 13:33 ` Alexey S. Kuznetsov
  0 siblings, 1 reply; 6+ messages in thread
From: Ivanov Maxim @ 2004-11-11 13:22 UTC (permalink / raw)
  To: community

Здравствуйте, 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

Это часом уже не бред попер?

________________
С уважением,
Максим Иванов



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-11 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-11 13:22 [Comm] IPtables вопрос 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

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