This project create a DHCP Server for Legacy machine in a docker container using IPv4.
This documentation will provide you a working DHCP server and an example to integrate it with a PXE server.
- Docker
- Centos or Ubuntu is recommended
- An external PXE server
yum install docker-ce -y
to build the image, update the dhcpd.conf file located in the example folder,then proceed.
docker build . -t dhcp-server:latest
you should get an image named dhcp-server:latest
You can start the image with this command:
docker run -it --name dhcp \
-p 67:67/udp \
-p 67:67 \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v /tmp/$(mktemp -d):/run \
--privileged \
--net host \
dhcp-server:latest
this file contains the dhcpd configuration
/sys/fs/cgroup & /run are defined because systemctl is required and these folders are required.
nano dhcpd.conf
to change your dhcp configuration.
Create a VM or use a physical machine, boot the machine and do a dhcp request
If you have improvements or ideas, you can create pull request.
- Studio Webux S.E.N.C - SW - studiowebux
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details