LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2008, 11:06 AM   #1
naghi32
Member
 
Registered: Dec 2008
Distribution: Slackware
Posts: 39

Rep: Reputation: 17
Question Linux network load balancing trouble


I have a slackware box ( 12.1 ) running for quite some time and a few days ago i`ve added multiple isp connections
each connection has its own adapter
( eth1 eth3 tap4 ( tap 4 is made thru eth4 ) )
eth3 has ip 10.0.0.2 gw 10.0.0.1 ( 8mb )
eth3 has ip 82.xx.xx.135 gw 82.xx.xx.129 ( 2mb )
tap4 has ip 10.0.2.2 gw 10.0.2.1 ( 8mb )
eth2 (LAN) has multiple addresses ( 192.168.4,5,6,7.xx and 86.xx.xx.129-193 ( public ) )
/etc/iproute2/rt_tables has the folowing
"
255 local
254 main
253 default
0 unspec
252 rtclocal
251 rtcvpn
250 rds
"
i run the folowing ip commands

ip route add default via 82.xx.xx.129 table rds
ip route add default via 10.0.0.1 table rtclocal
ip route add default via 10.0.2.1 table rtcvpn

ip route add default equalize scope global \
nexthop via 10.0.0.1 dev eth3 weight 2 \
nexthop via 10.0.2.1 dev tap4 weight 2 \
nexthop via 82.xx.xx.129 dev eth1 weight 1

ip rule add from 86.xx.xx.129/26 table rds
ip rule add from 192.168.4.1/24 table rds

The trouble is that connections kinda end up the wrong way
for example some connections get disconected and end up thru another adapter
I was wondering what have i done wrong.
The internet does work as it should but not always ( ie disconnections )
Any help is apreciated.
And as a sidenote how should the weight parameter be in order to defavour a route ( less used ) , bigger or smaller ? ( ie the rds route )

Thanks in advnace
 
Old 12-19-2008, 01:18 AM   #2
naghi32
Member
 
Registered: Dec 2008
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 17
Can`t anyone really help me ?
No ?
I`ve been trying to figure it out for days but i`ve decided to use a static route for the time beeing ( ie only 1 route ) untill i figure i out the problem.

Last edited by naghi32; 12-20-2008 at 03:15 AM.
 
Old 12-23-2008, 03:39 PM   #3
naghi32
Member
 
Registered: Dec 2008
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 17
Exclamation Fixed

Ok i seemed to find the MAJOR flaw in my routing setup
i`l just copy/paste from running config for a better view

#here i`ve added the default gw for each table and the way we respond to packets coming in thru an interface ( we don`t want to end up the wrong one do we ? )

ip route add 82.xx.xx.128/26 dev eth1 src 82.77.191.135 table rds
ip route add default via 82.xx.xx.129 dev eth1 table rds
ip route add 10.0.0.0/24 dev eth3 src 10.0.0.2 table rtclocal
ip route add default via 10.0.0.1 dev eth3 table rtclocal
ip route add 10.0.2.0/24 dev tap4 src 10.0.2.2 table rtcvpn
ip route add default via 10.0.2.1 dev tap4 table rtcvpn

#Here i`ve added the local ip`s to the tables so the server can be accessed locally
for i in `echo "192.168.4.0/24 192.168.5.0/24 192.168.6.0/24 192.168.7.0/24 86.xx.xx.128/26 "`
do
ip route add $i dev eth2 table rds
ip route add $i dev eth2 table rtclocal
ip route add $i dev eth2 table rtcvpn
done
#and here i`ve added the default multiroute
ip route add default equalize scope global \
nexthop via 10.0.0.1 dev eth3 weight 2 \
nexthop via 10.0.2.1 dev tap4 weight 2 \
nexthop via 82.xx.xx.129 dev eth1 weight 1

Hope it could be of some use to anybody
Comments where added in forum post they DO not exist in the script
 
  


Reply

Tags
balancing, linux, load, network



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network LOAD BALANCING shishirkotkar Linux - Networking 0 01-04-2008 12:24 AM
network load balancing Ammad Linux - Networking 1 08-09-2007 02:24 AM
network load balancing? jetpig Linux - Networking 3 11-08-2006 05:25 PM
Network Load Balancing bwilliam79 Linux - Networking 1 08-10-2004 10:38 AM
Network load balancing?? trycoon Linux - Networking 3 01-21-2003 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration