GUIDE / LOCAL NETWORK / DHCP

DHCP.

The RouterOS DHCP server hands out IPv4 leases to LAN clients. This page covers the basic shape, static leases (reservations), tuning the lease time, and the most common follow-up question — "why did this device get a different IP after a reboot?".

Basic setup

Quick Set creates a DHCP server on the bridge automatically. From a blank reset you do it in four commands: pool, network, server, then bind to an interface.

v6 4 lines · 284 bytes
/ip pool add name=lan-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=lan-dhcp interface=bridge-local address-pool=lan-pool lease-time=1d
/ip dhcp-server enable lan-dhcp
v7 4 lines · 284 bytes
/ip/pool add name=lan-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=lan-dhcp interface=bridge-local address-pool=lan-pool lease-time=1d
/ip/dhcp-server/enable lan-dhcp

Static leases (reservations)

Tie a specific MAC to a specific IP. The client still uses DHCP — it just always gets the same address.

v6 5 lines · 132 bytes
/ip dhcp-server lease add \
  mac-address=AA:BB:CC:DD:EE:FF \
  address=192.168.88.50 \
  server=lan-dhcp \
  comment="alice-laptop"
v7 5 lines · 132 bytes
/ip/dhcp-server/lease add \
  mac-address=AA:BB:CC:DD:EE:FF \
  address=192.168.88.50 \
  server=lan-dhcp \
  comment="alice-laptop"

Two gotchas:

  • The static IP should be outside the pool range (e.g. pool is 88.10–88.254, static lease at 88.50 works because the pool sees it as taken — but be deliberate). Cleaner: shrink the pool to 88.100–88.254 and keep 88.10–88.99 for reservations.
  • Many phones rotate MAC addresses for privacy. Static leases by MAC stop working when the phone enables "private Wi-Fi address" / "MAC randomization". Pin the option off on devices you want stable reservations for.

Lease time

The default of 1 day is fine for stable LANs. Considerations:

  • Short (1h–8h) when the pool is small or churn is high (guest networks). Devices that leave early give the IP back faster.
  • Long (1d–7d) for stable home / office LANs. Less DHCP traffic; devices keep the same IP across reboots when the previous lease is still valid.
  • Static (no DHCP) for servers that should never depend on the DHCP server being up. Set the IP statically on the device.

DHCP options

The basic three (gateway, DNS, NTP) cover most cases. Options live in /ip dhcp-server option and are bound either globally or per-lease. Common ones:

  • NTP servers (option 42) — point clients at your router for time, or at an external NTP pool.
  • Domain name (option 15) — sets the search-domain suffix for clients. home.local, internal, whatever you've picked.
  • TFTP server (option 66) — for PXE-booting clients / VoIP phone provisioning. Niche.
v6 2 lines · 155 bytes
/ip dhcp-server option add name=ntp-servers code=42 value="'$(/system clock get time-server-active)'"
/ip dhcp-server network set 0 dhcp-option=ntp-servers
v7 2 lines · 155 bytes
/ip/dhcp-server/option add name=ntp-servers code=42 value="'$(/system/clock get time-server-active)'"
/ip/dhcp-server/network set 0 dhcp-option=ntp-servers

Inspecting current leases

v6 3 lines · 137 bytes
/ip dhcp-server lease print
# Add a column with last-seen so you can spot stale entries:
/ip dhcp-server lease print detail where dynamic
v7 2 lines · 76 bytes
/ip/dhcp-server/lease print
/ip/dhcp-server/lease print detail where dynamic

The status column is the one you usually care about: bound = currently leased; waiting = client asked, server hasn't replied yet (rare); offered = mid- handshake; last-seen tells you when a device last renewed. A stale bound entry that hasn't been seen in days is a candidate for cleanup (or for a static lease if the device is permanent).

Multiple DHCP servers (one per VLAN)

Each VLAN with its own subnet gets its own DHCP server. The shape repeats — pool, network, server, bind:

v7 5 lines · 328 bytes
# IoT VLAN — tight pool, short lease, no LAN gateway exposed
/ip/pool add name=iot-pool ranges=10.20.0.10-10.20.0.250
/ip/dhcp-server/network add address=10.20.0.0/24 gateway=10.20.0.1 dns-server=10.20.0.1
/ip/dhcp-server add name=iot-dhcp interface=vlan-iot address-pool=iot-pool lease-time=4h
/ip/dhcp-server/enable iot-dhcp

The IoT DHCP server hands out its own gateway (the IoT VLAN's router-side address). Inter-VLAN traffic is controlled by the forward chain — see VLANs.

DHCP relay

If the DHCP server lives somewhere other than the LAN gateway, the router can relay broadcasts to it. Niche — most setups put the DHCP server ON the router. If you genuinely need relay (e.g. a central Windows DHCP server in a multi-site setup):

v7 2 lines · 108 bytes
/ip/dhcp-relay add name=lan-relay interface=bridge-local \
  dhcp-server=10.0.0.5 local-address=192.168.88.1