[lxc-users] macvlan networking
awg1 at gmx.com
Mon Sep 15 00:58:41 UTC 2014
Hello. I'm just starting to learn about containers so apologies for the
basic question (I couldn't find an exact answer from my non-exhaustive
review of the archives).
I'm trying to create a private container network using macvlan
interfaces. I'm running ubuntu 14.04 on the host and on the containers
and have created a dummy bridge to attach the containers to. It doesn't
have an IP address on the host but my understanding is this isn't needed
because it is only being used for bridging between containers. This
bridge is brought up upon boot from the interfaces script:
iface mvlbr0 inet manual
pre-up brctl addbr mvlbr0
up ip link set mvlbr0 up
down ip link set mvlbr0 down
post-down brctl delbr mvlbr0
I then add the following configuration to the first container:
lxc.network.type = macvlan
lxc.network.macvlan.mode = bridge
lxc.network.flags = up
lxc.network.link = mvlbr0
lxc.network.hwaddr = 00:16:31:b1:19:93
lxc.network.ipv4 = 10.1.1.2/26
I run lxc-start -n container and get the following error:
lxc-start: failed to move 'mvlbr0' to the container : Invalid argument
lxc-start: failed to create the configured network
lxc-start: failed to spawn 'apache01'
lxc-start: The container failed to start.
Could someone please provide some advice on what I'm doing wrong. Thanks.
More information about the lxc-users