"David Brown" <(E-Mail Removed)> wrote in message news:<ce2anv$sg1$(E-Mail Removed)>...
> Would it make sense to try to balance traffic between the two lines, or
> would it be much simpler to consider one as a backup and the other as the
> main line? Am I right in thinking that passing web requests down
> alternating lines would confuse session-tracking on some web servers, so
> that it might be best to split traffic according to services (eg., http down
> one line, mail on the other) ? I'm reasonably confident that I could
> configure such a split using iptables, but if anyone has pointers to any
> useful web sites or on-line tutorials (I've found plenty for "normal"
> firewall/router setups), I'd be very grateful.
In my experience it works best to split the traffic by type,
especially if you are running NAT on the Linux box.
I use iptables to mark the packages with the "-t mangle" module, and
then use "ip" to configure different routes for each mark. A snippet
of the configuration is shown below.
$IP rule add fwmark 1 table 100 pref 1000
$IP rule add fwmark 2 table 200 pref 1000
$IP route add table 200 scope global nexthop via x1.x2.x3.x4 dev eth2
$IP route add table 100 scope global nexthop via y1.y2.y3.y4 dev eth3
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 22 -j MARK
--set-mark 1 # ssh
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 443 -j MARK
--set-mark 1 # https
iptables -t mangle -A PREROUTING -i eth0 -p tcp --dport 110 -j MARK
--set-mark 2 # pop3
This works for outgoing traffic. Incoming traffic is a bit more
trickier. Mail is easy. Just put both the ip in the MX list. Web
traffic and other "user-to-machine" traffic is problematic. If you
define to aliases for a
www.example.com and one line is down. The
users will notice it since half the requests will go to the line that
is down.
If you have an external DNS server, you could check the status of your
two connections and change the records in the zone file to match the
status. This would require a short TTL value.
If you want real redundancy you need to use BGP.
Regards
Morten Isaksen
http://www.aub.dk/~misak/