First, I create the bridge:
brctl addbr mybr
Then configure it:
ifconfig mybr 10.2.0.0 netmask 255.255.0.0 up
Then in lxc.conf, I have:
lxc.network.type = veth lxc.network.flags = up lxc.network.link = mybr lxc.network.ipv4 = 10.2.0.3 lxc.network.ipv4.gateway = 10.2.0.0 lxc.network.name = eth0
Generally, it works. I can use the net from within the container.
However, sometimes, ping from within the container begins to timeout, and this goes on until I poke the interface from the host by pinging 10.2.0.3, at which point the ping responses begin to appear inside the container.
This is easily triggered by running an app inside the container that makes a couple of parallel HTTP GET requests. At some point, the requests are sent and do not receive a reply. Pings begin to timeout.
What could this be?
In case it matters, I'm using lxc 0.9.0-0ubuntu2 on kernel 3.7.9-030709-generic.
lxc-checkconfig shows "enabled" for all except "User namespace".