class options.

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Sep 7 16:12:27 UTC 2006


Back on list ...

Gene Rackow wrote:

>I guess I was looking for something simpler than what I have.
>Currently
>shared subnet "randomusers" {
>   subnet 10.0.0.0 netmask 255.255.255.0 {
>   pool {
>     range 10.0.0.10 10.0.0.50;
>     allow unknown-clients;
>     ....  other stuff
>     }
>   pool {
>     range 10.0.0.110 10.0.0.150;
>     deny unknown-clients;
>     allow members of "foo";
>     deny members of "bar";
>     ....  other stuff
>     }
>   pool {
>     range 10.0.0.210 10.0.0.250;
>     deny unknown-clients;
>     deny members of "foo";
>     allow members of "bar";
>     ....  other stuff
>     }
>}

First thing, mixing allow and deny won't do what you expect ! I can't 
remember the details, but there's some complicated way they work. An 
allow implies deny anything not allowed, and vice-versa.

Are there any clients that will not be a member of any class ? If not 
then you can simply do :

shared subnet "randomusers" {
   subnet 10.0.0.0 netmask 255.255.255.0 {
   pool {
     range 10.0.0.10 10.0.0.50;
     deny members of "foo";
     deny members of "bar";
     ....  other stuff
     }
   pool {
     range 10.0.0.110 10.0.0.150;
     allow members of "foo";
     ....  other stuff
     }
   pool {
     range 10.0.0.210 10.0.0.250;
     allow members of "bar";
     ....  other stuff
     }
}

If there are any clients which you need to treat as 'known' but which 
aren't in any class then you can either create host statements for 
them or create another class for 'unclassed' clients and leave out 
the host statements altogether.


>
>class "foo" {
>              match pick-first-value (option dhcp-client-identifier, hardware);
>}
>class "bar" {
>              match pick-first-value (option dhcp-client-identifier, hardware);
>}
>
>host host-122 { hardware ethernet 00:11:22:33:33:55; };
>subclass "foo" 1:00:11:22:33:33:55;
>host host-123 { hardware ethernet 00:11:22:33:33:66; };
>subclass "bar" 1:00:11:22:33:33:66;
>host host-124 { hardware ethernet 00:11:22:33:33:77; };
>subclass "bar" 1:00:11:22:33:33:77;
>host host-125 { hardware ethernet 00:11:22:33:33:88; };
>
>
>I'd really like to just specify on the "host" entry what class the 
>host belongs in.
>I really don't care if it's class or subclass or group or ...
>I'd just like to make this something easier to build/rebuild and not
>have multiple entries per host entry.

Don't let the size of the config file get in the way - you are 
machine generating it (or I assume an included file) anyway so it 
really doesn't matter that much. All it needs is a bit of script 
editing and you can build just about any config you want.


>I have more than the one shared subnet for different buildings, so
>when I take my laptop from one building to another, I'll get a
>different IP address, but it would be in the same ranges.

I hope what you mean there is that in another building you might have 
a similar construction but with (say) networks 10.0.1.0/24, 
10.0.2.0/24, etc and 10.0.n.10-10.0.n.50 etc ranges.

If you really mean the SAME ranges, as in multiple 10.0.0.0/24 
networks then that is a BIG problem as it isn't a valid IP setup and 
the dhcp server will NOT function correctly.

Simon


More information about the dhcp-users mailing list