Andreas Bach Aaen wrote:
Hi,
I would like to user dnsmasq as the one part of a PXE server on a
network. I would like to pass different options and filenames to
clients identified by different MAC addresses. How do I do this?
Regards,
First, set a tag based on the client's MAC address.
dhcp-host=net:blue,11:22:33:44:55:66
Then, tag the dhcp-boot lines you want sent, like this:
dhcp-boot=net:blue,blue-kernel,bootserver,192.68.1.1
and the options you want to be sent
dhcp-option=blue,3,192.168.1.2
A few things to note:
1) The syntax for tagging dhcp-boot and dhcp-option is different: the
-boot needs "net:" to distinguish the tag from the filename, -option
doesn't. Recent versions of dnsmasq will ignore net: if you add it to an
-option line, but not earlier ones.
2) The semantics of untagged -option is different from -boot. Untagged
options are always sent, untagged -boot is sent only when no tagged one
matches.
3) Only one dhcp-host line is ever matched for a given client, so if
you're already using dhcp-host to specify fixed addresses or hostnames,
you need to add the tag to the existing dhcp-host line. Alternatively,
you can match against a wildcarded MAC address using dhcp-mac:
dhcp-mac=blue,11:22:33:*:*:*
This is useful for matching a large class of hosts, when dhcp-host
matcing might already be in use for more specific stuff. dhcp-mac is
only available in more recent releases.
HTH
Simon.