Docker – CoreOS, Docker networking, more than one bridge

bridgecoreosdocker

I have a server with 4 ethernet-cards. With the switching hardware I put all 4 cards in different VLANs. With the default networking on CoreOS I get single bridge for the containers, with a private IP address range. And besides that, I can control the hosts networking, and forward ports.

What I want is to control which container connects to which physical port, without exposing the hosts networking stack to the containers. I thought of multiple bridges: one for each physical card, making the physical port of each card to a member of the respective bridge, and connect containers to the bridge I specify. I would have control over the VLAN membership of the containers.

But i'm not sure if docker can handle this. I know how to connect Docker to a custom bridge, but I couldn't find any hints how to connect it to several bridges. Can it do something like that? Is there any other solutions on how to control which VLAN my containers belong to?

thanks,

__
s.

Best Answer

It's not an easy solution but its doable with openvswitch running on your host machines. You want to do something like

http://fbevmware.blogspot.com/2013/12/coupling-docker-and-open-vswitch.html