Programming Blog




Article - 04
"Configure DHCP Server"

(15.10.2019)

Hello,

This article is about how to install/configurate DHCP Server on Ubuntu Linux(18.04) /Windows and Windows clients.

DHCP (Dynamic Host Configuration Protocol) is a network protocol that allows network
devices to automatically obtain the IP address and other parameters necessary to operate on a TCP / IP network.
This protocol works according to the client-server(link) model.
The client, when setting up the connection, receives data from the server.

I have done it all on Oracle VM VirtualBox Manager so if you no use VM you also can skip first pair steps.
First, we need to add and configure NatNetwork – Virtual Networking Hardware.



After this we can create DHCP Server Ubuntu VM and right after change Network Config.

Server:


Client:


Client has only one network card, namely the virtual NAT network card,
so that the communication to the DNS server, which has 2 network cards, can take place.


Ubuntu Linux Server

I’m working on Ubuntu 18.04, If you are working with 16.04 these configurations should not working.



After Ubuntu VM start
It would be better to config IP


Default it's automatic DHCP


We would use Manual DHCP Configurations


After this it’s almost ready,


just configure your account


You are welcome, we are in!
After apt-get update
sudo apt-get update

or when noting to update

Now we can install DHCP service
sudo apt install isc-dhcp-server

Don’t forget to do file copy with cp original_file_name original_file_name.cp before changing, to prevent fatal errors.

After in directory etc/dhcp
cd /etc/dhcp
change dhcpd.conf dhcp config file
sudo nano dhcpd.conf


before:


after:


Ctrl S to save
Ctrl X to exit from nano editor

With ifconfig -a you can see DHCP settings


we need configure enp0s8
next in /etc/default in isc-dhcp-server file
sudo nano /etc/default/isc-dhcp-server


It’s all
Now you need to start DHCP server
sudo service isc-dhcp-server start

And let’s check server status
sudo service isc-dhcp-server status

This red-colored alert you can ignoring but if you have other errors you need to check configured files.


Windows DHCP server

I’m using germane Windows Server 2019 Desktop version, therefore sorry for german on images.


After installing the Windows Virtual Machine, you also have to configure DHCP server.
Automatically by Windows start it should open Server-Manager window,


Here you have to select "Server role"(Server-Rolle)
Then you just have to press "Next"


Then you have to select "DHCP Tools" in the Windows menu


Here you right-click on "IPV4" and select "New area". This opens another window for further configuration.


Press "Next" and then select any description and any name.



Windows Client

As client you can use same vm as for Windows server, don’t forget to change vm Network configurations from first step.

On Windows you need just to change IPv4 configurations.
Open Network&Internet Settings -> change adapters options -> network adapter options -> Internetprotokol version 4:



Test

To test your dhcp connection open command line on client:
And use ipconfig
IPs should be right, otherwise check your configurations.


Back

Back to start