Networking Forums

Networking Forums > Computer Networking > Linux Networking > Ip Route equalize w/ one machine via one ISP

Reply
Thread Tools Display Modes

Ip Route equalize w/ one machine via one ISP

 
 
Mark
Guest
Posts: n/a

 
      07-05-2003, 11:56 AM
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
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remotely login into a pure IPv6 Linux machine from a DualStack windows machine chaitan Linux Networking 1 11-21-2007 05:37 PM
VPN client adds wrong route to local route table snowdog_2112 Windows Networking 7 11-01-2005 02:05 PM
route and static route to a gateway Sting Linux Networking 2 02-21-2004 03:35 AM
Creating a static route to an internal machine Yousaf Linux Networking 7 09-29-2003 08:25 AM
route issue? machine is accessible but cannot access outside local network Eric Smith Linux Networking 1 09-09-2003 03:57 PM



1 2 3 4 5 6 7 8 9 10 11