joebiellik/dhcpd

By joebiellik

Updated 4 months ago

DHCP server running on Alpine Linux

Image
Networking
21

100K+

joebiellik/dhcpd repository overview

DHCP Server Container

Docker Image Version Docker Image Size Docker Pulls Docker Stars License

ISC DHCP server running on Alpine Linux.

End-of-life notice

ISC DHCP reached end-of-life in December 2022. The final upstream release was 4.4.3-P1 and no further security fixes will be published by ISC.

This image is pinned to that final version on Alpine 3.20 (the last Alpine release to ship the dhcp package). It is provided as-is for users with existing deployments; no further upstream patches are expected.

For new deployments, ISC recommends migrating to Kea.

Tags

TagDescription
latest, 4.4.3-P1, 4.4.3, 4.4ISC DHCP 4.4.3-P1 on Alpine 3.20

Quickstart

services:
  dhcpd:
    image: joebiellik/dhcpd
    network_mode: host
    volumes:
      - ./dhcpd.conf:/etc/dhcp/dhcpd.conf
      # Uncomment to persist leases across container restarts
      # - ./data:/var/lib/dhcp

See the example directory for a sample dhcpd.conf.

Binding to a specific interface

By default dhcpd listens on every interface that has a matching subnet declaration in the config. To restrict it to one or more specific interfaces, set the INTERFACES environment variable to a space-separated list of interface names:

services:
  dhcpd:
    image: joebiellik/dhcpd
    network_mode: host
    environment:
      INTERFACES: eth0
    volumes:
      - ./dhcpd.conf:/etc/dhcp/dhcpd.conf

Multiple interfaces:

    environment:
      INTERFACES: eth0 eth1

FAQ

Why network_mode: host?

DHCP is a layer-2 protocol. Clients without an IP address broadcast DHCPDISCOVER packets from 0.0.0.0 to 255.255.255.255 and the server needs to see both the raw broadcast and the client's original MAC address to build a valid reply.

Docker's default bridge networking sits behind NAT and a userland proxy, which:

  • Does not forward link-local broadcasts (255.255.255.255) into the container
  • Rewrites source addresses, hiding the real client MAC from the server
  • Makes subnet clauses in dhcpd.conf match the wrong interface

Tag summary

Content type

Image

Digest

sha256:c04809c0d

Size

5.7 MB

Last updated

4 months ago

docker pull joebiellik/dhcpd