Last active
November 21, 2019 07:25
-
-
Save muka/cd05df8313395d72d281c511a4ba70d8 to your computer and use it in GitHub Desktop.
Setup a dhcpd server using docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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