[Dnsmasq-discuss] how to configure lot of static routes

Albert ARIBAUD albert.aribaud at free.fr
Wed Jul 1 22:58:35 BST 2015


Bonjour Michał,

Le Wed, 1 Jul 2015 23:26:05 +0200, Michał Lipka <michal at lipka.email> a
écrit :

> 2015-06-30 20:02 GMT+02:00 Albert ARIBAUD <albert.aribaud at free.fr>:
> 
> > Le Tue, 30 Jun 2015 19:52:26 +0200, Albert ARIBAUD
> > <albert.aribaud at free.fr> a écrit :
> >
> > > Le Tue, 30 Jun 2015 19:48:01 +0200, Albert ARIBAUD
> > > <albert.aribaud at free.fr> a écrit :
> > >
> > > > > yes but RFC 3396 is about "Encoding Long Options in the Dynamic Host
> > > > > Configuration Protocol (DHCPv4)"
> > > >
> > > > Yes, it is. The routes are among these long options.
> > >
> > > Forget that, sorry, heat wave here is making me slip things.
> > >
> > > What I meant to say is, DHCP routes are transmitted as variable-length
> > > options according to RFC 2132 section 2, not RFC 3396 -- do a Wireshark
> > > on some DHCP traffic and you'll see the option with the 8-byte-per-route
> > > entries in the DHCP offer.
> >
> > More to the point, routes in dnsmasq are transmitted as classless
> > static routes (option 121) which are described in RFC 3442 in the
> > binary form that I mentioned.
> >
> >
> So.. is there possibility to transfer more routes than 28 in general?
> apparently dnsmasq doesn't allow to configure more. Am I right?

At the DHCP protocol level, it is not possible to configure more than
31 classless static routes in one option 121, and in theory one of these
should be the default route, which leaves 30 other routes.

However...

RFC 2131 section 4.1 : "[...] The values to be passed in an 'option' tag
may be too long to fit in the 255 octets available to a single option
(e.g., a list of routers in a 'router' option [21]).  Options may
appear only once, unless otherwise specified in the options document.
The client concatenates the values of multiple instances of the same
option into a single parameter list for configuration."

So whether one can repeat option 121 depends on another RFC. Let's
track that...

RFC 3442, which defines option 121 (classless static routes) says "DHCP
clients requesting this option, and DHCP servers sending this option,
MUST implement DHCP option concatenation [5].  In the terminology of RFC
3396 [5], the Classless Static Route Option is a
concatenation-requiring option."

And RFC 3396 defines a concatenation-requiring option as one whose
content may be spread over several instances of the option in a single
DHCP message.

Therefore, /in theory/, dnsmasq could "legally" send more than 31
routes by putting several instances of option 121 in the DHCP message
(up to the overall UDP datagram size limit, of course) and DHCP
clients /should/ be able to handle it.

I do not know, however, whether dnsmasq /actually/ supports splitting
options as per RFC 3396, and if it does, whether it supports splitting
option 121 - you'd have to dig into the code to know this -- or maybe
ask Simon. :)

Neither do I know which DHCP clients "out there" support RFC 3396.

> Michal


Amicalement,
-- 
Albert.



More information about the Dnsmasq-discuss mailing list