bind mac address to ip pool?

Glenn Satchell glenn.satchell at uniq.com.au
Mon Feb 8 14:05:30 UTC 2010


Harald Dunkel wrote:
> Hi Simon,
> 
> On 02/03/10 10:22, Simon Hobson wrote:
>> See man dhcpd.conf and look at the section (and example) on classes and
>> subclasses. Define a class for each pool, add a subclass to assign
>> clients to classes, and then add 'allow "someclassname" ;' to each pool
>> (where someclassname is replaced with the appropriate class name).
>>
> 
> I tried, but it doesn't work :-(. Hosts are still assigned to the
> wrong pool.
> 
> Here is the configuration (hopefully I did not cut off too
> many lines):
> 
> 
> class "real-host" {
> 	match pick-first-value (option dhcp-client-identifier, hardware);
> }
> class "virtual-host" {
> 	match pick-first-value (option dhcp-client-identifier, hardware);
> }
> shared-network physicalnet1 {
> 	subnet 192.168.1.0 netmask 255.255.255.0 {
> 		option routers 192.168.1.1;
> 		option subnet-mask 255.255.255.0;
> 		option broadcast-address 192.168.1.255;
> 		pool {
> 			deny unknown-clients;
> 			allow members of "real-host";
> 			failover peer "dhcp-failover";
> 			range 192.168.1.231 192.168.1.254;
> 		}
> 		pool {
> 			deny unknown-clients;
> 			allow members of "virtual-host";
> 			failover peer "dhcp-failover";
> 			ddns-domainname "dyn.mydomain.de";
> 			range 192.168.1.140 192.168.1.189;
> 		}
> 	}
> }
> 
> host squeeze {
> 	hardware ethernet 00:16:36:65:73:c4;
> 	ddns-hostname "squeeze";
> 	option host-name "squeeze";
> }
> subclass "virtual-host" 00:16:36:65:73:c4;
> 
> 
> 
> AFAICS this is according to the example on dhcpd.conf, but
> host "squeeze" is still assigned to the "real-host" pool.
> 
> Any helpful hint would be highly appreciated.
> 
> 
> Regards
> 
> Harri

If you only want to match on mac address, try changing the match lines 
to only match the hardware address:

	class "virtual-host" { match hardware; }
	class "real-host" { match hardware; }

The client may be sending a client identifier that is different to the 
hardware address and attempting to match that value.

Second thing to try is putting the subclass statement before the 
shared-network definition.

Otherwise the rest of the configuration looks fine.

-- 
regards,
-glenn
--
Glenn Satchell                            |  Miss 9: What do you
Uniq Advances Pty Ltd, Sydney Australia   |  do at work Dad?
mailto:glenn.satchell at uniq.com.au         |  Miss 6: He just
http://www.uniq.com.au tel:0409-458-580   |  types random stuff.



More information about the dhcp-users mailing list