ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Alexander Bokovoy <ab@avilink.net>
To: mandrake-russian@linuxteam.iplabs.ru
Subject: Re: [mdk-re] HELP NEED
Date: Fri Jan 19 23:35:02 2001
Message-ID: <20010119223146.D3616@avilink.net> (raw)
In-Reply-To: <E14Ji1R-000M55-00@smtp1.port.ru>; from is-anti@mail.ru on Sat, Jan 20, 2001 at 01:21:20AM -0500

On Sat, Jan 20, 2001 at 01:21:20AM -0500, Igor Solovyov wrote:
> Hi All!
> 
> Очень срочно (до понедельника) нужно разрешить такую проблему:
> 
> Есть рутер, к нему несколько локалок прицеплено.
> И имеются два канала в и-нет - один скоростной (radio-ethernet),
> второй медленный (выделенка на 115 кбит/с).
> Нужно разделить и-нет между локалками. Т.е. часть локалок
> идут все время через медленный канал, остальные - через скоростной.
> 
> Не пойму как этого можно добиться. Когда был один канал, все было
> просто - прописал default gateway и нет проблем. А как сделать
> для разных сетей разные default gateway в одном рутере?
> Видимо никак. Может есть иные способы?

Есть. Ставите iproute2/iputils. Затем определяете две таблицы маршрутизации
и добавляете правила, определяющие какую из них для какой сети использовать.

Вроде такого (номера таблиц я взял "от балды", чтоб не пересеклись с тем, что
там есть по умолчанию):

echo "10	highspeed" >> /etc/iproute2/rt_tables
echo "11	lowspeed" >> /etc/iproute2/rt_tables

Теперь выставим маршруты в таблицах, для простоты -- только по умолчанию:
/sbin/ip route add default via ШЛЮЗ-БЫСТРОГО-КАНАЛА table highspeed
/sbin/ip route add default via ШЛЮЗ-МЕДЛЕННОГО-КАНАЛА table lowspeed

Теперь определим, кто куда ходит (повторить столько раз, сколько подсетей
входит в БЫСТРАЯ-СЕТЬ и МЕДЛЕННАЯ-СЕТЬ, каждый раз изменяя preference -- это
значение должно быть уникальным для каждого правила -- и, естественно, подсеть):
/sbin/ip rule add from БЫСТРАЯ-ПОДСЕТЬ/МАСКА preference 100 table highspeed
/sbin/ip rule add from МЕДЛЕННАЯ-ПОДСЕТЬ/МАСКА preference 200 table lowspeed

Я выбрал 100 и 200 "от балды".

А теперь скажем, что все должно начать работать:
/sbin/ip route flush cache

Можно также поставить что-нибудь еще в основной (main) таблице по умолчанию
(например, ШЛЮЗ-БЫСТРОГО-КАНАЛА), тогда одним набором правил будет меньше.
Читайте ip-cref.ps из документации на iproute2 для больших подробностей.
-- 
Sincerely yours, Alexander Bokovoy 
  The Midgard Project   | www.midgard-project.org |    Aurora R&D team 
Minsk Linux Users Group |    www.minsk-lug.net    |  www.aurora-linux.com  
   IPLabs Linux Team    |     linux.iplabs.ru     | Architecte Open Source
-- "Trust me.  I know what I'm doing."
-- Sledge Hammer



  reply	other threads:[~2001-01-19 23:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-19 23:21 Igor Solovyov
2001-01-19 23:35 ` Alexander Bokovoy [this message]
2001-01-20  0:03   ` Igor Solovyov
2001-01-20  0:35   ` Igor Solovyov
2001-01-20  0:53     ` Aleksey Novodvorsky

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=20010119223146.D3616@avilink.net \
    --to=ab@avilink.net \
    --cc=mandrake-russian@linuxteam.iplabs.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