Two NIC cards => Possible to Configure Two Default Routes?

This is a discussion on Two NIC cards => Possible to Configure Two Default Routes? within the Linux Networking forums, part of the Linux Forums category; Folks, I have two DSL providers, can I configure two default routes that are able to send and receive network ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-26-2005
beagle197@hotmail.com
 
Posts: n/a
Default Two NIC cards => Possible to Configure Two Default Routes?

Folks,
I have two DSL providers, can I configure two default routes that are
able to send and receive network packets on both interfaces (eth0 and
eth1) at the same time? It would seem to me that it would be possible,
since if eth0 receives traffic, then response would be sent back
through eth0. The same with eth1. I noted a lot of discussion about
this topic from past posts, where folks have achieved this using
external equipment routers, or that it was possible using Solaris OS. I
am guessing that some Linux folks have devised or written their
customized solution since they went to the extra effort to modify the
TCP/IP stack or tweak the networking kernel modules (but I haven't seen
or heard anything on this point for sure at this time). Is it possible,
and how can I achieve it? I tried to use a higher metric for default
route eth0 verses eth1, but packets were not sent on both interfaces.
Thanks, BEA

bea:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
69.109.218.0 0.0.0.0 255.255.248.0 U 0 0 0
eth1
0.0.0.0 69.109.218.1 0.0.0.0 UG 0 0 0
eth1
0.0.0.0 10.0.0.1 0.0.0.0 UG 20 0 0
eth0
bea:/# uname -a
Linux bea 2.6.8-2-686 #1 Thu May 19 17:53:30 JST 2005 i686 GNU/Linux
bea:/# cat /etc/debian_version
testing/unstable
bea:/#

Reply With Quote
  #2 (permalink)  
Old 09-26-2005
buck
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

On 26 Sep 2005 08:11:16 -0700, beagle197@hotmail.com wrote:

>Folks,
>I have two DSL providers, can I configure two default routes that are
>able to send and receive network packets on both interfaces (eth0 and
>eth1) at the same time? It would seem to me that it would be possible,
>since if eth0 receives traffic, then response would be sent back
>through eth0. The same with eth1. I noted a lot of discussion about
>this topic from past posts, where folks have achieved this using
>external equipment routers, or that it was possible using Solaris OS. I
>am guessing that some Linux folks have devised or written their
>customized solution since they went to the extra effort to modify the
>TCP/IP stack or tweak the networking kernel modules (but I haven't seen
>or heard anything on this point for sure at this time). Is it possible,
>and how can I achieve it? I tried to use a higher metric for default
>route eth0 verses eth1, but packets were not sent on both interfaces.
>Thanks, BEA
>
>bea:/# route -n
>Kernel IP routing table
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0
>eth0
>69.109.218.0 0.0.0.0 255.255.248.0 U 0 0 0
>eth1
>0.0.0.0 69.109.218.1 0.0.0.0 UG 0 0 0
>eth1
>0.0.0.0 10.0.0.1 0.0.0.0 UG 20 0 0
>eth0
>bea:/# uname -a
>Linux bea 2.6.8-2-686 #1 Thu May 19 17:53:30 JST 2005 i686 GNU/Linux
>bea:/# cat /etc/debian_version
>testing/unstable
>bea:/#


Yes, you can set two default routes. Try 'man ip'.

Read LARTC, the Linux Advanced Routing and Traffic Control mailing
list.
http://lartc.org/

Read Julian's web site.
http://www.ssi.bg/~ja/

http://www.ssi.bg/~ja/nano.txt
--
buck

Reply With Quote
  #3 (permalink)  
Old 09-26-2005
Clifford Kite
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

beagle197@hotmail.com wrote:
> Folks,
> I have two DSL providers, can I configure two default routes that are
> able to send and receive network packets on both interfaces (eth0 and
> eth1) at the same time?


Take a look at section "4.2. Routing for multiple uplinks/providers"
in the "Linux Advanced Routing & Traffic Control HOWTO" available at
http://lartc.org and see if that fills your need.

--
Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
Reply With Quote
  #4 (permalink)  
Old 09-26-2005
James Knott
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

beagle197@hotmail.com wrote:

> Folks,
> I have two DSL providers, can I configure two default routes that are
> able to send and receive network packets on both interfaces (eth0 and
> eth1) at the same time? It would seem to me that it would be possible,
> since if eth0 receives traffic, then response would be sent back
> through eth0. The same with eth1. I noted a lot of discussion about
> this topic from past posts, where folks have achieved this using
> external equipment routers, or that it was possible using Solaris OS. I
> am guessing that some Linux folks have devised or written their
> customized solution since they went to the extra effort to modify the
> TCP/IP stack or tweak the networking kernel modules (but I haven't seen
> or heard anything on this point for sure at this time). Is it possible,
> and how can I achieve it? I tried to use a higher metric for default
> route eth0 verses eth1, but packets were not sent on both interfaces.
> Thanks, BEA


There can only be one default route. There is no mechanism by which an app
can determine which port a packet came in on. Transmitted packets are
simply routed according to the routing tables in your computer.

Reply With Quote
  #5 (permalink)  
Old 09-26-2005
James Knott
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

buck wrote:

> Yes, you can set two default routes. Try 'man ip'.


How on earth can there possibly be two default routes? By definition, a
default is used, when no other listed route is available. How would the
computer determine which of two default routes to use?


Reply With Quote
  #6 (permalink)  
Old 09-26-2005
John Adams
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

In article <Gd2dnWAQdrJbyaXenZ2dnUVZ_s2dnZ2d@rogers.com>,
James Knott <james.knott@rogers.com> wrote:
>beagle197@hotmail.com wrote:
>
>> Folks,
>> I have two DSL providers, can I configure two default routes that are
>> able to send and receive network packets on both interfaces (eth0 and
>> eth1) at the same time? It would seem to me that it would be possible,
>> since if eth0 receives traffic, then response would be sent back
>> through eth0. The same with eth1. I noted a lot of discussion about
>> this topic from past posts, where folks have achieved this using
>> external equipment routers, or that it was possible using Solaris OS. I
>> am guessing that some Linux folks have devised or written their
>> customized solution since they went to the extra effort to modify the
>> TCP/IP stack or tweak the networking kernel modules (but I haven't seen
>> or heard anything on this point for sure at this time). Is it possible,
>> and how can I achieve it? I tried to use a higher metric for default
>> route eth0 verses eth1, but packets were not sent on both interfaces.
>> Thanks, BEA

>
>There can only be one default route. There is no mechanism by which an app
>can determine which port a packet came in on. Transmitted packets are
>simply routed according to the routing tables in your computer.


Here's a part of my routing table:
66.93.49.0/24 dev eth0 proto kernel scope link src 66.93.49.232
66.93.49.0/24 dev eth1 proto kernel scope link src 66.93.49.140
default equalize
nexthop via 66.93.49.1 dev eth0 weight 1
nexthop via 66.93.49.1 dev eth1 weight 1
It has two default routes, balanced for outbound. See man ip.
And yes, reply packets go back out the interface from whence they came.
Do the following to achieve this. (May be overkill)
echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_filter
echo 1 > /proc/sys/net/ipv4/conf/eth1/arp_filter

Reply With Quote
  #7 (permalink)  
Old 09-27-2005
David Schwartz
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?


"James Knott" <james.knott@rogers.com> wrote in message
news:dcydnfleL4pnyKXeRVn-3A@rogers.com...

> buck wrote:


>> Yes, you can set two default routes. Try 'man ip'.


> How on earth can there possibly be two default routes? By definition, a
> default is used, when no other listed route is available. How would the
> computer determine which of two default routes to use?


It would pick the one that had the lower cost or the one that had a next
hop that was closer to the destination (on the same network). It would break
ties arbitrarily, either alternating or by picking a preferred route
'randomly'.

DS


Reply With Quote
  #8 (permalink)  
Old 09-27-2005
David Schwartz
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?


"James Knott" <james.knott@rogers.com> wrote in message
news:Gd2dnWAQdrJbyaXenZ2dnUVZ_s2dnZ2d@rogers.com.. .

> There can only be one default route.


No, there can be more than one.

> There is no mechanism by which an app
> can determine which port a packet came in on.


What does that have to do with anything?

> Transmitted packets are
> simply routed according to the routing tables in your computer.


Right.

The point is that issue has nothing to do with routing in the sense of
getting packets to their destination. The routing would have to be by source
address, and the issue would be how to control what source address is used
(for packets that aren't replies).

DS


Reply With Quote
  #9 (permalink)  
Old 09-27-2005
James Knott
 
Posts: n/a
Default Re: Two NIC cards => Possible to Configure Two Default Routes?

David Schwartz wrote:

>> There can only be one default route.

>
> No, there can be more than one.


"Default", by definition, means the route taken, when no other is suitable.
That means there can not be more than one default route. If you're using
"cost" to determine if a route is used, it is no longer a default root.
The default route is the one taken, only after all other routes have been
determined to be not suitable. By assigning costs to a route, you are
making a selection, just as though it was an entry in the routing table.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0