What Is DHCP Server And How Does It Work?

What Is DHCP Server And How Does It Work?

What Is DHCP Server – The full form of DHCP is Dynamic Host Configuration Protocol (DHCP) is a protocol that was invented to address some problems like, in our network, all end-user devices need an IP address to access the network. Static IP addresses are usually assigned to routers, management interfaces on switches, servers, and other devices in the network which does not change location either physically or logically. Static IP addresses are also used to access and manage these devices remotely. On the other hand, user devices such as computers, smartphones, IP phones, and others are like to change their location either physically or logically. This means that assigning them a static IP address would be an unavailable solution.

DHCP port number is 67. With DHCP, we can assign IP address information to user nodes automatically which saves on the administrative overhead that would be involved in assigning IP addressing information to clients statically.

Download Free CCNA Android Apps from Playstore

Learn MCSA for free – full course with LAB Configuration

Learn Linux for free – full course with LAB Configuration

DHCP Operation: Assigning IP addressing information to user devices is one of the most important tasks that are performed by the DHCP servers in our networks. It accomplishes these tasks in one of three ways:

Manual IP allocation: In this type of DHCP allocation, the network administrator assigns users with IP addresses from the DHCP server and then the DHCP server communicates this information to the clients.

Automatic IP allocation: In this mode, the DHCP server assigns static IP addresses to clients from a pool. These addresses do not change unless the administrator configures them differently.

Dynamic IP allocation: In this mode, the administrator configures a pool of addresses that can be assigned to clients. The clients then request the IP addressing information for a particular time period, when the time expires, the IP address is returned to the DHCP pool and the client has to request another IP address.

When a PC is connected to a DHCP server, the DHCP server usually gives it IP addressing information. The PC can use the IP addressing information it has been assigned until the specified lease period expires.

Excluding Address: Exclude IP addresses configured on the router’s interfaces, switch management interface, and server from DHCP. The devices we will exclude from participation in DHCP have been configured with static IP addresses. It is highly unlikely that these devices will be moved any time soon and also statically configured IP addresses on these devices helps in troubleshooting when there is a problem.

DHCP Server Syntax

R1(config)#ip dhcp excluded-address <start_ip_address> <end_ip_address>

DHCP_SERVER(config)#ip dhcp excluded-address 192.168.1.1    192.168.1.5

Create DHCP pool

R1(config)# ip dhcp pool<DHCP_POOL_NAME>

DHCP_SERVER(config)#ip dhcp pool everythingishere

DHCP Pool: The DHCP pool is the range of IP addresses that the hosts in the network can request, the command needed to configure the DHCP pool IP addresses is

R1(dhcp-config)#network <network_address.<subnet_mask>

DHCP_SERVER(dhcp-config)#network 192.168.1.0   255.255.255.0

Default gateway/default router: The default gateway is used by hosts for delivery to remote networks, in this case the default gateway is the IP address that is configured on the router’s LAN interface.

R1(dhcp-config)#default-router <ip_address>

DHCP_SERVER(dhcp-config)# default-router 192.168.1.1

DNS Server: The DNS server, is used to resolve IP addresses to hostnames.

R1(dhcp-config)# dns-server <ip_address>

DHCP_SERVER(dhcp-config)#dns-server 192.168.1.2

Lease Time: The lease time specifies how long a client can have an IP address before it has to make a new request.

R1(dhcp-config)#lease <days> <hours>

DHCP_SERVER(dhcp-config)# lease 3 0

This specifies that the clients will have to renew the DHCP configuration once every three days.

The commands we will use in our scenario to configure  DHCP are given below.

DHCP_ SERVER(config)#ip dhcp excluded-address 192.168.1.1   192.168.1.5

DHCP_ SERVER(config)#ip dhcp pool everythingishere

DHCP_ SERVER(config-config)#network 192.168.1.0    255.255.255.0

DHCP_ SERVER(config-config)#default-router 192.168.1.1

DHCP_ SERVER(config-config)#dns-server 192.168.1.2

DHCP_ SERVER(config-config)#lease 3 0

DHCP  Relay: The DHCP server will most likely not be the router and it will be located on a server farm. This may be a problem for clients who want to get IP addresses.

An IP helper-address is a solution that enables routers in the network to forward DHCP broadcast messages from the local network to a DHCP server that may be in a different network. In this situation, the router usually relays requests to the DHCP server which then can communicate IP addressing information to the user devices.

Syntax:

R1(config)#interface <interface_ID><interface_number>

R1(config-if)#ip helper-address <DHCP_SERVER_IP_ADDRESS>

<==Access CCNA LAB’s for Free==>

Solve Quiz and become expert in Networking

I hope you find this article helpful, you can support us by donating just $1. It will really encourage us. EIHeducation


Leave a Reply

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