[quagga-dev 9052] Help with specifying both gateway and ifindex in IPv4

Juliusz Chroboczek jch at pps.jussieu.fr
Sat Feb 11 08:21:15 GMT 2012


The Babel protocol is designed to be suitable for both traditional,
prefix-based networks, and for pure meshes.  A pure mesh is a network
where there are is subnet structure, and in which all routes are host
routes (/32 in IPv4, /128 in IPv6); hence, in a pure mesh the
prefixes/netmasks that you configure on your interfaces are pretty much

In IPv6, a route is specified by an interface index and a link-local
next-hop address, so pure meshes work out of the box -- it doesn't
matter much how you specify your connected networks.  In IPv4, however,
routes are traditionally specified by just a next-hop address, and the
connected prefix (netmask) is used to pick the right interface.  Hence,
traditional IPv4 routing doesn't work without some tweaking in pure meshes.

In babeld, we're working around that in system-dependent ways.  Under
Linux, we specify both a next-hop and an ifindex, then use the "onlink"
flag (RTNH_F_ONLINK) which requests that the kernel don't check the
connected prefix; this makes routing in IPv4 work pretty much like
IPv6.  Under BSD, there's no "onlink" flag, but we're still able to
specify both an ifindex and a nexthop; this requires that the user
configure his connected prefixes correctly, but it is possible to
specify the same connected prefix on all interfaces.

Under Quagga, this does not work: if we specify both an ifindex and
a nexthop to zapi_ipv4_route, the nexthop is ignored, and the route
appears to zebra as a directly connected route.  For that reason, we're
currently specifying just the nexthop for now, which means that babeld
under Quagga requires interfaces to have non-overlapping prefixes
(making it impossible to use pure meshes with multiple interfaces).

Is the limitation to either a nexthop or an ifindex in IPv4 by design?
Is it a bug?  If the latter, could somebody point me at the point in the
code where to fix it?


-- Juliusz

More information about the Quagga-dev mailing list