All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abraham van der Merwe <abz@frogfoot.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] help with routing determined by source address
Date: Tue, 19 Nov 2002 13:42:32 +0000	[thread overview]
Message-ID: <marc-lartc-103771343018171@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103770799113287@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]

Hi Vincent!

> > I want to route packets where the gateway is determined by the source
> > address and not the destination address - is this possible with iproute2?
> > 
> Yes.
> # When sraddr belongs to ISPA
> ip rule add prio $PRIO_ISPA from $ISPA_NET lookup $ISPA_TABLE
> # When sraddr belongs to ISPB
> ip rule add prio $PRIO_ISPB from $ISPB_NET lookup $ISPB_TABLE
> # Everything else
> ip rule add prio $PRIO_DEFAULT lookup $DEFAULT_TABLE
>
> # Default route through ISPA
> ip route add table $ISPA_TABLE default via $ISPA_GW dev $ISPA_DEV
> # Default route through ISPB
> ip route add table $ISPB_TABLE default via $ISPB_GW dev $ISPB_DEV
> 
> #For everything else, use a multipath route;
> ip route add table $DEFAULT_TABLE nexthop via $ISPA_GW dev $ISPA_DEV
> nexthop via $ISPB_GW dev $ISPB_DEV

Thanks, this makes sense. I just don't understand the multipath route? Also,
I take it the _TABLE variables can be arbitrary [unique] ids right? And if I
want to have ISPB as the exception to the rule, I'll set ISPA's priority the
highest?

> > for example:
> > 
> >  ISP-A   ISP-B
> >   |        |
> > +---------------+
> > | linux machine +
> > +---------------+
> > 
> > default gw is ISP-A interface, but if packet comes via ISP-B, the ISP-B
> > interface should be used instead of ISP-A interface
> 
> IPs used on the linux machines, are private or public IPs ?

public ips

-- 

Regards
 Abraham

BEWARE!  People acting under the influence of human nature.

___________________________________________________
 Abraham vd Merwe [ZR1BBQ] - Frogfoot Networks
 P.O. Box 3472, Matieland, Stellenbosch, 7602
 Cell: +27 82 565 4451 Http: http://www.frogfoot.net
 Email: abz@frogfoot.net


[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  parent reply	other threads:[~2002-11-19 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-19 12:11 [LARTC] help with routing determined by source address Abraham van der Merwe
2002-11-19 13:36 ` Vincent Jaussaud
2002-11-19 13:42 ` Abraham van der Merwe [this message]
2002-11-19 14:17 ` Vincent Jaussaud

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=marc-lartc-103771343018171@msgid-missing \
    --to=abz@frogfoot.net \
    --cc=lartc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.