1

I'm currently using an Ethernet connection, which has no configuration in /etc/network/interfaces, and is (presumably) using DHCP as specified by the router, in order to be assigned an IP address.

However, when I set the following in /etc/network/interfaces:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The wired / ethernet interface
iface enh0j7 inet dhcp

and reboot, the Ethernet interface is no longer assigned an IP address and is no longer manageable in the NetworkManager:

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enh0j7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 70:be:72:97:88:66 brd ff:ff:ff:ff:ff:ff

enter image description here

I haven't changed anything that the Ethernet interface isn't already configured for (e.g. DHCP via the router). So, why does the Ethernet interface fail to be provided an IP address when specifying to be configured by DHCP?

However, if I add the following to /etc/network/interfaces:

auto enh0j7

The interface is once again provided an IP address (albeit still not manageable in the NetworkManager, but I understand why).

What impact does the auto setting have on the interface that the iface inet dhcp does not?

1 Answer 1

0

I haven't changed anything that the Ethernet interface isn't already configured for (e.g. DHCP via the router).

You have. Your previous configuration was to use NetworkManager for DHCP; your new configuration is to use ifupdown (/etc/network/interfaces) for DHCP.

Although NetworkManager remains running, it deliberately avoids configuring this interface, because you told the system to manage it via ifupdown instead. This is deliberate to avoid conflicts, as two programs configuring the same network interface can give strange results (duplicate addresses, etc).

(Note that previous Debian NM packages used to have the opposite behavior: NM would read configuration from ifupdown's 'interfaces' file and apply it on its own, without calling ifupdown at all. As written on the Debian Wiki page, this changed in Debian 6, and NM is now strictly separated from ifupdown.)

So, why does the Ethernet interface fail to be provided an IP address when specifying to be configured by DHCP? [...] What impact does the auto setting have on the interface that the iface inet dhcp does not?

Settings from /etc/network/interfaces are only applied when ifup is run. So the "impact" you are seeing is literally the purpose of "auto": it tells the system to run ifup <interface> on boot. Without that option, ifupdown does not configure the interface automatically and is left for manual usage.

When you had neither "auto" nor "iface", ifup also did nothing – instead you had NetworkManager acting as your DHCP client.

1
  • Thank you very much. Your explanation was clear and concise. I was not aware of the history of how NM applied configuration changes before Debian 7 (I started with Wheezy) and was not aware the two work independently. More informative than many other resources I found on this subject.
    – jimjamz
    Apr 16, 2019 at 22:58

You must log in to answer this question.

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