Thursday, May 20, 2021

Mikrotik DHCP Configuration

The DHCP server is used to automatically manage the IP assignment process. We can manage the IP assignment process manually if the network size is not so big. Maybe there are 20, 30, or 50 users in that network. In that case, we can manage the IP assignment process manually. But if the users' number is 100 or above then it will be very difficult to manage the IP assignment process. In this situation, the DHCP server will play an important role to make this thing easier.

In this tutorial, we will learn how to configure the DHCP server in the Mikrotik router. We will go through the step-by-step DHCP server configuration process in the Mikrotik router.

Mikrotik router has a built-in package to enable the DHCP server. If we want we can use other DHCP servers also.

Now we will enable the DHCP Server service on this router. Go to the "IP" section from the menu and then select the "DHCP Server" from the sub-menu. After opening the "DHCP" server interface, navigate to the "DHCP" tab and then click on the "DHCP Setup" wizard.


We will configure the DHCP server in our "Ether-2" interface so that my LAN users can receive the IP address from this DHCP server. We will select "Ether-2" for the "DHCP Server Interface" parameter value. Then click on the "Next" button.


Now we will write the network address that we want to provide through this DHCP server. For an example, our LAN network will be 192.168.1.0/24. And then click on "Next".


At this step, we have to write the gateway address for our LAN users. The "Ether-2" interface of the Mikrotik router will be the gateway for our LAN users. It receives all the internet traffic requests from the LAN users and then forwards them to the ISP's network. So the gateway IP address will be for our LAN users is 192.168.1.254. Because this IP address is used in our "Ether-2" interface.


Now we have to provide the address range that we want to allocate to our LAN users. Our address range will be "192.168.1.1"-"192.168.1.253". LAN users should receive the IP address from this address range. Here notice one thing, we didn't add our "Ether-2" IP address (192.168.1.254) within this range. Because this address is already being used. If the DHCP server is allocated this 192.168.1.254 address to someone then there will be a conflict with that "Ether-2" interface. That's why we remove it from our address range


Later, we can change this address pool from the IP -> Pool menu. 

At this step, we will write our DNS server address to provide our LAN users through this DHCP server. For an example, our DNS server address will be "10.16.16.5".


Now we will specify how long an address will remain with the LAN users. This is called the "Lease time". After this lease time is expired, LAN users will have to renew their IP address. Here I will leave the default setting.


After click on the "Next", this DHCP server will add to the list and it will be ready to provide the IP address to the LAN users.

All the work is done. Now any LAN user should get their IP address automatically from this router.

You can modify any settings after creating the DHCP server. Just double click on that server from the list and you will find the DHCP server properties interface. Here, you can modify the server name, DHCP server interface, Lease time, Address pool and so many things.


If you want you can create a new or modify an existing address pool for the DHCP server. To do that, go to the “IP” option from the menu and then select “Pool” from the sub-menu. 


In the "Used Addresses" tab you can see the list of addresses which is provided by the DHCP server to the clients. 


That's all.

No comments:

Post a Comment