Four ways to connect a docker container to a local network

Update (2018-03-22) Since I wrote this document back in 2014, Docker has developed the macvlan network driver. That gives you a supported mechanism for direct connectivity to a local layer 2 network. I’ve written an article about working with the macvlan driver. This article discusses four ways to make a Docker container appear on a local network. These are not suggested as practical solutions, but are meant to illustrate some of the underlying network technology available in Linux.
read more →

Open vSwitch and persistent MAC addresses

Normally I like to post solutions, but today’s post is about a vexing problem to which I have not been able to find a solution. This started as a simple attempt to set up external connectivity on an all-in-one Icehouse install deployed on an OpenStack instance. I wanted to add eth0 to br-ex in order to model a typical method for providing external connectivity, but I ran into a very odd problem: the system would boot and work fine for a few seconds, but would then promptly lose network connectivity.
read more →

Solved: Open vSwitch and persistent MAC addresses

In my previous post I discussed a problem I was having setting a persistent MAC address on an OVS bridge device. It looks like the short answer is, “don’t use ip link set …” for this purpose. You can set the bridge MAC address via ovs-vsctl like this: ovs-vsctl set bridge br-ex other-config:hwaddr=$MACADDR So I’ve updated my ifconfig-br-ex to look like this: DEVICE=br-ex DEVICETYPE=ovs TYPE=OVSBridge ONBOOT=yes OVSBOOTPROTO=dhcp OVSDHCPINTERFACES=eth0 MACADDR=fa:16:3e:ef:91:ec OVS_EXTRA="set bridge br-ex other-config:hwaddr=$MACADDR" The OVS_EXTRA parameter gets passed to the add-br call like this:
read more →

Fedora and OVS Bridge Interfaces

I run OpenStack on my laptop, and I’ve been chasing down a pernicious problem with OVS bridge interfaces under both F19 and F20. My OpenStack environment relies on an OVS bridge device named br-ex for external connectivity and for making services available to OpenStack instances, but after rebooting, br-ex was consistently unconfigured, which caused a variety of problems. This is the network configuration file for br-ex on my system: DEVICE=br-ex DEVICETYPE=ovs TYPE=OVSBridge BOOTPROT=static IPADDR=192.
read more →