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

Commit 2ca8dcf

Browse files
Merge pull request #27 from ticevi/master
Add DHCPv6 support via environment variable
2 parents 2ff2475 + e979b42 commit 2ca8dcf

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ RUN apt-get -q -y update \
1212
&& apt-get -q -y clean \
1313
&& rm -rf /var/lib/apt/lists/*
1414

15+
ENV DHCPD_PROTOCOL=4
16+
1517
COPY util/entrypoint.sh /entrypoint.sh
1618
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile.ldap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ RUN apt-get -q -y update \
1212
&& apt-get -q -y clean \
1313
&& rm -rf /var/lib/apt/lists/*
1414

15+
ENV DHCPD_PROTOCOL=4
16+
1517
COPY util/entrypoint.sh /entrypoint.sh
1618
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ on.
3434
A simple `run` script is also included which makes it quick to iterate on a
3535
configuration until you're satisfied.
3636

37+
DHCPv6
38+
------
39+
40+
To use a DHCPv6-Server you have to pass `DHCPD_PROTOCOL=6` as enviroment variable
41+
42+
`docker run -it --rm --init -e DHCPD_PROTOCOL=6 --net host -v "$(pwd)/data":/data networkboot/dhcpd eth0`
43+
44+
3745
Notes
3846
=====
3947

util/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ -n "$IFACE" ]; then
6969
echo "You must add the 'docker run' option '--net=host' if you want to provide DHCP service to the host network."
7070
fi
7171

72-
$run /usr/sbin/dhcpd -4 -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE
72+
$run /usr/sbin/dhcpd -$DHCPD_PROTOCOL -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE
7373
else
7474
# Run another binary
7575
$run "$@"

0 commit comments

Comments
 (0)