Docker Community Forums

Share and learn in the Docker community.

How can we assign a docker container ip address dynamically using dhcp

Do we have have docker image and will run the container from that. I want Containers interface/s has to acquire the DHCP IPs from DHCP server running on router attached to the host network

I want my container’s interface/s to acquire the DHCP IPs/default gateway/dns from DHCP server .

Thanks for the help.

1 Like

hi @xverman,

i know this is an old topic but did you ever get an answer to this? i’m having the same issue.

When docker starts a container, it creates a virtual interface on host system with unique name like vethef766ac, and assign IP address within the same subnet. This new interface will be connected to the eth0 interface on the container and allow networking between containers by adding iptable rules.