Thursday, February 19, 2015

how to add network interface to lxc container

1- create a new interface for separate from the old one and assign ip

~$ sudo brctl addbr lxcbr1
~$ sudo ifconfig lxcbr1 up

2- edit container ubuntu-test to add two network interface, one belong to lxcbr0 and another below to lxcbr1 by modify the network config in /var/lib/lxc/ubuntu-test/config to below = veth = up = lxcbr0 = 00:16:3e:4b:cf:96 = veth = up = lxcbr1 = 00:16:3e:a7:ff:84

3- run the lxc and see the the new interface appear

~$ sudo lxc-start -n ubuntu-test

1 comment: