* semi OT: default route @ 2004-10-20 13:25 Payal Rathod 2004-10-20 16:17 ` Jason Opperisano 0 siblings, 1 reply; 7+ messages in thread From: Payal Rathod @ 2004-10-20 13:25 UTC (permalink / raw) To: Netfilter ML 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? Thanks a lot for the answer in advance and waiting eagerly for any replies. With warm regards, -Payal ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: semi OT: default route 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 0 siblings, 1 reply; 7+ messages in thread From: Jason Opperisano @ 2004-10-20 16:17 UTC (permalink / raw) To: Netfilter ML 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? this will sound like a stupid answer, but it will probably always use the route that you added first. 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 if you want to load-balance outbound traffic over multiple ISP links, you'll want to use something along the lines of the 'nth' patch from POM: http://netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.html#ss3.9 if you want to split outbound traffic over multiple links by source IP or protocol, etc--you can use the concepts from: http://lartc.org/howto/lartc.netfilter.html -j -- Jason Opperisano <opie@817west.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: semi OT: default route 2004-10-20 16:17 ` Jason Opperisano @ 2004-10-20 16:37 ` Nick Drage 2004-10-20 16:48 ` Jason Opperisano 0 siblings, 1 reply; 7+ messages in thread From: Nick Drage @ 2004-10-20 16:37 UTC (permalink / raw) To: netfilter 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: semi OT: default route 2004-10-20 16:37 ` Nick Drage @ 2004-10-20 16:48 ` Jason Opperisano 2004-10-20 16:57 ` Payal Rathod 2004-10-22 16:40 ` multiple external interface ? Faisal 0 siblings, 2 replies; 7+ messages in thread From: Jason Opperisano @ 2004-10-20 16:48 UTC (permalink / raw) To: netfilter On Wed, Oct 20, 2004 at 05:37:34PM +0100, Nick Drage wrote: > 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 ;) yes--the linux routing code will do dead gateway detection and fall back to a lower metric route in the event of failure, and also go back to the higher metric route upon resurrection. this can be useful for an active-standby setup. as for which route added by 'route' actually gets used--i've never spent the time to figure out how it picks the one it uses, but it certainly only appears to ever use one--maybe it picks the one with the lowest numerical value... or maybe it uses one of those magic 8-ball things... -j -- Jason Opperisano <opie@817west.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: semi OT: default route 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 1 sibling, 1 reply; 7+ messages in thread From: Payal Rathod @ 2004-10-20 16:57 UTC (permalink / raw) To: Jason Opperisano, netfilter On Wed, Oct 20, 2004 at 12:48:30PM -0400, Jason Opperisano wrote: > yes--the linux routing code will do dead gateway detection and fall > back to a lower metric route in the event of failure, and also go back > to the higher metric route upon resurrection. this can be useful for > an active-standby setup. routed might help here. Right? Can anyone with 2 ISP setup please check the load balance thing? I vaguely remember seeing something about multiple default routes in early chapters of TCP/IP Illustrated Vol. 1 (I am not at all sure). Thanks. With warm regards, -Payal -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: semi OT: default route 2004-10-20 16:57 ` Payal Rathod @ 2004-10-20 18:24 ` Jason Opperisano 0 siblings, 0 replies; 7+ messages in thread From: Jason Opperisano @ 2004-10-20 18:24 UTC (permalink / raw) To: netfilter On Wed, Oct 20, 2004 at 12:57:37PM -0400, Payal Rathod wrote: > On Wed, Oct 20, 2004 at 12:48:30PM -0400, Jason Opperisano wrote: > > yes--the linux routing code will do dead gateway detection and fall > > back to a lower metric route in the event of failure, and also go back > > to the higher metric route upon resurrection. this can be useful for > > an active-standby setup. > > routed might help here. Right? no--routed is a method for learning routes. you already know what the routes are. you're looking for a method to balance traffic over two physical links. the solution to that goal is more complicated than just adding two default gateways. -j -- Jason Opperisano <opie@817west.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* multiple external interface ? 2004-10-20 16:48 ` Jason Opperisano 2004-10-20 16:57 ` Payal Rathod @ 2004-10-22 16:40 ` Faisal 1 sibling, 0 replies; 7+ messages in thread From: Faisal @ 2004-10-22 16:40 UTC (permalink / raw) To: netfilter Is it possible in iptables to have more then one external interfaces ? I am going to run a webproxy server with iptables enabled with NAT & for that i want to increase my bandwith in doing so ... thanks ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-10-22 16:40 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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.