Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Latest commit

 

History

History
37 lines (21 loc) · 1.1 KB

README.md

File metadata and controls

37 lines (21 loc) · 1.1 KB

DHCP Server Container

Description

DHCP (Dynamic Host Configuration Protocol) server provides network configuration for dhcp-clients.

Running in docker

Clone this repository somewhere and build the container:

# docker build -t <username>/dhcpd .

Configure dhcp-server in /etc/dhcp/dhcpd.conf (dhcp-server configuration) and run dhcpd container as root.

# docker run --net=host -v /etc/dhcp/:/etc/dhcp -v /var/lib/dhcpd:/var/lib/dhcpd --name dhcp <username>/dhcpd

Functionality check

If you want to test the functionality, you can do it using dummy interface:

# modprobe dummy
# ip address add 1.2.3.4/24 dev dummy0
# ip link set dev dummy0 up

Add configuration for dummy interface to dhcpd-conf:

subnet 1.2.3.0 netmask 255.255.255.0 {
  range 1.2.3.20 1.2.3.30;
}

Use either pre-installed dhcp-client on your host:

    # /usr/sbin/dhclient -d dummy0

Or use dhcp-client container.