<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Routing Tricks - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=Routing_Tricks&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 01:02:07 GMT</lastBuildDate>
		<item>
			<title>Arfon: /* Weighted Routing */  FIXED the screwed up link. And added the category</title>
			<link>https://www.slackwiki.com/index.php?title=Routing_Tricks&amp;diff=280&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Routing_Tricks&amp;diff=280&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Weighted Routing: &lt;/span&gt;  FIXED the screwed up link. And added the category&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:34, 9 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot;&gt;Line 78:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you call the script without any parameters, it tries to balance eth0 and ppp0 (because this works in my case ).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you call the script without any parameters, it tries to balance eth0 and ppp0 (because this works in my case ).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://www.linuxquestions.org/questions/slackware-14/script-to-load-balance-two-isps-with-ip-route-and-ip-rules-672602 HERE IS HIS ORIGINAL POSTING]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://www.linuxquestions.org/questions/slackware-14/script-to-load-balance-two-isps-with-ip-route-and-ip-rules-672602&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/ &lt;/ins&gt;HERE IS HIS ORIGINAL POSTING]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;(ALSO, I copied a copy of his permission on my DISCUSSION page)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;(ALSO, I copied a copy of his permission on my DISCUSSION page)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tips]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 09 Jan 2010 01:34:53 GMT</pubDate>
			<dc:creator>Arfon</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Routing_Tricks</comments>
		</item>
		<item>
			<title>Arfon: CREATED THIS PAGE</title>
			<link>https://www.slackwiki.com/index.php?title=Routing_Tricks&amp;diff=278&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Routing_Tricks&amp;diff=278&amp;oldid=prev</guid>
			<description>&lt;p&gt;CREATED THIS PAGE&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Weighted Routing==&lt;br /&gt;
(aka Load Balancing, Net Balancing)&lt;br /&gt;
&lt;br /&gt;
'''What is Weighted Routing'''&lt;br /&gt;
Simply put, distributing network traffic over multiple paths based on load.&lt;br /&gt;
&lt;br /&gt;
EXAMPLE 1: You have two DSL connections incoming and you distribute your connection traffic between them.&lt;br /&gt;
&lt;br /&gt;
EXAMPLE 2: You have a 1.5Mbs DSL connection and a 3MBs cable connection, therefore you set up your routing to send 1/3 of the traffic out the DSL connection and 2/3 out the cable connection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How do I do it?'''&lt;br /&gt;
&lt;br /&gt;
Niels Horn has written a slick little script to do the weighted routing for you.  He has given me permission to copy it here.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #&lt;br /&gt;
 # bal_local		Load-balance internet connection over two local links &lt;br /&gt;
 #&lt;br /&gt;
 # Version:		1.0.0 - Fri, Sep 26, 2008&lt;br /&gt;
 #&lt;br /&gt;
 # Author:		Niels Horn &amp;lt;niels.horn(at symbol)gmail.com&amp;gt;&lt;br /&gt;
 #&lt;br /&gt;
 #&lt;br /&gt;
 # Set devices:&lt;br /&gt;
 DEV1=${1-eth0}	# default eth0&lt;br /&gt;
 DEV2=${2-ppp0}	# default ppp0&lt;br /&gt;
 #&lt;br /&gt;
 # Get IP addresses of our devices:&lt;br /&gt;
 ip1=`ifconfig $DEV1 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'`&lt;br /&gt;
 ip2=`ifconfig $DEV2 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'`&lt;br /&gt;
 #&lt;br /&gt;
 # Get default gateway for our devices:&lt;br /&gt;
 gw1=`route -n | grep $DEV1 | grep '^0.0.0.0' | awk '{ print $2 }'`&lt;br /&gt;
 gw2=`route -n | grep $DEV2 | grep '^0.0.0.0' | awk '{ print $2 }'`&lt;br /&gt;
 #&lt;br /&gt;
 echo &amp;quot;$DEV1: IP=$ip1 GW=$gw1&amp;quot;&lt;br /&gt;
 echo &amp;quot;$DEV2: IP=$ip2 GW=$gw2&amp;quot;&lt;br /&gt;
 #&lt;br /&gt;
 ### Definition of routes ###&lt;br /&gt;
 #&lt;br /&gt;
 # Check if tables exists, if not -&amp;gt; create them:&lt;br /&gt;
 if [ -z &amp;quot;`cat /etc/iproute2/rt_tables | grep '^251'`&amp;quot; ] ; then&lt;br /&gt;
 	echo &amp;quot;251	rt_dev1&amp;quot; &amp;gt;&amp;gt; /etc/iproute2/rt_tables&lt;br /&gt;
 fi&lt;br /&gt;
 if [ -z &amp;quot;`cat /etc/iproute2/rt_tables | grep '^252'`&amp;quot; ] ; then&lt;br /&gt;
 	echo &amp;quot;252	rt_dev2&amp;quot; &amp;gt;&amp;gt; /etc/iproute2/rt_tables&lt;br /&gt;
 fi&lt;br /&gt;
 #&lt;br /&gt;
 # Define routing tables:&lt;br /&gt;
 ip route add default via $gw1 table rt_dev1&lt;br /&gt;
 ip route add default via $gw2 table rt_dev2&lt;br /&gt;
 #&lt;br /&gt;
 # Create rules:&lt;br /&gt;
 ip rule add from $ip1 table rt_dev1&lt;br /&gt;
 ip rule add from $ip2 table rt_dev2&lt;br /&gt;
 #&lt;br /&gt;
 # If we already have a 'nexthop' route, delete it:&lt;br /&gt;
 if [ ! -z &amp;quot;`ip route show table main | grep 'nexthop'`&amp;quot; ] ; then&lt;br /&gt;
 	ip route del default scope global&lt;br /&gt;
 fi&lt;br /&gt;
 #&lt;br /&gt;
 # Balance links based on routes:&lt;br /&gt;
 ip route add default scope global nexthop via $gw1 dev $DEV1 weight 1 nexthop via $gw2 dev $DEV2 weight 1&lt;br /&gt;
 #&lt;br /&gt;
 # Flush cache table:&lt;br /&gt;
 ip route flush cache  &lt;br /&gt;
 #&lt;br /&gt;
 # All done...&lt;br /&gt;
&lt;br /&gt;
To use the script, copy it to /usr/local/bin, make it executable with 'chmod +x' and call it with:&lt;br /&gt;
Code:&lt;br /&gt;
&lt;br /&gt;
 bal_local &amp;lt;dev1&amp;gt; &amp;lt;dev2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
filling in &amp;lt;dev1&amp;gt; and &amp;lt;dev2&amp;gt; with your network-devices.&lt;br /&gt;
If you call the script without any parameters, it tries to balance eth0 and ppp0 (because this works in my case ).&lt;br /&gt;
&lt;br /&gt;
[http://www.linuxquestions.org/questions/slackware-14/script-to-load-balance-two-isps-with-ip-route-and-ip-rules-672602 HERE IS HIS ORIGINAL POSTING]&lt;br /&gt;
&lt;br /&gt;
(ALSO, I copied a copy of his permission on my DISCUSSION page)&lt;/div&gt;</description>
			<pubDate>Sat, 09 Jan 2010 01:27:56 GMT</pubDate>
			<dc:creator>Arfon</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Routing_Tricks</comments>
		</item>
</channel></rss>