Skip to content

Instantly share code, notes, and snippets.

@mingderwang
Forked from muka/dhcpd.conf
Last active November 22, 2019 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingderwang/27634642fde4bf6f2a14166eb2fb8cc3 to your computer and use it in GitHub Desktop.
Save mingderwang/27634642fde4bf6f2a14166eb2fb8cc3 to your computer and use it in GitHub Desktop.
Setup a dhcpd server using docker
ddns-update-style none;
option domain-name "bimap.co";
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 86400;
max-lease-time 604800;
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 10.99.1.0 netmask 255.255.255.0 {
## dhcp start and end IP range ##
range 10.99.1.220 10.99.1.240;
option subnet-mask 255.255.255.0; ## subnet
option broadcast-address 10.99.1.255; ## broadcast
option routers 10.99.1.254; ## router IP
host pc1 {
hardware ethernet 00:0c:29:2f:d0:dd;
fixed-address 10.99.1.99;
}
}
@mingderwang
Copy link
Author

mingderwang commented Nov 21, 2019

ETH=eno1

mkdir /tmp/data
https://gist.githubusercontent.com/mingderwang/27634642fde4bf6f2a14166eb2fb8cc3/raw/97c59e860f54a5dd81b3b765c703831b61cd5572/dhcpd.conf
#sudo ifconfig $ETH 10.99.1.1 up
#sudo ip route add 10.99.1.0/24 via 10.99.1.254
sudo docker run -it --rm --net=host -v "/tmp/data":/data networkboot/dhcpd $ETH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment