Skip to content
MikroTik RouterOS Docs

IPv6 DHCP Client (DHCPv6) in RouterOS: A Complete Guide

IPv6 DHCP Client (DHCPv6) in RouterOS: A Complete Guide

Section titled β€œIPv6 DHCP Client (DHCPv6) in RouterOS: A Complete Guide”

RouterOS Version: 7.x+ Difficulty: Intermediate Estimated Time: 30 minutes

The IPv6 DHCP client (DHCPv6) enables automatic IPv6 address and prefix acquisition from upstream providers. Unlike IPv4 DHCP which provides addresses, gateway, and DNS together, IPv6 splits these responsibilities:

  • DHCPv6 provides addresses (IA_NA) and/or prefix delegation (IA_PD)
  • Router Advertisements (RA) provide the default gateway
  • DNS can come from either DHCPv6 or RA

The most common use case is Prefix Delegation (DHCP-PD), where your ISP delegates a block of addresses (typically /48, /56, or /60) that you can distribute across your internal networks.

Critical concept: DHCPv6 does NOT provide default gateway information. You MUST enable Router Advertisement acceptance (accept-router-advertisements=yes) for IPv6 internet connectivity.

Before configuring DHCPv6:

  1. Enable the IPv6 package:

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

    /system package print where name=ipv6
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ISP Network β”‚
β”‚ β”‚
β”‚ DHCPv6 Server ─────────────── Router Advertisement ──────────── β”‚
β”‚ (Prefix Delegation) (Default Gateway) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚
β”‚ Prefix: 2001:db8::/56 β”‚ Gateway: fe80::1
β–Ό β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Your MikroTik Router β”‚
β”‚ β”‚
β”‚ DHCPv6 Client ──▢ IPv6 Pool ──▢ LAN Addresses β”‚
β”‚ (ether1-wan) (isp-pool) (bridge: ::1/64 from pool) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”‚ RA with prefix 2001:db8:0:1::/64
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ LAN Devices β”‚
β”‚ (SLAAC: 2001:db8:0:1:xxxx:xxxx:xxxx:xxxx) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
MenuPurpose
/ipv6 dhcp-clientDHCPv6 client configuration
/ipv6 poolIPv6 address pools (auto-created by PD)
/ipv6 addressIPv6 addresses (use from-pool for PD)
/ipv6 settingsGlobal IPv6 settings (RA acceptance)
PropertyTypeDefaultDescription
interfacestring-WAN interface for DHCPv6 (required)
requestprefix, address-What to request from server
pool-namestring-Pool name to store delegated prefix
pool-prefix-lengthinteger-Size of allocations from pool (typically 64)
prefix-hintIPv6 prefix-Preferred prefix size hint to ISP (e.g., ::/56)
add-default-routeyes/nonoAdd default route from DHCPv6 (NOT recommended)
use-peer-dnsyes/noyesAccept DNS servers from DHCPv6
disabledyes/nonoEnable/disable client

This is the standard residential/SMB setup:

# Step 1: Enable Router Advertisement acceptance (CRITICAL)
/ipv6 settings set accept-router-advertisements=yes
# Step 2: Create DHCPv6 client for prefix delegation
/ipv6 dhcp-client add interface=ether1-wan request=prefix \
pool-name=isp-pool pool-prefix-length=64
# Step 3: Verify prefix received
/ipv6 dhcp-client print

Expected output:

# INTERFACE STATUS PREFIX
0 ether1-wan bound 2001:db8:abcd::/56
# Step 4: Assign address to LAN from pool
/ipv6 address add address=::1/64 from-pool=isp-pool interface=bridge advertise=yes
# Step 5: Verify default route (comes from RA, not DHCPv6)
/ipv6 route print where dst-address="::/0"

Expected: Route with fe80::... gateway (link-local address is normal).

For ISPs using PPPoE with IPv6:

# Step 1: Create PPPoE client
/interface pppoe-client add name=pppoe-wan interface=ether1 \
user=myuser password=mypass
# Step 2: Enable RA acceptance
/ipv6 settings set accept-router-advertisements=yes
# Step 3: Create DHCPv6 client on PPPoE interface
/ipv6 dhcp-client add interface=pppoe-wan request=prefix \
pool-name=pppoe-pool pool-prefix-length=64
# Step 4: Assign LAN address from pool
/ipv6 address add address=::1/64 from-pool=pppoe-pool interface=bridge advertise=yes

Some ISPs provide both a WAN address and a delegated prefix:

/ipv6 dhcp-client add interface=ether1-wan request=address,prefix \
pool-name=isp-pool pool-prefix-length=64 use-peer-dns=yes

Verify both were received:

/ipv6 dhcp-client print detail

Look for both address and prefix fields populated.

When ISP provides a larger prefix (/48 or /56), distribute across VLANs:

# Step 1: Request prefix with size hint
/ipv6 dhcp-client add interface=ether1-wan request=prefix \
pool-name=isp-pool pool-prefix-length=64 prefix-hint=::/56
# Step 2: Assign to multiple VLANs (each gets unique /64)
/ipv6 address add address=::1/64 from-pool=isp-pool interface=vlan10 advertise=yes
/ipv6 address add address=::1/64 from-pool=isp-pool interface=vlan20 advertise=yes
/ipv6 address add address=::1/64 from-pool=isp-pool interface=vlan30 advertise=yes
# Step 3: Verify each VLAN got different /64
/ipv6 address print where from-pool=isp-pool
/ipv6 dhcp-client add interface=ether1-wan request=prefix \
pool-name=isp-pool pool-prefix-length=64 use-peer-dns=no
# Set custom DNS
/ip dns set servers=2606:4700:4700::1111,2606:4700:4700::1001

Execute a script when prefix is acquired or lost:

/ipv6 dhcp-client add interface=ether1-wan request=prefix \
pool-name=isp-pool pool-prefix-length=64 script={
:if ($"pd-valid" = 1) do={
:log info "DHCPv6: Prefix acquired: $\"pd-prefix\""
# Add custom actions here
} else={
:log warning "DHCPv6: Prefix lost!"
# Add recovery actions here
}
}

Available script variables:

VariableDescription
pd-valid1 = prefix valid, 0 = prefix removed
pd-prefixThe delegated prefix (e.g., 2001:db8::/56)
na-valid1 = address valid, 0 = address removed
na-addressThe assigned IPv6 address

Ensure firewall allows DHCPv6 client traffic:

/ipv6 firewall filter add chain=input dst-port=546 protocol=udp \
action=accept comment="Allow DHCPv6 client" place-before=0

Note: Some ISPs send DHCPv6 from global addresses (not link-local). If using a firewall rule with src-address=fe80::/10, change it to in-interface=ether1-wan instead.

These are commonly confused:

PropertyPurposeExample
prefix-hintTell ISP what size prefix you want::/56 requests a /56
pool-prefix-lengthSize of allocations FROM the pool64 means pool gives out /64s

Example: ISP gives you a /56. You want to assign /64s to each VLAN:

/ipv6 dhcp-client add interface=ether1-wan request=prefix \
pool-name=isp-pool \
prefix-hint=::/56 \ # Request /56 from ISP
pool-prefix-length=64 # Allocate /64s from pool

Problem 1: No Internet Despite β€œBound” Status

Section titled β€œProblem 1: No Internet Despite β€œBound” Status”

Symptom: DHCPv6 shows bound but no IPv6 connectivity.

Cause: Missing default route because Router Advertisements are disabled.

Solution:

/ipv6 settings set accept-router-advertisements=yes

Verify:

/ipv6 route print where dst-address="::/0"

Should show route with fe80:: gateway.

Causes:

  1. Firewall blocking UDP port 546
  2. ISP not providing DHCPv6
  3. ISP device in gateway mode (not bridge)

Solutions:

# Add firewall rule
/ipv6 firewall filter add chain=input dst-port=546 protocol=udp action=accept place-before=0
# Check ISP provides DHCPv6 (contact ISP)
# Put ISP modem in bridge mode if possible

Symptom: DHCPv6 works on some ISPs but not others.

Cause: Default firewall rule restricts DHCPv6 to link-local sources, but some ISPs (like Comcast) use global addresses.

Solution:

# Instead of: src-address=fe80::/10
# Use: in-interface=ether1-wan
/ipv6 firewall filter set [find comment~"DHCPv6"] in-interface=ether1-wan

Cause: pool-prefix-length not set or set incorrectly.

Solution:

/ipv6 dhcp-client set [find] pool-prefix-length=64

This ensures /64s are allocated from the pool (not the entire prefix as one block).

Cause: This property is a workaround that often fails.

Solution:

# Don't use add-default-route
/ipv6 dhcp-client set [find] add-default-route=no
# Instead, enable RA acceptance
/ipv6 settings set accept-router-advertisements=yes

Cause: DNS may also come from Router Advertisements.

Solution: Wait for prefix renewal, or release/renew:

/ipv6 dhcp-client release [find]
/ipv6 dhcp-client renew [find]
StatusMeaning
boundSuccessfully acquired prefix/address
searchingSending SOLICIT, waiting for server
requestingSent REQUEST, waiting for REPLY
renewingRenewing lease with original server
rebindingTrying to rebind with any server
stoppedClient is disabled
errorError occurred
# Check DHCPv6 client status
/ipv6 dhcp-client print detail
# Verify pool was created
/ipv6 pool print
# Check LAN addresses from pool
/ipv6 address print where from-pool
# Verify default route (from RA)
/ipv6 route print where dst-address="::/0"
# Check RA acceptance is enabled
/ipv6 settings print
# Test IPv6 connectivity
/ping 2001:4860:4860::8888 count=3
# Release and renew
/ipv6 dhcp-client release [find]
/ipv6 dhcp-client renew [find]
AspectIPv4 DHCPIPv6 DHCPv6
Default GatewayProvided by DHCPProvided by Router Advertisement
Address AssignmentAlways via DHCPCan be DHCP, SLAAC, or both
Prefix DelegationNot applicableCommon feature (DHCP-PD)
DNSProvided by DHCPCan be DHCP or RA
  • IPv6 Addresses (/ipv6 address) - Use from-pool for dynamic assignment
  • IPv6 Pools (/ipv6 pool) - Stores delegated prefixes
  • IPv6 ND (/ipv6 nd) - Configure Router Advertisements for LAN
  • IPv6 Firewall (/ipv6 firewall) - Must allow UDP 546
  • IPv6 Routes (/ipv6 route) - Default route comes from RA
  • IPv6 Settings (/ipv6 settings) - Enable accept-router-advertisements

DHCPv6 in RouterOS is primarily used for Prefix Delegation from your ISP:

  1. Enable IPv6 package and reboot
  2. Enable RA acceptance (accept-router-advertisements=yes) - CRITICAL
  3. Create DHCPv6 client with request=prefix
  4. Assign LAN addresses using from-pool
  5. Verify connectivity with ping to IPv6 address

Key points:

  • DHCPv6 does NOT provide default gateway - that comes from Router Advertisements
  • pool-prefix-length=64 is typically correct for LAN allocation
  • prefix-hint is a request to ISP (may be ignored)
  • Some ISPs require their modem/ONT in bridge mode for PD to work
  • Link-local addresses (fe80::) as gateways are normal in IPv6