On 30/10/11 16:21, Tom Metro wrote:
The dhcp-host option has a complex syntax, and the man page doesn't
cover all the rules.
One aspect not mentioned is that the order of the arguments don't have
to match what it is specified. The man page indicates:
--dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
and yet it show the example:
--dhcp-host=lap,192.168.0.199
where hostname appears *before* IP address. Can any argument appear in
any oder? If not, what are the rules?
Generally, some of these arguments are used by Dnsmasq to identify the
client making the request to see if it matches this static rule, while
other arguments are used to define the static entry. The behavior of
dhcp-host may be clearer if you identified which arguments fall into
which of those groups.
Some rather useful behaviors, such as being able to assign a host name
to a MAC address, without assigning a static IP, are not covered by the
man page. There should be an expanded collection of examples that cover
things like this.
There should be a sentence or two describing each of these options (for
example, the format of lease_time is never defined, other than
mentioning the special cases of 'infinite 'and 'ignore.' This would also
be the place specify default values if the argument is omitted.
I don't disagree with any of the above, but my available dnsmasq time if
going into the IPv6 DHCP project at the moment. Patches towards this,
from anybody, gratefully accepted.
The special option id:* means "ignore any client-id and use MAC
addresses only." This is useful when a client presents a client-id
sometimes but not others.
How is that different from specifying a mac address and no client-id?
Without this option, if a client presents different client-ids at
different times, it will be treated as two different clients, even if
the MAC address is the same. With this option the client-id is ignored
so that same MAC address -> same client. (It used to be that two
requests, one with and one without a client-id would also be treated as
different. This is the most common case, for instance when a DHCP client
in netboot ROM behaves differently to the OS that finally gets booted.
Eventually, more subtle behaviour was added for this case, which renders
the id;* option redundant most of the time.)
Simon.
-Tom