What is DHCP?
DHCP (Dynamic Host configuration protocol) provides a mechanism for automatically allocating IP (IPv4) addresses to network devices e.g. computers.
DHCP consists of two components.
- A DHCP client
- A DHCP server
All modern operating systems come equipped with a DHCP client, and by default, they are all configured to use DHCP.
A DHCP client is responsible for requesting an IP address and assigning it to the computer.
If you go to you adaptor settings page (see this tutorial for windows 10) or Wi-Fi settings page you will see a page similar to the one below:
You can see that the DHCP client is configured to obtain an IP address, and also a DNS server address.
A DHCP server is responsible for allocating IP address and other information to requesting clients.
The DHCP server is configured with a range of IP addresses that it can assign and also with other settings like DNS servers, default gateway addresses etc.
IP addresses from a DHCP server are normally leased, and must be renewed periodically.
This renewal process happens in the background, and doesn’t require any user intervention.
DHCP Server Location
On home networks the DHCP server is on the home router or home hub.
Most home routers will have the DHCP server enabled by default (turned on).
However you can use another computer e.g raspberry pi as a DHCP server, but it is generally not done.
DHCP Server Settings and Configuration
On home networks there is generally nothing to be configured.
If you go the admin page on your home router you will see configuration options similar to the screen shot below.
The common settings are:
- Authoritative DHCP
- Server Address Range
- Lease Time
This is normally selected to make the DHCP server active (on).
This is normally selected to make the DHCP server authoritative for this address pool as it is usually the only server on the network.
Server Address Range
You usually leave these as the default settings are usually adequate.
You should note that the allocation range on my home router is 192.168.1.64-192.168.1.253.
The home router itself uses address 192.168.1.254 and so it leaves me 192.168.1.1-.192.168.1.63 for allocating to static clients if needed.
Only assigning static addresses in this range will help avoid IP address conflicts.
You should also start at address 192..168.1.1 or 192..168.1.2 and work up in case you need to increase the address range at a later date.
Note: Some networks use 192..168.1.1 for the default gateway address.
IP addresses are leased to the client a must be renewed before the lase expires. You can see from my settings that the lease period is 1 day.
The default setting is generally used.
Assigning Static Addresses Using DHCP
Although you can manually assign a static address to a client it is not really the best way as it is very inflexible.
A better way is to use the DHCP server to assign the address on a permanent basis and almost all home routers have this ability.
This is usually known as address reservation and the screen shot below shows my tplink router settings.
It works by using the MAC address of the client,which is fixed, to fix the IP address to that client.
Using DHCP to assign static IP addresses greatly reduces the possibility of duplicate IP addresses.
You will need to look at the clients and the home router.
The main client trouble shooting tool is the command line tool ipconfig (windows) and ifconfig (Linux).
This tool will show you the IP addresses assigned to your device.
What you are looking for when using this tool is that your computer has a valid IP address,Gateway address, and DNS server address.
If your client has an IP address beginning with 169 or an address of 0.0.0.0 then something is wrong, and it can’t locate a DHCP server.
In the screen shot above you can see that the client is configured for DHCP and that the IP address has been leased.
Router Checks – You will also need to logon to your home router and check that DHCP has been enabled.
If you have many clients on the network then you may also need to adjust the address range.
If you do adjust the address range then make sure that you haven’t already assigned static addresses in this range.
Common Questions and Answers
Q- Can I assign static IP addresses on the client and still use DHCP?
A- Yes most DHCP servers (even on home networks) allow you to exclude IP addresses and address ranges.
Q- Can I assign DNS servers manually even though I’m using DHCP?
A- Yes there is a separate setting for that on the client configuration.
Q- My IP address doesn’t appear to change does this mean that I have a static IP address?
A- No not necessarily as when a DHCP client renews its IP address it asks for the same address and will normally be allowed to keep it.
Q- Can I have more than one DHCP server on a network?
A- Yes and No. You might find multiple DHCP servers on large corporate networks. Setup is tricky and they must be configured so as not to assign the same IP addresses from the same address range. On Home networks you should only have one.
Q- Does a DHCP server provide IPv6 addresses?
A- Currently No as IPv6 addresses on home networks are auto assigned by the client and don’t need DHCP.
Q- Do Wi-Fi Clients use DHCP
A- Yes-This is usually the default setting.
Q- How does a DHCP client locate a DHCP server?
A- It uses broadcasts.
Terms and Acronyms
MAC address– Also known as the Ethernet or physical address is fixed and part of the hardware.
Static Address – An IP address that is assigned manually.
Dynamic Address – An IP address assigned automatically and can change from time to time.
IP Address Conflict – When Two computers(devices) are configured to use the same IP address.
Default Gateway — The IP address of the device that provides access to the Internet i.e. your home router.
Broadcast -A message that is sent to all clients on a network.
Resources and Related tutorials
Useful Ipconfig commands
ipconfig /all -This command will show IP and DNS settings
ipconfig /release -This command will release the IP address from DHCP
ipconfig /renew -This command will renew the IP address using DHCP
Useful Rapberry Pi /Linux commands
ifconfig – Shows basic address details for all Interfaces.
dhclient lets you renew and release IP addresses:
to release use:
to renew use:
to target a particular interface (e.g eth0) use
dhclient -r eth0
to enable more details use the -v (verbose) switch
dhclient -r -v eth0
- Setting Up A Static IP Address on Windows 10
- Home Network Addressing
- Setting Up and building a Home Network
- How to Setup and Configure your Home Router
- Name Resolution on Home Networks
- DHCP specification RFC 2131 for IPv4