Home:ALL Converter>How to configure a Docker container for acquiring DHCP IP/s from dhcp server running on ESX

How to configure a Docker container for acquiring DHCP IP/s from dhcp server running on ESX

Ask Time:2017-04-13T22:22:36         Author:Anupam

Json Formatter

My host is SLES12 VM running on an ESX server. VM Host has interfaces which acquire DHCP IPs from the DHCP server running on ESX.

In my docker container (docker image: opensuse) I am running a NFS server and hence need external access. I want the container to acquire dhcp IP from the dhcp server running on ESX (just like my Host VM gets).

I have tried pipework but could not get it working. Here is what I did:

  1. Enabled Promiscuous mode on ESX. Created new bridge (br1) and
    attached it to Host interface eth0.

  2. Using pipework added a new interface (eth1) in Docker container with an IP address using this command pipework br1 $CONTAINERID 0/0

  3. After I tried assigning DHCP IP to the new interface (eth1) of the container, using the command pipework eth1 $CONTAINERID dhclient

    But got the below error: RTNETLINK answers: File exists

  4. To resolve this I flushed the eth1 device in the container and ran the command again. I observe that my docker daemon crashed. Docker version: 1.12.3 (both client and server).

Please let me know what I am missing here. I want my container's interface/s to acquire the DHCP IPs from DHCP server running on ESX.

Author:Anupam,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/43394826/how-to-configure-a-docker-container-for-acquiring-dhcp-ip-s-from-dhcp-server-run
yy