Skip to content
MikroTik RouterOS Docs

Basic DHCP Server Setup

For the impatient: here’s the 30-second version.

# Minimal DHCP server on ether2
/ip address add address=192.168.88.1/24 interface=ether2
/ip pool add name=dhcp-pool ranges=192.168.88.10-192.168.88.254
/ip dhcp-server network add address=192.168.88.0/24 gateway=192.168.88.1 dns-server=192.168.88.1
/ip dhcp-server add name=dhcp-lan interface=ether2 address-pool=dhcp-pool lease-time=1d disabled=no

This guide demonstrates how to configure a basic DHCP server on MikroTik RouterOS to automatically distribute IP addresses to devices on your local network. A DHCP server eliminates the need to manually configure IP addresses on each client device.

  • A MikroTik router running RouterOS 7.x or later
  • An interface configured with a static IP address (this will be the gateway)
  • Access to the router via SSH, WinBox, or WebFig

Note: In this example, we use ether2 as the LAN interface. In a staging environment, ether1 is typically reserved for management/WAN access.

Step 1: Assign an IP Address to the Interface

Section titled “Step 1: Assign an IP Address to the Interface”

Before configuring the DHCP server, ensure the interface has a static IP address. This address will serve as the gateway for DHCP clients.

/ip address add address=192.168.88.1/24 interface=ether2 comment="LAN Gateway"

This assigns 192.168.88.1 with a /24 subnet mask to ether2 (LAN interface).

Create a pool of IP addresses that the DHCP server will distribute to clients. The pool should NOT include the gateway address.

/ip pool add name=dhcp-pool ranges=192.168.88.10-192.168.88.254

This creates a pool named “dhcp-pool” with addresses from 192.168.88.10 to 192.168.88.254 (245 available addresses).

Define the network parameters that will be sent to DHCP clients, including the gateway and DNS servers.

/ip dhcp-server network add address=192.168.88.0/24 gateway=192.168.88.1 dns-server=192.168.88.1 comment="LAN Network"

This tells clients:

  • Their network is 192.168.88.0/24
  • The gateway is 192.168.88.1
  • The DNS server is 192.168.88.1 (the router itself)

Create the DHCP server and bind it to the interface and address pool.

/ip dhcp-server add name=dhcp-lan interface=ether2 address-pool=dhcp-pool lease-time=1d disabled=no

This creates a DHCP server named “dhcp-lan” on ether2 with a 1-day lease time.

Confirm your DHCP server is working by running these commands:

/ip dhcp-server print

Expected Output:

Flags: D - dynamic, X - disabled, I - invalid
# NAME INTERFACE RELAY ADDRESS-POOL LEASE-TIME ADD-ARP
0 dhcp-lan ether2 dhcp-pool 1d no

The server should appear without the “X” (disabled) flag.

/ip pool print

Expected Output:

# NAME RANGES
0 dhcp-pool 192.168.88.10-192.168.88.254
/ip dhcp-server network print

Expected Output:

# ADDRESS GATEWAY DNS-SERVER
0 192.168.88.0/24 192.168.88.1 192.168.88.1

Check 4: View Active Leases (after clients connect)

Section titled “Check 4: View Active Leases (after clients connect)”
/ip dhcp-server lease print

Expected Output (when clients are connected):

Flags: D - dynamic, B - blocked
# ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS
0 D 192.168.88.10 AA:BB:CC:DD:EE:FF client1 dhcp-lan bound

Solution: Enable the server with /ip dhcp-server enable dhcp-lan

Problem: Clients not receiving IP addresses

Section titled “Problem: Clients not receiving IP addresses”

Solution:

  1. Verify the interface name is correct
  2. Check that the address pool has available addresses
  3. Ensure no firewall rules are blocking DHCP traffic (UDP ports 67-68)

Problem: Clients receive IP but cannot access the internet

Section titled “Problem: Clients receive IP but cannot access the internet”

Solution:

  1. Verify NAT masquerade is configured for the interface
  2. Check that the gateway address is correct in the network configuration
  3. Ensure DNS is working: /ip dns print

Solution:

  1. Increase the pool range
  2. Reduce the lease time to free up addresses faster
  3. Remove stale leases: /ip dhcp-server lease remove [find status=waiting]
  • DHCP Client - obtain IP address from upstream DHCP server
  • DHCP Relay - forward DHCP requests across network segments
  • IP Pools - advanced pool configuration options