Undestanding DHCP

Sun, 08/26/2012 - 18:58 -- jamie

On most linux computer, network interfaces (e.g. the network card that you plug an ethernet cable into or a wireless access card) are configured in a mostly automatic way. In other words, as soon as you plug in a cable, the network interface is activated and just works. Or, you click on a wireless access point that is in a drop down menu and indicate that you want to connect to it.

Behind the scenes DHCP is at work, ensuring that your interface gets a unique IP address.

DHCP is a protocol with a server and client part. The server listens on the network and waits for a request to come in. The client, when activated, sends a broadcast message to everyone on the local network asking if there is a DHCP server available. Through communication between the client and the server, an IP address is assigned to the client and recorded by the server (to ensure it is not given out to another client as well).

Usually, this interaction is hidden from view, but you can watch it progress via your syslog.

Try typing the following in your terminal:

tail -f /var/log/syslog

Then, either unplug and replug your ethernet cable or turn off and on your wireless card.