Using Option 82

Warner, Bill bill.warner at earlywarning.com
Mon Nov 26 18:13:09 UTC 2012


Here is a snip-it of my dhcpd.conf file  from the switch, the network admin sets the option agent.circuit-id to the hostname that the hardware should receive.  Everything else is handled by PXEBoot and DHCPd.

I'm posting this because I wasn't able to find any really good examples, and I was looking for some possible comments on if it is the best way to handle this:

#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
ddns-update-style none;

option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;

# Needed for dhcp 3.0.5
next-server x.x.x.18; # TFTP Server

# VLAN 1 is for VMs
# VLAN 2
class "static-x.x.x.36" { match if option agent.circuit-id="hostname1:switch2"; }
class "static-x.x.x.37" { match if option agent.circuit-id="hostname2:switch2"; }
class "static-x.x.x.38" { match if option agent.circuit-id="hostname3:switch2"; }
class "static-x.x.x.39" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.40" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.41" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.42" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.43" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.44" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.45" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.46" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.47" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.48" { match if option agent.circuit-id="HOSTNAME:switch2"; }
class "static-x.x.x.49" { match if option agent.circuit-id="HOSTNAME:switch2"; }

shared-network eth0 {
        not authoritative;
        use-host-decl-names true;

        site-option-space "pxelinux";
        option pxelinux.magic f1:00:74:7e;
        option pxelinux.reboottime 10;

        if exists dhcp-parameter-request-list {
                option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
        }

        option host-name = substring(option agent.circuit-id, 0, 9);

        log (info, "client requested");
        log (info, concat("raw circuit-id = ", option agent.circuit-id));
        log (info, concat("parsed circuit-id = ", substring(option agent.circuit-id, 0, 9)));

        subnet x.x.x.0 netmask 255.255.255.224 {
                option domain-name "example.com";
                option subnet-mask      255.255.255.224;
                option routers    x.x.x.1;
                option domain-name-servers x.x.y.12, x.x.y.11;
                filename "images/base/boot/pxelinux.0";

                option root-path "x.x.x.18:/tftpboot/images/base";
                option pxelinux.configfile "pxelinux.cfg";
                option pxelinux.pathprefix "/images/base/boot/";
        }

        pool { range x.x.x.36; allow members of "static-x.x.x.36"; }
        pool { range x.x.x.37; allow members of "static-x.x.x.37"; }
        pool { range x.x.x.38; allow members of "static-x.x.x.38"; }
        pool { range x.x.x.39; allow members of "static-x.x.x.39"; }
        pool { range x.x.x.40; allow members of "static-x.x.x.40"; }
        pool { range x.x.x.41; allow members of "static-x.x.x.41"; }
        pool { range x.x.x.42; allow members of "static-x.x.x.42"; }
        pool { range x.x.x.43; allow members of "static-x.x.x.43"; }
        pool { range x.x.x.44; allow members of "static-x.x.x.44"; }
        pool { range x.x.x.45; allow members of "static-x.x.x.45"; }
        pool { range x.x.x.46; allow members of "static-x.x.x.46"; }
        pool { range x.x.x.47; allow members of "static-x.x.x.47"; }
        pool { range x.x.x.48; allow members of "static-x.x.x.48"; }
        pool { range x.x.x.49; allow members of "static-x.x.x.49"; }
} #end eth0

--
Bill Warner
Linux/Unix/VMWare/Storage Systems Administrator
Early Warning Services, LLC
Tel:  480-656-6901
Mob: 602-908-0784
Fax:  480-656-5001
Email: bill.warner at early-warning.com<mailto:bill.warner at early-warning.com>

--------------------- This e-mail transmission may contain confidential and/or private information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. If you are not the intended recipient, you are hereby notified that any disclosure, copying, or distribution of the contents of this e-mail transmission, or the taking of any action in reliance thereon or pursuant thereto, is strictly prohibited. Should you have received this e-mail in error, please contact the sender and delete and destroy all copies of the original message.--------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20121126/1158fd34/attachment.html>


More information about the dhcp-users mailing list