Chapter 4. DHCP server

This server will answer the DHCP requests for the PXE client, depending on the PXE client class. Logs files location on the server depends on your configuration, on Mandrake Linux 8.x you can find them in /var/log/messages. Default configuration file is stored in /etc/ directory.


ddns-update-style ad-hoc;
allow booting;
allow bootp;
not authoritative;
DHCPD_INTERFACE = "eth1";

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

class "Etherboot" {
match if substring (option vendor-class-identifier, 0, 13) = "Etherboot-5.0";
filename "/etherboot/nbgrub";
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;
option vendor-class-identifier "Etherboot-5.0";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
next-server 192.168.200.1;
}

class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
#filename "/PXEClient/pxegrub";
filename "/PXEClient/pxelinux.0";
option vendor-class-identifier "PXEClient";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
next-server 192.168.200.1;
}

class "known" {
  match hardware;
  one-lease-per-client on;
  ddns-updates on;
  ddns-domainname = "mandrakesoft.com";
  ddns-hostname = pick-first-value(ddns-hostname, option host-name);
  option fqdn.no-client-update on;
  set vendor_class_identifier = option vendor-class-identifier;
}

shared-network "mynetwork" {
  subnet 192.168.200.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option routers 192.168.200.1;
  default-lease-time 28800;
  max-lease-time 86400;
   
    pool { 
       range 192.168.200.50 192.168.200.99;
       deny members of "PXE";
       deny members of "Etherboot";
    }

    pool {
      range 192.168.200.200 192.168.200.254;
        allow members of "PXE";
        deny members of "known";
        allow members of "Etherboot";
         }
  }
}