ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: Anton Gorlov <stalker@altlinux.ru>
To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] странная бага с маршрутизацией
Date: Mon, 06 Aug 2007 18:03:23 +0400
Message-ID: <46B72A2B.7070909@altlinux.ru> (raw)
In-Reply-To: <a443d1d70708060628l210903e4qe996f69a428908eb@mail.gmail.com>

slaytor пишет:
>> А как раньше работало ? По идее, так и должно быть. Куда пришло, туда
>> и пришло, а уходить должно через default gw. Это если по-умолчанию.
> раньше никаких манипуляций с iproute итп не требовалось просто
> поднятие интерфейса с настройками по умолчанию без шлюза и из вне
> подключения принимались без проблем

  Основной провайдер 10.1.2.3/24, резервный провайдер 10.4.5.6/24

#!/bin/csh
set ip1="10.1.2.3"
set net1="10.1.2.0/24"
set gw1="10.1.2.254"
set ip2="10.4.5.6"
set net2="10.4.5.0/24"
set gw2="10.4.5.254"
ip route add $net1 dev eth1 src $ip1 table 10
ip route add default via $gw1 table 10
ip route add $net2 dev eth2 src $ip2 table 20
ip route add default via $gw2 table 20
ip route add default via $gw1
ip rule add from $ip1 table 10
ip rule add from $ip2 table 20

А еще можно в crontab прописать скрипт наподобие:
#!/bin/csh
set gw1="10.1.2.254"
set gw2="10.4.5.254"
ping -c4 $gw1 >& /dev/null
if ($status) then
ip route del default
ip route add default via $gw2
else
ip route del default
ip route add default via $gw1
endif

... а при настройке NAT использовать -j MASQUERADE





-- 
   np: silence


  reply	other threads:[~2007-08-06 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05  6:20 slaytor
2007-08-05 19:55 ` Sergey
2007-08-06 13:28   ` slaytor
2007-08-06 14:03     ` Anton Gorlov [this message]
2007-08-07  5:35       ` slaytor
2007-08-06 16:03     ` Sergey
2007-08-06 16:59       ` slaytor
2007-08-07  4:28         ` Sergey

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=46B72A2B.7070909@altlinux.ru \
    --to=stalker@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