If you receive command not found when trying to run dhcp or dhclient, it's possible that these are not installed.
The dhcpd command you mentioned is for the DHCP server, not the client.
To install the DHCP client utilities run:
As @John Greene already mentioned in his post, ISC announced the end of maintenance for ISC DHCP (isc-dhcp-client).
sudo apt install isc-dhcp-client
This will install the isc-dhcp-client package, which includes the dhclient.
After the installation, you should be able to use the dhclient command to receive an IP address from a DHCP server.
Other alternative clients for Debian and/or Ubuntu
Alternative DHCP_Client | Debian Wiki
The list comes from the Debian Wiki, and one should ensure to find the corresponding packages for Ubuntu!
You should not simply install Debian packages on Ubuntu (or vice versa) because the two systems have different versions of libraries and dependencies, which can lead to incompatibilities and system errors.
Additionally, the deep integration of packages into the system (e.g., services or configurations) can cause issues if they are not specifically designed for the respective distribution!
Here is a set of DHCP clients that might work as an alternative from the Debian Wiki:
systemd-networkd
systemd-networkd is a system daemon that manages network configurations. It detects and configures network devices as they appear, it can also create virtual network devices.
udhcpc
udhcpc is a very small DHCP client program geared towards embedded systems.The letters are an abbreviation for Micro - DHCP - Client (μDHCPc).The program tries to be fully functional and RFC 2131 compliant.
dhcpcd
dhcpcd is a DHCP and DHCPv6 client. It is currently the most feature-rich open source DHCP client; see the home page for the full list of features.
dhcpcanon
dhcpcanon is a DCHP client implementation of the DHCP Anonymity Profiles (RFC7844). using Scapy Automaton.
NetworkManager
By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the nettools' n-dhcp4 library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.
odhcp6c
odhcp6c is a minimal DHCPv6 and RA-client for use in embedded Linux systems especially routers. It compiles to only about 35 KB (-Os -s).
coredhcp client
Coredhcp is a fast, multithreaded, modular and extensible DHCP server written in Go. In CoreDHCP almost everything is implemented as a plugin. Every request is evaluated calling each plugin in order, until one breaks the evaluation and responds to, or drops, the request.
Configure DHCP over /etc/network/interfaces
Make sure that /etc/network/interfaces is configured to use DHCP.
auto eth0 iface eth0 inet dhcp
Replace eth0 with your network interface name on your system.
Restart the networking with:
systemctl restart networking
You can run the following command to request an IP address:
sudo dhclient
DHCP server
For resources that may help in migrating your existing ISC DHCP server deployment to our newer DHCP server, Kea. ISC DHCP
Migrating to Kea from ISC DHCP
Kea is the DHCP server developed by ISC to replace isc-dhcp. It is newer and designed for more modern network environment
How to install and configure isc-kea on ubuntu
Old isc-dhcp-server
If you need to configure and run a DHCP server, you will need to install and set up the isc-dhcp-server package instead.
Configure network with netplan:
Locate the netplan configuration file in the /etc/netplan/ folder and has a .yaml extension.
Edit the file, should see a yaml structure defining the network interfaces and their configurations. Set the dhcp4 property to true.
nano /etc/netplan/YOUR_NETPLAN_CONFIG_FILE.yaml
dhcp example:
network: version: 2 renderer: networkd ethernets: eth0: dhcp4: true dhcp6: true
If you have multiple network interfaces, you can add similar sections for each interface.
Apply changes:
netplan apply
Request an IP address:
sudo dhclient
Ubuntu source:
Debian source:
Network configuration:
/etc/network/interfacesfile.if-pre-up.dandif-up.dfolders there