<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Load Balancing two ISPs</title>
	<atom:link href="http://blog.nielshorn.net/2008/09/load-balancing-two-isps/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/</link>
	<description>Random thoughts, tips &#38; tricks about Slackware-Linux, Lego and Star Wars</description>
	<lastBuildDate>Tue, 10 Jan 2012 12:10:37 -0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Niels Horn</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-1784</link>
		<dc:creator>Niels Horn</dc:creator>
		<pubDate>Tue, 22 Mar 2011 12:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-1784</guid>
		<description>Hello,

In this case - having the same gateway - my solution won&#039;t work for you...
But it should be possible to adapt it to your setup. The problem is I can&#039;t test it for you here :)

You might try using &quot;via a.b.c.d&quot; where a.b.c.d is the internal IP address of the NIC connected to your adsl modem, instead of the gateway address.
But - as I said - I have not tried this here...</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>In this case &#8211; having the same gateway &#8211; my solution won&#8217;t work for you&#8230;<br />
But it should be possible to adapt it to your setup. The problem is I can&#8217;t test it for you here <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You might try using &#8220;via a.b.c.d&#8221; where a.b.c.d is the internal IP address of the NIC connected to your adsl modem, instead of the gateway address.<br />
But &#8211; as I said &#8211; I have not tried this here&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A. Orta</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-1780</link>
		<dc:creator>A. Orta</dc:creator>
		<pubDate>Tue, 22 Mar 2011 00:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-1780</guid>
		<description>Hi,

I tried this script but under my circumstances does not work. I have 2 adsl bridged modems from the same ISP and I connected it via pppoe. The problem is that I have the same default gw for ppp0 and ppp1. When only one link is up it works perfectly but when I start the second and run the script the two links goes &quot;down&quot;(not really because when I shut down one the other begin to work). Do you need more details? Any help will be appreciated. 

P.S. I use Slackware too.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I tried this script but under my circumstances does not work. I have 2 adsl bridged modems from the same ISP and I connected it via pppoe. The problem is that I have the same default gw for ppp0 and ppp1. When only one link is up it works perfectly but when I start the second and run the script the two links goes &#8220;down&#8221;(not really because when I shut down one the other begin to work). Do you need more details? Any help will be appreciated. </p>
<p>P.S. I use Slackware too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Horn</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-252</link>
		<dc:creator>Niels Horn</dc:creator>
		<pubDate>Sat, 27 Mar 2010 15:09:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-252</guid>
		<description>@aspnair:
IIRC, pppd should create the gateway. You might have to set the &quot;defaultroute&quot; parameter in your pppd configuration file, or use it as an option when calling pppd.</description>
		<content:encoded><![CDATA[<p>@aspnair:<br />
IIRC, pppd should create the gateway. You might have to set the &#8220;defaultroute&#8221; parameter in your pppd configuration file, or use it as an option when calling pppd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aspnair</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-245</link>
		<dc:creator>aspnair</dc:creator>
		<pubDate>Wed, 24 Mar 2010 14:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-245</guid>
		<description>I just modified the script to find out the ppp0 gateway from ifconfig itself.
Following is my modification.

  gw2=$(route -n &#124; grep $DEV2 &#124; grep &#039;^0.0.0.0&#039; &#124; awk &#039;{print $2}&#039;)
  if [ &quot;$gw2&quot; == &quot;&quot; ]
  then
    gw2=$(ifconfig $DEV2 &#124; grep P-t-P &#124; awk &#039;{print $3}&#039; &#124; awk -F: &#039;{print $2}&#039;)
  fi

I tried dialing using pon with pppd and wvdial.  It looks like, they dont add a default route
when it sees another active default route, eth0 interface in this case.</description>
		<content:encoded><![CDATA[<p>I just modified the script to find out the ppp0 gateway from ifconfig itself.<br />
Following is my modification.</p>
<p>  gw2=$(route -n | grep $DEV2 | grep &#8216;^0.0.0.0&#8242; | awk &#8216;{print $2}&#8217;)<br />
  if [ "$gw2" == "" ]<br />
  then<br />
    gw2=$(ifconfig $DEV2 | grep P-t-P | awk &#8216;{print $3}&#8217; | awk -F: &#8216;{print $2}&#8217;)<br />
  fi</p>
<p>I tried dialing using pon with pppd and wvdial.  It looks like, they dont add a default route<br />
when it sees another active default route, eth0 interface in this case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Horn</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-244</link>
		<dc:creator>Niels Horn</dc:creator>
		<pubDate>Wed, 24 Mar 2010 11:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-244</guid>
		<description>@aspnair:
It seems that when you use your GSM modem, it is not recognized as a gateway in your routing table.
I use a script to &quot;dial&quot; my ISP with my GSM modem that automatically adds it as a gateway, so the balancing script finds it when I start that.
Setting the gw2 variable manually works, but it would be best to set the gateway on your ppp connection.
Anyway, thanks for your feedback!</description>
		<content:encoded><![CDATA[<p>@aspnair:<br />
It seems that when you use your GSM modem, it is not recognized as a gateway in your routing table.<br />
I use a script to &#8220;dial&#8221; my ISP with my GSM modem that automatically adds it as a gateway, so the balancing script finds it when I start that.<br />
Setting the gw2 variable manually works, but it would be best to set the gateway on your ppp connection.<br />
Anyway, thanks for your feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aspnair</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-243</link>
		<dc:creator>aspnair</dc:creator>
		<pubDate>Wed, 24 Mar 2010 10:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-243</guid>
		<description>Hello Niels....This is a wonderful post.  Thanks.
I was following your link.
My linux machine is behind a NAT router and it is connected to the router/switch using eth0.  For the other connection I use a GSM broadband modem (ppp0).  I could get it working after making one change from your script, for now I did that manually.

For my case, &quot;ifconfig ppp0&quot; is
ppp0      Link encap:Point-to-Point Protocol
          inet addr:115.117.135.93  P-t-P:172.29.243.129  Mask:255.255.255.255
......
route -n &#124; grep ppp0
......
172.29.243.129  0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
......
From your script.. gw2=`route -n &#124; grep $DEV2 &#124; grep &#039;^0.0.0.0&#039; &#124; awk &#039;{ print $2 }&#039;`
gw2 becomes &#039;0.0.0.0&#039; and this was not working.
But instead of that when I changed gw2 to 172.29.243.129, then things were working.</description>
		<content:encoded><![CDATA[<p>Hello Niels&#8230;.This is a wonderful post.  Thanks.<br />
I was following your link.<br />
My linux machine is behind a NAT router and it is connected to the router/switch using eth0.  For the other connection I use a GSM broadband modem (ppp0).  I could get it working after making one change from your script, for now I did that manually.</p>
<p>For my case, &#8220;ifconfig ppp0&#8243; is<br />
ppp0      Link encap:Point-to-Point Protocol<br />
          inet addr:115.117.135.93  P-t-P:172.29.243.129  Mask:255.255.255.255<br />
&#8230;&#8230;<br />
route -n | grep ppp0<br />
&#8230;&#8230;<br />
172.29.243.129  0.0.0.0         255.255.255.255 UH    0      0        0 ppp0<br />
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0<br />
&#8230;&#8230;<br />
From your script.. gw2=`route -n | grep $DEV2 | grep &#8216;^0.0.0.0&#8242; | awk &#8216;{ print $2 }&#8217;`<br />
gw2 becomes &#8216;0.0.0.0&#8242; and this was not working.<br />
But instead of that when I changed gw2 to 172.29.243.129, then things were working.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Horn</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-52</link>
		<dc:creator>Niels Horn</dc:creator>
		<pubDate>Thu, 07 Jan 2010 14:10:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-52</guid>
		<description>Both links should be equally used, but only if you have several simultaneous connections (like my example downloading with some torrent software). If you are downloading a large file from a single IP, there will be only one IP-to-IP connection that cannot be balanced between two links, as the sending IP can only send data to one destination for a single download.

With torrent software you will have many simultaneous connections, downloading different parts from different peers. In this case the balancing works fine.</description>
		<content:encoded><![CDATA[<p>Both links should be equally used, but only if you have several simultaneous connections (like my example downloading with some torrent software). If you are downloading a large file from a single IP, there will be only one IP-to-IP connection that cannot be balanced between two links, as the sending IP can only send data to one destination for a single download.</p>
<p>With torrent software you will have many simultaneous connections, downloading different parts from different peers. In this case the balancing works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balaji rm</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-51</link>
		<dc:creator>balaji rm</dc:creator>
		<pubDate>Thu, 07 Jan 2010 11:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-51</guid>
		<description>hi,
   could you please help me out where in i get even (same)speed across two ip&#039;s say 100kbits/sec through two ett0 and ppp0.</description>
		<content:encoded><![CDATA[<p>hi,<br />
   could you please help me out where in i get even (same)speed across two ip&#8217;s say 100kbits/sec through two ett0 and ppp0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: niels.horn</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-37</link>
		<dc:creator>niels.horn</dc:creator>
		<pubDate>Mon, 12 Oct 2009 12:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-37</guid>
		<description>@gmbastos: You&#039;re right, it can be done in a shorter line. Like they say &quot;there are many ways to Rome&quot;. :) &lt;br /&gt;I kept the script as simple &amp; clear as possible to make it easier to understand. But everyone is free to improve it like you did.&lt;br /&gt;Awk if an extremely powerful tool and I sometimes think I only use like 10% of its power...</description>
		<content:encoded><![CDATA[<p>@gmbastos: You&#39;re right, it can be done in a shorter line. Like they say &quot;there are many ways to Rome&quot;. <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <br />I kept the script as simple &amp; clear as possible to make it easier to understand. But everyone is free to improve it like you did.<br />Awk if an extremely powerful tool and I sometimes think I only use like 10% of its power&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmbastos</title>
		<link>http://blog.nielshorn.net/2008/09/load-balancing-two-isps/comment-page-1/#comment-35</link>
		<dc:creator>gmbastos</dc:creator>
		<pubDate>Mon, 12 Oct 2009 07:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.nielshorn.net/blog/?p=5#comment-35</guid>
		<description>Hello, Niels.&lt;br /&gt;&lt;br /&gt;Thank you for this great post. :)&lt;br /&gt;&lt;br /&gt;But, even though you are far more experienced than me in scripting, I dare to tell you that awk can make that IP address extraction in one run (I&#039;m referring to your load balance script):&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;# Get IP addresses of our devices:&lt;br /&gt;ip1=`ifconfig $DEV1 &#124; awk &#039;/inet addr:/ { split($2,inetline,&quot;:&quot;); print inetline[2]}&#039;`&lt;br /&gt;ip2=`ifconfig $DEV2 &#124; awk &#039;/inet addr:/ { split($2,inetline,&quot;:&quot;); print inetline[2]}&#039;`&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;As you work with heavy-weight servers, perhaps this can make some difference (for a SOHO user speed and footprint improvements are unnoticeable).</description>
		<content:encoded><![CDATA[<p>Hello, Niels.</p>
<p>Thank you for this great post. <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But, even though you are far more experienced than me in scripting, I dare to tell you that awk can make that IP address extraction in one run (I&#39;m referring to your load balance script):</p>
<p><i><br /># Get IP addresses of our devices:<br />ip1=`ifconfig $DEV1 | awk &#39;/inet addr:/ { split($2,inetline,&quot;:&quot;); print inetline[2]}&#39;`<br />ip2=`ifconfig $DEV2 | awk &#39;/inet addr:/ { split($2,inetline,&quot;:&quot;); print inetline[2]}&#39;`<br /></i></p>
<p>As you work with heavy-weight servers, perhaps this can make some difference (for a SOHO user speed and footprint improvements are unnoticeable).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

