Networking Forums

Networking Forums > Computer Networking > Linux Networking > Two NIC cards => Possible to Configure Two Default Routes?

Reply
Thread Tools Display Modes

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

 
 
beagle197@hotmail.com
Guest
Posts: n/a

 
      09-26-2005, 03:11 PM
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
 
 
 
 
buck
Guest
Posts: n/a

 
      09-26-2005, 04:54 PM
On 26 Sep 2005 08:11:16 -0700, (E-Mail Removed) 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
 
Clifford Kite
Guest
Posts: n/a

 
      09-26-2005, 04:55 PM
(E-Mail Removed) 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-(E-Mail Removed)|rot13"
 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      09-26-2005, 08:06 PM
(E-Mail Removed) 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
 
James Knott
Guest
Posts: n/a

 
      09-26-2005, 08:11 PM
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
 
John Adams
Guest
Posts: n/a

 
      09-26-2005, 09:16 PM
In article <(E-Mail Removed)>,
James Knott <(E-Mail Removed)> wrote:
>(E-Mail Removed) 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
 
David Schwartz
Guest
Posts: n/a

 
      09-27-2005, 11:06 AM

"James Knott" <(E-Mail Removed)> wrote in message
news:dcydnfleL4pnyKXeRVn-(E-Mail Removed)...

> 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
 
David Schwartz
Guest
Posts: n/a

 
      09-27-2005, 11:07 AM

"James Knott" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed).. .

> 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
 
James Knott
Guest
Posts: n/a

 
      09-27-2005, 11:55 AM
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
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple default routes j-k-l@mail.ru Linux Networking 0 04-09-2008 11:20 AM
Multiple default routes - sorting by interface priority =?UTF-8?B?TGFzc2UgS8Okcmtrw6RpbmVuIC8gVHJvbmlj?= Linux Networking 2 03-05-2006 11:02 AM
redundant default routes? Jay McCanta Linux Networking 1 10-11-2004 01:15 PM
independant default routes for separate nics Johnny Musacha Linux Networking 4 08-18-2004 03:16 AM
Multiple default routes Kool Breeze Linux Networking 5 12-04-2003 01:41 AM



1 2 3 4 5 6 7 8 9 10 11