SIOCGIFADDR fails in container [message #48608] |
Wed, 24 October 2012 21:38  |
mose
Messages: 6 Registered: February 2012 Location: Nebraska
|
Junior Member |
|
|
Debian 6.0.6
Kernel 2.6.32-5-openvz-amd64
vzctl 3.0.24
Container 270 (spaced for readability)
NETIF="
ifname=eth0,bridge=vzbr0,mac=00:18:51:F4:B3:1D,
host_ifname=veth270.0,host_mac=00:18:51:E4:88:29,mac_filter=off;
ifname=eth1,bridge=vzbr1,mac=00:18:51:B0:95:9D,
host_ifname=veth270.1,host_mac=00:18:51:CB:DE:3D,mac_filter=off"
I am attempting to use perl modules in a container, such as Net::RawIP and Net::Frame::Device, but they are failing when they attempt to query any interface for its MAC address (lo, eth0 or eth1).
A similar problem is described in the post below.
comments.gmane.org/gmane.linux.kernel.containers.lxc.general /238
A program is included in the post to demonstrate the problem. I can run the program on the host, and if the interface has an IP address, it will return it, but it does not find the MAC address, for some reason. For example,
> ./a.out vzbr0
Getting IP / MAC info for device (vzbr0)
Got IP (167777507) and MAC ()
If I run the program in the container,
# ./a.out eth0
Getting IP / MAC info for device (eth0)
SIOCGIFADDR failed with code (22) : Invalid argument
Since a patch was submitted as a result of that post, and it was 2 years ago, I'm assuming that the patch is in the kernel I am using. I looked through Net::RawIP and saw that it was using tap to get its information. On the chance this somehow involved the tun device, I followed the steps to make the tun device accessible in the container as described in the wiki.
wiki.openvz.org/VPN_via_the_TUN/TAP_device
Unfortunately, that didn't seem to affect anything. Is there anything else I need to turn on for SIOCGIFADDR and SIOCGIFHWADDR to work, or is this just not possible from a container? ip/ifconfig must have a way to do this, because they display the MAC address for the interface. Any pointers to more information, debugging tips or things to try would be greatly appreciated. Thanks!
|
|
|