aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/templates/dhcpd.conf.j2
blob: 1b832e19b9594f94859a08a45bc243985c9f4d1a (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
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
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp/dhcpd.conf.example
#   see dhcpd.conf(5) man page
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
#option domain-name "labitat.dk";
default-lease-time 3600;
max-lease-time 7200;
min-lease-time 600;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility daemon;


# Admin net
subnet 10.42.0.0 netmask 255.255.255.0 {
	range 10.42.0.50 10.42.0.69;
	range 10.42.0.71 10.42.0.250;
	option routers 10.42.0.1;
	option domain-name-servers 185.38.175.0;
	#option ntp-servers 90.185.0.18;
{% for host in local_hosts %}
{%   if host.ips | ipaddr('10.42.0.0/24') %}
{%     if 'mac' in host %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	host {{ host.name }} {
		hardware ethernet {{ host.mac }};
		fixed-address {{ host.ips | ipaddr('10.42.0.0/24') | first }};
{%       if 'filename' in host %}
		filename "{{ host.filename }}";
{%       endif %}
	}
{%     else %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	#host {{ host.name }} {
	#	fixed-address {{ host.ips | ipaddr('10.42.0.0/24') | first }};
	#}
{%     endif %}
{%   endif %}
{% endfor %}

	host spacewand {
		hardware ethernet 00:1f:7b:b4:0e:00;
		fixed-address 10.42.0.70;
	}
}


# Wired net
subnet 10.42.1.0 netmask 255.255.255.0 {
	range dynamic-bootp 10.42.1.50 10.42.1.250;
	option routers 10.42.1.1;
	option domain-name-servers 185.38.175.0;
	#option ntp-servers 90.185.0.18;
	next-server 10.42.1.1;
	filename "pxelinux.0";
{% for host in local_hosts %}
{%   if host.ips | ipaddr('10.42.1.0/24') %}
{%     if 'mac' in host %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	host {{ host.name }} {
		hardware ethernet {{ host.mac }};
		fixed-address {{ host.ips | ipaddr('10.42.1.0/24') | first }};
{%       if 'filename' in host %}
		filename "{{ host.filename }}";
{%       endif %}
	}
{%     else %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	#host {{ host.name }} {
	#	fixed-address {{ host.ips | ipaddr('10.42.1.0/24') | first }};
	#}
{%     endif %}
{%   endif %}
{% endfor %}
}


# Private wifi
subnet 10.42.2.0 netmask 255.255.255.0 {
	range 10.42.2.50 10.42.2.250;
	option routers 10.42.2.1;
	option domain-name-servers 185.38.175.0;
	#option ntp-servers 90.185.0.18;
	next-server 10.42.2.1;
	filename "pxelinux.0";
{% for host in local_hosts %}
{%   if host.ips | ipaddr('10.42.2.0/24') %}
{%     if 'mac' in host %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	host {{ host.name }} {
		hardware ethernet {{ host.mac }};
		fixed-address {{ host.ips | ipaddr('10.42.2.0/24') | first }};
{%       if 'filename' in host %}
		filename "{{ host.filename }}";
{%       endif %}
	}
{%     else %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	#host {{ host.name }} {
	#	fixed-address {{ host.ips | ipaddr('10.42.2.0/24') | first }};
	#}
{%     endif %}
{%   endif %}
{% endfor %}
}

# Free wifi
subnet 10.42.3.0 netmask 255.255.255.0 {
	range 10.42.3.50 10.42.3.250;
	option routers 10.42.3.1;
	option domain-name-servers 185.38.175.0;
	#option ntp-servers 90.185.0.18;
{% for host in local_hosts %}
{%   if host.ips | ipaddr('10.42.3.0/24') %}
{%     if 'mac' in host %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	host {{ host.name }} {
		hardware ethernet {{ host.mac }};
		fixed-address {{ host.ips | ipaddr('10.42.3.0/24') | first }};
{%       if 'filename' in host %}
		filename "{{ host.filename }}";
{%       endif %}
	}
{%     else %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	#host {{ host.name }} {
	#	fixed-address {{ host.ips | ipaddr('10.42.3.0/24') | first }};
	#}
{%     endif %}
{%   endif %}
{% endfor %}
}

# Password protected wifi
subnet 10.42.4.0 netmask 255.255.255.0 {
	range 10.42.4.50 10.42.4.250;
	option routers 10.42.4.1;
	option domain-name-servers 185.38.175.0;
	#option ntp-servers 90.185.0.18;
{% for host in local_hosts %}
{%   if host.ips | ipaddr('10.42.4.0/24') %}
{%     if 'mac' in host %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	host {{ host.name }} {
		hardware ethernet {{ host.mac }};
		fixed-address {{ host.ips | ipaddr('10.42.4.0/24') | first }};
{%       if 'filename' in host %}
		filename "{{ host.filename }}";
{%       endif %}
	}
{%     else %}

{%       if 'description' in host %}
	# {{ host.description }}
{%       endif %}
	#host {{ host.name }} {
	#	fixed-address {{ host.ips | ipaddr('10.42.4.0/24') | first }};
	#}
{%     endif %}
{%   endif %}
{% endfor %}
}