Linux Netfilter discussions
 help / color / mirror / Atom feed
From: George Alexandru Dragoi <waruiinu@gmail.com>
To: Kevin de Kok <kevin@oom-killer.org>
Cc: netfilter@lists.netfilter.org
Subject: Re: More gateways in the same subnet
Date: Sun, 27 Mar 2005 20:16:26 +0300	[thread overview]
Message-ID: <3063e505032709164a601ff8@mail.gmail.com> (raw)
In-Reply-To: <4245FB01.6080204@oom-killer.org>

echo 100 isp1 >> /etc/iproute2/rt_tables
echo 101 isp2 >> /etc/iproute2/rt_tables

ip ro add 192.168.1.0/24 dev eth1 table isp1
ip ro add 192.168.1.0/24 dev eth3 table isp2
ip ro add <isp1_subnet_link> dev eth0 table isp1
ip ro add <isp2_subnet_link> dev eth2 table isp2

if ISP1 gave you the 1.2.3.4ip, then <isp1_subnet_link> will be
1.2.3.0/24 , or whatever the netmask may be. Now do:

ip ro add default via <isp1_gw> table isp1
ip ro add default via <isp2_gw> table isp2

also

ip ro add default via <whatever_isp_gw_you_want> if you happen not to
have a default gateway

and last;

ip rule add from 192.168.1.0/24 iif dev eth1 table isp1
ip rule add from 192.168.1.0/24 iif dev eth3 table isp2

Hopefully it will work :)
One problem will be if both ethernet cards will reply to some ap
query, so even a client choose 192.168.1.1 as a gateway, the traffic
may come on eth3.



On Sun, 27 Mar 2005 01:14:57 +0100, Kevin de Kok <kevin@oom-killer.org> wrote:
> Hi,
> 
> I have a linux router in my lan with two nic's to two isp's and i also
> have two nic's for the lan. I have on eth0 the ip from ISP1 on eth2 the
> ip from ISP2 on eth1 i have 192.168.1.1 and on eth3 i have 192.168.1.2.
> What i'am trying to is when i give 192.168.1.1 as gateway on a client in
> my  lan then the traffic go's over ISP1 and when i give  as gateway
> 192.168.1.2 that the traffic go's over ISP2. How can i manage this?
> 
> 


-- 
Bla bla


  reply	other threads:[~2005-03-27 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-27  0:14 More gateways in the same subnet Kevin de Kok
2005-03-27 17:16 ` George Alexandru Dragoi [this message]
2005-03-28  6:13   ` Grant Taylor

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=3063e505032709164a601ff8@mail.gmail.com \
    --to=waruiinu@gmail.com \
    --cc=kevin@oom-killer.org \
    --cc=netfilter@lists.netfilter.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox