Wildcard hardware address syntax

Glenn Satchell Glenn.Satchell at uniq.com.au
Thu Aug 3 14:18:57 UTC 2006


The full hardware address is required to match a host statement because
it must be unique. How could the system decide which one of potentially
many MAC addresses should be applied to a given host statement?

I can see two possibilities:

1. Create pools consisting of a single address (not a very easy
solution) and you'd still need to know the full MAC address.

2. Get rid of the host statements and use DDNS so that dhcpd assigns an
address from within the range, and then DNS gets a name that points to
the particular address. It would require always using the name, but
otherwise should be workable. There's examples for dhcpd.conf and
named.conf in the dhcpd.conf man page (search for DYNAMIC DNS
UPDATES).

And the length parameter in the substring needs to be 3 to match the
length of the string you're comparing with. Starting at offset 1 is
correct, otherwise you'd need to include the first byte (hardware media
type) in the comparison string.

class "vmware" {
	match if substring (hardware, 1, 3) = 00:0c:29;
	}

regards,
-glenn

>From: "HAWKER, Dan" <dan.hawker at astrium.eads.net>
>To: " (dhcp-users at isc.org)" <dhcp-users at isc.org>
>Subject: Wildcard hardware address syntax
>Date: Thu, 3 Aug 2006 12:30:11 +0100 
>
>
>Hi All,
>
>Have a DHCPD 3.0.2 server running on FC4. Runs fine and is extensively used.
>
>Is there a way of using a wildcard to grab a group of network cards and
>allocate them to a particular address pool (& hence subnet/group)??
>
>Reason...
>We have a project ongoing that will be used by some developers to test using
>VMware the booting and application of some embedded devices via PXE.
>Presently this works fine, however we presently have to explicitly set some
>parameters and I'd like to make it all a bit more automated.
>
>I have distributed a basic VMware config that is setup as required. When you
>*startup* a pre-existing image it will ask if you wish to reset the MAC
>address and such like. Which we'd obviously need to do. Unfortunately this
>uses a pretty random algorithm, so other than going to the user and getting
>the automatically-generated MAC address, there isn't a way of knowing the
>MAC addresses at the start. A small *area* of hostnames have been allocated
>to specific IP addresses on our DNS box (BIND).
>
>Obviously at this point, the MAC address is unknown to the DHCPD server,
>however VMware MAC addresses are generated with the following syntax...
>00:0c:29:xx:xx:xx
>
>I have setup a class which I *think* sees this and hence uses a particular
>pool of addresses. This seems to work, however unless I add the full MAC
>address to a host declaration, it fails to allocate the address and boot.
>Have tried both within and without a group declaration (we group our hosts
>per PXE config). The subnet/class/hosts etc for this area of my DHCPD config
>is below...
>
>Later as this becomes used more, I'd like to add Dynamic updating of the DNS
>too, however at the moment, I'd be happy with just this :)
>
>Any ideas???
>
>Dan
>
>###### Start of dhcpd.conf file #######
>
># Global
><snip>
># have some standard global settings set. Just to ensure pxe works, etc.
>This does so, so have not included
></snip>
>
># Class to match vmware MAC addresses
>class "vmware" {
>	match if substring (hardware,1 ,5) = 00:0c:29;
>	}
>
>shared-network pms {
>	default-lease-time	3600;
>	max-lease-time		43200;
>
># vmware subnet
>subnet 172.30.0.0 netmask 255.255.240.0 {
>	option routers		172.30.15.254;
>	option subnet-mask	255.255.240.0;
>	option domain-name 	"local";
>	option domain-name-servers	192.168.203.238, 192.168.203.240;
>	option ntp-servers	192.168.203.92
>	default-lease-time	3600;
>	max-lease-time		7200;
>#close subnet
>}
>
>#pools#
># vmware pool
>pool {
>	allow members of "vmware";
>	range 172.30.1.1 172.30.1.50;
>	}
>
>#close shared-network
>}
>
># group to apply PXE attributes
>group {
>	next-server voyager;
>	filename "pxelinux.0";
>	use-host-decl-names	on;
>
>host vmware1 {
>	hardware ethernet	00:0c:29:09:fc:cd;
>	fixed-address	vmware1.local;
>	}
>host vmware2 {
>#	hardware ethernet	00:0c:29:09:fc:cd;
>	fixed-address	vmware2.local;
>	}
>#close group
>}
>
>########### EOF ###############
>
>This email is for the intended addressee only.
>If you have received it in error then you must not use, retain, disseminate or 
otherwise deal with it.
>Please notify the sender by return email.
>The views of the author may not necessarily constitute the views of Astrium 
Limited.
>Nothing in this email shall bind Astrium Limited in any contract or obligation.
>
>Astrium Limited, Registered in England and Wales No. 2449259
>Registered Office: Gunnels Wood Road, Stevenage, Hertfordshire, SG1 2AS, 
England
>



More information about the dhcp-users mailing list