1 |
# for explanation in french go to : http://www.delafond.org/traducmanfr/man/man5/dhcpd.conf.5.html |
2 |
ddns-update-style none; |
3 |
allow booting; |
4 |
allow bootp; |
5 |
|
6 |
# Your dhcp server is not master on your network ! |
7 |
#not authoritative; |
8 |
# Your dhcpd server is master on your network ! |
9 |
authoritative; |
10 |
#not authoritative; |
11 |
|
12 |
#Interface where dhcpd is active |
13 |
DHCPD_INTERFACE = "__dhcpd_interface__"; |
14 |
|
15 |
# Definition of PXE-specific options |
16 |
# Code 1: Multicast IP address of bootfile |
17 |
# Code 2: UDP port that client should monitor for MTFTP responses |
18 |
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests |
19 |
# Code 4: Number of secondes a client must listen for activity before trying |
20 |
# to start a new MTFTP transfer |
21 |
# Code 5: Number of secondes a client must listen before trying to restart |
22 |
# a MTFTP transfer |
23 |
|
24 |
# define Option for the PXE class |
25 |
option space PXE; |
26 |
option PXE.mtftp-ip code 1 = ip-address; |
27 |
option PXE.mtftp-cport code 2 = unsigned integer 16; |
28 |
option PXE.mtftp-sport code 3 = unsigned integer 16; |
29 |
option PXE.mtftp-tmout code 4 = unsigned integer 8; |
30 |
option PXE.mtftp-delay code 5 = unsigned integer 8; |
31 |
option PXE.discovery-control code 6 = unsigned integer 8; |
32 |
option PXE.discovery-mcast-addr code 7 = ip-address; |
33 |
|
34 |
#Define options for pxelinux |
35 |
option space pxelinux; |
36 |
option pxelinux.magic code 208 = string; |
37 |
option pxelinux.configfile code 209 = text; |
38 |
option pxelinux.pathprefix code 210 = text; |
39 |
option pxelinux.reboottime code 211 = unsigned integer 32; |
40 |
site-option-space "pxelinux"; |
41 |
# These lines should be customized to your setup |
42 |
#option pxelinux.configfile "configs/common"; |
43 |
#option pxelinux.pathprefix "/pxelinux/files/"; |
44 |
#filename "/pxelinux/pxelinux.bin"; |
45 |
|
46 |
option pxelinux.magic f1:00:74:7e; |
47 |
option pxelinux.reboottime 30; |
48 |
#if exists dhcp-parameter-request-list { |
49 |
# Always send the PXELINUX options |
50 |
# append dhcp-parameter-request-list 208, 209, 210, 211; |
51 |
# append dhcp-parameter-request-list 208,211; |
52 |
# } |
53 |
|
54 |
#Class that determine the options for Etherboot 5.x requests |
55 |
class "Etherboot" { |
56 |
|
57 |
#if The vendor-class-identifier equal Etherboot-5.0 |
58 |
match if substring (option vendor-class-identifier, 0, 9) = "Etherboot"; |
59 |
|
60 |
# filename define the file retrieve by the client, there nbgrub |
61 |
# our tftp is chrooted so is just the path to the file |
62 |
filename "/etherboot/nbgrub"; |
63 |
|
64 |
#Used by etherboot to detect a valid pxe dhcp server |
65 |
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff; |
66 |
|
67 |
# Set the "vendor-class-identifier" field to "PXEClient" in dhcp answer |
68 |
# if this field is not set the pxe client will ignore the answer ! |
69 |
option vendor-class-identifier "Etherboot"; |
70 |
|
71 |
vendor-option-space PXE; |
72 |
option PXE.mtftp-ip 0.0.0.0; |
73 |
|
74 |
# IP of you TFTP server |
75 |
next-server __tftpserverip__; |
76 |
} |
77 |
|
78 |
|
79 |
# create the Class PXE |
80 |
class "PXE" { |
81 |
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request |
82 |
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; |
83 |
|
84 |
# filename define the file retrieve by the client, there pxelinux.0 |
85 |
# our tftp is chrooted so is just the path to the file |
86 |
# If you prefer use grub, use pxegrub compiled for your ethernet card. |
87 |
#filename "/PXEClient/pxegrub"; |
88 |
filename "/X86PC/linux/linux.0"; |
89 |
|
90 |
# Set the "vendor-class-identifier" field to "PXEClient" in dhcp answer |
91 |
# if this field is not set the pxe client will ignore the answer ! |
92 |
option vendor-class-identifier "PXEClient"; |
93 |
|
94 |
|
95 |
vendor-option-space PXE; |
96 |
option PXE.mtftp-ip 0.0.0.0; |
97 |
|
98 |
# IP of you TFTP server |
99 |
next-server __tftpserverip__; |
100 |
} |
101 |
|
102 |
# the class know exist just for deny the response to other DHCP request |
103 |
class "known" { |
104 |
match hardware; |
105 |
one-lease-per-client on; |
106 |
ddns-updates on; |
107 |
ddns-domainname = "__dname__"; |
108 |
option domain-name "__dname__"; |
109 |
option domain-name-servers __ip__; |
110 |
ddns-hostname = pick-first-value(ddns-hostname, option host-name); |
111 |
option fqdn.no-client-update on; |
112 |
set vendor_class_identifier = option vendor-class-identifier; |
113 |
} |
114 |
|
115 |
# TAG: COMPUTER_LIST_BEGIN |
116 |
#host compute9{ |
117 |
# hardware ethernet 00:02:b3:3f:7e:b7; |
118 |
# fixed-address compute9; |
119 |
# TAG: COMPUTER_LIST_END |
120 |
|
121 |
# subnet 192.168.200.0 netmask 255.255.255.0 { |
122 |
subnet __net__ netmask __mask__ { |
123 |
option subnet-mask __mask__; |
124 |
option routers __gateway__; |
125 |
default-lease-time 28800; |
126 |
max-lease-time 86400; |
127 |
option domain-name "__dname__"; |
128 |
option domain-name-servers __ip__; |
129 |
next-server __tftpserverip__; |
130 |
|
131 |
pool { |
132 |
range __rng1__ __rng2__; |
133 |
# deny members of "PXE"; |
134 |
# deny members of "Etherboot"; |
135 |
} |
136 |
|
137 |
# pool { |
138 |
# range 192.168.200.200 192.168.200.254; |
139 |
# give an address of the the pool for PXE client and deny the other |
140 |
#allow members of "PXE"; |
141 |
#deny members of "known"; |
142 |
#allow members of "Etherboot"; |
143 |
# } |
144 |
} |