Host declarations in different ranges within the same subnet

Marcio Merlone marcio.merlone at a1.ind.br
Tue Jun 12 16:51:20 UTC 2012


Em 12-06-2012 13:31, Simon Hobson escreveu:
> Marcio Merlone wrote:
>> shared-network foo{
>>     subnet 10.0.0.0 netmask 255.255.255.0 {
>>
>>         group {
>>             option routers 10.0.0.100;
>>             option blah;
>>             pool {
>>                 range 10.0.0.1 10.0.0.10;
>>             }
>>             host bar1 { hardware-ethernet 00:00:00:00:00:01; }
>>             host bar2 { hardware-ethernet 00:00:00:00:00:02; }
>>         }
(...)
>> }
> Yes it's possible - though not sure about putting pool declaration in 
> there.
I am sure now, got time to test. It cannot be there:

dhcpd3 -t -cf /etc/dhcp3/dhcpd.conf
Internet Systems Consortium DHCP Server V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
/etc/dhcp3/dhcpd.conf line 56: pool declared outside of network
                         pool
                         ^
/etc/dhcp3/dhcpd.conf line 150: pool declared outside of network
                         pool
                         ^
Configuration file errors encountered -- exiting

>> Will it work as expected?
> That depends on what you expect !
I expect bar1 and 2 to get an ip from one range and the others from 
another range, all within the same subnet. Sorry not making this clear 
before. And please, don't ask why I need this. :)

> Also, if you have any expectation that the host statements would in 
> any way whatsoever tie the hosts to a subnet or range, then no that 
> won't do what you expect.
Indeed.

> It is this element of unexpected (and almost certainly unwanted) 
> option inheritance that leads to the general advice to never put host 
> statements within a subnet declaration.
>
> It's more likely that you'd want to use classes (see the man page 
> section on classes and subclasses) :
> class "group1" ...
> class "group2" ...
> subnet ...
>   range ...
>     option routers ... # not too sure about this one
>     allow members of class1
>   range ...
>     option routers ... # not too sure about this one
>     allow members of class2

Will dig for that and post here if any success. Meanwhile, if someone 
have any example on how to do it I'll be very happy.

Best regards.

-- 
*Marcio Merlone*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20120612/30c90285/attachment.html>


More information about the dhcp-users mailing list