3. dhclient

We've discussed DHCP before, and most often you will never need to statically set your IP addresses, subnet masks, etc. Instead, you'll be using DHCP! The dhclient starts up on boot and gets a list of network interfaces from the dhclient.conf file. For each interface listed, it tries to configure the interface using the DHCP protocol.

In the dhclient.leases file, dhclient keeps track of a list of leases across system reboots. After reading dhclient.conf, the dhclient.leases file is read to let it know what leases it's already assigned.

To obtain a fresh IP

sudo dhclient

Sign in to save your learning progress

Sign in

Exercises

Practice makes perfect! Here are some hands-on labs to reinforce your understanding of dynamic IP addressing and network configuration:

  1. Manage IP Addressing in Linux - Practice using dhclient to obtain a dynamic IP address and verify network configuration in a real Linux environment.
  2. Identify MAC and IP Addresses in Linux - Learn to inspect network interfaces and identify MAC and IP addresses, which are fundamental to understanding how DHCP assigns addresses.
  3. Explore IP Address Types and Reachability in Linux - Test network reachability and explore different IP address types, building on your understanding of how IP addresses function in a network.

These labs will help you apply the concepts of DHCP and IP addressing in real scenarios and build confidence with network configuration in Linux.

Quiz

What tries to assign IP addresses with the DHCP protocol?