Introduction
See introduction of DHCP_Server.
Installation
There are different DHCP client packages around. The default for Debian seems to be dhcp-client (virtual package!). It is probably installed already, as you can check within aptitude. But to be sure you can run as root
aptitude install dhcp-client
Note that the traditional DHCP client, isc-dhcp-client, is now EOL and the dhcp-client virtual package doesn't provide many alternatives. Here is a set of DHCP clients that might work as an alternative:
systemd-networkd (systemd)
Note that ifupdown can use udhcpc if available.
Users of systemd-networkd (systemd) or NetworkManager do not need to worry about that deprecation since they include their own DHCP clients.
Configuration
Basic configuration
For a basic configuration you have to edit the file /etc/network/interfaces, which defines the interfaces of your computer. If you want to use eth0 as the interface to be configured through DHCP during boot up, add/edit the eth0-entry
auto eth0 iface eth0 inet dhcp
The different keywords have the following meaning:
auto: the interface should be configured during boot time.
inet: interface uses TCP/IP networking.
dhcp: the interface can be configured through DHCP.
That is all.
To change the system to use a static IP address (not dhcp), change the /etc/network/interfaces file to something like:
iface eth0 inet static address 192.168.12.2 netmask 255.255.255.0 gateway 192.168.12.254
Advanced configuration
Consult the man pages of interfaces(5) (man interfaces) and dhclient(8) for more advanced options.