[DHCP] group ip ranges

Ashley M. Kirchner ashley at pcraft.com
Sat Nov 10 00:30:43 UTC 2007


Ken Appell wrote:
> I have a small network with different appliances on it that all 
> connect to the same DHCP server to get their IP addresses. In order to 
> simplify maintenance, I'd like to group the IP addresses according to 
> appliance type. I know my example below doesn't work, but is there 
> another way to do it?

    At the office, I group machines by department and give them a 
specific range.  This way when I see an IP on the network, I know what 
department it belongs to.  Here's a snippet of one such "group":

authoritative;
option routers              192.168.1.1;
option broadcast-address    192.168.1.255;
option subnet-mask          255.255.255.0;
option domain-name-servers  192.168.1.1;
deny unknown-clients;

class "digital_rats" {
  match pick-first-value (option dhcp-client-identifier, hardware);
}
group {
  ddns-hostname = pick (option host-name,  
concat("dhcp-",binary-to-ascii(16,8,"-",substring(hardware,1,6))));

  use-host-decl-names on;
  host server_1  { hardware ethernet 00:0A:95:7C:E7:34;
                   ddns-hostname server_1; }
  host server_2  { hardware ethernet 00:03:93:53:BE:58;
                   ddns-hostname server_2; }
  host server_3  { hardware ethernet 00:0D:93:4A:8A:64;
                   ddns-hostname server_3; }
  host server_4  { hardware ethernet 00:0A:95:E8:CE:4A;
                   ddns-hostname server_4; }
}
subclass "digital_rats" 1:00:0A:95:7C:E7:34;
subclass "digital_rats" 1:00:03:93:53:BE:58;
subclass "digital_rats" 1:00:0D:93:4A:8A:64;
subclass "digital_rats" 1:00:0A:95:E8:CE:4A;

# ... define more classes and groups here ...

subnet 192.168.1.0 netmask 255.255.255.0 {
  # Digital Rats
  pool {
    allow members of "digital_rats";
    range 192.168.1.21 192.168.1.40
  }

# ... add more pools here, each one corresponding to a class/group above ...
}



    As I mentioned, this allows me to designate all the machines within 
a department to have a specific range of IP.  I would suspect you could 
do the same for your setup and define your appliances in a class/group 
and then set the appropriate pools for them.



More information about the dhcp-users mailing list