ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: "Peter V. Saveliev" <peet@altlinux.ru>
To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] два шлюза и проброс во внутреннюю  сеть
Date: Wed, 31 Oct 2007 14:25:16 +0300
Message-ID: <200710311425.16908.peet@altlinux.ru> (raw)
In-Reply-To: <47282362.80006@aaanet.ru>

On Wednesday 31 October 2007, altlinux@aaanet.ru wrote:
> всем привет!
> есть два шлюза в инет (канал U и канал S) и сервер во внутренней сети на
> котором есть ftp. Нужно обеспечить доступ к ftp с этих двух каналов.
> Шлюзом по умолчанию является канал U. Если я с инета пытаюсь соединиться
> через канал S то пакеты доходят до внутреннего ftp, но возращаются не
> через канал S, а через шлюз по умолчанию т.е. U.
> проброс осуществляется
> $IPTABLES -t nat -A PREROUTING -p TCP -d $EXTERNAL_U_ADDRESS --dport 21
> -j DNAT --to-destination 192.168.100.8:21
> $IPTABLES -t nat -A PREROUTING -p TCP -d $EXTERNAL_S_ADDRESS --dport 21
> -j DNAT --to-destination 192.168.100.8:21
> Как можно решить эту проблему.
>

в идеале -- самое простое -- это иметь по интерфейсу к каждому из шлюзов. 
Тогда:

ip route add default via S table S
ip route add default via U table U
ip route add default via U table main
ip rule add dev ethS table S
ip rule add dev ethU table U

Эта схема опробована и работает на мэйл-сервере, который глядит в две разных 
AS.

Возможно, что можно следить и не по интерфейсам, а по меткам, но это не 
пробовал, а с интерфейсами работает.

-- 
Peter V. Saveliev

  reply	other threads:[~2007-10-31 11:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  6:40 altlinux
2007-10-31 11:25 ` Peter V. Saveliev [this message]
2007-11-01  7:25   ` altlinux
2007-11-01  7:50     ` Peter V. Saveliev
2007-11-02  5:57       ` altlinux
2007-11-02  7:11         ` Peter V. Saveliev
2007-11-02  7:36           ` altlinux
2007-11-02  8:03             ` Peter V. Saveliev
2007-11-02 10:43               ` altlinux
2007-11-02 11:11                 ` Peter V. Saveliev
2007-11-06 10:26                   ` altlinux
2007-11-02 14:18                 ` Serge
2007-11-02 14:48                   ` Peter V. Saveliev
2007-11-06  7:56                     ` Alexey I. Froloff
2007-11-02 12:28   ` Igor Solovyov
2007-11-02 12:54     ` Peter V. Saveliev
2007-11-02 17:58       ` Igor Solovyov
2007-11-11 17:21       ` Igor Solovyov

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=200710311425.16908.peet@altlinux.ru \
    --to=peet@altlinux.ru \
    --cc=sysadmins@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 sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/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 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git