LARTC
[Top] [All Lists]

Re: [LARTC] Split access, load balancing AND forwarding: HOW?

To: <lartc@mailman.ds9a.nl>
Subject: Re: [LARTC] Split access, load balancing AND forwarding: HOW?
From: "Ming-Ching Tiew" <mingching.tiew@redtone.com>
Date: Thu, 22 Feb 2007 10:58:24 +0800
Delivered-to: sp-com-lists@consult.net
Delivered-to: lartc-list@securepoint.com
Delivered-to: lartc@outpost.ds9a.nl
List-archive: <http://mailman.ds9a.nl/pipermail/lartc>
List-help: <mailto:lartc-request@mailman.ds9a.nl?subject=help>
List-id: "Mailinglist of the Linux Advanced Routing &amp; Traffic Control project" <lartc.mailman.ds9a.nl>
List-post: <mailto:lartc@mailman.ds9a.nl>
List-subscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=subscribe>
List-unsubscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=unsubscribe>
References: <Pine.LNX.4.64.0702211529590.9170@dellareas.intoweb.co.za> <200702212316.53813.luciano@lugmen.org.ar>
Sender: lartc-bounces@mailman.ds9a.nl
From: "Luciano Ruete" <luciano@lugmen.org.ar>
> 
> The solution is to use CONNTRACK from iptables, full example described in 
> this[1] e-mail from the archive. No patches needed.
> 
> [1] http://mailman.ds9a.nl/pipermail/lartc/2006q2/018964.html
>

I think you mean CONNMARK ( not CONNTRACK ) from iptables  ?

The ever popular routing command :-

>
> #route commands
> ip ro add default  nexthop via x.x.x.x dev eth1 weight 1 nexthop via y.y.y.y 
> dev eth2
>

I personal view is that  ***NEVER*** use such a routing statement, or never let 
the system has a chance to use such a routing statement, especially when you 
are 
doing NAT. The email example above included this routing statement but it is 
not used because the  'ip rule' takes precedence. The multipath weighted cached
based routing is problematic.

I would say it would be better to re-order the the iptables command :-

#restore mark before ROUTING decision
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
#by-pass rules if it is already MARKed
iptables -t mangle -A POSTROUTING -m mark  --mark ! 0 -j ACCEPT 
#1st packets(from a connection) will arrive here 
iptables -t mangle -A POSTROUTING -o eth1 -j MARK --set-mark 0x1
iptables -t mangle -A POSTROUTING -o eth2 -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark

ie restore-mark is moved to the top.

I strongly recommend that the LARTC documentation be updated, especially it 
encourages people to use multipath weighted routing instead of iptables 
based solution.

Cheers.



_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

<Prev in Thread] Current Thread [Next in Thread>