Skip to contentSkip to conversation

Load Balance simply

LARTC JasonB 1 participant 1 message Aug 31, 2004

lore
Share & tools
lore

JasonB

author
#0 lore raw

Hello,

From the looks of it you have the IP Network incorrect, You need to set this to your Network... for example ..

ip route add 23.215.4.0/26 dev eth2 src 23.215.4.61 table T2

23.215.4.0 is the network address, because 23.215.4.1 is my gateway for this interface (Router). If you still have a hard time with it .. You can post your Netmask and GW and I should be able to figure it out for you. There may be a way to do it from your IP address, but I had subnetting and aren't very good at it :)

ip route add 212.71.142.210/29 dev eth1 src 212.71.142.210 table 10

Quoted 55 lines · Marc-Christian Petersen

On Thursday 26 August 2004 15:06, Marcos Schonfeld wrote:

Hi Marcos,

Quoted 8 lines

ip route add $P1_NET dev $IF1 src $IP1 table 10
ip route add default via $P1 table 10
ip route add $P2_NET dev $IF2 src $IP2 table 20
ip route add default via $P2 table 20

ip route add $P1_NET dev $IF1 src $IP1 # This may be not necessary ip route add $P2_NET dev $IF2 src $IP2 # This may be not necessary

Quoted 6 lines

## ip route add default via $P1 ## You don't have to set this default gw, because you'll be routing accross this gateway instead of doing load-balance

ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

shouldn't this be table 10 and table 20? :)

anyway, I have a problem settings this up. I get:

ip route add 212.71.142.210/29 dev eth1 src 212.71.142.210 table 10 RTNETLINK answers: Invalid argument

ip route add default via 212.71.142.209 table 10
ip route add 61.212.57.152/29 dev eth2 src 61.212.57.152 table 20 ip route add default via 61.212.57.153 table 20

ip route add 212.71.142.210/29 dev eth1 src 212.71.142.210 RTNETLINK answers: Invalid argument

ip route add 61.212.57.152/29 dev eth2 src 61.212.57.152 RTNETLINK answers: File exists

ip rule add from 212.71.142.210 table 10
ip rule add from 61.212.57.152 table 20

strace from 1st RTNETLINK invalid argument:

....
controllen=0, msg_flags=0}, 0) = 36
dup(2) = 4
fcntl64(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(4, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4b3ed000
_llseek(4, 0, 0xb8526df0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(4, "RTNETLINK answers: Invalid argum"..., 36) = 36
close(4) = 0
munmap(0x4b3ed000, 4096) = 0
brk(0)

Quoted 3 lines

any idea what I am doing wrong?

Thanks alot.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/