Load balancing with failover
Hi all,
i have network setup with 3 gateways and a large number of intranet nodes, i want to do automatic load balancing with failover,
i have put following ip rules and routes,
ip rule add prio 222 table 222
ip route add default table 222 proto static \
nexthop via $GWE1 dev $IFE1 \
nexthop via $GWE2 dev $IFE2 \
nexthop via $GWE2 dev $IFE3 \Now, i also want to do failover,
but the point is that what shall i need to do about deleting the route cache as soon as some gateway becomes dead or unavailable, what the system will do on its own and what we need to do for this,
i need a help,
please guide me,
thanx in advance,
Regards,
----------------------------------------------------------------
Tushar Thakker
Elitecore Technologies Ltd.
Ph: 9824080066 / 6405600 Ext-535
----------------------------------------------------------------
Life gives all that one deserves, but not all that one desires...
----------------------------------------------------------------
Hi,
Put a script to monitor a gateway with crond job and if it fails automatically change to gateway 2, you gotta it?
[]'s
Anderson
----- Original Message -----
From: Tushar Thakker
To: [email protected]
Sent: Friday, January 02, 2004 5:08 PM
Subject: [LARTC] Load balancing with failover
Hi all,
i have network setup with 3 gateways and a large number of intranet nodes, i want to do automatic load balancing with failover,
i have put following ip rules and routes,
ip rule add prio 222 table 222
ip route add default table 222 proto static \
nexthop via $GWE1 dev $IFE1 \
nexthop via $GWE2 dev $IFE2 \
nexthop via $GWE2 dev $IFE3 \ Now, i also want to do failover,
but the point is that what shall i need to do about deleting the route cache as soon as some gateway becomes dead or unavailable, what the system will do on its own and what we need to do for this,
i need a help,
please guide me,
thanx in advance,
Regards,
----------------------------------------------------------------
Tushar Thakker
Elitecore Technologies Ltd.
Ph: 9824080066 / 6405600 Ext-535
----------------------------------------------------------------
Life gives all that one deserves, but not all that one desires...
----------------------------------------------------------------
Quoted 11 lines · Tushar Thakker
Hi all,
i have network setup with 3 gateways and a large number of intranet nodes, i want to do automatic load balancing with failover,
i have put following ip rules and routes,ip rule add prio 222 table 222 ip route add default table 222 proto static \ nexthop via $GWE1 dev $IFE1 \ nexthop via $GWE2 dev $IFE2 \ nexthop via $GWE2 dev $IFE3 \
Quoted 4 lines
Now, i also want to do failover,
but the point is that what shall i need to do about deleting the route cache as soon as some gateway becomes dead or unavailable, what the system will do on its own and what we need to do for this,
i need a help,
AFAIK, You'd have to look at Julian's routepatch(es):
<http://www.ssi.bg/~ja/#routes-2.4>.
Search for "Dead Gateway Detection".
It may not be the entire solution, but a step in the right direction.
Signature · 7 lines
Mvh. / Best regards, Steen Suder <http://www.suder.dk/> ICQ UIN 4133803 _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 2 lines
Put a script to monitor a gateway with crond job and if it fails automatically change to gateway 2, you gotta it?
Does that address the problem of routes being cached?
Greetz -- Jurrie
[email protected]
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 4 lines · Tushar Thakker
Hi all,
i have network setup with 3 gateways and a large number of intranet nodes,
i want to do automatic load balancing with failover,
One find way to do this is to use a combination of :
- nth :
http://www.netfilter.org/documentation/pomlist/pom-base.html#nth
- condition :
http://www.netfilter.org/documentation/pomlist/pom-extra.html#condition
- CONNMARK :
http://www.netfilter.org/documentation/pomlist/pom-extra.html#CONNMARK
- iproute2
the first three are patch available in patch-o-matic from netfilter, see provided link for explanation.
The idea is the following :
let say that we've got a link A at 512 and a link B at 1024 kbits. I want to have twice the number of connection on B as on A to really use link B so i set a counter with 3 slots, I fed slots 0 and 2 to B and slots 1 to A.
iptables -t mangle -A FORWARD -m state --state NEW NEW -m nth --counter
1 \
--every 3 --packet 0 -j MARK --set-mark 0x1
iptables -t mangle -A FORWARD -m state --state NEW -m nth --counter 1 \
--every 3 --packet 1 -j MARK --set-mark 0x2
iptables -t mangle -A FORWARD -m state --state NEW -m nth --counter 1 \
--every 3 --packet 1 -j MARK --set-mark 0x1You need to restore and save the mark with connmark to have mark follow connection and tcp session coming from the same IP.
Next route mark 0x1 on link B and route 0x2 on link A (use ip rules and diferrent routing tables)
Here you've got a good load-balancing.
Next thing use condition on each line to have packet being marked only if the corresponding link is detected as UP (else marked it with the other link mark if it is itself not down). To test if the link is up you'll have to write a simple daemon which ping gateway and set the corresponding condition to 0 or 1 if link is down or up.
BR,
Signature · 2 lines
Eric Leblond NuFW, Now User Filtering Works (http://www.nufw.org)
Quoted 4 lines · Jurrie Overgoor
Quoted 2 lines
Put a script to monitor a gateway with crond job and if it fails automatically change to gateway 2, you gotta it?
Does that address the problem of routes being cached?
ip route flush cache
Gordan
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/