Skip to content
MikroTik RouterOS Docs

IPv6 DHCP Server (DHCPv6) in RouterOS: Configuration Guide

IPv6 DHCP Server (DHCPv6) in RouterOS: Configuration Guide

Section titled “IPv6 DHCP Server (DHCPv6) in RouterOS: Configuration Guide”

The DHCPv6 server in MikroTik RouterOS enables automatic IPv6 resource distribution to clients. It supports two primary modes:

  • Prefix Delegation (DHCPv6-PD): Delegates IPv6 prefixes to downstream routers, which then distribute addresses to their networks via SLAAC or their own DHCPv6 server
  • Stateful Address Assignment: Assigns individual IPv6 addresses (/128) directly to clients

DHCPv6 is commonly used by ISPs to delegate prefixes to customer routers, or in enterprise environments where centralized address management is required.

Key concept: DHCPv6 does NOT provide default gateway information. Clients receive their default gateway through Router Advertisements (RA), which must be configured separately using Neighbor Discovery (/ipv6 nd).

Before configuring the DHCPv6 server:

  1. Enable the IPv6 package:

    /system package enable ipv6
    /system reboot
  2. Verify package is active:

    /system package print where name=ipv6
  3. Have an IPv6 address block to distribute:

    • Your own IPv6 allocation (from RIR or ISP)
    • A prefix delegated from your upstream provider
┌─────────────────────────────────────────────────────────────────────┐
│ Your MikroTik Router │
│ │
│ IPv6 Pool ──────────────────▶ DHCPv6 Server ◀──── ND/RADVD │
│ (2001:db8::/48) (Prefix/Address) (Gateway via RA) │
└─────────────────────────────────────────────────────────────────────┘
│ │
│ Prefix: 2001:db8:1::/60 │ Gateway: fe80::1
▼ ▼
┌─────────────────────────────────────────────────────────────────────┐
│ Downstream Router (Client) │
│ │
│ DHCPv6 Client ──▶ IPv6 Pool ──▶ LAN Addresses (SLAAC) │
│ (Receives /60) (From /60) (Assigns /64s to clients) │
└─────────────────────────────────────────────────────────────────────┘
MenuPurpose
/ipv6 dhcp-serverDHCPv6 server configuration
/ipv6 dhcp-server bindingView/manage client bindings
/ipv6 poolIPv6 address pools for delegation
/ipv6 ndNeighbor Discovery (Router Advertisements)
PropertyTypeDefaultDescription
namestring-Server identifier (required)
interfacestring-Interface to serve DHCPv6 (required)
address-poolstring-Pool for address assignment (/128 prefixes)
prefix-poolstring-Pool for prefix delegation
lease-timetime3dHow long clients can use assigned resources
preferenceinteger:0-255-Server priority (higher = preferred)
rapid-commityes/noyesEnable two-message exchange (faster)
route-distanceinteger-Distance for routes to DHCPv6 clients
use-radiusno/yes/accountingnoRADIUS integration for authentication/accounting
disabledyes/nonoEnable/disable server
PropertyTypeDefaultDescription
namestring-Pool identifier (required)
prefixIPv6 prefix-Parent prefix to allocate from
prefix-lengthinteger:1-128-Size of delegated prefixes (e.g., 64 for /64s)
PropertyTypeDescription
addressIPv6 prefixAssigned prefix or address
duidhex stringClient’s unique identifier
iaidintegerIdentity Association Identifier
serverstringDHCPv6 server name
statusenumwaiting, offered, or bound
rate-limitrx/txBandwidth limit for this binding

Example 1: Prefix Delegation for Downstream Routers

Section titled “Example 1: Prefix Delegation for Downstream Routers”

Delegate /60 prefixes from a /48 block to customer routers:

# Step 1: Create IPv6 pool for prefix delegation
/ipv6 pool add name=customer-pool prefix=2001:db8::/48 prefix-length=60
# Step 2: Create DHCPv6 server for prefix delegation
/ipv6 dhcp-server add name=dhcpv6-pd interface=ether2-customers \
prefix-pool=customer-pool lease-time=1d
# Step 3: Verify server is running
/ipv6 dhcp-server print

Expected output:

# NAME INTERFACE ADDRESS-POOL PREFIX-POOL LEASE-TIME
0 dhcpv6-pd ether2-customers customer-pool 1d

Note: The server automatically installs routes to assigned prefixes in the routing table.

Assign individual IPv6 addresses to clients (useful when SLAAC is not desired):

# Step 1: Create pool with /128 prefix-length for addresses
/ipv6 pool add name=address-pool prefix=2001:db8:100::/64 prefix-length=128
# Step 2: Create DHCPv6 server for address assignment
/ipv6 dhcp-server add name=dhcpv6-addr interface=bridge-lan \
address-pool=address-pool lease-time=12h
# Step 3: Configure ND to tell clients to use DHCPv6 for addresses
/ipv6 nd set [find interface=bridge-lan] managed-address-configuration=yes
# Step 4: Optionally disable SLAAC (autonomous addressing)
/ipv6 nd prefix set [find interface=bridge-lan] autonomous=no

Example 3: Combined Address and Prefix Delegation

Section titled “Example 3: Combined Address and Prefix Delegation”

Provide both addresses and prefixes to clients:

# Step 1: Create pools
/ipv6 pool add name=addr-pool prefix=2001:db8:1::/64 prefix-length=128
/ipv6 pool add name=prefix-pool prefix=2001:db8:2::/48 prefix-length=60
# Step 2: Create DHCPv6 server with both pools
/ipv6 dhcp-server add name=dhcpv6-full interface=ether2 \
address-pool=addr-pool prefix-pool=prefix-pool lease-time=1d

Delegate prefixes to PPPoE clients using PPP profiles:

# Step 1: Create IPv6 pool
/ipv6 pool add name=pppoe-pd-pool prefix=2001:db8::/48 prefix-length=60
# Step 2: Create PPP profile with DHCPv6-PD enabled
/ppp profile add name=pppoe-ipv6 local-address=pool-pppoe \
dhcpv6-pd-pool=pppoe-pd-pool
# Step 3: Create PPPoE server using the profile
/interface pppoe-server server add interface=ether1 \
default-profile=pppoe-ipv6 service-name=pppoe-service

Note: PPP automatically creates a dynamic DHCPv6-PD server when clients connect.

Example 5: Static Binding for Specific Client

Section titled “Example 5: Static Binding for Specific Client”

Reserve a specific prefix for a known client:

# Step 1: Find client's DUID from current bindings
/ipv6 dhcp-server binding print detail
# Step 2: Convert dynamic binding to static
/ipv6 dhcp-server binding make-static [find duid=0x00010001...]
# Step 3: Or create static binding manually
/ipv6 dhcp-server binding add server=dhcpv6-pd \
duid=0x00010001abcd1234 address=2001:db8:1::/60

Limit bandwidth per client binding:

# Step 1: Convert binding to static
/ipv6 dhcp-server binding make-static [find duid=0x00010001...]
# Step 2: Set rate limit (rx/tx in bits per second)
/ipv6 dhcp-server binding set [find duid=0x00010001...] \
rate-limit=10M/5M
# Step 3: Enable dual-stack queue (optional, combines IPv4/IPv6)
/ipv6 dhcp-server set [find] allow-dual-stack-queue=yes

Execute a script when bindings change:

/ipv6 dhcp-server add name=dhcpv6-pd interface=ether2 \
prefix-pool=customer-pool script={
:if ($bindingBound = 1) do={
:log info "DHCPv6: Prefix $bindingPrefix bound to $bindingDUID"
} else={
:log warning "DHCPv6: Prefix released by $bindingDUID"
}
}

Available script variables:

VariableDescription
bindingBound1 = bound, 0 = unbound
bindingServerNameDHCPv6 server name
bindingDUIDClient’s DUID
bindingAddressAssigned address (if applicable)
bindingPrefixDelegated prefix (if applicable)

The prefix-length property determines what size prefixes are delegated:

Pool Prefixprefix-lengthResultAvailable Prefixes
/4860Delegates /60s4,096 clients
/4856Delegates /56s256 clients
/4852Delegates /52s16 clients
/5660Delegates /60s16 clients
/5664Delegates /64s256 clients
/64128Assigns addresses18 quintillion addresses

Example: ISP with /32 allocating /56 per customer:

/ipv6 pool add name=isp-pool prefix=2001:db8::/32 prefix-length=56
# Result: 16 million /56 prefixes available

Symptom: DHCPv6 server is running but clients stay in “searching” state.

Causes:

  1. Firewall blocking UDP port 547 (server) or 546 (client)
  2. Wrong interface specified
  3. Pool exhausted

Solutions:

# Add firewall rule for DHCPv6 server
/ipv6 firewall filter add chain=input dst-port=547 protocol=udp \
action=accept comment="Allow DHCPv6 server"
# Verify interface is correct
/ipv6 dhcp-server print
# Check pool usage
/ipv6 pool used print

Problem 2: Routes Not Installed for Delegated Prefixes

Section titled “Problem 2: Routes Not Installed for Delegated Prefixes”

Symptom: Server delegates prefix but traffic doesn’t route to client.

Cause: Route installation disabled or distance too high.

Solution:

# Check if routes are being installed
/ipv6 route print where dynamic
# Set appropriate route distance
/ipv6 dhcp-server set [find] route-distance=1

Symptom: Client receives prefix but has no connectivity.

Cause: Client not receiving default gateway (Router Advertisements disabled).

Solution:

# On the DHCPv6 server side - ensure ND is configured
/ipv6 nd print
# Should show interface with RA enabled
# On client side - ensure RA acceptance is enabled
/ipv6 settings set accept-router-advertisements=yes

Problem 4: Binding Shows “waiting” Indefinitely

Section titled “Problem 4: Binding Shows “waiting” Indefinitely”

Symptom: Static binding never transitions to “bound” status.

Causes:

  1. Incorrect DUID format
  2. Client not requesting resources
  3. IAID mismatch

Solution:

# Verify DUID from working dynamic binding first
/ipv6 dhcp-server binding print detail where status=bound
# Match DUID format exactly (include 0x prefix)
/ipv6 dhcp-server binding set [find] duid=0x00010001...

Symptom: “no free prefixes” error, new clients cannot connect.

Solutions:

# Check pool usage
/ipv6 pool used print
# Remove stale bindings
/ipv6 dhcp-server binding remove [find status!=bound]
# Reduce lease time to reclaim prefixes faster
/ipv6 dhcp-server set [find] lease-time=4h
# Or expand pool if possible
AspectDHCPv6 ServerSLAAC (ND)
Address SourceCentral serverClient generates from prefix
ManagementCentralized, trackable bindingsDecentralized, harder to track
Prefix DelegationSupportedNot applicable
Best ForISPs, large networksHome/small office
LoggingFull binding historyLimited (neighbor table)
ConfigurationMore complexSimple (advertise=yes)
# Check DHCPv6 server status
/ipv6 dhcp-server print
# View all bindings
/ipv6 dhcp-server binding print
# View binding details
/ipv6 dhcp-server binding print detail
# Check pool allocation
/ipv6 pool print
/ipv6 pool used print
# Verify routes to delegated prefixes
/ipv6 route print where dynamic
# Check ND configuration
/ipv6 nd print
# Force client reconfiguration (if supported)
/ipv6 dhcp-server binding send-reconfigure [find]

DHCPv6 uses UDP ports:

  • 546: Client port
  • 547: Server port
# Allow DHCPv6 server traffic
/ipv6 firewall filter add chain=input protocol=udp dst-port=547 \
action=accept comment="DHCPv6 server" place-before=0
# Allow DHCPv6 client responses (if router is also a client)
/ipv6 firewall filter add chain=input protocol=udp dst-port=546 \
action=accept comment="DHCPv6 client" place-before=0
  • RADIUS - authentication and accounting

The RouterOS DHCPv6 server provides:

  1. Prefix Delegation: Delegate blocks of addresses to downstream routers
  2. Address Assignment: Assign individual addresses to clients
  3. RADIUS Integration: Optional authentication and accounting
  4. Rate Limiting: Per-client bandwidth control

Key points:

  • Create IPv6 pools first, then reference them in the server configuration
  • prefix-length in pools determines the size of delegated prefixes
  • DHCPv6 does NOT provide default gateway - configure ND separately
  • Use managed-address-configuration=yes in ND to signal clients to use DHCPv6
  • Static bindings allow reservations for specific clients
  • Routes to delegated prefixes are installed automatically