From: "Глазунов Алексей Александрович" <glazunov@oblgaz.vrn.ru> To: community@lists.altlinux.org Subject: [Comm] iptables_settings Date: Fri, 20 Oct 2006 16:01:25 +0400 Message-ID: <op.thpycnae88vapp@glazunov.vrnoblgaz.local> (raw) Есть необходимость научить программу "Дипост" ходить в инет в обход 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
next reply other threads:[~2006-10-20 12:01 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-10-20 12:01 Глазунов Алексей Александрович [this message] 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 ` Дмитрий Ананьев
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=op.thpycnae88vapp@glazunov.vrnoblgaz.local \ --to=glazunov@oblgaz.vrn.ru \ --cc=community@lists.altlinux.org \ /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