-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdhcpd.conf
278 lines (241 loc) · 6.88 KB
/
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
ddns-update-style none;
default-lease-time 300;
max-lease-time 600;
# Do not disturb clients that happen to temporary be on this network
not authoritative;
log-facility local7;
# Set filename, it will cause one single download from DHCP which will
# bring the switch to minimalistic dhtech base config.
# When a DHCP request is accepted it will spawn a SNMP configuration set
# process that will tell the switch to download configuration from TFTP.
next-server 192.168.40.10;
filename "network-confg";
on commit {
set agentType = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 0, 1));
set agentLength = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 1, 1));
set swName = pick-first-value(option agent.circuit-id, "None");
# TODO : do not determine option82 format based on the client vendor-class-identifier
set swMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set swIp = binary-to-ascii(10, 8, ".", leased-address);
set swClient = pick-first-value(substring(option dhcp-client-identifier, 1, 5), substring(option vendor-class-identifier, 0, 50));
set swRelay = binary-to-ascii(10, 8, ".", packet(24,4));
execute("/scripts/swboot/dhcp-hook.py", "commit", swMac, swIp, swName, swClient, swRelay);
}
# Juniper options. For details, see:
# https://www.juniper.net/documentation/en_US/junos/topics/topic-map/zero-touch-provision.html
option space OPT43;
option OPT43.image-file-name code 0 = text;
option OPT43.config-file-name code 1 = text;
option OPT43.transfer-mode code 3 = text;
option OPT43-encapsulation code 43 = encapsulate OPT43;
option option-150 code 150 = ip-address;
option option-150 192.168.40.10;
if (substring(option vendor-class-identifier, 0, 7) = "Juniper") {
option OPT43.config-file-name "juniper-confg";
# Enable this to auto upgrade switches. Read this first though:
# https://www.reddit.com/r/Juniper/comments/ctgoyh/ex3400_ztp_storage_issues/
#option OPT43.image-file-name "juniper.tgz";
option OPT43.transfer-mode "http";
}
class "cisco-switch" {
match if (substring (option dhcp-client-identifier, 1, 5) = "cisco") or
(substring(option vendor-class-identifier, 0, 7) = "Juniper");
}
subnet 192.168.0.0 netmask 255.255.252.0 {
pool {
allow members of "cisco-switch";
range 192.168.1.10 192.168.3.250;
option routers 192.168.0.1;
}
}
subnet 192.168.4.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.4.10 192.168.4.250;
option routers 192.168.4.1;
}
}
subnet 192.168.5.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.5.10 192.168.5.250;
option routers 192.168.5.1;
}
}
subnet 192.168.6.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.6.10 192.168.6.250;
option routers 192.168.6.1;
}
}
subnet 192.168.7.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.7.10 192.168.7.250;
option routers 192.168.7.1;
}
}
subnet 192.168.8.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.8.10 192.168.8.250;
option routers 192.168.8.1;
}
}
subnet 192.168.9.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.9.10 192.168.9.250;
option routers 192.168.9.1;
}
}
subnet 192.168.10.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.10.10 192.168.10.250;
option routers 192.168.10.1;
}
}
subnet 192.168.11.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.11.10 192.168.11.250;
option routers 192.168.11.1;
}
}
subnet 192.168.12.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.12.10 192.168.12.250;
option routers 192.168.12.1;
}
}
subnet 192.168.13.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.13.10 192.168.13.250;
option routers 192.168.13.1;
}
}
subnet 192.168.14.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.14.10 192.168.14.250;
option routers 192.168.14.1;
}
}
subnet 192.168.15.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.15.10 192.168.15.250;
option routers 192.168.15.1;
}
}
subnet 192.168.16.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.16.10 192.168.16.250;
option routers 192.168.16.1;
}
}
subnet 192.168.17.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.17.10 192.168.17.250;
option routers 192.168.17.1;
}
}
subnet 192.168.18.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.18.10 192.168.18.250;
option routers 192.168.18.1;
}
}
subnet 192.168.19.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.19.10 192.168.19.250;
option routers 192.168.19.1;
}
}
subnet 192.168.20.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.20.50 192.168.20.250;
option routers 192.168.20.1;
}
}
subnet 192.168.21.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.21.50 192.168.21.250;
option routers 192.168.21.1;
}
}
subnet 192.168.22.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.22.50 192.168.22.250;
option routers 192.168.22.1;
}
}
subnet 192.168.23.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.23.50 192.168.23.250;
option routers 192.168.23.1;
}
}
subnet 192.168.24.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.24.50 192.168.24.250;
option routers 192.168.24.1;
}
}
subnet 192.168.25.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.25.50 192.168.25.250;
option routers 192.168.25.1;
}
}
subnet 192.168.26.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.26.50 192.168.26.250;
option routers 192.168.26.1;
}
}
subnet 192.168.27.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.27.50 192.168.27.250;
option routers 192.168.27.1;
}
}
subnet 192.168.28.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.28.50 192.168.28.250;
option routers 192.168.28.1;
}
}
subnet 192.168.29.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.29.50 192.168.29.250;
option routers 192.168.29.1;
}
}
subnet 192.168.30.0 netmask 255.255.255.0 {
pool {
allow members of "cisco-switch";
range 192.168.30.50 192.168.30.250;
option routers 192.168.30.1;
}
}
# local net for activating isc-dhcpd
subnet 192.168.40.0 netmask 255.255.255.0 { }