From: Nick Drage <nickd@metastasis.org.uk>
To: netfilter@lists.netfilter.org
Subject: Re: semi OT: default route
Date: Wed, 20 Oct 2004 17:37:34 +0100 [thread overview]
Message-ID: <20041020163734.GR21006@metastasis.org.uk> (raw)
In-Reply-To: <20041020161725.GA7221@bender.817west.com>
On Wed, Oct 20, 2004 at 12:17:25PM -0400, Jason Opperisano wrote:
> On Wed, Oct 20, 2004 at 09:25:51AM -0400, Payal Rathod wrote:
> > Hi,
> > I have a question which has haunted me for many months. If I have 2 ISP
> > connections with me, with default gw 1.2.3.4 and 4.5.6.7 and if I add
> > both as default routes on my Linux gateway as,
> > route add -net default gw 1.2.3.4
> > route add -net default gw 4.5.6.7
> > and if I send a packet from a windows client to internet, which ISP will it
> > go through?
Looking at this from a slightly different, well, simpler, point of view
than Jason...
> this will sound like a stupid answer, but it will probably always use
> the route that you added first.
On the host I've just tried this on - admittedly just the once, it tried
the route I added *last*. But this is about thirty seconds worth of
testing :)
> the 'route' command will allow you to added multiple default routes,
> but the ones you add after the first one end up getting ignored. the
> 'ip' command won't let you add a default route once you have one (it
> uses teq and multipath for this):
>
> $ ip route list | grep default
> default via 10.2.1.1 dev eth0
>
> $ sudo ip route add default via 10.2.1.2
> RTNETLINK answers: File exists
However if you want to give the routes different metrics....
ip route add default via 1.2.3.4 metric 1
ip route add default via 4.5.6.7 metric 2
"ip" will accept that input.
That should mean if the host can't send the traffic via 1.2.3.4 it will
realise this ( I presume solely if it gets no arp-reply for 1.2.3.4) it
will try and send the traffic via 4.5.6.7 instead.
That seems to be the way it should work, however on a test box my host
is happily trying to arp for 1.2.3.4 continuosly.
Anyone help me finish off this answer ;)
--
We are the Willing, led by the Unknowing,
Are doing the Impossible, for the Ungrateful.
We have done so much, for so long, with so little,
We are now qualified to do anything with nothing.
next prev parent reply other threads:[~2004-10-20 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-20 13:25 semi OT: default route Payal Rathod
2004-10-20 16:17 ` Jason Opperisano
2004-10-20 16:37 ` Nick Drage [this message]
2004-10-20 16:48 ` Jason Opperisano
2004-10-20 16:57 ` Payal Rathod
2004-10-20 18:24 ` Jason Opperisano
2004-10-22 16:40 ` multiple external interface ? Faisal
-- strict thread matches above, loose matches on Subject: below --
2004-10-20 18:08 semi OT: default route Daniel Chemko
2004-10-20 18:53 ` Lopsch
2004-10-20 19:56 Daniel Chemko
2004-10-20 21:05 Lopsch
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=20041020163734.GR21006@metastasis.org.uk \
--to=nickd@metastasis.org.uk \
--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 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.