0

Not so new to Docker, but not nearly an expert either.

I am trying to build a Docker environment where a custom bridge is connected to a specific NIC.

The use case is to have a dedicated isolated lab network running on a separate interface eth1 on my PC with devices and services which cannot see nor interfere with the office/production network which is running on eth0.

One of the containers i am going to run is a DHCP server and i only want to give out IP addresses on eth1. Obviously I don’t want to give out IP addresses to the rest of the office over eth0. I have been reading documentation, watching videos, doing online trainings, reading blogs. To me, what i want to achieve is something very basic, but i cannot seem to find how to do this.

Any ideas?

0

For your issue, I think you can try to create a bridge and bind it to the NIC eht1. The steps will like this:

  1. edit the eth1 config file ifcfg-eth1:

    enter image description here

  2. edit the bridge br0 config file ifcfg-br0:

    enter image description here

  3. restart the network service: service network restart

  4. find your docker config file and change the DOCKER_NETWORK_OPTIONS into:

    DOCKER_NETWORK_OPTIONS="-b=br0"

  5. restart your docker server

  6. create your docker with no network:

    docker run -itd --net=none --name=dockerName yourImage

  7. set the network for your container and you need to install the tool pipework

    git clone https://github.com/jpetazzo/pipework cp ~/pipework/pipework /usr/local/bin/ pipework br0 dockerName 192.168.0.11/24@192.168.0.141

Note: the container's IP address is 192.168.0.11, the netmask is 24, and the gateway is 192.168.0.141. You can change some setting according to your requirement. Hope this will help you.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.