26

For Ubuntu 16.04 LTS (GNU/Linux 3.10.96-113 armv7l)

When I have the following, my static configuration is ignored:

/etc/network/interfaces

source-directory /etc/network/interfaces.d

/etc/network/interfaces.d/eth0

auto eth0
iface eth0 inet static
        address 192.168.40.112
        netmask 255.255.255.0
        gateway 192.168.40.1
        dns-nameservers 8.8.8.8

However, with the following:

/etc/network/interfaces

auto eth0
iface eth0 inet static
        address 192.168.40.112
        netmask 255.255.255.0
        gateway 192.168.40.1
        dns-nameservers 8.8.8.8

source-directory /etc/network/interfaces.d

the static configuration is set at boot (independently of what I have in interfaces.d/).

In case it is relevant, I am using a udev rule to rename the eth0 interface (it used to be "enx001e063110c0"...)

heynnema
  • 73,649

3 Answers3

42

I think I found it. From the manual, the problem seems to be with the source-directory keyword. It looks that, since 16.04, it is not supported anymore.

So replacing

source-directory /etc/network/interfaces.d

with

source /etc/network/interfaces.d/*

seems to fix the problem.

6

I had approximately the same problem. It turns out source-directory is supported on my system, but only includes files whose filenames consist of letters, numbers, dashes and underscores.

That is why my eth0.conf didn't get read, because it contained a dot.

Sjoerd
  • 171
2

Your Kernel 3.10 is too old for systemd IFF using systemd-v230 or newer.

According to systemd kernel requirements in github at (github.com - systemd README) you need version >= 3.12 if you are using systemd-v230 or newer:

REQUIREMENTS:
        Linux kernel >= 3.12
        Linux kernel >= 4.2 for unified cgroup hierarchy support

Lines 37, 38 and 39 are printed above.

You are running under ARM architecture which I frankly know little about. Google search tells me your armvl7 is used by Raspberry Pi and is a 32 bit kernel.

Updating your Kernel to modern times

If you want the latest (October 21, 2016) "Dirty COW" security protection (What is the "Dirty COW" bug, and how can I secure my system against it?) plus a host of other security patches, bug fixes and system improvements (after your 2013 version) you should be on kernel 4.4.0-47.

Unfortunately I don't know how to do that for a RaspberryPi. I have linked this question to people who use RaspberryPi and have asked them to critique this answer.