What is DHCP?
DHCP stands for Dynamic Host configuration protocol and provides a mechanism for automatically allocating IP (IPv4) addresses to network devices e.g. computers.
DHCP allows devices to join a home network without the need for any device setup.
The DHCP protocol 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 etc.
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:
When you enable the setting to obtain IP address automatically you are enabling the DHCP client.
The client can obtain an IP address from the DHCP server and also the DNS server addresses.
However they are both configurable as seen in the screen shot above.
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.
A DHCP client will request to keep it’s IP address when it renews which is why device IP addresses don’t normally change on home networks.
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 DHCP 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.
DHCP 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.
Subnet Mask – Normally 255.255.255.0 on home networks see subnet masks explained.
Default Gateway – The IP address of your home router
IP addresses are leased to the client a must be renewed before the lease 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
Most devices on a network will be automatic IP addresses assigned using a DHCP server.
However devices like:
- Network printers
- Smart Hubs
- Network Printers
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. However the set up 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.
Q-What is the IP address of the DHCP server?
A- This isn’t really relevant as the client will locate it using broadcasts.
Q- How do you find the address of a DHCP Server?
A- On windows the ipconfig /all command will show you the DHCP IP address of the DHCP server if the client is configured to use it.
Q- Does DHCP provide the address of the default gateway?
Q- Should I assign static IP addresses to all network devices?
A- No only to devices you need to manage
Q- Why should I assign a static IP address to network printers?
A- Because you will need to know the IP address in order to manage it.
Q- Should DHCP be on or OFF?
A- On almost all home networks it should be on I can’t think of a reason to turn it off.
Video -Static vs Dynamic IP Addresses
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
Q-1 Which devices do you think would require a static IP address?
A- Your mobile Phone
B -Your Tablet
C -Your network router
D- Smart switches on the network
Q 2-You Haven’t documented your network and need to manage a smart switch on the network how do you find it’s IP address?
A -Use the Ping command
B -Look at address reservations on the DHCP server
C- Look for address assignments on the DHCP server.
Q 3– Using DHCP to assign static IP addresses greatly reduces the possibility of duplicate IP addresses?True or False?
Q 4 Yo need to tell all clients the IP address of the DHCO server? True or False?
Q5- On Which device do you normally find the DHCP server?
Related Tutorials and resources:
- Setting Up A Static IP Address on Windows 10
- Video- Static vs Dynamic IP Addresses
- 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
Q1 C and D
Q2 B and C
Q4 False The client uses broadcasts to Locate the DHCP server
Q5 -The home router