Is there a way to add load balancing in NAS (busybox)?
I did try some scripts I got from google, but all of then fail at some
point (iptables missing, or some option not available in busybox).
But it didn't stop me from having crazy ideas:
I got two logical networks working in the same physical network:
NetworkA =
192.168.254.1/16, gateway is 192.168.146.1
NetworkB =
10.0.0.2/24, gateway is 10.0.0.1
So my first step was to add the second address to interface by adding
a virtual one:
ifconfig eth0:0 10.0.0.2 netmask 255.255.255.0
Works perfectly, I can ping the gateway from NetworkB without any
problems.
But for internet only gateway from NetworkA is used. Next step was to
change routing (remove old and add new ones):
route del default gw 192.168.146.1
route add -net
0.0.0.0/1 gw 192.168.146.1
route add -net
128.0.0.0/1 gw 10.0.0.1
Now, every packet with destination from 0.0.0.0 to 127.255.255.255
must go through gateway A, and from 128.0.0.0 to 255.255.255.255 must
go through gateway B.
The main problem is, for example, if an external connection request
comes from address 130.125.25.12 through gateway A, the reply will
follow the gateway B, and so the connection will never happen. So it
did not work that well, but better than only gateway A or B alone.
Any ideas how to 'fix' this problem or how to correct use load
balancing?
Thanks in advice,
Willian