Hello all
I continue fighting with load balancing, I though it was easier :-/
Here is the script with my configuration
#!/bin/sh
IFI=eth0
IPI=192.168.10.155
NMI=24
IFE1=eth1
IPE1=192.168.1.128
NWE1=192.168.1.0
NME1=24
BRD1=192.168.1.255
GWE1=192.168.1.1
IFE2=eth2
IPE2=192.168.254.128
NWE2=192.168.254.0
NME2=24
BRD2=192.168.254.255
GWE2=192.168.254.254
ip link set $IFI up
ip addr add $IPI/$NMI brd + dev IFI
ip rule add prio 50 table main
ip route del default table main
ip link set $IFE1 up
ip addr flush dev $IFE1
ip addr add $IPE1/$NME1 brd $BRD1 dev $IFE1
ip link set $IFE2 up
ip addr flush dev $IFE2
ip addr add $IPE2/$NME2 brd $BRD2 dev $IFE2
ip rule add prio 201 from $NWE1/$NME1 table 201
ip route add default via $GWE1 dev $IFE1 src $IPE1 proto static table 201
ip route append prohibit default table 201 metric 1 proto static
ip rule add prio 202 from $NWE2/$NME2 table 202
ip route add default via $GWE2 dev $IFE2 src $IPE2 proto static table 202
ip route append prohibit default table 202 metric 1 proto static
ip rule add prio 222 table 222
ip route add default table 222 proto static nexthop via $GWE1 dev $IFE1
nexthop via $GWE2 dev $IFE2
This is a copy/paste from http://www.ssi.bg/~ja/nano.txt configuration
Some tests...
root@enrutizador:~# ip rule
0: from all lookup local
50: from all lookup main
201: from 192.168.1.0/24 lookup 201
202: from 192.168.254.0/24 lookup 202
222: from all lookup 222
32766: from all lookup main
32767: from all lookup default
root@enrutizador:~# ip route list table main
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.128
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.155
192.168.254.0/24 dev eth2 proto kernel scope link src 192.168.254.128
root@enrutizador:~# ip route list table 201
default via 192.168.1.1 dev eth1 proto static src 192.168.1.128
prohibit default proto static metric 1
root@enrutizador:~# ip route list table 202
default via 192.168.254.254 dev eth2 proto static src 192.168.254.128
prohibit default proto static metric 1
root@enrutizador:~# ip route list table 222
default proto static
nexthop via 192.168.1.1 dev eth1 weight 1
nexthop via 192.168.254.254 dev eth2 weight 1
The problem is that load balancing isnt't working :-/
root@enrutizador:~# for x in $(seq 1 10); do ip r g 130.206.1.$x; done
130.206.1.1 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.2 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.3 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.4 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.5 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.6 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.7 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.8 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.9 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.10 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
I think everything is ok, but obviusly itsn't
Thanks for your help
Javier
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc