DHCP on Home Networks

understanding-dhcpWhat 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





DHCP Client

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.

Client Configuration

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:

standard-ip-address-settings

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.

DHCP Server

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.

If you are thinking of using another device to be a DHCP server it is important to understand that you can only have one DHCP server on a network.
.

 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.

dhcp-server-settings

The common settings are:

  • Enabled
  • Authoritative DHCP
  • Server Address Range
  • Lease Time

Enabled

This is normally selected to make the DHCP server active (on).

Authoritative DHCP

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

Lease Time

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.

tp-link-address-reservation

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.

Troubleshooting DHCP

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.

ipconfig-dhcp

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.

dhcp-server-address

Q- Does DHCP provide the address of the default gateway?

A- Yes

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:

dhclient -r

to renew use:

dhclient

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

 

Quick Quiz

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?

[ googlead]

Related Tutorials and resources:

Answers
Q1 C and D
Q2 B and C
Q3 True
Q4 False The client uses broadcasts to Locate the DHCP server
Q5 -The home router

 

Please Let me Know if you found it Useful
[Total: 14 Average: 5]

10 comments

  1. Does the ‘automatically’ in ‘Obtain dns server adress automatically’ mean the same as ‘let the router send requests to the dns server and use the ip adresses the router obtains’?
    Would there be any differences in what is done if you instead wrote the routers local ip in the ‘Use the following dns server adresses’ field?
    Best regards
    Sue

    1. Hi
      The router doesn’t send dns requests the client does (your PC). The router will supply the client with the address of the dns servers (Obtain dns settings automatically).
      You cannot configure the client with the router address as it is not a DNS server.
      Does that make sense
      Rgds
      Steve

  2. So if I have a DHCP range 192.168.0.10 – 192.168.0.254, if I set a stactic within 192.168.0.1 – 192.168.0.9, this will be outside of the DHCP range?

  3. Hello Steve,
    This is only valid for inside your Local Lan correct ? I get confused with nameservers that are servers that resolve public ip addresses and name. That would be a different type of thing from this. I am just learning about networking and it is, for me, a confusing topic.
    Thanks
    Joe

    1. DHCP is used to assign IP addresses and has noting to do with name servers.
      DHCP is used inside you local network. I is also often used by your ISP to provide you with your external IP address.
      If you monitor this address over a period you will notice that it changes.

      A name server resolves a name to IP address and are used on the Internet.However you can configure one on your local network for your internal machines.

      Joe networking can be confusing and everyone finds it that way to start but it does get easier.
      Rgds
      Steve

  4. I am trying to setup a second router as an access point. I have an ONT router using 192.168.1.64 to 192.168.253 as its range and want to add a Netgear Nighthawk as the second router. When I disable the DHCP on the Netgear router, what IP address should I use.

    1. As the 0-63 is not in the dhcp range I would use an IP from there . I wouldn’t go for 1 as you may want to use that for the router at some stage. So 10 is easy to remember.
      Rgds
      Steve

  5. Very good and easy to read/understand. However, the following information needs to be edited.
    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

    Just FYI you don’t use a period before the switch. Thank you for your time.

Leave a Reply

Your email address will not be published. Required fields are marked *