<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Multi gateway balancing with iptables</title>
	<atom:link href="http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/</link>
	<description>Adventures in Ubuntu systems administration</description>
	<lastBuildDate>Fri, 13 Aug 2010 22:40:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Sumera</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-219</link>
		<dc:creator>Sumera</dc:creator>
		<pubDate>Fri, 13 Aug 2010 22:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-219</guid>
		<description>Hello Evey One !!!
i am very new in Linux .. ubuntu and squid type stuff... we have a little network of 30 workstations..  

i have one machine installed unbuntu 9.10 and squid 2.74 with 4 Ethernet cards.

eth0 ......ISP-1
eth1.......LAN-1
eth2.......ISP-2
eth3.......LAN2 

( LAN1 : 192.168.0.1 )===&gt; 20 Work Stations
( LAN2 : 192.168.2.1 )===&gt; 10 Work Stations 

i just need to make it possible that LAN 1 will use the internet from WAN-1 and LAN-2 will use the Internet From WAN-2 .. 

although i want that if WAN-1 fails then only LAN1 should be routed to WAN-2... WAN-2 is pretty fine it does not go down mostly... Please Help me step by step i will be very thank full to you</description>
		<content:encoded><![CDATA[<p>Hello Evey One !!!<br />
i am very new in Linux .. ubuntu and squid type stuff&#8230; we have a little network of 30 workstations..  </p>
<p>i have one machine installed unbuntu 9.10 and squid 2.74 with 4 Ethernet cards.</p>
<p>eth0 &#8230;&#8230;ISP-1<br />
eth1&#8230;&#8230;.LAN-1<br />
eth2&#8230;&#8230;.ISP-2<br />
eth3&#8230;&#8230;.LAN2 </p>
<p>( LAN1 : 192.168.0.1 )===&gt; 20 Work Stations<br />
( LAN2 : 192.168.2.1 )===&gt; 10 Work Stations </p>
<p>i just need to make it possible that LAN 1 will use the internet from WAN-1 and LAN-2 will use the Internet From WAN-2 .. </p>
<p>although i want that if WAN-1 fails then only LAN1 should be routed to WAN-2&#8230; WAN-2 is pretty fine it does not go down mostly&#8230; Please Help me step by step i will be very thank full to you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John ORourke</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-196</link>
		<dc:creator>John ORourke</dc:creator>
		<pubDate>Tue, 18 May 2010 10:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-196</guid>
		<description>Just 2 notes for people trying this:

1. In the rules under &#039;# Choose our route and save the mark&#039;, don&#039;t use those rules because they just copy the connection mark to the packet mark, then copy that back to the connection mark again.  Replace them with these, and that also allows you to remove the &#039;# Check to see if we have already marked a packet&#039; section because these rules do the same thing:

    # Choose our route and save the mark (copies the connection mark to the packet mark)
    iptables -t mangle -A PREROUTING -m connmark ! --mark 0 -j CONNMARK --restore-mark
    iptables -t mangle -A OUTPUT -m connmark ! --mark 0 -j CONNMARK --restore-mark

2. I found the same issue as the commenter above - with no default route in the &#039;main&#039; routing table, a lot of things on the local machine didn&#039;t work.  I tried the dummy route as above, that didn&#039;t work either.  When I looked, it was sending packets out to the LAN with a source address of the dummy interface!  I think this might be specific to my setup - I&#039;m balancing outgoing connections between 2 gateways on the same interface / same LAN.

Here&#039;s my full  setup, where the LAN is 172.26.16.0/24 and the gateways are 172.26.16.1 and 172.26.16.2:


IP TABLES SCRIPT:
&lt;b&gt;Note - this does not include, but should work with, any NAT/masquerading rules you have.&lt;/b&gt;
&lt;pre&gt;
# flush existing rules:
iptables -t mangle -F OUTPUT
iptables -t mangle -F PREROUTING

# Load balancing rules (Split 50/50 between fwmark 1/2)
iptables -t mangle -F balance1 &gt;/dev/null 2&gt;&amp;1  # flush balance1 if exists
iptables -t mangle -X balance1 &gt;/dev/null 2&gt;&amp;1  # delete balance1 if exists
iptables -t mangle -N balance1
iptables -t mangle -A balance1 -d 172.26.16.0/24 -j RETURN
iptables -t mangle -A balance1 -m connmark ! --mark 0 -j RETURN
iptables -t mangle -A balance1 -m state --state ESTABLISHED,RELATED -j RETURN
iptables -t mangle -A balance1 -m statistic --mode nth --every 2 --packet 0 -j CONNMARK --set-mark 1
iptables -t mangle -A balance1 -m statistic --mode nth --every 2 --packet 1 -j CONNMARK --set-mark 2

# New outgoing connections
iptables -t mangle -A PREROUTING -s 172.26.16.0/24 -m state --state NEW -j balance1
iptables -t mangle -A OUTPUT -m state --state NEW -j balance1

# Choose our route and save the mark
iptables -t mangle -A PREROUTING -m connmark ! --mark 0 -j CONNMARK --restore-mark
iptables -t mangle -A OUTPUT -m connmark ! --mark 0 -j CONNMARK --restore-mark

&lt;/pre&gt;

IP ROUTING/RULES SCRIPT:
&lt;pre&gt;
ip route del default table main
ip route del default table 1
ip route del 172.26.16.0/24 dev eth0 table 1
ip route del 172.26.16.0/24 dev eth0 table 2
ip route del default table 2
ip rule del fwmark 1
ip rule del fwmark 2
ip rule add fwmark 1 table 1
ip rule add fwmark 2 table 2
ip route add default via 172.26.16.1 table 1
ip route add default via 172.26.16.3 table 2
ip route add default via 172.26.16.1 table main
ip route flush cache
&lt;/pre&gt;

Hope that helps someone, and thanks for this article agentk - it was a massive help!</description>
		<content:encoded><![CDATA[<p>Just 2 notes for people trying this:</p>
<p>1. In the rules under &#8216;# Choose our route and save the mark&#8217;, don&#8217;t use those rules because they just copy the connection mark to the packet mark, then copy that back to the connection mark again.  Replace them with these, and that also allows you to remove the &#8216;# Check to see if we have already marked a packet&#8217; section because these rules do the same thing:</p>
<p>    # Choose our route and save the mark (copies the connection mark to the packet mark)<br />
    iptables -t mangle -A PREROUTING -m connmark ! &#8211;mark 0 -j CONNMARK &#8211;restore-mark<br />
    iptables -t mangle -A OUTPUT -m connmark ! &#8211;mark 0 -j CONNMARK &#8211;restore-mark</p>
<p>2. I found the same issue as the commenter above &#8211; with no default route in the &#8216;main&#8217; routing table, a lot of things on the local machine didn&#8217;t work.  I tried the dummy route as above, that didn&#8217;t work either.  When I looked, it was sending packets out to the LAN with a source address of the dummy interface!  I think this might be specific to my setup &#8211; I&#8217;m balancing outgoing connections between 2 gateways on the same interface / same LAN.</p>
<p>Here&#8217;s my full  setup, where the LAN is 172.26.16.0/24 and the gateways are 172.26.16.1 and 172.26.16.2:</p>
<p>IP TABLES SCRIPT:<br />
<b>Note &#8211; this does not include, but should work with, any NAT/masquerading rules you have.</b></p>
<pre>
# flush existing rules:
iptables -t mangle -F OUTPUT
iptables -t mangle -F PREROUTING

# Load balancing rules (Split 50/50 between fwmark 1/2)
iptables -t mangle -F balance1 &gt;/dev/null 2&gt;&amp;1  # flush balance1 if exists
iptables -t mangle -X balance1 &gt;/dev/null 2&gt;&amp;1  # delete balance1 if exists
iptables -t mangle -N balance1
iptables -t mangle -A balance1 -d 172.26.16.0/24 -j RETURN
iptables -t mangle -A balance1 -m connmark ! --mark 0 -j RETURN
iptables -t mangle -A balance1 -m state --state ESTABLISHED,RELATED -j RETURN
iptables -t mangle -A balance1 -m statistic --mode nth --every 2 --packet 0 -j CONNMARK --set-mark 1
iptables -t mangle -A balance1 -m statistic --mode nth --every 2 --packet 1 -j CONNMARK --set-mark 2

# New outgoing connections
iptables -t mangle -A PREROUTING -s 172.26.16.0/24 -m state --state NEW -j balance1
iptables -t mangle -A OUTPUT -m state --state NEW -j balance1

# Choose our route and save the mark
iptables -t mangle -A PREROUTING -m connmark ! --mark 0 -j CONNMARK --restore-mark
iptables -t mangle -A OUTPUT -m connmark ! --mark 0 -j CONNMARK --restore-mark
</pre>
<p>IP ROUTING/RULES SCRIPT:</p>
<pre>
ip route del default table main
ip route del default table 1
ip route del 172.26.16.0/24 dev eth0 table 1
ip route del 172.26.16.0/24 dev eth0 table 2
ip route del default table 2
ip rule del fwmark 1
ip rule del fwmark 2
ip rule add fwmark 1 table 1
ip rule add fwmark 2 table 2
ip route add default via 172.26.16.1 table 1
ip route add default via 172.26.16.3 table 2
ip route add default via 172.26.16.1 table main
ip route flush cache
</pre>
<p>Hope that helps someone, and thanks for this article agentk &#8211; it was a massive help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elvar</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-155</link>
		<dc:creator>Elvar</dc:creator>
		<pubDate>Wed, 20 Jan 2010 08:13:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-155</guid>
		<description>In order to get this working, what has to be done with routing tables and what not? I&#039;ve tried http://lartc.org/howto/lartc.rpdb.multiple-links.html which works fine for outbound connections but it screws up my inbound port redirections because sometimes they go in eth1 and come out eth2 which obviously doesn&#039;t work. I&#039;d really like to get your solution working.


Regards</description>
		<content:encoded><![CDATA[<p>In order to get this working, what has to be done with routing tables and what not? I&#8217;ve tried <a href="http://lartc.org/howto/lartc.rpdb.multiple-links.html" rel="nofollow">http://lartc.org/howto/lartc.rpdb.multiple-links.html</a> which works fine for outbound connections but it screws up my inbound port redirections because sometimes they go in eth1 and come out eth2 which obviously doesn&#8217;t work. I&#8217;d really like to get your solution working.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sysenm</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-133</link>
		<dc:creator>sysenm</dc:creator>
		<pubDate>Sun, 06 Dec 2009 16:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-133</guid>
		<description>Thanks dude!

Here is a more cleaner explanation now with a simpler set of commands..

eth0  - DHCP server is running on it, serving clients of lan
eth1 - is connected to isp1 with ip 192.168.0.101 and gateway 192.168.0.1
eth2 - is connected to isp2 with ip 192.168.2.133 and gateway 192.168.2.1


ip ru add fwmark 1 table 1
ip route add default via 192.168.0.1 dev eth1 table 1

iptables -t mangle -A PREROUTING -p tcp --dport 80 -j MARK --set-mark 1 
iptables -t mangle -A PREROUTING -p tcp --dport 53 -j MARK --set-mark 1

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

ip r del default main

echo 0 &gt; /proc/sys/net/ipv4/conf/eth1/rp_filter
echo 0 &gt; /proc/sys/net/ipv4/conf/eth2/rp_filter 

ifconfig dummy0 1.2.3.4
ip route add default dev dummy0

The above scenario does not work. The dummy is not helping. Why a default route is necessory in main ? and secondly how can i mark all the packets that are unmarked ?

Thanks for a quick reply.</description>
		<content:encoded><![CDATA[<p>Thanks dude!</p>
<p>Here is a more cleaner explanation now with a simpler set of commands..</p>
<p>eth0  &#8211; DHCP server is running on it, serving clients of lan<br />
eth1 &#8211; is connected to isp1 with ip 192.168.0.101 and gateway 192.168.0.1<br />
eth2 &#8211; is connected to isp2 with ip 192.168.2.133 and gateway 192.168.2.1</p>
<p>ip ru add fwmark 1 table 1<br />
ip route add default via 192.168.0.1 dev eth1 table 1</p>
<p>iptables -t mangle -A PREROUTING -p tcp &#8211;dport 80 -j MARK &#8211;set-mark 1<br />
iptables -t mangle -A PREROUTING -p tcp &#8211;dport 53 -j MARK &#8211;set-mark 1</p>
<p>iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE<br />
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE</p>
<p>ip r del default main</p>
<p>echo 0 &gt; /proc/sys/net/ipv4/conf/eth1/rp_filter<br />
echo 0 &gt; /proc/sys/net/ipv4/conf/eth2/rp_filter </p>
<p>ifconfig dummy0 1.2.3.4<br />
ip route add default dev dummy0</p>
<p>The above scenario does not work. The dummy is not helping. Why a default route is necessory in main ? and secondly how can i mark all the packets that are unmarked ?</p>
<p>Thanks for a quick reply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: agentk</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-129</link>
		<dc:creator>agentk</dc:creator>
		<pubDate>Sun, 06 Dec 2009 01:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-129</guid>
		<description>Ok. I&#039;ll start with the questions in order:

If eth0 and eth1 are not typos and you are referring to external bound traffic, then &#039;No&#039;. It is not normal that external bound traffic be alternated between an internal lan dev (which should not happen as eth1 and eth2 should be the only devices with a gateway) and an isp. What could be causing it? Do not know without seeing a lot more detail as it is not a problem I have encountered so far.

No default route in main? Yes. But. There still has to be a default route in the main table just make it a dummy route though as seen at: http://www.clintoneast.com/articles/multihomed.php
&lt;code&gt;ifconfig dummy0 1.2.3.4
ip route add default dev dummy0&lt;/code&gt;

To much un-marked traffic? No problem. It will just be redirected to the default route in the main table.

Ok. What you want sounds very similar to what I have here just using ip route nexthops for load balancing instead of iptables though.
I am going to suggest (the process I went through) that you start off with the routes as separated as possible first and use iptables for debugging your traffic. For example, when I was testing nexthop balancing I used (in addition to table 1 &amp; 2) fwmark 3 / table 3 and gave it a nexthop default route. Then in iptables just tested for any NEW un-MARKed traffic and gave it mark 3. ie:

[code]iptables -t mangle -A PREROUTING  -m state --state NEW -m connmark ! --mark 0  -j CONNMARK --set-mark 3[/code]

Somewhere just after testing for traffic that I want sent to a specific table. (This is also just for forwarded traffic. For traffic from this server use the OUTPUT chain).

After getting that in place I test it out to make sure traffic is going out and getting returned and check the packet counts in iptables:

[code]iptables -t mangle -L PREROUTING -nv[/code]

You should see the pkts column increase each time a request is forwarded.

If you then use the iptables balancing rules ala &#039;balance1&#039; chain in the post, you can then do [code]iptables -t mangle -L balance1 -nv[/code] to see the number of packets being directed to each interface.

That help at all? When I was trying to work out where packets were going I went all the way to logging all packets between the interfaces in mangle if per interface for just port 80 traffic:
[code]
-A PREROUTING  -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/PREROUTING  dport]: &quot;
-A POSTROUTING -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/POSTROUTING dport]: &quot;
-A INPUT       -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/INPUT       dport]: &quot;
-A OUTPUT      -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/OUTPUT      dport]: &quot;
-A FORWARD     -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/FORWARD     dport]: &quot;

-A PREROUTING  -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/PREROUTING  sport]: &quot;
-A POSTROUTING -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/POSTROUTING sport]: &quot;
-A INPUT       -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/INPUT       sport]: &quot;
-A OUTPUT      -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/OUTPUT      sport]: &quot;
-A FORWARD     -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/FORWARD     sport]: &quot;
[/code]

Then monitor syslog as I generate traffic to debug what was going on.</description>
		<content:encoded><![CDATA[<p>Ok. I&#8217;ll start with the questions in order:</p>
<p>If eth0 and eth1 are not typos and you are referring to external bound traffic, then &#8216;No&#8217;. It is not normal that external bound traffic be alternated between an internal lan dev (which should not happen as eth1 and eth2 should be the only devices with a gateway) and an isp. What could be causing it? Do not know without seeing a lot more detail as it is not a problem I have encountered so far.</p>
<p>No default route in main? Yes. But. There still has to be a default route in the main table just make it a dummy route though as seen at: <a href="http://www.clintoneast.com/articles/multihomed.php" rel="nofollow">http://www.clintoneast.com/articles/multihomed.php</a><br />
<code>ifconfig dummy0 1.2.3.4<br />
ip route add default dev dummy0</code></p>
<p>To much un-marked traffic? No problem. It will just be redirected to the default route in the main table.</p>
<p>Ok. What you want sounds very similar to what I have here just using ip route nexthops for load balancing instead of iptables though.<br />
I am going to suggest (the process I went through) that you start off with the routes as separated as possible first and use iptables for debugging your traffic. For example, when I was testing nexthop balancing I used (in addition to table 1 &amp; 2) fwmark 3 / table 3 and gave it a nexthop default route. Then in iptables just tested for any NEW un-MARKed traffic and gave it mark 3. ie:</p>
<pre class="brush: plain;">iptables -t mangle -A PREROUTING  -m state --state NEW -m connmark ! --mark 0  -j CONNMARK --set-mark 3</pre>
<p>Somewhere just after testing for traffic that I want sent to a specific table. (This is also just for forwarded traffic. For traffic from this server use the OUTPUT chain).</p>
<p>After getting that in place I test it out to make sure traffic is going out and getting returned and check the packet counts in iptables:</p>
<pre class="brush: plain;">iptables -t mangle -L PREROUTING -nv</pre>
<p>You should see the pkts column increase each time a request is forwarded.</p>
<p>If you then use the iptables balancing rules ala &#8216;balance1&#8242; chain in the post, you can then do
<pre class="brush: plain;">iptables -t mangle -L balance1 -nv</pre>
<p> to see the number of packets being directed to each interface.</p>
<p>That help at all? When I was trying to work out where packets were going I went all the way to logging all packets between the interfaces in mangle if per interface for just port 80 traffic:</p>
<pre class="brush: plain;">
-A PREROUTING  -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/PREROUTING  dport]: &quot;
-A POSTROUTING -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/POSTROUTING dport]: &quot;
-A INPUT       -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/INPUT       dport]: &quot;
-A OUTPUT      -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/OUTPUT      dport]: &quot;
-A FORWARD     -s EXTERNALIP -p tcp -m tcp --dport 80 -j LOG --log-prefix &quot;[d/FORWARD     dport]: &quot;

-A PREROUTING  -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/PREROUTING  sport]: &quot;
-A POSTROUTING -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/POSTROUTING sport]: &quot;
-A INPUT       -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/INPUT       sport]: &quot;
-A OUTPUT      -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/OUTPUT      sport]: &quot;
-A FORWARD     -d EXTERNALIP -p tcp -m tcp --sport 80 -j LOG --log-prefix &quot;[d/FORWARD     sport]: &quot;
</pre>
<p>Then monitor syslog as I generate traffic to debug what was going on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sysenm</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-128</link>
		<dc:creator>sysenm</dc:creator>
		<pubDate>Sun, 06 Dec 2009 00:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-128</guid>
		<description>Hello

Thank you for such a wonderful article/guide.

I have started working on load balancing and i am trying to achieve something similar to what you have described here but i would like to mark my traffic (using iptables and dport) so that i can have more control. Here is the scenario:
eth0 - static adress to internal lan
eth1 - isp 1
eth2 - isp 2

1 - http, dns, ftp, ssl, ssh are marked 1 (based on destination port)
2 - chat and voip are marked 2
3 - ip ru add fwmark 1 table 1
     ip ru add fwmark 2 table 2
4 - ip route add default via eth1 table 1
     ip route add default via eth2 table 2
5 - add multiple default routes in main. ( . . . nexthop via eth1 nexthop via eth2)

The problem i am facing is that any unmarked traffic is alternating between eth0 and eth1. Is this suppose to be normal ? 
Is it possible to do without adding any kind of default route in the main ? What kinds of problem can be faced if i have too much un-marked traffic ??

Waiting for your help!

Thanks again!</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Thank you for such a wonderful article/guide.</p>
<p>I have started working on load balancing and i am trying to achieve something similar to what you have described here but i would like to mark my traffic (using iptables and dport) so that i can have more control. Here is the scenario:<br />
eth0 &#8211; static adress to internal lan<br />
eth1 &#8211; isp 1<br />
eth2 &#8211; isp 2</p>
<p>1 &#8211; http, dns, ftp, ssl, ssh are marked 1 (based on destination port)<br />
2 &#8211; chat and voip are marked 2<br />
3 &#8211; ip ru add fwmark 1 table 1<br />
     ip ru add fwmark 2 table 2<br />
4 &#8211; ip route add default via eth1 table 1<br />
     ip route add default via eth2 table 2<br />
5 &#8211; add multiple default routes in main. ( . . . nexthop via eth1 nexthop via eth2)</p>
<p>The problem i am facing is that any unmarked traffic is alternating between eth0 and eth1. Is this suppose to be normal ?<br />
Is it possible to do without adding any kind of default route in the main ? What kinds of problem can be faced if i have too much un-marked traffic ??</p>
<p>Waiting for your help!</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-12-01 &#171; Bloggitation</title>
		<link>http://blog.khax.net/2009/12/01/multi-gateway-balancing-with-iptables/#comment-125</link>
		<dc:creator>links for 2009-12-01 &#171; Bloggitation</dc:creator>
		<pubDate>Wed, 02 Dec 2009 06:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.khax.net/?p=163#comment-125</guid>
		<description>[...] Multi gateway balancing with iptables (tags: iptables security linux sysadmin)   Possibly related posts: (automatically generated)Tags on Blogs Make for Great SEOTags to friends    Categories: Links        Comments (0) Trackbacks (0) Leave a comment Trackback [...]</description>
		<content:encoded><![CDATA[<p>[...] Multi gateway balancing with iptables (tags: iptables security linux sysadmin)   Possibly related posts: (automatically generated)Tags on Blogs Make for Great SEOTags to friends    Categories: Links        Comments (0) Trackbacks (0) Leave a comment Trackback [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
