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

Michał Lipka michal at lipka.email
Mon Jun 29 21:01:53 BST 2015


2015-06-25 16:02 GMT+02:00 wkitty42 at gmail.com <wkitty42 at gmail.com>:

> On 06/25/2015 06:58 AM, Michał Lipka wrote:
>
>> Hello,
>> I've set dnsmasq to provide static routes for vpn clients.
>> Several routes I can configure like this (gw is 1.2.3.4):
>> dhcp-option=121,10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4
>> dhcp-option=249,10.0.0.1/32,1.2.3.4,192.168.13.15/32,1.2.3.4
>> (the second line is for compatibility with MS and Apple systems)
>>
>> Unfortunately I have a lot of different IP's to route (about 30).
>> If I put all in one line dnsmasq won't start (it accepts about 255 bytes
>> for
>> dhcp-option according to RFC):
>> Jun 24 19:43:32 vpn dnsmasq[21760]: dhcp-option too long at line 318 of
>> /etc/dnsmasq.conf
>>
>> Jun 24 19:43:32 vpn dnsmasq[21760]: FAILED to start up
>>
>> If I make few lines with the same option only last is used:
>>
>
> 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, \
>   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, \
>   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:

# dnsmasq --test

dnsmasq: bad option at line 321 of /etc/dnsmasq.conf
(in your example it would fail at 2nd line: 192.168.13.16/32 ........)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20150629/aae94637/attachment.html>


More information about the Dnsmasq-discuss mailing list