[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] load balance



On Tue, 2005-01-25 at 20:26 +0000, Russ wrote:
>  Dont know if i want too much ?? But it would be good if i could get it 

You can use the ip command to set the routing tables to continously
"hop" connections: Your web browsing connection gets routed through one
adsl, then the gaming connection gets routed through the second. ip
knows to then maintain each connection via its respective modem. Here
are the rules which set up the routing tables for one of the sites I
have set up. 

-----------------------
/sbin/ip route del default

/sbin/ip rule add prio 50 table main

/sbin/ip rule add prio 222 table 222
/sbin/ip route add default table 222 proto static nexthop via 192.168.0.1 dev eth0 nexthop via 192.168.1.1 dev eth3

/sbin/ip rule add prio 201 from 192.168.0.2/24 table 201
/sbin/ip route add default via 192.168.0.1 dev eth0 src 192.168.0.2 proto static table 201
/sbin/ip route append prohibit default table 201 metric 1 proto static

/sbin/ip rule add prio 202 from 192.168.1.2/24 table 202
/sbin/ip route add default via 192.168.1.1 dev eth3 src 192.168.1.2 proto static table 202
/sbin/ip route append prohibit default table 202 metric 1 proto static
---------------------

It's the nexthop arguments which set it up. You'll also have to set up
your iptables correctly. 


Have fun.

Seb

-- 
Sebastian James - Embedded Systems.
Hypercube Systems Ltd 'Embedded Linux Solutions'
35 Walkley Crescent Road, Sheffield, S6 5BA
Tel: 0845 4580277  Web: www.hypercubesystems.co.uk

___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.