[Dnsmasq-discuss] how to configure lot of static routes
Maciej Soltysiak
maciej at soltysiak.com
Tue Jun 30 14:56:36 BST 2015
On Tue, Jun 30, 2015 at 3:24 PM, Albert ARIBAUD <albert.aribaud at free.fr>
wrote:
> Bonjour Michał,
>
> Le Tue, 30 Jun 2015 13:54:11 +0200, Michał Lipka <michal at lipka.email> a
> écrit :
>
> > 2015-06-30 12:10 GMT+02:00 Maciej Soltysiak <maciej at soltysiak.com>:
> >
> > > On Tue, Jun 30, 2015 at 4:03 AM, wkitty42 at gmail.com <
> wkitty42 at gmail.com>
> > > wrote:
> > >
> > >>
> > >> On 06/29/2015 04:01 PM, Michał Lipka wrote:
> > >>
> > >>>
> > >>> 2015-06-25 16:02 GMT+02:00 wkitty42 at gmail.com
> > >>> does breaking the line work?
> > >>>
> > >>> eg:
> > >>> dhcp-option=249,10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4
> > >>> <http://10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4>, \
> > >>> 192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4
> > >>> <http://192.168.13.16/32,1.2.3.4,192.168.13.17/32,1.2.3.4>, \
> > >>> 192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4
> > >>> <http://192.168.13.18/32,1.2.3.4,192.168.13.19/32,1.2.3.4>, \
> > >>> 192.168.13.20/32,1.2.3.4 <http://192.168.13.20/32,1.2.3.4>
> > >>>
> > >>>
> > >>> Thank you for this idea. Unfortunately it does not work. dnsmasq
> fails
> > >>> at first
> > >>> line which has no option:
> > >>>
> > >>
> > >> sounds like an option that should maybe be implemented... especially
> > >> since it is an apparent standard that so many tools do follow ;)
> > >>
> > > I think dnsmasq has a 1024 characters for config lines. I browsed the
> > > source briefly last night but couldn't find it.
> > >
> >
> > I checked it more precisely and it turned out that is not line length
> that
> > bothers dnsmasq. It's routes count.
> > I can set up to 28 routes in single dhcp-option line. It doesn't matter
> if
> > it will take 600 or 800 characters. If I set 29th route dnsmasq complains
> > about option too long:
> >
> > dnsmasq: dhcp-option too long at line 320 of /etc/dnsmasq.conf
> > Can you check the code once again and try to find this limit (28) ? Why
> it
> > is like that?
>
> Could it be that the total DHCP packet size goes over the maximum
> allowed size for an UDP frame?
>
Perhaps. The offending code is related to the length of the dhcp option,
not the number of routes per se:
if (!is6 &&
((new->len > 255) ||
(new->len > 253 && (new->flags & (DHOPT_VENDOR | DHOPT_ENCAPSULATE)))
||
(new->len > 250 && (new->flags & DHOPT_RFC3925))))
ret_err(_("dhcp-option too long"));
I guess you can stick more than 255 bytes in a dhcp packet, anyone knows if
the limit is coming from RFCs or elsewhere?
Amicalement,
> --
> Albert.
Best regards,
Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20150630/2cd25077/attachment.html>
More information about the Dnsmasq-discuss
mailing list