How to create a networks with multiple physical host interfaces?

Hi Docker masters,

I haven’t found what I want to do though it seems basic.

On my host I have multiple physical interfaces and docker0 by default (that is connected to which interface?!)

  • One interface eth0 is for the whole host and default network of Docker containers.
  • My other interface enp0s20f0u1 should be used by only few selected containers in a isolated way. That means nothing else is allowed to connect to this interface.

I guess I need to create a Docker network but I have no way to tell it to use only one interface and nothing else.

When I run a container, I’ll associate no interface, docker0 or the custom specific network.

Example:

  • container c1: run without anything => should be connected to docker0 but anything else
  • container c2: run with --net=none => no network access, completely isolated
  • container c3: run with --network=myspecificnetwork => connected to enp0s20f0u1 and nothing else, isolated

Thank you!