MikroTik DHCP Server Setup Guide

This guide aims to effectively demonstrate the steps required to setup a simple DHCP server on MikroTik RouterOS.

Step 1:

Before we start with the DHCP server, there are two considerations we need to take into account. 1, what IP subnet are we going to use for our LAN range that DHCP hands out? 2, what interface is the DHCP server going to live on?

In my case, I will be using 10.0.0.0/24 for my LAN range, and the DHCP server will live on my LAN bridge, which my wireless interface is a part of.

To start, I’ll add an IP address and subnet to my bridge interface. To do this, navigate to IP > Addresses, and click on the + button to add a new IP address.

Type the IP address you want to assign to your interface, and the corresponding CIDR notation. In my case, 10.0.0.1/24. In the Interface drop down menu, select the interface that this IP is getting assigned to. By doing this, we are assigning 10.0.0.1 to the LAN bridge interface. This is the IP address that LAN devices will use as their gateway, and the IP address they use to reach the router. You may leave the Network field blank if a CIDR notation is included on the Address. Once you hit Apply, the router will automatically work out the network address.

Step 2:

With the IP address and subnet added to the routers LAN interface, we can start with step 2, which is to setup the DHCP server.

Navigate to IP > DHCP Server, and click on DHCP Setup. This will open the DHCP server setup wizard.

Set the DHCP Server Interface to the same interface you put your LAN IP range on. > Next.

The DHCP Address Space in most cases will be automatically worked out based on the LAN subnet on the interface, but in some cases especially if you have multiple things going on, on the same interface, you might need to specify this manually. This needs to be the LAN subnet, so in my case 10.0.0.0/24. > Next.

The Gateway for DHCP Network needs to be the IP address that you put in your LAN interface. No CIDR notation required. > Next.

Addresses to Give Out directly relates to the IP pool that gets created by the DHCP Setup wizard. This is where you need to decide how many IP addresses your DHCP server hands out, and where the range starts and ends for your LAN subnet. In my example, I am allowing the DHCP server to use IP addresses from 10.0.0.20/24 up till 10.0.0.254/24. The range has to be within the LAN subnet.

Side Note: There isn’t a way to split up this pool in the DHCP Setup wizard, but afterwards you can go to IP > Pools and edit the pool to split it up further or add a second pool.

To add DHCP exclusion please see my Mikrotik DHCP Lease Exclusions guide.

The DNS Servers can be the routers LAN IP, or an external DNS server. Ensure that if you use your routers LAN IP to Allow Remote Requests on your DNS server settings.

Lease Time depends on a few factors, but for the most part anywhere from a few hours to half an hour should be ok. If the network is busy, and there are constantly new devices connecting you might want to use a shorter lease time, or create a larger LAN subnet.

DHCP lease time is the time that the DHCP server will reserve an IP address for a specific device. If the device is connected, and remains connected it will renew its lease time with the router once half the lease time has elapsed. If the device disconnects, the router will hold onto the lease until the time runs out. This can cause issues if you have a bunch of leases kept in the lease table that aren’t being used and you run out of addresses. A shorter lease time can help to mitigate this a bit by killing leases quickly once they expire.

Once the DHCP Setup wizard is done, you can press OK and you will see your new DHCP server under the DHCP tab.

If you navigate to IP > Pools, you can see info about the IP addresses that the DHCP server is handing out.

Once devices connect up to your DHCP server, you will be able to find information about them in your DHCP leases table. Navigate to IP > DHCP Server, and click on the Leases tab to find this.

As far as a simple DHCP server, this is all that is required to host a simple one on a MikroTik router.