Ip Route equalize w/ one machine via one ISP

This is a discussion on Ip Route equalize w/ one machine via one ISP within the Linux Networking forums, part of the Linux Forums category; I've got 2 DSL's lines I'm attempting to load balance. I seem to have it working but ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-05-2003
Mark
 
Posts: n/a
Default Ip Route equalize w/ one machine via one ISP

I've got 2 DSL's lines I'm attempting to load balance. I seem to have it
working but I want to add one more thing. I want 10.0.2.252 to just go out
over eth0, ie., I don't want that machine to use the load balancing.
10.0.2.254 is the gateway.

INTERF0="eth0"
INTERF1="eth1"
NTSERV="10.0.2.252"

LOCALIP0=`cat /etc/dhcpc/dhcpcd-eth0.info | grep IPADDR | cut -c8-21`
LOCALIP1=`cat /etc/dhcpc/dhcpcd-eth1.info | grep IPADDR | cut -c8-21`

# Clear old masq's / forwards

${NET}/iptables -L -t nat
${NET}/iptables -F -t nat
${NET}/iptables -F INPUT
${NET}/iptables -F OUTPUT
${NET}/iptables -F FORWARD
${NET}/iptables -t nat -F POSTROUTING
${NET}/iptables -t nat -F PREROUTING

# Setup IP Masq
echo 1 > /proc/sys/net/ipv4/ip_forward

ip rule add from XXX.XXX.253.158 lookup 1 dev eth1
ip route add 10.0.0.0/24 via 10.0.2.254 table 1
ip route add 0/0 table 1 dev eth1

ip rule add from XXX.XXX.253.52 lookup 2 dev eth0
ip route add 10.0.0.0/24 via 10.0.2.254 table 2
ip route add 0/0 table 2 dev eth0

ip route add default equalize \
nexthop via XXX.XXX.253.1 dev eth1 \
nexthop via XXX.XXX.253.1 dev eth0

${NET}/iptables -t nat -A POSTROUTING -o ${INTERF0} -j SNAT --to
${LOCALIP0}
${NET}/iptables -t nat -A POSTROUTING -o ${INTERF1} -j SNAT --to
${LOCALIP1}

If I add a 3rd table/lookup for 10.0.2.252 and then try to add a default
route for it. I get a msg that it already exists???

TIA,
Mark
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:41 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0