mschonfeld@ubp.edu.ar
2004-Aug-20 13:51 UTC
trouble with nexthop when I try to load balance
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 / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Julian Anastasov
2004-Aug-21 06:38 UTC
Re: trouble with nexthop when I try to load balance
Hello, On Fri, 20 Aug 2004 mschonfeld@ubp.edu.ar 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.> 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.Better use latest versions of iproute2.> I really need the solution to this issue. Please help me :( > Thanks in advanceRegards -- Julian Anastasov <ja@ssi.bg> _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/