24

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"...)

6
  • My hunch is something to do with Kernel version 3.10 that might not even be supported anymore. Nov 25, 2016 at 20:45
  • It doesn't really sound like a kernel issue to me. But I am clueless yet at to how networking initialization works after the move to systemd -not saying it is a systemd issue Nov 25, 2016 at 22:05
  • Just curious, why are you running Linux 3.10 instead of the most recent version?
    – wjandrea
    Nov 25, 2016 at 22:13
  • The point about the kernel is I thought stystemd didn't come out until a later version but I'm on my phone still and can't confirm. Nov 25, 2016 at 22:48
  • @LuisdeArquer I've answered the kernel issue below. Nov 26, 2016 at 1:11

3 Answers 3

40

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.

4
  • Ha good for you. +1 for tenacity :) Don't forget to come back in two days and mark your answer as solving the question (click the check mark next to your answer and make it green) Nov 27, 2016 at 15:22
  • @WinEunuuchs2Unix Thanks for your help! :) Nov 27, 2016 at 15:23
  • This seems to fix the identical problem with the current (March 2018) version of raspbian as well.
    – jacobq
    Apr 3, 2018 at 18:43
  • 1
    Very interesting. The Odroid Ubuntu 16.04 is affected by this problem as well.
    – Marcus
    Apr 13, 2018 at 20:45
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.

1
  • For all it's worth - I've verified with several machines on 14.04 and 16.04 that files w/o extensions in /etc/network/interfaces.d get sourced just fine from /etc/network/interfaces with source-directory /etc/network/interfaces.d ... ;) Also worth noting that in our environment network-manager gets removed from servers; too unpredictable :D
    – tink
    Nov 1, 2017 at 0:20
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.

10
  • Just to confirm: The ARM CPU in the Pi is indeed 32-bit. Nov 26, 2016 at 2:03
  • @NathanOsman Thank you for confirming this new subject area for me :) Nov 26, 2016 at 2:11
  • +1 for pointing this out. However, please see this. Systemd generally supports 2y old kernels, so even you may be right, I would be surprised this is the root cause. I'll check the systemd version I am running. But even if it is a newish version, doesn't it sound more like a userspace issue? How could the kernel allow you read one file but stop you from reading another one? And the network configuration is clearly applied without issues in the second case. [More on next comment] Nov 27, 2016 at 11:54
  • Normally I would just upgrade the kernel and test, but it may be difficult in this case. This system runs on an ODROID XU4, where security is not a concern, but changing kernels can take some time, and probably is not a long term solution due to stability. If no other solution comes up, I may try it though just for curiosity : ) Nov 27, 2016 at 12:00
  • @NathanOsman Actually, the CPU itself is 64 bit on the Raspberry 3 (but normally it is used with 32 bit kernels) Nov 27, 2016 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .