solaris macros == named groups

crjw crjw at irisnet.ca
Tue Oct 26 22:05:20 UTC 2010


Back in September Kyle M. posted a question about "macros".
see: https://lists.isc.org/mailman/htdig/dhcp-users/2010-September/011989.html
A macro is an feature built into the Solaris DHCP server; it
allows a group of options to be defined once and then 
referenced as many times as necessary in the DHCP configuration.
Kyle had asked if the ISC DHCP server had similar functionality.
Several people responded... but not with anything useful.
#
Like Kyle, I am also trying to convert from Solaris DHCP to ISC DHCP.
After playing with ISC DHCP for the last 24 hours, I stumbled 
across something called "named groups" which are not well
documented but they appear to provide the exact same 
functionality as the Macros in the Solaris DHCP server.
#
Named groups don't appear to be well documented but they seem to work.
The syntax is 'group <groupname> { };' 
Groups are referenced with "group <groupname>";
See examples below.
#
I have an environment with a mix of sparc and x86 gear.
Any host needs to be able to boot any supported version
of Linux or Solaris at the discretion of the sysadmin.
#
By using a "named group" for each OS release, the sysadmins can map any MAC
address to the OS release of their choce. The mapping of MACs to OS can be done
in a separate file (outside of /etc/dhcpd.conf) or better
yet it can be done with OMAPI.
Once /etc/dhcpd.conf is created, it does not need to be changed!
#
I only started exploring this yesterday but so far I come up with
 a configuration with five named groups:
     x86                  # for linux and solaris x86
     Solaris_10-U8-sun4u  # Solaris 10 10/09 sun4u
     Solaris_10-U8-sun4v  # Solaris 10 10/09 sun4v
     Solaris_10-U9-sun4u  # Solaris 10 9/10 sun4u
     Solaris_10-U9-sun4v  # Solaris 10 9/10 sun4v
I currently have some test hosts hard coded in a separate file but
I plan to switch to OMAPI.

Below is the working configuration file and host file.

# BEGIN dhcpd.conf ####################################
ignore unknown-clients;
allow bootp;
allow booting;
default-lease-time 600;
max-lease-time 7200;
use-host-decl-names on;
authoritative;
log-facility local7;
option space SUNW;
option SUNW.SrootOpt code  1 = text;
option SUNW.SrootIP4 code  2 = ip-address;
option SUNW.SrootNM  code  3 = text;
option SUNW.SrootPTH code  4 = text;
option SUNW.SswapIP4 code  5 = ip-address;
option SUNW.SswapPTH code  6 = text;
option SUNW.SbootFIL code  7 = text;
option SUNW.Stz      code  8 = text;
option SUNW.SbootRS  code  9 = unsigned integer 16;
option SUNW.SinstIP4 code 10 = ip-address;
option SUNW.SinstNM  code 11 = text;
option SUNW.SinstPTH code 12 = text;
option SUNW.SsysidCF code 13 = text;
option SUNW.SjumpsCF code 14 = text;
option SUNW.Sterm    code 15 = text;
option SUNW.SbootURI code 16 = text;

subnet 192.168.1.0 netmask 255.255.255.0 {
  option broadcast-address 192.168.1.255;
  option routers 192.168.1.1;
  next-server 192.168.1.2;
}

group x86 {
  filename "pxegrub";
  # Nothing more is needed here.
  # GRUB menus provide assorted OS choices.
}

# Solaris sparc ###################################################
group {
  vendor-option-space SUNW;

  option SUNW.SjumpsCF  "192.168.2.100:/apps/jumpstart";
  option SUNW.SsysidCF  "192.168.1.2:/apps/jumpstart/sysidcfg/192.168.1.2";
  option SUNW.SinstNM   "aphid";
  option SUNW.SinstIP4  192.168.2.100;
  option SUNW.SrootNM   "aphid";
  option SUNW.SrootIP4  192.168.2.100;

  # Solaris_10 U8 (10/09) ###########################################
  group {
    option SUNW.SinstPTH  "/work/install/sparc/Solaris_10-1009";
    option SUNW.SrootPTH  "/work/install/sparc/Solaris_10-1009/Solaris_10/Tools/Boot";
    group Solaris_10-U8-sun4u {
      filename "inetboot.Solaris_10-U8-sun4u";
    }
    group Solaris_10-U8-sun4v {
      filename "inetboot.Solaris_10-U8-sun4v";
    }
  }

  # Solaris_10 U9 (9/10) ###########################################
  group {
    option SUNW.SinstPTH  "/work/install/sparc/Solaris_10-0910";
    option SUNW.SrootPTH  "/work/install/sparc/Solaris_10-0910/Solaris_10/Tools/Boot";
    group Solaris_10-U9-sun4u {
      filename "inetboot.Solaris_10-U9-sun4u";
    }
    group Solaris_10-U9-sun4v {
      filename "inetboot.Solaris_10-U9-sun4v";
    }
  }
}

include "/etc/dhcpd-hosts.conf";
# END dhcpd.conf ######################################

# BEGIN dhcpd-hosts.conf ##############################
host aaa {
        hardware ethernet aa:aa:aa:aa:aa:aa;
        fixed-address 192.168.1.10;
        group "Solaris_10-U9-sun4u";
}

host bbb {
        hardware ethernet bb:bb:bb:bb:bb:bb;
        fixed-address 192.168.1.11;
        group "Solaris_10-U8-sun4v";
}

host ccc {
        hardware ethernet cc:cc:cc:cc:cc:cc;
        fixed-address 192.168.1.12;
        group "x86";
}
# END dhcpd-hosts.conf ################################





More information about the dhcp-users mailing list