Hi there, Last week I got load balancing working between our 2 lans and 2 adsl connections. This script here is how I set it up. A tad excessive stipulating the eth setup at the beginning, but I wanted it all in one script. The firewall config was more taxing, but it is perfectly possible to allow incoming services on either ISP connection and route it back over the correct one, just need to write lots of firewall rules, matching on the outgoing interface is how I managed the source nat'ing for both. Cheers, Daniel. #!/bin/bash # ISP Variables ISP1DEV="eth0" ISP1IP="1.1.1.54" ISP1MASK="255.255.255.248" ISP1NET="1.1.1.48/29" ISP1BCAST="1.1.1.55" ISP1GW="1.1.1.49" ISP2DEV="eth3" ISP2IP="2.2.2.210" ISP2MASK="255.255.255.248" ISP2NET="2.2.2.208/29" ISP2BCAST="2.2.2.215" ISP2GW="2.2.2.209" # LAN Variables # DMZ LAN1DEV="eth1" LAN1IP="10.0.0.1" LAN1MASK="255.255.255.0" LAN1NET="10.0.0.0/24" LAN1BCAST="10.0.0.255" # LAN LAN2DEV="eth2" LAN2IP="192.168.42.250" LAN2MASK="255.255.255.0" LAN2NET="192.168.42.0/24" LAN2BCAST="192.168.42.255" # Setup interfaces with correct IPs/Netmasks ifconfig $ISP1DEV down ifconfig $ISP2DEV down ifconfig $LAN1DEV down ifconfig $LAN2DEV down ifconfig $ISP1DEV $ISP1IP netmask $ISP1MASK broadcast $ISP1BCAST ifconfig $ISP2DEV $ISP2IP netmask $ISP2MASK broadcast $ISP2BCAST ifconfig $LAN1DEV $LAN1IP netmask $LAN1MASK broadcast $LAN1BCAST ifconfig $LAN2DEV $LAN2IP netmask $LAN2MASK broadcast $LAN2BCAST # Clear current routing tables ip route del # Setup routing tables ip route add $ISP1NET dev $ISP1DEV src $ISP1IP table T1 ip route add $ISP2NET dev $ISP2DEV src $ISP2IP table T1 ip route add default via $ISP1GW table T1 ip route add default via $ISP2GW table T2 # Setup main routing table ip route add $ISP1NET dev $ISP1DEV src $ISP1IP ip route add $ISP2NET dev $ISP2DEV src $ISP2IP # Setup matching to tables based on connection ip rule add from $ISP1IP table T1 ip rule add from $ISP2IP table T2 ip route add $LAN1NET dev $LAN1DEV table T1 ip route add $LAN2NET dev $LAN2DEV table T1 ip route add $ISP2NET dev $ISP2DEV table T1 ip route add 127.0.0.0/8 dev lo table T1 ip route add $LAN1NET dev $LAN1DEV table T2 ip route add $LAN2NET dev $LAN2DEV table T2 ip route add $ISP1NET dev $ISP1DEV table T2 ip route add 127.0.0.0/8 dev lo table T2 # Set weighting for load balancing ip route add default scope global nexthop via $ISP1GW dev $ISP1DEV weight 5 nexthop via $ISP2GW dev $ISP2DEV weight 5