dhcp3 IP address allocation based on part of MAC doesn't work

b5b5b5b5 b5b5b5b5 at centrum.sk
Fri Mar 20 14:24:36 UTC 2009


Greetings.

For few last days i'm trying to find why the IP address allocation based 
on part of MAC doesn't work.
Everything else works fine.
But when i try to make some allocation based on the part of MAC address, 
e.g.:

class "vm-vmware" {
	match if substring (hardware, 1, 2) = 00:0C:29;
}

subnet 192.168.0.0 netmask 255.255.0.0 {
	range 192.168.20.160 192.168.20.240;
	option subnet-mask 255.255.0.0;
	pool {
		range 192.168.23.50 192.168.23.150;
		allow members of "vm-vmware";
		option subnet-mask 255.255.0.0;
		option routers 192.168.22.1;
		option broadcast-address 192.168.23.255;
	}
}

... then it doesn't work.
The destination system takes it's IP address from the first range: 
"range 192.168.20.160 192.168.20.240".
I've really tryied lot of things which google found, e.g. 
http://archives.devshed.com/forums/networking-100/ip-allocation-based-on-mac-address-961758.html 
, but nothing helped.
And i can't find what's wrong in the configuration of mine.
Here is entire dhcpd.conf:


# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "domain.eu";
option domain-name-servers 192.168.22.1, 192.168.22.2, 192.168.22.3;
option routers 192.168.22.1;
option smtp-server 192.168.22.4;
option time-servers 192.168.22.1, 192.168.22.2, 192.168.22.3;

default-lease-time 600;
max-lease-time 28800;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

class "vm-vmware" {
	match if substring (hardware, 1, 3) = 00:0C:29;
}
class "vm-virtualbox" {
	match if substring (hardware, 1, 3) = 08:00:27;
}

subnet 192.168.0.0 netmask 255.255.0.0 {
	range 192.168.22.160 192.168.22.240;
	option subnet-mask 255.255.0.0;
	pool {
		range 192.168.23.50 192.168.23.150;
		allow members of "vm-vmware";
		option subnet-mask 255.255.0.0;
		option routers 192.168.22.4;
		option broadcast-address 192.168.23.255;
	}
	pool {
		range 192.168.23.200 192.168.23.250;
		allow members of "vm-virtualbox";
		option subnet-mask 255.255.0.0;
		option routers 192.168.22.4;
		option broadcast-address 192.168.23.255;
	}
}


host 1stclient {
	fixed-address 192.168.22.50;
	hardware ethernet 00:1c:f0:bb:0e:f5;
}


Thanks in advance for any help.
Daniel



More information about the dhcp-users mailing list