Friday, July 6, 2012

ISC-DHCP baseline configuration

There's a good and well explained sample at /etc/inet/dhcpd4.conf.example.
Nevertheless here's a base configuration which I believe useful:

authoritative;

option domain-name "example.local";
option domain-name-servers ns1.example.local, ns2.example.local;

default-lease-time 600;
max-lease-time 7200;

log-facility local7;

class "Solaris" {
  match pick-first-value
   (option dhcp-client-identifier, hardware);
}

# Clients by MAC
subclass "Solaris" 1:XX:XX:XX:XX:XX:XX;
subclass "Solaris" 1:YY:YY:YY:YY:YY:YY;

subnet 192.168.0.0 netmask 255.255.255.0 {

  pool {
    allow members of "Solaris";
    range 192.168.0.100 192.168.0.150;
  }

  option broadcast-address 192.168.0.255;
  option routers 192.168.0.254;

}

# Group clients by specifics (not shown)
group {

  ...

  host XXXXXXXXXXXX {
    hardware ethernet XX:XX:XX:XX:XX:XX;
    fixed-address 192.168.0.210;
  }

  host YYYYYYYYYYYY {
    hardware ethernet YY:YY:YY:YY:YY:YY;
    fixed-address 192.186.0.211;
  }

}

Note: On this example I assume the server participates in subnet 192.168.0.0.