Electrical-Forenics Home ray@RayFranco.com                       601.529.7473
   © Dr. Ray Franco, PhD, PE  -  208 Fairways Dr., Vicksburg, MS 39183

Updated on Febuary 5, 2023

Raspberry Pi OS's Dynamic Host Configuration Protocol (DHCP) Clients

The Raspberry Pi OS is a Linux distribution based off of the Debian distribution. Linux has several DHCP clients. The Raspberry Pi OS has used three different DHCP clients, as their default for configuring network interfaces (Table 2). In addition, since Sept 2015, there is another DHCP client that is in every image of the Raspberry Pi OS. Each DHCP client places their network interface configuration file in a diffient directory, and the rules and syntaxes are different for each of them.

DHCP ClientsInterface Configuration File(s)RPi Date
NetworkManager/etc/NetworkManger/system-connections/ Sept 2022 to Present
dhcpcd (dhcp client daemon)/etc/hdcpd.conf May 2015 to Present
dhclient (isc-hpcd-client)/etc/network/interfacesPre-May 2015
Systemd-Networkd/etc/systemd/network/Not a Default
wpa_supplicant*/etc/wpa_supplicant/wpa_supplicant.conf
* The Wi-Fi Protected Access (WPA) supplicant is used with an DHCP client for wireless interfaces.

The original purpose of the Raspberry Pi, and still the RPi Foundation, is to teach coding to children. Many of the people using the Raspberry Pi are learning Linux. This is mass confusion for them! They can search on the Internet for how to set up a static IP address or how to use a Raspberry Pi as an Access Point, and see four different methods for configuring a network interface. On the latest image of the Raspberry Pi OS all four DHCP clients are present.

The purpose of this article to bring some clarity to the confusion of configuring a network interface and to help you decide which method is best for you.

However, before that can be accomplished, there are some basics that need to be covered.

Dynamic Host configuration Protocol (DHCP)

The DHCP protocol is controlled by the Internet Engineering Task Force (IETF) [42]. It is a server-client model that assigns IP addresses to network interfaces [43].

DHCP Servers

On a home network, the Router is DHCP server. However, if you want to use the Raspberry Pi OS as an Access Point, it must have a DHCP server. You can install your own [43], or use the built-in DHCP server, dnsmasq [15].

DHCP Clients

In addition to access the Internet, a Domain Name Server (DNS) must be specified.

The Four Raspberry Pi DHCP Clients:

NetworkManager - Sept 2022 to Present

The Raspberry Pi OS added support for the NetworkManger on Sept 7, 2022, and they announced that at some point in time, it would become the default [1].

The NetworkManager was introduced by RedHat (now IBM) in 2004 [2]. It is now updated and maintained by the Gnone organization [39, 40].

It appears that the NetworkManger is becoming the de facto standard for most Linux distributions [1]. It is Debian's default package for managing network interfaces for laptops [4]. Some non-Debian Linux distributions are using it for servers.

NetworkManager's behavior can be modify by its configuration file "/etc/NetworkManager/NetworkManger.conf". Debian's NetworkManager.conf file is set so that it will not manage any interfaces that are declared in "/etc/network/interfaces" or the directory "/etc/network/interfaces.d".

NetworkManager's interface configuration files are in the directory: "/etc/NetworkManager/system-connections/".

NetworkManager will automatically start other services as it requires them (wpa_supplicant for WPA and 802.1x connections, pppd for mobile broadband) [37].

DHCP Client Daemon (dhcpcd) and wpa_supplicant (May 2015 to Present)

This is still Raspberry Pi's default method of managing network interfaces.

In the last update to Raspbian Whezzy (May 2015), the default DHCP client was switched from the Internet System Consortium's DHCP Client (dhclient) to Roy Marples' DHCP Client Daemon (dhcpcd) [53, 22].

Although dhcpcd is in Debian's repository, it has never used as a default by Debian to configure network interfaces. There is nothing in Debian's guides or documentation about dhcpcd except for a man page. However, dhcpcd is very popular, and it has been used as the default in several Linux distributions based off of Debian.

Network interface parameters are placed in the file "/etc/dhcpcd.conf".

The behavior of dhcpcd can be modified by entries in the same configuration file (dhcpcd.conf) [52, 22]. By default, dhcpcd manages every interface it finds. To exclude both eth0 and wlan0, add the following to dhcpcd.conf:

denyinterfaces eth0 wlan0

If you do not have a denyinterfaces list in dhcpcd.conf and there is another DHCP client on your system, you can end up with more than one IP address for the same interface.

You can avoid conflicting with the previous method, by not having any any network interface entries in /etc/network/interfaces or "/etc/network/interfaces.d". If there are entries in /etc/network/interfaces, you will get a second IP address for these entries.

For wireless network interfaces, dhcpcd uses the helper configuration file: "/etc/wpa_supplicant/wpa_supplicant.conf".

The previous method can optionally use the same "/etc/wpa_supplicant/wpa_supplicant.conf" file.

Do not confuse dhcpcd with dhcpd, which is ISC's DHCP server daemon.

Examples:

ISC-DHCP-Client (dhclient) - (Pre-May 2015)

Raspian Wheeze used the Internet System Consortium (ISC) DHCP client, dhclient. It is in the package isc-dhcp-client. This client first appeared in 1999 [45]. It has a 23-year history. ISC stopped maintaining this client in Q1 2022 [46]. However, it is in every version of the Raspberry Pi OS. It is in Debian 11 (Bullseye), and it is actively being used for servers and simple workstations [7].

Its behavior can be modified by the configuration file: etc/DHCP/hdclent.conf.

Interface configuration parameters are placed in the file: "/etc/network/interfaces" or files in the directory, "/etc/network/interfaes.d".

Raspberry Pi Buster will not process files in "/etc/network/interaces.d" with a dot in the file name. Hence, do not use filename.conf or other extensions [add reference]. Raspberry Pi Bullseye will process files names with a dot in them. (Recheck this).

Wireless network configuration parameters are usually placed in the helper file "/etc/wpa_supplicant/wpa_supplicant.conf".

However, it is possible to put all the wireless network parameters in "/etc/network/interfaces" and not use the supplicant [25].

Raspberry Pi OS Buster has only /etc/network/interfaces file. It has only one active line:
 
source /etc/network/interfaces.d

Raspberry Pi OS Bullseye has two files: /etc/network/interfaces and "/etc/network/interfaces.new". The comments in the later file (.new) say that this file is to be used with dhcpcd. What does this mean?

It has only one active line:
source-directory /etc/network/interfaces.d
 
The "source-directory' specification requires that file names in the directory consist of: A-Z, a-z, numbers, underscores, and minus sign. It will not process a file names with a "." such as eth0.conf [man interfaces].

Examples:

Mixed Mode - NetworkManger and ISC-HDCP-Client (hdclient)

Debian's NetworkManager will not manage any interfaces that are declared in /etc/network/interfaces or in the directory "/etc/network/interfaces.d". Hence, you should be able to manage some interfaces with the NetworkManager and others in /etc/network/interfaces.

However, the Raspberry Pi's implementation is not currently working, as I believe it should:

1. You can use the NetworkManager to configure eth0 and /etc/network/interfaces to configure wlan0, but all of the Wi-Fi configuration has to be in /etc/network/interfaces. The NetworkManger is blocking the wpa_supplicant.conf file.

2. If you try to use the NetworkManger to configure wlan0 and /etc/network/interfaces to configure eth0, without the eth0 cable plugged in, wlan0 will not work.

Systemd-Networkd

Since Debian 8 (jessie) and Raspbian jessie (9/20/2015), systemd has been the default service manager [32]. Since that time, Systemd-Networkd can be used to manage the network interfaces [9,33,34]. You create configuration files for the interfaces and place them in the directory: "/etc/systemd/network/" ([7] Section 5.3).

At the present, setting up wireless networks with Systemd-Networkd is more difficult than the other methods [add reference].

Systemd-Networkd has never been the default method of the Raspberry Pi OS to manage network interfaces. However, it appears to be the current preferred method by Debian for managing modern network interfaces without a GUI (see Section 5.3 in [7]). It is definitely a viable option. You can find articles on the Internet with Systemd-Networkd managing interfaces on the Raspberry Pi [add references].

Predictable Network Interface Names

The Raspberry Pi only has one ethernet interface, and one wireless interface. Their default names are eth0 and wlan0.

However, interfaces can be added via the USB ports. If you add another ethernet port, eth1, after you reboot, the second ethernet port may become eth0 and vice versa. To solve this problem, Linux added support for Predictable Network Interface Names [13,14]. This might should have been called consistent interface names since it is not that easy to interpret the names.

In Debian Stretch, new systems by default no longer used old-style interface names such as eth0 and wlan0. Debian Stretch and Buster still retain support for the old-style names, but users are advised to upgrade before Bullseye [4].

Add reference and when this became available for the RPi.

Conclusions:

The Internet Systems Consortium (ISC) DHCP-Server has reached the End of its Life [45]. However, ISC now has a new DHCP server: Kea-DHCP. ISC is no longer maintaining their DHCP client, isc-dhcp-client (dhclient). They have decided not to purse an DHCP client or relay [46].

Due to his ill health, Roy Marples, is no longer maintaining his DHCP client, dhcpcd [51]. Supposely, Ido Rosen, has agreed to maintain his projects [51].

Thus, it is no wonder that the NetworkManager is becoming the de facto standard for most Linux Distributions.

References:

  1. The latest update to Raspberry Pi OS - Sept 7, 2022
  2. Wikipedia - NetworkManager
  3. NetworkManager Reference Manual
  4. Debian Wiki - Network Configuration
  5. Debian Wiki - NetworkManger
  6. Debian 11 - Administrator's Handbook - Chapter 8.2. Configuring the Network
  7. Debian References - Chapter 5. Network setup
  8. Connect to Wi-Fi From Terminal on Debian 11/10 with WPA Supplicant (Nov 8, 2022)
  9. Debian Systemd-Networkd Overview
  10. Systemd-Networkd - Debian Wiki
  11. Debian Network Configuration Using ifupdown
  12. What is WICD? Ubuntu Help
  13. Raspberry Pi Forums - Enable Predictable names
  14. Assign Fixed Name to The Network Interface on Raspbian
  15. Setting up a Routed Wireless Access Point - Official Raspberry Pi Documentation
  16. Raspberry Pi Access Point, VPN, SNMP, Router, Mobile Internet, Live Dashcam Access, etc
  17.  
  18.  
  19.  
  20.  
  21.  
  22. Static IP address templates for dhcpcd.conf - March 15, 2016 - Raspberry Pi Forums Moderator
  23. Raspberry Pi Raspbian Image Archives 2013-2020
  24. dhcpcd vs interfaces file - Raspberry Pi Forums
  25. Network Configuration for a Wi-Fi Access Point (12/26/2020)
  26. Bullseye – the new version of Raspberry Pi OS - Official Raspberry Pi News - Nov 8, 2021
  27. The Raspberry Pi computer goes on general sale - BBC News Feb 29, 2012
  28. Beta Raspberry Pi PCs Draw Big Bids On eBay - Jan 2, 2012
  29. Raspberry Pi OS - Wikipedia
  30. 8GB Raspberry Pi 4 on sale now at $75 - Official Raspberry Pi News - May 28, 2020
  31. Raspberry Pi OS (64-bit) - Official Raspberry Pi News - Feb 2, 2022
  32. systemd - system and service manager - Debian Wiki
  33. systemd.network - basic network configuration (e.g., DHCP, static, IPv6, MAC, MTU)
  34. systemd.netdev - Virtual Network Device configuration
  35. wpa_supplicant - Wikipedia
  36. Configuring Networking on The Raspberry Pi - Dec 21, 2022
  37. NetworkManager for administrators
  38. All About Debian /etc/network/interfaces File - 2019
  39. NetworkManger Homepage
  40. NetworkManger - Gnome Wiki
  41. RPI4 Network Lesson September 6, 2019 Peter Scargill
  42. Internet Engineering Task Force
  43. Dynamic Host Configuration Protocol - Wikipedia
  44. Comparison of DHCP server software - Wikipedia
  45. ISC DHCP Server has reached EOL
  46. ISC DHCP Client and Relay End of Maintenance
  47. Raspbian's new insanely bad design decision: DHCP Static IPs [obsolete] - Raspberry Pi Forums
  48. How to Set Static IP Address on Debian 11 (Bullseye) - NetworkManager
  49. SystemdNetworkd - wiki
  50. History of dhcpcd by Roy Marples
  51. Roy Marples - Projects Overview
  52. dhcpcd.conf man page - Debian Bullseye
  53. Another Raspbian Desktop User Interface Update