A Guide to Understanding DHCP

Thumbnail image of Port Forward Staff
Port Forward Staff
July 18, 2017 (Last Updated: ) | Reading Time: 3 minutes

DHCP stands for Dynamic Host Control Protocol. It is a process that runs on your router that assigns an IP address, subnet, and gateway to each device on your local area network. For more about these terms visit our help page. Let's look at what an IP address is first then we will get into how DHCP works.

Devices on a network
Devices on a network

An IP Address is a unique number given to every computer on a network. Each IP address is unique because two computers on the same network cannot have the same IP address. The IP address generally takes the form of four numbers (from 0 through 255) which are seperated by periods. A common IP address is 192.168.1.2.

Example IP address
Example IP address

Everytime a computer is turned on it contacts the DHCP server to request an IP address, subnet and gateway. The DHCP server generally provides the next availble IP address. This is more important than it sounds. The order in which the computers are turned on effect which computer gets which IP address.

A Problem With DHCP and Port Forwarding

For example, one day you turn computer A on first and it gets the 192.168.1.2 IP address. The next day maybe computer A is turned on second and it gets a 192.168.1.3 IP address. Forwarding a port causes certain data to be sent to a specific IP address. If a port forward had been set up and then that IP address changes, the port forwarding configuration will no longer be set up properly for that computer.

So back to our previous example, one day the port forwarding configuration works. The next day it may not. In order to avoid this problem, we need to set up a static IP address on the computer that the ports are going to be forwarded to.

A person setting up a router
A person setting up a router

A static IP address is an IP address that is not assigned by DHCP. A static IP address is an IP address that has been manually setup on that device. DHCP actually knows nothing about an IP address that has been assigned statically. It doesn't even know that an IP address has been assigned. So it can very easily hand out an IP address via DHCP that is the same as the one that has been assigned statically. Remember, an IP address needs to be unique. When two computers have the same IP address there is an IP address conflict and neither of them can connect to the internet.

Let's go back to computer A and computer B. Computer A has the static IP address 192.168.1.2. Computer B boots onto the network and DHCP then hands it the first available IP address, which it considers to be 192.168.1.2.

The easy way around this is to just assign an IP address that is far away from the range of IP addresses that are assigned by DHCP. If DHCP assigns 192.168.1.2 as it's first assignable IP address, assign a static IP address that is something like 192.168.1.50 or more. (It's pretty unlikely that you will have 50 computers on your network, so there will never be an IP address conflict.) If the first IP address handed out by DHCP is something like 192.168.1.253, assign an IP address that is 192.168.1.150 or less.

Know Your DHCP Pool

The only thing that matters is that there are no IP address conflicts. Just make sure you do not set up a static IP address that is one of the IP addresses that DHCP normally hands out. To always avoid IP address conflicts you need to know what your router's DHCP range is. You can find it by logging in to your router and going to the DHCP section. The range will be listed there. Simply choose an IP address outside the listed range when setting up a static IP and you will never have an IP address conflict.

More From Port Forward

Thumbnail for Phantasy Star Online 2: New Genesis

How to Port Forward in Your Router for Phantasy Star Online 2: New Genesis

Help improve your connects in Phantasy Star Online 2: New Genesis by forwarding some ports in your router.

Read More
Thumbnail for Darkest Dungeon

Forward Ports on Your Router for Darkest Dungeon

You can help improve your online multiplayer connections in Darkest Dungeon by forwarding some ports in your router.

Read More
Thumbnail for For Honor

For Honor Port Forwarding

Help improve your online connections and make connecting with others easier in For Honor by forwarding some ports.

Read More
Thumbnail for Chicory: A Colorful Tale

Forwarding Ports for Chicory: A Colorful Tale on Your Router.

You can forward some ports in your router to help improve online connections for Chicory: A Colorful Tale.

Read More
Thumbnail for Wave Break

Create a Port Forward for Wave Break in your Router

Forwarding some ports for Wave Break can make it easier to play with others and help improve your connections.

Read More
Thumbnail for Knockout City

Forwarding Ports for Knockout City on Your Router.

Help improve your online connections in Knockout City and connect with more players by forwarding some ports.

Read More
Thumbnail for Dying Light 2: Stay Human

Port Forwarding for Dying Light 2: Stay Human

You can connect with friends more easily and help improve connections in Dying Light 2: Stay Human by forwarding some ports.

Read More
Thumbnail for Far Cry 6

Creating a Port Forward in Your Router for Far Cry 6

You can help improve your online experiences and more easily connect with others in Far Cry 6 by forwarding some ports.

Read More