All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arthur van Leeuwen <arthurvl@sci.kun.nl>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Newbie question
Date: Thu, 28 Feb 2002 12:31:36 +0000	[thread overview]
Message-ID: <marc-lartc-101489955603208@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101480860824396@msgid-missing>

On Thu, 28 Feb 2002, Ard van Breemen wrote:
> On Wed, Feb 27, 2002 at 04:29:23PM +0530, suresh wrote:
> > In eth0 172.16.1.1 and eth0:1 192.168.1.1
> > in eth1 are public ips of isps as eth1 a.b.c.d and eth1:0 w.x..y.z

> > echo 200 isp1 >> /etc/iproute2/rt_tables
> > ip rule ls
> > 0:      from all lookup local
> > 32765:  from 172.16.1.0/24 lookup isp1
> > 32766:  from all lookup main
> > 32767:  from all lookup default

> > ip route add default via a.b.c.d dev eth1 table isp1
> > ip route flush cache

> > Its work fine when request comes from 172.16.1.0 netwok
> > When i add   ip route add default via w.x.y.z dev eth1
> > to forward request from another lan network it works fine
> > but req from 172.16.1.0 does not work
> > if i remove  ip route del default via w.x.y.z dev eth1
> > its work well.

> > Did i leaveout anything in configuration?

> Yep: by adding the rule:
> ip rule add from 172.16.1.0/24 table isp1
> everything *WILL* go to table isp1.

Bzt. Every packet with a source address matching 172.16.1.0 will have
table isp1 searched first. If no route comes up for it the packet will still
be routed according to table main.

> In my experience everything even local traffic that matches the rule
> will go to the isp1 table, and hence will be routed to the gateway.

Local traffic should not be routed over this host anyway. The only thing
that will break is traffic from this host to the local network.

> Use a normal routing table for isp1:
> For instance:
> ip route add 172.16.1.0/24 dev {right device} scope link
> to make sure that you can still route back to 172.16.1.0...

This is good advice. Very good advice. It makes for a much clearer
configuration.

> Anyway: tcpdumping all of your interfaces will make you clear what is
> actually happenning.

Not always. Besides, the information you need is in the routing tables...
why not look at that instead and try to figure out what should happen?

(Ofcourse, this will not show programs sneakily changing the TOS of a
connection... but still... the information can be found in the routing
tables, if you count the cache as a routing table as well... :))

> Thinking about it: it only contains a default route, which means, it
> only knows that it should route to that default gateway.
> The default is I guess some sort of end point in a routing table.

Any route is an endpoint. Once a route has been found, the routing algorithm
will quit searching, and just route out that route. This has interesting
consequences, as the first thing searched is always the cache... and you can
even manipulate *that* by hand. >:)

Doei, Arthur.

-- 
  /\    / |      arthurvl@sci.kun.nl      | Work like you don't need the money
 /__\  /  | A friend is someone with whom | Love like you have never been hurt
/    \/__ | you can dare to be yourself   | Dance like there's nobody watching

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2002-02-28 12:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 11:11 [LARTC] Newbie question suresh
2002-02-28 11:44 ` Ard van Breemen
2002-02-28 12:30 ` suresh
2002-02-28 12:31 ` Arthur van Leeuwen [this message]
2002-02-28 13:24 ` Ard van Breemen
2002-12-16 15:58 ` [LARTC] newbie question Del Riesgo, Christopher D
2003-10-09 11:45 ` Muhammad Reza
2003-10-09 11:46 ` jeremie le-hen
2003-10-09 12:15 ` Muhammad Reza
2003-10-13 11:38 ` Muhammad Reza
2003-10-13 18:46 ` Stef Coene
2004-03-02 14:22 ` [LARTC] Newbie question Aravind babu
2004-03-03  5:45 ` Martin A. Brown
2004-09-28  7:35 ` Mark S. Nesterovich

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-101489955603208@msgid-missing \
    --to=arthurvl@sci.kun.nl \
    --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.