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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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:/# |
|
|||
|
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 |
|
|||
|
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" |
|
|||
|
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. |
|
|||
|
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? |
|
|||
|
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 |
|
|||
|
"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 |
|
|||
|
"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 |
|
|||
|
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. |