DHCP – Dynamic Host Configuration Protocol
Translation: Dynamic host configuration protocol
N.b. This protocol dates back to 1993 !!!!
The pedagogical objectives of this lesson are:
– Be aware of the DHCP protocol.
– Know how it works.
– Be able to create a DHCP server on active equipment.
I'm in a café with friends and I want to go on the internet via Wifi.
I type the password Wifi and Hop!! I'm on the Internet!!!
magic? Not really. What happens when your equipment took a few seconds to connect?
He asked for an IP address !!!
Because of what? DHCP !!!
To browse the Internet, any computer, tablet, phone needs to have an IP address!
To put an IP address on a computer, there are two methods:
– Fixed IP Address
– Dynamic IP address
Do you see yourself explaining to your granny how to change her IP address on her computer? no! It's too complicated!
The DHCP was born!
The DHCP protocol or service allows you to dynamically assign an IP address to a host.
The DHCP allows a customer who arrives on a network to request a dynamic network configuration.
The latter will contain at least:
An IP address.
A sub-network mask.
A default gateway.
One or more DNS servers.
How's it going?
The customer – DHCP DISCOVER: Hi everyone! I need an IP address!
The server – DHCP OFFER: Hi dude! Here's your IP address😉
Customer – DHCP REQUEST: Thank you !!! I'll take it. 😉
The server – DHCP ACK: It's noted!
The various DHCP queries
The main queries:
DHCP DISCOVER (Customer wants to locate DHCP servers)
DHCP OFFER (Response of the DHCP server, it contains the first IP settings)
DHCP REQUEST (Various request of the client to for example extend its lease)
DHCP ACK (response from the server that contains settings and the client's IP address)
DHCP NAK (Server response to notify the customer that the lease has expired or if the customer announces a bad network configuration)
DHCP DECLINE (Customer refuses IP address because it is already in use)
DHCP RELEASE (Customer releases IP address)
DHCP INFORM (Customer asks for local settings, he already has his IP address)
The DHCP protocol provides an IANA official DHCP documentation address with links to CFRs:
Official CISCO documentation on DHCP options:
The DHCP lease
lease – lease
Our DHCP server is not actually going to DON't HAVE an IP address to our client. He's going to LOR him for a while. Let's move on to the concert:
Open your Windows Order Guest (CMD) and type in the following order:
C: 'Users'Christmas NICOLAS'ipconfig /all
With this command, we can see the IP configuration of our computer.
The parameters learned are:
– Address IPv4: 192.168.43.5
– Subnetwork Mask: 255.255.255.0
– Lease obtained: Wednesday, September 26, 2018 22:29:25
– Expiring lease: Thursday, September 27, 2018 3:11:46
– Default bridge: 192.168.43.1
– DHCP Server: 192.168.43.1
– DNS Server: 192.168.43.1
Our computer at IP 192.168.43.5 for 4 hours 42 minutes! Our DHCP server will not be able to give this address back to another person during this time!
– I want my router to make DHCP server for the network 192.168.1.0 /24
– IP addresses ending with .254, .1 and .2 are already in use.
– IP 192.168.1.90 is reserved for the computer with the address mac 000B.6B52.3268
– The default gateway for my network is address 192.168.1.254
– The IP addresses of my DNS servers are: 192.168.1.1 and 192.168.1.2
– The customer must request a new IP address every 10 minutes.
Here's the setup:
ip dhcp excluded-address 192.168.1.254< Exclure la Gateway exclure="" la=""></ Exclure la Gateway> ip dhcp excluded-address 192.168.1.1 192.168.1.2< Autres Exlusions autres=""></ Autres Exlusions> ip dhcp pool FINGER-POOL< Nom de notre Pool DHCP nom="" de="" notre="" pool=""></ Nom de notre Pool DHCP> network 192.168.1.0 255.255.255.0< Plage d'adresse IP plage="" d'adresse=""></ Plage d'adresse IP> default-router 192.168.1.254< Passerelle par défaut passerelle="" par=""></ Passerelle par défaut> dns-server 192.168.1.1 192.168.1.2< Serveur DNS serveur=""></ Serveur DNS> lease 0 0 10< Durée[Day_Hours_Minutes] du bail DHCP durée="" du="" bail=""></ Durée du bail DHCP> ip dhcp pool FINGER-POOL-FIXE-90< Réservation de bail DHCP réservation="" de="" bail=""></ Réservation de bail DHCP> network 192.168.1.90 255.255.255.0 hardware-address 000b.6b52.3268< Adresse MAC de notre client adresse="" mac="" de="" notre=""></ Adresse MAC de notre client> default-router 192.168.1.254 dns-server 192.168.1.1 192.168.1.2 lease 0 0 10
DHCP Spoofing is about intentionally giving bad DHCP information to our customers. (Attack)
DHCP Snooping protects against DHCP Spoofing.
See the article on DHCP Snooping for more information.
Hoping this article has been helpful to you! Don't hesitate to let me know!!
This site has other network items, take the opportunity to browse the menu bar!