-
Notifications
You must be signed in to change notification settings - Fork 4
/
sample-dhcpd.conf
121 lines (112 loc) · 4.88 KB
/
sample-dhcpd.conf
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
78
79
80
81
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
option domain-name "primp-industries.com";
option domain-name-servers 192.168.1.1;
default-lease-time 3600;
max-lease-time 7200;
ddns-update-style none;
ddns-updates off;
ignore client-updates;
allow booting;
allow bootp;
authoritative;
log-facility local7;
boot-unknown-clients on;
ping-check off;
allow-unknown-clients;
allow-known-clients;
## Added per ESXi PXE Boot Documentation
option client-system-arch code 93 = unsigned integer 16;
option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;
option ipxe.priority code 1 = signed integer 8;
option ipxe.keep-san code 8 = unsigned integer 8;
option ipxe.skip-san-boot code 9 = unsigned integer 8;
option ipxe.syslogs code 85 = string;
option ipxe.cert code 91 = string;
option ipxe.privkey code 92 = string;
option ipxe.crosscert code 93 = string;
option ipxe.no-pxedhcp code 176 = unsigned integer 8;
option ipxe.bus-id code 177 = string;
option ipxe.bios-drive code 189 = unsigned integer 8;
option ipxe.username code 190 = string;
option ipxe.password code 191 = string;
option ipxe.reverse-username code 192 = string;
option ipxe.reverse-password code 193 = string;
option ipxe.version code 235 = string;
option iscsi-initiator-iqn code 203 = string;
# Feature indicators
option ipxe.pxeext code 16 = unsigned integer 8;
option ipxe.iscsi code 17 = unsigned integer 8;
option ipxe.aoe code 18 = unsigned integer 8;
option ipxe.http code 19 = unsigned integer 8;
option ipxe.https code 20 = unsigned integer 8;
option ipxe.tftp code 21 = unsigned integer 8;
option ipxe.ftp code 22 = unsigned integer 8;
option ipxe.dns code 23 = unsigned integer 8;
option ipxe.bzimage code 24 = unsigned integer 8;
option ipxe.multiboot code 25 = unsigned integer 8;
option ipxe.slam code 26 = unsigned integer 8;
option ipxe.srp code 27 = unsigned integer 8;
option ipxe.nbi code 32 = unsigned integer 8;
option ipxe.pxe code 33 = unsigned integer 8;
option ipxe.elf code 34 = unsigned integer 8;
option ipxe.comboot code 35 = unsigned integer 8;
option ipxe.efi code 36 = unsigned integer 8;
option ipxe.fcoe code 37 = unsigned integer 8;
option ipxe.vlan code 38 = unsigned integer 8;
option ipxe.menu code 39 = unsigned integer 8;
option ipxe.sdi code 40 = unsigned integer 8;
option ipxe.nfs code 41 = unsigned integer 8;
option ipxe.no-pxedhcp 1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.20;
range dynamic-bootp 192.168.1.21 192.168.1.22;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
}
class "netboot" {
match if substring (option vendor-class-identifier, 0, 9) = "AAPLBSDPC";
option dhcp-parameter-request-list 1,3,17,43,60;
if (option dhcp-message-type = 1) {
option vendor-class-identifier "AAPLBSDPC";
option vendor-encapsulated-options
08:04:81:00:00:89; # bsdp option 8 (length 04) -- selected image id;
} elsif (option dhcp-message-type = 8) {
option vendor-class-identifier "AAPLBSDPC";
if (substring(option vendor-encapsulated-options, 0, 3) = 01:01:01) {
log(debug, "bsdp_msgtype_list");
# bsdp image list message:
# one image, plus one default image (both are the same)
option vendor-encapsulated-options
01:01:01: # bsdp_msgtype_list
04:02: # bsdp option code 4 (length 02) server priority
80:00: # Priority (32768)
07:04: # bsdp option code 7 (length 04) default image id
81:00:00:89: # Image ID (137)
09:0e: # bsdp option code 9 (length 0e) image list
81:00:00:89: # Image ID (137)
09:54:68:65:2d:49:6d:61:67:65; # Name (length 09) 'The-Image'
} else {
log(debug, "bspd_msgtype_select");
# details about the selected image
option vendor-encapsulated-options
01:01:02: # bsdp_msgtype_select
08:04: # bsdptag_selected_boot_image
81:00:00:89: # Image ID (137)
82:09: # Machine Name (length 09)
54:68:65:2d:49:6d:61:67:65; # 'The-Image'
if (substring(option vendor-class-identifier, 10, 4) = "i386") {
next-server 192.168.1.16;
filename "snponly.efi";
}
}
}
}
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.1.16;
if option client-system-arch = 00:07 or option client-system-arch = 00:09 {
if exists user-class and option user-class = "iPXE" {
filename = "http://192.168.1.16/esxi65/mboot.efi";
}
}
}