diff --git a/Dockerfile b/Dockerfile index 4836674..1d97dfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,7 @@ RUN apt-get -q -y update \ && apt-get -q -y clean \ && rm -rf /var/lib/apt/lists/* +ENV DHCPD_PROTOCOL=4 + COPY util/entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile.ldap b/Dockerfile.ldap index deaabd6..52048af 100644 --- a/Dockerfile.ldap +++ b/Dockerfile.ldap @@ -12,5 +12,7 @@ RUN apt-get -q -y update \ && apt-get -q -y clean \ && rm -rf /var/lib/apt/lists/* +ENV DHCPD_PROTOCOL=4 + COPY util/entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index 2590fe8..d5078bd 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,14 @@ on. A simple `run` script is also included which makes it quick to iterate on a configuration until you're satisfied. +DHCPv6 +------ + +To use a DHCPv6-Server you have to pass `DHCPD_PROTOCOL=6` as enviroment variable + +`docker run -it --rm --init -e DHCPD_PROTOCOL=6 --net host -v "$(pwd)/data":/data networkboot/dhcpd eth0` + + Notes ===== diff --git a/util/entrypoint.sh b/util/entrypoint.sh index 1a8f59b..63883fd 100755 --- a/util/entrypoint.sh +++ b/util/entrypoint.sh @@ -69,7 +69,7 @@ if [ -n "$IFACE" ]; then echo "You must add the 'docker run' option '--net=host' if you want to provide DHCP service to the host network." fi - $run /usr/sbin/dhcpd -4 -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE + $run /usr/sbin/dhcpd -$DHCPD_PROTOCOL -f -d --no-pid -cf "$data_dir/dhcpd.conf" -lf "$data_dir/dhcpd.leases" $IFACE else # Run another binary $run "$@"