fbpx

Chapter 2.4 – DHCP Server and DHCP Client

DHCP Server/Client

The DHCP (Dynamic Host Configuration Protocol) protocol is used for easy distribution of IP addresses on a network. RouterOS Mikrotik includes both parts: Server / Client.

The router supports an individual DHCP server for each Ethernet interface. The Mikrotik server with the main functions is to provide a client with assignments of an IP address with its respective IP mask, as well as the address of the gateway and the DNS server.

The interface that hosts the DHCP server must have its own IP address and at the same time must not be included in the pool of addresses that clients will receive when they request it.

The DHCP protocol is located at the Network layer of the protocol map.

DHCP communication scenario

  • DHCP Server always listens on port 67/UDP.
  • DHCP Client listens on port 68/UDP.
  • The initial negotiation involves communication between broadcast addresses.
  • In some phases the sender uses source address 0.0.0.0 and/or destination addresses 255.255.255.255.
  • Care must be taken of this when building a firewall.

The process for assigning an IP address to a client is as follows:

DHCP-DISCOVER.
src-mac= , dst-mac= , protocol=udp, src-ip=0.0.0.0:68, dst-ip=255.255.255.255:67
DHCP-OFFER.
src-mac= , dst-mac= , protocol=udp, src-ip= :67, dst-ip=255.255.255.255:67
DHCP-REQUEST.
src-mac= , dst-mac= , protocol=udp, src-ip=0.0.0.0:68, dst-ip=255.255.255.255:67
DHCP-ACKNOWLEGMENT.
src-mac= , dst-mac= , protocol=udp, src-ip= :67, dst-ip=255.255.255.255:67
DHCP Server process for IP address assignment

DHCP Server Setup

The interface that is to be configured as DHCP-Server must have its own address and at the same time that address must not be included in the pool of an address. A pool is a range of addresses that will be available to clients.

In the DHCP-Server window, press the DHCP Setup button and then continue with the requested requirements:

1. Interface to which the DHCP server will be assigned:

DHCP MikroTik 1. Interface to which the DHCP server will be assigned

2. Network address:

DHCP MikroTIk Setup Network Address

3. Gateway:

4. Address pool for DHCP clients:

DHCP Setup MikroTik DHCP address pool

5. DNS server (more than one can be used):

6. Time of assignments:

DHCP Setup MikroTik Lease Time Address allocation time

7. Then we press next and in this way the process ends:

DHCP Setup MikroTik complete configuration

In the window you can see the DHCP server created.

In this automatic configuration (by running DHCP Setup) the following parameters are generated:

  • An address pool is created: a group of addresses to assign to clients.
  • The DHCP server is created: its name and parameters (such as the interface that will accept requests from clients).
  • The address space is created: the network IP address and various parameters.

IMPORTANT NOTE: if you have a bridge environment, the DHCP server must be configured on the bridge interface. If the DHCP Server is configured on a port that is part of the bridge, the DHCP server will not work.

DHCP Client

DHCP MikroTik DHCP CLIENT configuration

Allows an Ethernet interface to request an IP address

  • A remote DHCP Server will deliver:
      • IP adress
      • Mask and Gateway
      • DNS server addresses
  • The DHCP Client will provide these options
      • Hostname
      • Client ID (in this case, the MAC address)
There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

1 comment on “Chapter 2.4 – DHCP Server and DHCP Client”

Leave your comment

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

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

Present in several = 15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

Present in several = 20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

Present in several = 30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

Present in several = 17%

all MikroTik OnLine courses

CW23-AX

Present in several = 30%

all Academy courses

CW23-LIB

Present in several = 25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

Present in several = 22%

all MikroTik OnLine courses

BF23-AX

Present in several = 35%

all Academy courses

BF23-LIB

Present in several = 30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011