LXC

ta-ching chen

1 minute read

Prerequisites

  • Ubuntu 14.04 LTS (Trusty Tahr)

LXC(LinuX Container) has only one network interface when its created, so we have to add other interfaces manually.

Create an container

sudo lxc-create -t download -n <cotnainer name> -- -d ubuntu -r trusty -a amd64
ta-ching chen

1 minute read

Prerequisites

  • Ubuntu 14.04 LTS (Trusty Tahr)

Steps

/var/lib/lxc/<container name>/config for newly created container looks like following

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:aa:cc:9c

Because LXC not supports OVS add-port, so we have to remove following line

lxc.network.link = lxcbr0

And add following lines

lxc.network.script.up = /etc/network/if-up.d/lxc-ifup
lxc.network.script.down = /etc/network/if-down.d/lxc-ifdown 
lxc.network.veth.pair = <ovs port name>