Skip to content

Instantly share code, notes, and snippets.

@muka muka/dhcpd.conf
Last active Dec 2, 2017

Embed
What would you like to do?
Setup a dhcpd server using docker
ddns-update-style none;
option domain-name "thpi";
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.0.0.0 netmask 255.255.255.0 {
## dhcp start and end IP range ##
range 10.0.0.20 10.0.0.90;
option subnet-mask 255.255.255.0; ## subnet
option broadcast-address 10.0.0.255; ## broadcast
option routers 10.0.0.1; ## router IP
host pc1 {
hardware ethernet 60:a4:4c:3d:76:fa;
fixed-address 10.0.0.100;
}
host lap1 {
hardware ethernet 6c:71:d9:1e:f3:4f;
fixed-address 10.0.0.150;
}
host thnote {
hardware ethernet d0:22:be:d3:be:e1;
fixed-address 10.0.0.200;
}
}
ETH=eno1
mkdir /tmp/data
wget https://gist.githubusercontent.com/muka/cd05df8313395d72d281c511a4ba70d8/raw/a97561d6431989b467b454e7e7aeac3378fdb4f6/dhcpd.conf -O /tmp/data/dhcp.conf
sudo ifconfig $ETH 10.0.0.1 up
sudo ip route add 10.0.0.0/24 via 10.0.0.1
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
You can’t perform that action at this time.