Files in /etc/network/interfaces.d Ignored – Troubleshooting Guide

armnetwork-managernetworkingraspberrypisystemd

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

Best Answer

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.