Skip to contentSkip to conversation

trouble with nexthop when I try to load balance

LARTC [email protected] 2 participants 2 messages Aug 20, 2004 – Aug 21, 2004

lore
Share & tools
lore
#0 lore raw

I have two internet lines and I want to do equal cost loadbalancing on the two uplinks to the internet. This is what I do:

ip route add 200.200.200.0/24 dev eth2 table 200 ip route add default via 200.200.200.254 dev eth2 table 200

ip route add 100.100.100.0/24 dev eth1 table 100 ip route add default via 100.100.100.254 dev eth1 table 100

ip route add 200.200.200.0/24 src 200.200.200.1 dev eth2 ip route add 100.100.100.0/24 src 100.100.100.1 dev eth1

ip route add default scope global nexthop via 100.100.100.254 \

                                  nexthop via 200.200.200.254

The last command fails with the message:"RTNETLINK answers: Invalid argument". I found a posts that says to fix the iproute2/ip/iproute.c:parse_nexthops() with change like this:

        rtnh->rtnh_ifindex = 0;

+ rtnh->rtnh_flags = 0;
+ rtnh->rtnh_hops = 0;
rta->rta_len += rtnh->rtnh_len;

I fixed the file, but get the same error "Invalid argument". I don't know why it fails. I have a 2.4.20 kernel with Julian Anastasov's patches. iproute2 version ss010824.
I really need the solution to this issue. Please help me :( Thanks in advance
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

Hello,

Quoted 2 lines · On Fri, 20 Aug 2004 [email protected] wrote:

I have two internet lines and I want to do equal cost loadbalancing on the two uplinks to the internet. This is what I do:

You need to add ip rules for all tables, before they are
used from other gateways in other routes. Then the kernel will see the routes in your tables, the gateways will become reachable and visible for all other routes you are adding. The difference is that you do not add the link routes in table main, for some reason you decided to add them in unused tables and the following command can not see the GWs.

Quoted 11 lines

ip route add default scope global nexthop via 100.100.100.254 \

                                  nexthop via 200.200.200.254

The last command fails with the message:"RTNETLINK answers: Invalid argument". I found a posts that says to fix the iproute2/ip/iproute.c:parse_nexthops() with change like this:

        rtnh->rtnh_ifindex = 0;
(quoted diff) +2 -0
+       rtnh->rtnh_flags = 0;
+	rtnh->rtnh_hops = 0;
 	rta->rta_len += rtnh->rtnh_len;
Quoted 3 lines

I fixed the file, but get the same error "Invalid argument". I don't know why it fails. I have a 2.4.20 kernel with Julian Anastasov's patches. iproute2 version ss010824.

Better use latest versions of iproute2.

Quoted 2 lines

I really need the solution to this issue. Please help me :( Thanks in advance

Regards

--
Julian Anastasov <[email protected]>
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/