[Dnsmasq-discuss] disable Router does not work
Simon Kelley
simon at thekelleys.org.uk
Fri Aug 25 15:10:16 BST 2006
Jürgen Steinel wrote:
> Hi,
>
> today I wanted to disable routing for a single host. That machine gets
> its IP from dnsmasq.
>
> In the dnsmasq.conf I added an entry to assign the host to a
> network-group and set an option for this group that should disable the
> gateway.
>
> dhcp-host=<host>,<ip>,net:norouting
> dhcp-option=norouting,3,0.0.0.0
>
> Unfortunately this did not have the expected effect. The host got the IP
> mentioned in dhcp-host but was still told where the (actual) router is.
>
> I captured the dhcp-request/reply to make sure the Information came from
> dnsmasq (and was not cached by the client). Dnsmasq *did* deliver the
> Information.
>
> To test if dhcp-option does anything at all I changed the above line to
> this:
>
> dhcp-option=norouting,3,1.2.3.4
>
> After requesting a new IP the client got 1.2.3.4 as default gateway.
>
>
> I think this behaviour is wrong (=ignore option if given IP is 0) and
> even if it is intented it should be mentioned in the manual.
>
> Is there a different way to set an option to a zero-value?
>
Short answer:
dhcp-option=norouting,3
long answer:
Using 0.0.0.0 doesn't work, since that's used as shorthand for "the
address of the host running dnsmasq" - you saw this in your experiments.
For most DHCP options, doing
dhcp-option=<option number>
will send the option, with no extra data, but for the four special
options which dnsmasq sends by default (router, DNS server, netmask and
broadcast address) then doing
dhcp-option=<option number>
completely suppresses sending the default.
I hope that this is actually more logical than my explanation of it....
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list