ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] iptables_settings
@ 2006-10-20 12:01 Глазунов Алексей Александрович
  2006-10-20 12:08 ` Дмитрий Ананьев
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Глазунов Алексей Александрович @ 2006-10-20 12:01 UTC (permalink / raw)
  To: community

Есть необходимость научить программу "Дипост" ходить в инет в обход proxy.
Функцию прокси, помимо прочих, выполняет ALTLinux Master 2.2.
На ALTLinux-сервере стоит 2 сетевые карты:
eth0 - смотрит в инет с IP 213.129.97.250
eth1 - смотрит в локалку с IP 192.168.0.0/255.255.255.0
Все ходят в инет только через squid.

Дипост рапотает с портами 25 и 110  и никаких настроек под прокси не имеет.
Есть возможность другие порты указать. Решили, чтобы не сломать почту, что  
нужно
на сервере с локального компа 192.168.0.205 принимать запросы на порты  
3025 и 3110
и передавать их далее на 195.98.64.73 в порты 25 и 110. Ответы с  
195.98.64.73
соответвенно требуется переадресовать на 192.168.0.205.
Сделал следующие настройки в iptables:

# Example iptables config file.
# Note the this file uses the format of iptables-save
# What follows is an example of this output.  However,
# the actual rule lines have been commented out.
# DO NOT USE THE -t (table) OPTION IN THIS FILE!
*mangle
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
#-A PREROUTING -p tcp --dport 22 -j TOS --set-tos 0x10
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
#-A FORWARD -i eth0 -j ACCEPT
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
#195.98.64.73 - ip-server_bank
#-A PREROUTING -p tcp --dport 25 -j REDIRECT --to-ports 3128
#-A PREROUTING -p tcp -d 192.168.0.205 --dport 3025 -j DNAT  
--to-destination 195.98.64.73:25
#-A PREROUTING -p tcp -d 192.168.0.205 --dport 3110 -j DNAT  
--to-destination 195.98.64.73:110

-A PREROUTING -p tcp -s 195.98.64.73 -d 213.129.97.252 --dport 25 -j DNAT  
--to-destination 192.168.0.205:3025
-A PREROUTING -p tcp -s 195.98.64.73 -d 213.129.97.252 --dport 110 -j DNAT  
--to-destination 192.168.0.205:3110

:POSTROUTING ACCEPT [0:0]
#-A POSTROUTING -p tcp --dport 110 -o eth0 -j SNAT --to-source  
213.129.97.252
#-A POSTROUTING -p tcp -s 192.168.0.205 -d 192.168.0.201 -o eth0 -j SNAT  
--to-source 213.129.97.252:25

-A POSTROUTING -p tcp -s 192.168.0.205 -o eth0 -j SNAT --to-source  
213.129.97.252:25
-A POSTROUTING -p tcp -s 192.168.0.205 -o eth0 -j SNAT --to-source  
213.129.97.252:110

:OUTPUT ACCEPT [0:0]
#-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT



"Дипост" так и не заработал :-(
Как проверить правильно ли настроил iptables? Может еще чего-то нужно  
подкрутить?

-- 
С уважением,
Глазунов Алексей Александрович
Ведущий инженер-программист
Отдел программирования и связи
ОАО "ВОРОНЕЖОБЛГАЗ"
(4732) 51-22-56


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

end of thread, other threads:[~2006-10-20 14:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-20 12:01 [Comm] iptables_settings Глазунов Алексей Александрович
2006-10-20 12:08 ` Дмитрий Ананьев
2006-10-20 12:10   ` Дмитрий Ананьев
2006-10-20 12:21     ` Глазунов Алексей Александрович
2006-10-20 12:27       ` Дмитрий Ананьев
2006-10-20 12:29       ` Artur Yakupov
2006-10-20 12:31       ` Artur Yakupov
2006-10-20 12:41 ` Artur Yakupov
2006-10-20 13:18   ` Глазунов Алексей Александрович
2006-10-20 14:09     ` Artur Yakupov
2006-10-20 13:14 ` Шенцев Алексей Владимирович
2006-10-20 13:28   ` Глазунов Алексей Александрович
2006-10-20 13:36     ` Дмитрий Ананьев

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