3

I would like to install a DHCP server in a container to provide the devices (some raspberry pis and network switches) connected to the host system with IP addresses.

I start the container with "--net=host" flag in order to listen on broadcast traffic. It is working as expected. All devices get their IP address from the DHCP server.

However, the "--net=host" option represents an increased security risk. Do you know if there is a better option to acchieve the same? I could install both docker and podman on my system.

If there is no other option, how could I restrict the visibility of the network from the container so that it can only see the specific network interface where all devices are connected?

user5580578
  • 1,134
  • 1
  • 12
  • 28
  • It will probably be easier (and no more or less secure) to run this outside of Docker. Docker's networking setup isn't particularly designed for very-low-level protocols like DHCP. – David Maze Jan 20 '21 at 13:50

0 Answers0