dhcpd.conf.nobootinfo.template.in 4.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#
# dhcpd.conf.template - From the emulab software distribution
#
# This file is used with dhcpd_makeconf to generate an actual dhpd.conf file
# from the database.
#
# Make sure to change all subnets (don't forget the mask!), the DHCP and DNS
# servers' IP addresses, the router's IP, and see the comment about nodetypes
# below.
#
server-identifier               @BOSSNODE_IP@;
server-name                     "@BOSSNODE_IP@";

# Config these too?
option  root-path		"/tftpboot";
filename 			"/tftpboot/pxeboot.emu";

default-lease-time              36000;                  # 10 hours
max-lease-time                  36000;                  # 10 hours
ddns-update-style               none;                   # req'd vers 3 directive

# Define the PXE option space
# 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
# Code 128: IP address of Emulab bootinfo server
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;
option PXE.emulab-bootinfo code 128 = ip-address;

#
# For PXE booting nodes we set the magic bits to tell the client that we are
# PXE-saavy so they don't wait around for 12 seconds or so waiting for a
# better response.
#
# If, for some reason, this doesn't work for you, just comment out the
# entire PXE class block.  It will work without it, it will just take longer.
#
class "PXE" {
	match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
	option vendor-class-identifier "PXEClient";
	vendor-option-space PXE;

	# bit 3 = If set, and a boot file name is present in the initial
	# DHCP or ProxyDHCP offer packet, download the boot file (do not
	# prompt/menu/discover).
	option PXE.discovery-control 8;
}

on commit {
    set clip = binary-to-ascii(10, 8, ".", leased-address);
    set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
    if (substring (option vendor-class-identifier, 0, 9) = "PXEClient") {
64
	set boot = "PXE";
65
    } elsif (substring (option vendor-class-identifier, 0, 6) = "U-boot") {
66
	set boot = "UBOOT";
67
    } else {
68 69 70 71
	set boot = "OS";
    }

    ## If you want to send an event on both PXE and OS contacts, use this
72 73 74 75 76 77
    #execute("@prefix@/sbin/reportboot", "-bD", clip, clhw, boot);

    ## If you want to send both events on the PXE or U-boot contact, use this
    #if (boot != "OS") {
    #	execute("@prefix@/sbin/reportboot", "-bDC", clip, clhw, boot);
    #}
78

79 80 81
    # If you want to send both events on just U-boot contact, use this
    if (boot = "UBOOT") {
	execute("@prefix@/sbin/reportboot", "-bDU", clip, clhw, boot);
82
    }
83

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
}

@DHCPD_CONTROLNET_DECL@
 
shared-network emulab {
 
 subnet @CONTROL_NETWORK@ netmask @CONTROL_NETMASK@ {
	option subnet-mask		@CONTROL_NETMASK@;
	option routers                  @CONTROL_ROUTER_IP@;
	option domain-name-servers      @BOSSNODE_IP@;
	option domain-name              "@OURDOMAIN@";
	next-server			@BOSSNODE_IP@;

	# Example of a dynamic range. If you uncomment the following line 
	# (after changing the IP addresses to suitable ones, of course)
	# unknown nodes will get assigned a random IP in it
	#range @DHCPD_DYNRANGE@;

	# testbed PCs
	group {
		#
		# For every PC nodetype, include a line like the one below.
		# These lines will be replaced with auto-generated entries for
		# nodes of that type. You can also use the class field from the
		# node_types table
		#
		%%nodetype=pc
	}
 }

 %%management

 #
 # Private network; for virtual (jailed) nodes.
 #
 subnet @VIRTNODE_NETWORK@ netmask @VIRTNODE_NETMASK@ {
 }
}