Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1ba87d4

Browse files
committed
Add sample dhcpd and helper lavalab-gen.sh
1 parent 508e53f commit 1ba87d4

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed

dhcpd/dhcpd.conf

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# dhcpd.conf
2+
#
3+
# Sample configuration file for ISC dhcpd
4+
#
5+
6+
# option definitions common to all supported networks...
7+
option domain-name "lavalab.local";
8+
#option domain-name-servers 192.168.1.1;
9+
10+
default-lease-time 600;
11+
max-lease-time 7200;
12+
13+
# The ddns-updates-style parameter controls whether or not the server will
14+
# attempt to do a DNS update when a lease is confirmed. We default to the
15+
# behavior of the version 2 packages ('none', since DHCP v2 didn't
16+
# have support for DDNS.)
17+
ddns-update-style none;
18+
19+
# If this DHCP server is the official DHCP server for the local
20+
# network, the authoritative directive should be uncommented.
21+
authoritative;
22+
23+
# Use this to send dhcp log messages to a different log file (you also
24+
# have to hack syslog.conf to complete the redirection).
25+
#log-facility local7;
26+
27+
# No service will be given on this subnet, but declaring it helps the
28+
# DHCP server to understand the network topology.
29+
30+
#subnet 10.152.187.0 netmask 255.255.255.0 {
31+
#}
32+
33+
# This is a very basic subnet declaration.
34+
35+
#subnet 10.254.239.0 netmask 255.255.255.224 {
36+
# range 10.254.239.10 10.254.239.20;
37+
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
38+
#}
39+
40+
# This declaration allows BOOTP clients to get dynamic addresses,
41+
# which we don't really recommend.
42+
43+
#subnet 10.254.239.32 netmask 255.255.255.224 {
44+
# range dynamic-bootp 10.254.239.40 10.254.239.60;
45+
# option broadcast-address 10.254.239.31;
46+
# option routers rtr-239-32-1.example.org;
47+
#}
48+
49+
# A slightly different configuration for an internal subnet.
50+
#subnet 10.5.5.0 netmask 255.255.255.224 {
51+
# range 10.5.5.26 10.5.5.30;
52+
# option domain-name-servers ns1.internal.example.org;
53+
# option domain-name "internal.example.org";
54+
# option routers 10.5.5.1;
55+
# option broadcast-address 10.5.5.31;
56+
# default-lease-time 600;
57+
# max-lease-time 7200;
58+
#}
59+
60+
# Hosts which require special configuration options can be listed in
61+
# host statements. If no address is specified, the address will be
62+
# allocated dynamically (if possible), but the host-specific information
63+
# will still come from the host declaration.
64+
65+
#host passacaglia {
66+
# hardware ethernet 0:0:c0:5d:bd:95;
67+
# filename "vmunix.passacaglia";
68+
# server-name "toccata.example.com";
69+
#}
70+
71+
# Fixed IP addresses can also be specified for hosts. These addresses
72+
# should not also be listed as being available for dynamic assignment.
73+
# Hosts for which fixed IP addresses have been specified can boot using
74+
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
75+
# be booted with DHCP, unless there is an address range on the subnet
76+
# to which a BOOTP client is connected which has the dynamic-bootp flag
77+
# set.
78+
#host fantasia {
79+
# hardware ethernet 08:00:07:26:c0:a5;
80+
# fixed-address fantasia.example.com;
81+
#}
82+
83+
# You can declare a class of clients and then do address allocation
84+
# based on that. The example below shows a case where all clients
85+
# in a certain class get addresses on the 10.17.224/24 subnet, and all
86+
# other clients get addresses on the 10.0.29/24 subnet.
87+
88+
#class "foo" {
89+
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
90+
#}
91+
92+
#shared-network 224-29 {
93+
# subnet 10.17.224.0 netmask 255.255.255.0 {
94+
# option routers rtr-224.example.org;
95+
# }
96+
# subnet 10.0.29.0 netmask 255.255.255.0 {
97+
# option routers rtr-29.example.org;
98+
# }
99+
# pool {
100+
# allow members of "foo";
101+
# range 10.17.224.10 10.17.224.250;
102+
# }
103+
# pool {
104+
# deny members of "foo";
105+
# range 10.0.29.10 10.0.29.230;
106+
# }
107+
#}
108+
109+
subnet 192.168.66.0 netmask 255.255.255.0 {
110+
range 192.168.66.3 192.168.66.254;
111+
group {
112+
host baylibre-acme {
113+
hardware ethernet 6c:ec:eb:67:89:ad;
114+
fixed-address 192.168.66.2;
115+
}
116+
host baylibre-acme2 {
117+
hardware ethernet 84:eb:18:94:2e:ca;
118+
fixed-address 192.168.66.2;
119+
}
120+
}
121+
}
122+

lavalab-gen.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
rm -rv lava-master/devices/
4+
rm -rv lava-master/slaves/
5+
rm -rv lava-slave/conmux/
6+
rm -rv lava-master/tokens/
7+
rm -rv lava-master/users/
8+
rm lavalab*rules
9+
10+
if [ "$1" = "mrproper" ];then
11+
exit 0
12+
fi
13+
14+
./lavalab-gen.py || exit 1
15+
16+
rm /etc/udev/rules.d/lavalab*rules
17+
cp lavalab*rules /etc/udev/rules.d/
18+
19+
docker-compose build || exit 1
20+
docker-compose up || exit 1

0 commit comments

Comments
 (0)