Latest LXC Alpine template fails to start networking on Ubuntu latest
Continues http://bugs.alpinelinux.org/issues/4617 which was closed.
Problem is Alpine containers fail to start networking by default.
Unable to start networking manually either.
It appears there’s no package installed to handle the /etc/network/interfaces dhcp directive.
Ubuntu containers work as expected.
_
Host details…
net4-dev# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
net4-dev# uname -a
Linux net4.bizcooker.com 4.2.0-22-generic #27-Ubuntu SMP Thu Dec 17
22:57:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
net4-dev# lxc-checkconfig
Kernel configuration not found at /proc/config.gz; searching…
Kernel configuration found at /boot/config-4.2.0-22-generic
—- Namespaces —-
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled
—- Control groups —-
Cgroup: enabled
Cgroup clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
—- Misc —-
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
Bridges: enabled
Advanced netfilter: enabled
CONFIG_NF_NAT_IPV4: enabled
CONFIG_NF_NAT_IPV6: enabled
CONFIG_IP_NF_TARGET_MASQUERADE: enabled
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled
—- Checkpoint/Restore —-
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
LXC version…
net4-dev# dpkg -l | egrep ‘lxc|cgroup’
ii cgmanager 0.39-2ubuntu2 amd64 Central cgroup manager daemon
ii cgroup-bin 0.41-6ubuntu1 all control and monitor control groups
(transitional package)
ii cgroup-lite 1.10 all Light-weight package to set up cgroups at system
boot
ii cgroup-tools 0.41-6ubuntu1 amd64 control and monitor control groups
(tools)
ii libcgmanager0:amd64 0.39-2ubuntu2 amd64 Central cgroup manager daemon
(client library)
ii libcgroup1:amd64 0.41-6ubuntu1 amd64 control and monitor control
groups (library)
ii liblxc1 1.1.5-0ubuntu0.15.10.3 amd64 Linux Containers userspace tools
(library)
ii lxc 1.1.5-0ubuntu0.15.10.3 amd64 Linux Containers userspace tools
ii lxc-templates 1.1.5-0ubuntu0.15.10.3 amd64 Linux Containers userspace
tools (templates)
ii lxcfs 0.10-0ubuntu2.1 amd64 FUSE based filesystem for LXC
ii lxctl 0.3.1+debian-3 all Utility to manage LXC
ii python3-lxc 1.1.5-0ubuntu0.15.10.3 amd64 Linux Containers userspace
tools (Python 3.x bindings)
/var/lib/lxc/alpine/config network related settings…
lxc.network.type = veth
lxc.network.flags = up
lxc.network.name = eth0
lxc.network.veth.pair = veth.alpine
lxc.network.link = lxcbr0
On host after container creation…
net4-dev# brctl show
bridge name bridge id STP enabled interfaces
lxcbr0 8000.fe772082da9b no veth.alpine
vethCTK18E
net4-dev# ifconfig -a
eth0 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7e
inet addr:167.114.119.48 Bcast:167.114.119.255 Mask:255.255.255.0
inet6 addr: fe80::ec4:7aff:fe48:817e/64 Scope:Link
inet6 addr: 2607:5300:60:6e30::/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:136070 errors:0 dropped:0 overruns:0 frame:0
TX packets:57506 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39746482 (39.7 MB) TX bytes:19355454 (19.3 MB)
Memory:fb920000-fb93ffff
eth0:1 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7e
inet addr:198.50.134.220 Bcast:198.50.134.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:fb920000-fb93ffff
eth0:2 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7e
inet addr:198.50.134.221 Bcast:198.50.134.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:fb920000-fb93ffff
eth1 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7f
inet addr:167.114.219.192 Bcast:167.114.255.255 Mask:255.255.0.0
inet6 addr: fe80::ec4:7aff:fe48:817f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:9342 (9.3 KB)
Memory:fb900000-fb91ffff
eth1:1 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7f
inet addr:198.50.134.222 Bcast:198.50.134.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:fb900000-fb91ffff
eth1:2 Link encap:Ethernet HWaddr 0c:c4:7a:48:81:7f
inet addr:198.50.134.223 Bcast:198.50.134.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:fb900000-fb91ffff
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1952 errors:0 dropped:0 overruns:0 frame:0
TX packets:1952 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:453994 (453.9 KB) TX bytes:453994 (453.9 KB)
lxcbr0 Link encap:Ethernet HWaddr fe:77:20:82:da:9b
inet addr:10.0.3.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::1c7e:23ff:fe4a:9678/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:549 errors:0 dropped:0 overruns:0 frame:0
TX packets:783 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:33757 (33.7 KB) TX bytes:14452841 (14.4 MB)
veth.alpine Link encap:Ethernet HWaddr fe:8e:52:9a:35:4f
inet6 addr: fe80::fc8e:52ff:fe9a:354f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:648 (648.0 B) TX bytes:438 (438.0 B)
vethCTK18E Link encap:Ethernet HWaddr fe:77:20:82:da:9b
inet6 addr: fe80::fc77:20ff:fe82:da9b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 frame:0
TX packets:124 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3878 (3.8 KB) TX bytes:11282 (11.2 KB)
Creating container as follows.
lxc-create -t alpine -n alpine — —release edge
lxc-start -n alpine
lxc-attach -n alpine /etc/init.d/networking start
* Starting networking …
* lo … [ !! ]
* eth0 … [ !! ]
* ERROR: networking failed to start
There appears to be no default code assign an IP address.
The Ubuntu template appears to start dhclient (isc-dhcp-client packag) to handle this.
There seems to be no dhcp package installed to handle the /etc/network/interfaces entry for eth0 in container.
net4-dev# lxc-attach -n alpine — cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
net4-dev# lxc-attach -n alpine — apk -vv info | sort
alpine-base-3.3.0-r0 - Meta package for minimal alpine base
alpine-baselayout-2.3.2-r10 - Alpine base dir structure and init
scripts
alpine-conf-3.3.0-r0 - Alpine configuration management scripts
alpine-keys-1.1-r0 - Public keys for Alpine Linux packages
apk-tools-2.6.5-r1 - Alpine Package Keeper - package manager for
alpine
busybox-1.24.1-r7 - Size optimized toolbox of many common UNIX
utilities
busybox-initscripts-2.3-r1 - Init scripts for busybox daemons
busybox-suid-1.24.1-r7 - suid binaries of Busybox
libc-utils-0.7-r0 - Meta package to pull in correct libc
libcrypto1.0-1.0.2e-r0 - Crypto library from openssl
libssl1.0-1.0.2e-r0 - SSL shared libraries
musl-1.1.12-r1 - the musl c library (libc) implementation
musl-utils-1.1.12-r1 - the musl c library (libc) implementation
openrc-0.19-r2 - OpenRC manages the services, startup and shutdown of a
host
scanelf-0.9.1-r0 - Scan ELF binaries for stuff
zlib-1.2.8-r2 - A compression/decompression Library
(from redmine: issue id 4976, created on 2015-12-23)