summaryrefslogtreecommitdiffstats
path: root/config/dhcpd.conf
blob: bfddf4d7ec3020dbc8f5c4c0941b72ab8d9d3cdf (about) (plain) (blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# dhcpd.conf for interface __INTERFACE__
# generated by dyndhcpd/__VERSION__

include "/etc/dyndhcpd/ipxe-options.conf";

authoritative;
ddns-update-style none;
ignore client-updates;
default-lease-time 21600;
max-lease-time 43200;

option domain-name "__DOMAINNAME__";

class "PXEClient" {
	match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";

	allow booting;
	allow bootp;
}

subnet __NETADDRESS__ netmask __NETMASK__ {
	option broadcast-address __BROADCAST__;
	option routers __ADDRESS__;
	option domain-name-servers __ADDRESS__;
	option time-servers __ADDRESS__;

	pool {
		allow members of "PXEClient";

		next-server __ADDRESS__;

		# Disable ProxyDHCP, we're in control of the primary DHCP server.
		option ipxe.no-pxedhcp 1;

		# Make sure the iPXE we're loading supports what we need,
		# if not load a full-featured version.
		if exists ipxe.http
		  and exists ipxe.menu
		  and ((exists ipxe.pxe
		      and exists ipxe.bzimage
		      and exists ipxe.elf)
		    or (exists ipxe.efi)) {
			# Everything is fine, just send the boot configuration file.
			filename "http://__ADDRESS__:3928/default.ipxe";
		} elsif exists user-class and option user-class = "iPXE" {
			# We're already using iPXE, but not a feature-full version,
			# and possibly an out-of-date version from ROM, so load a more
			# complete version with native drivers.
			if option arch = 00:06 {
				filename "/ipxe/efi-i386.efi";
			} elsif option arch = 00:07 {
				filename "/ipxe/efi-x86_64.efi";
			} else {
				filename "/ipxe/ipxe.pxe";
			}
		} elsif exists user-class and option user-class = "gPXE" {
			# If someone has an old version of gPXE burned into their ROM,
			# load a more recent iPXE
			filename "/ipxe/ipxe.pxe";
		} elsif option arch = 00:06 {
			filename "/ipxe/efi-i386.efi";
		} elsif option arch = 00:07 {
			filename "/ipxe/efi-x86_64.efi";
		} else {
			filename "/ipxe/ipxe.pxe";
		}

		range dynamic-bootp __MINBOOTP__ __MAXBOOTP__;
	}

	pool {
		deny members of "PXEClient";

		range __MINDHCP__ __MAXDHCP__;
	}
}