1 | initial version |
To set up a DHCP server within a Docker container for the fiber card network interface of the Docker host, you can follow these steps:
docker network create --driver=host mynetwork
docker run -d --net=mynetwork --name=mydhcpserver -v /var/run/docker.sock:/var/run/docker.sock rgielen/dhcpd
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
docker start mydhcpserver
Your DHCP server should now be running and providing IP addresses to devices connected to the network through the fiber card interface of the Docker host.