Bug#809339: systemd: Ignores previously supported & documented method of disabling PredictableNetworkInterfaceNames

Neil Williams codehelp at debian.org
Wed Dec 30 14:18:35 GMT 2015


On Tue, 29 Dec 2015 15:24:55 -0300
Felipe Sateler <fsateler at debian.org> wrote:

> > This particular issue arises from this documentation:
> > http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
> >
> > It may also be related to #789439.
> >
> > I adapted vmdebootstrap to mask udev's rule file, as advised in the
> > first of the documented methods of disabling this support.
> > "You disable the assignment of fixed names, so that the
> > unpredictable kernel names are used again. For this, simply mask
> > udev's rule file for the default policy: ln
> > -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules"
> >
> > http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/tree/vmdebootstrap/base.py?id=vmdebootstrap-1.3#n208
> >
> > That worked during testing. Since releasing that change, systemd
> > has apparently dropped support for this method and a VM built with
> > this change no longer raises a network interface using DHCP.
> >
> > $ sudo vmdebootstrap --image=sid.img --distribution=unstable --grub
> > --enable-dhcp --verbose  
> 
> Do you have a log that you can share? Also, is the interface not named
> as expected, or is the interface named correctly but not brought up?

Interface is not named as expected - eth0 does not exist.
Despite the name, the interface name created by systemd/udev is not
actually predictable for emulated systems or systems to be used for
live image or preinstallation use cases.

> There were recent changes in the ifupdown/systemd integration, that
> may be related.

Command output:
Creating disk image
Creating partitions
Installing MBR
Creating filesystem ext4
Mounting /dev/mapper/loop0p1 on /tmp/tmpzUHSMQ
Debootstrapping unstable [amd64]
Give root an empty password
Removing udev persistent cd and net rules
Setting up networking
Disabling systemd predictable interface names
Configuring grub2
Skipping setting serial console- wheezy only.
Cleaning up

To get a logfile and to get the boot log, I added options for:
--log=809339.log --log-level=debug  --serial-console.

There was a temporary issue with the httpredir support, so I added:
--mirror=http://mirror.bytemark.co.uk/debian

809339.log is the vmdebootstrap log output.
debootstrap.log is the debootstrap output (there were no errors, so this is minimal)
boot.log is the qemu boot output (by using the -nographic option when
testing the image using qemu).

$ sudo chown neil:neil sid.img
$ qemu-system-x86_64 -m 2048 -enable-kvm -drive format=raw,file=sid.img -nographic 2>&1 | tee boot.log

Relevant content:

root at debian:~# ifconfig -a
ens3: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:12:34:56  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root at debian:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
root at debian:~# cat /etc/network/interfaces.d/setup 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
root at debian:~# ifup eth0
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "eth0"
Failed to get interface index: No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging..

exiting.
Failed to bring up eth0.
root at debian:~# 
root at debian:~# ls -l /etc/udev/rules.d/80-net-setup-link.rules
lrwxrwxrwx 1 root root 9 Dec 30 14:00 /etc/udev/rules.d/80-net-setup-link.rules -> /dev/null

This symlink *should* have prevented the naming of the network
interface as ens3 and allowed QEMU to raise eth0 at boot, automatically.

> > QEMU is capable of booting images with different network
> > configurations, so it is not simple for vmdebootstrap to know in
> > advance what names systemd will generate - hence the change to
> > assert the previous behaviour. vmdebootstrap is also used to
> > generate images for use on ARM dev boards like beaglebone-black and
> > cubietruck, so having a consistent interface that can be configured
> > to use DHCP at boot is important.  
> 
> Do the systems booted by vmdebootstrap use systemd?

As the default init, yes - although this cannot necessarily be assumed.

> If so, it may be
> simpler to use systemd-networkd:
> 
> echo <<EOF > /etc/systemd/network/99-dhcp-all.network
> [Match]
> Name=*
> 
> [Network]
> DHCP=yes
> 
> EOF

I am testing with support like this - two things to note.

Name=* is too generic for images for use other than with QEMU, Name=en*
could rule out bridging, so this becomes awkward.

Secondly, the systemd-networkd service also needs to be enabled before
the interface can be raised during boot (which is what *should* have
happened with the vmdebootstrap commands used in the test image above).

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 809339.log
Type: text/x-log
Size: 56270 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20151230/bf9df1c5/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boot.log
Type: text/x-log
Size: 38002 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20151230/bf9df1c5/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debootstrap.log
Type: text/x-log
Size: 352 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20151230/bf9df1c5/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20151230/bf9df1c5/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list