[lxc-devel] Problem with lxc and physical network interface

Daniel Lezcano dlezcano at fr.ibm.com
Wed Jun 3 07:48:03 UTC 2009


lxc-devel-owner at lists.sourceforge.net wrote:
> Subject:
> Problem with lxc and physical network interface
> From:
> Markus Schuster <ml at markus.schuster.name>
> Date:
> Tue, 2 Jun 2009 23:58:32 +0200
> To:
> lxc-devel at lists.sourceforge.net
> 
> To:
> lxc-devel at lists.sourceforge.net
> 
> 
> Hello list!
> 
> My plan is to create a linux container that exclusively owns one of my 
> machines' network interfaces. This fails with the following error while trying 
> to bring the container up using lxc-start:
> 
>> lxc 1243978760.627 ERROR    lxc_conf - failed to move wlan0 to 21156
>> lxc 1243978760.627 ERROR    lxc_parse - callback failed
>> lxc 1243978760.628 ERROR    lxc_conf - failed to move the netdev to the 
>> container
>> lxc 1243978760.628 ERROR    lxc_start - failed to create the configured
>> network
>> Internal system error
> 
> Here is my configuration file:
>> lxc.utsname = wlan
>> lxc.network.type = phys
>> lxc.network.flags = up
>> lxc.network.link = wlan0
> 
> I use the following commands to bring up the container:
>> lxc-create -n wlan -f /etc/lxc/wlan.conf
>> lxc-start -n wlan
> 
> I'm running Debian lenny with linux-image-2.6.29-2-686 and lxc (0.6.2) from 
> unstable. 
> I've tried eth1 (USB ethernet NIC) instead of wlan0 and even br0 (linux bride) 
> with the same result. Using veth and a bridge works fine. 
> Attached to this e-mail you find some strace output of lxc-start. 
> 
> What could cause this problem?
> Thanks for your help in advance!

Hi Markus,

at present the support of the physical network interfaces are not 
supported if sysfs is enabled in the kernel. This is a kernel limitation 
because the sysfs virtualization is not yet finisihed.
Only the virtual network devices are supported for the moment.

Did you tried the macvlan configuration ? it is the simpler and the 
fastest configuration. Maybe that can fit your needs.

Below a configuration example:

lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
# the following lines are optional
lxc.network.hwaddr = 4a:49:43:49:79:bd
lxc.network.ipv4 = 1.2.3.4/24
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596

Thanks
   -- Daniel





More information about the lxc-devel mailing list