MikroTik RouterOS IPv6 DHCP Relay: Centralizing DHCPv6 Services
MikroTik RouterOS IPv6 DHCP Relay: Centralizing DHCPv6 Services
Section titled “MikroTik RouterOS IPv6 DHCP Relay: Centralizing DHCPv6 Services”RouterOS Version: 7.18+ recommended (bindings and route installation added) Difficulty: Intermediate Estimated Time: 30 minutes
Overview
Section titled “Overview”DHCPv6 relay forwards DHCPv6 requests from clients on one network segment to a DHCPv6 server on another segment. This enables centralized DHCPv6 management across multiple subnets without requiring a DHCPv6 server on each segment.
Important version note: DHCPv6 relay in RouterOS had significant limitations prior to version 7.18. Earlier versions did not install routes for delegated prefixes, making prefix delegation essentially non-functional. RouterOS 7.18 added bindings support and automatic route installation, making DHCPv6 relay practical for production use.
If you’re running RouterOS versions prior to 7.18, consider using the DHCPv6 client/server approach instead (see Alternatives section).
When to Use DHCPv6 Relay
Section titled “When to Use DHCPv6 Relay”| Scenario | DHCPv6 Relay Appropriate |
|---|---|
| Centralized DHCPv6 server serving multiple remote sites | Yes (7.18+) |
| ISP providing prefix delegation to customer routers | Consider local DHCPv6 server |
| Single router serving local network | No - use DHCPv6 server directly |
| Multiple VLANs on same router | No - use DHCPv6 server directly |
| RouterOS version < 7.18 | Not recommended |
Prerequisites
Section titled “Prerequisites”- RouterOS 7.18 or later (strongly recommended)
- IPv6 package enabled
- Routing between relay and DHCPv6 server
- DHCPv6 server configured on remote router
Configuration Steps
Section titled “Configuration Steps”Step 1: Verify RouterOS Version
Section titled “Step 1: Verify RouterOS Version”DHCPv6 relay requires version 7.18+ for full functionality:
/system resource printCheck the version field. If below 7.18, see the Alternatives section.
Step 2: Configure DHCPv6 Relay
Section titled “Step 2: Configure DHCPv6 Relay”The basic DHCPv6 relay configuration:
/ipv6 dhcp-relay add name=relay1 interface=bridge-lan dhcp-server=2001:db8::1%ether1-wanKey syntax note: The dhcp-server parameter uses the format address%interface where:
addressis the DHCPv6 server’s IPv6 addressinterfaceis the local interface used to reach the server
Step 3: Verify Relay Configuration
Section titled “Step 3: Verify Relay Configuration”/ipv6 dhcp-relay printExpected Output:
Flags: X - disabled, I - invalid # NAME INTERFACE DHCP-SERVER 0 relay1 bridge-lan 2001:db8::1%ether1-wanStep 4: Verify Bindings (RouterOS 7.18+)
Section titled “Step 4: Verify Bindings (RouterOS 7.18+)”After clients request prefixes, check the relay bindings:
/ipv6 dhcp-relay binding printThis shows delegated prefixes and associated routes.
Complete Configuration Example
Section titled “Complete Configuration Example”Network Topology
Section titled “Network Topology”[DHCPv6 Server] [DHCPv6 Relay] [Client CPE] 2001:db8::1 ───── WAN ───── relay-router ───── LAN ───── customer ether1-wan bridge-lanDHCPv6 Server Configuration (Remote Router)
Section titled “DHCPv6 Server Configuration (Remote Router)”On the central DHCPv6 server:
# Create prefix pool for delegation/ipv6 pool add name=client-prefixes prefix=2001:db8:1000::/40 prefix-length=56
# Configure DHCPv6 server/ipv6 dhcp-server add name=dhcp6-server interface=ether1 address-pool=client-prefixesDHCPv6 Relay Configuration (Local Router)
Section titled “DHCPv6 Relay Configuration (Local Router)”On the router with clients:
# Ensure interface has IPv6 address/ipv6 address add address=2001:db8:2::1/64 interface=ether1-wan
# Configure DHCPv6 relay/ipv6 dhcp-relay add name=client-relay interface=bridge-lan dhcp-server=2001:db8::1%ether1-wanClient CPE Configuration
Section titled “Client CPE Configuration”On the customer device requesting prefix delegation:
/ipv6 dhcp-client add interface=ether1 request=prefix pool-name=delegated add-default-route=yesDHCPv6 Relay Properties
Section titled “DHCPv6 Relay Properties”| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Descriptive name for the relay |
interface | string | - | Interface listening for DHCPv6 client requests |
dhcp-server | string | - | DHCPv6 server address in address%interface format |
disabled | yes/no | no | Enable/disable the relay |
Verification
Section titled “Verification”Check 1: Relay Status
Section titled “Check 1: Relay Status”/ipv6 dhcp-relay printExpected: No X (disabled) or I (invalid) flags.
Check 2: Connectivity to DHCPv6 Server
Section titled “Check 2: Connectivity to DHCPv6 Server”/ping 2001:db8::1 count=3Expected: Successful replies from DHCPv6 server.
Check 3: Relay Bindings (7.18+)
Section titled “Check 3: Relay Bindings (7.18+)”/ipv6 dhcp-relay binding printExpected: Entries showing delegated prefixes after clients request them.
Check 4: Routes Installed for Delegated Prefixes
Section titled “Check 4: Routes Installed for Delegated Prefixes”/ipv6 route print where dhcpExpected: Dynamic routes for delegated prefixes pointing to client interfaces.
Check 5: Client Prefix Assignment
Section titled “Check 5: Client Prefix Assignment”On the client CPE:
/ipv6 dhcp-client print detailExpected: status=bound and a delegated prefix shown.
Troubleshooting
Section titled “Troubleshooting”Problem: “Relay shows invalid flag”
Section titled “Problem: “Relay shows invalid flag””Cause: Interface doesn’t exist or DHCPv6 server unreachable.
Solution:
- Verify interface exists:
/interface print where name=bridge-lan - Verify connectivity to server:
/ping 2001:db8::1 - Check the
dhcp-serverformat includes%interface
Problem: “Clients not receiving prefixes”
Section titled “Problem: “Clients not receiving prefixes””Cause: Routing issue between relay and server, or firewall blocking DHCPv6.
Solution:
- Ensure UDP ports 546/547 are not blocked:
/ipv6 firewall filter add chain=forward action=accept protocol=udp dst-port=546,547 comment="Allow DHCPv6"/ipv6 firewall filter add chain=input action=accept protocol=udp dst-port=546,547 comment="Allow DHCPv6 to router"- Verify bidirectional routing between relay and server
- Check DHCPv6 server logs on the remote router
Problem: “Prefixes delegated but routes not installed” (Pre-7.18)
Section titled “Problem: “Prefixes delegated but routes not installed” (Pre-7.18)”Cause: RouterOS versions before 7.18 do not install routes for relayed prefixes.
Solution:
- Upgrade to RouterOS 7.18 or later
- Or use the DHCPv6 client/server approach instead of relay (see Alternatives)
- Or implement a script-based workaround that monitors DHCP logs and adds routes
Problem: “Return traffic not reaching clients”
Section titled “Problem: “Return traffic not reaching clients””Cause: DHCPv6 server doesn’t have route to delegated prefix via relay router.
Solution: Ensure the DHCPv6 server has a route pointing delegated prefixes through the relay router:
# On DHCPv6 server/ipv6 route add dst-address=2001:db8:1000::/40 gateway=2001:db8:2::1Problem: “DHCPv6 relay worked in v6 but not in v7”
Section titled “Problem: “DHCPv6 relay worked in v6 but not in v7””Cause: Implementation changes between major versions.
Solution:
- Verify configuration syntax is correct for v7
- Check that
dhcp-serverusesaddress%interfaceformat - Upgrade to 7.18+ for improved DHCPv6 relay support
Common Pitfalls
Section titled “Common Pitfalls”1. Missing Interface in dhcp-server Parameter
Section titled “1. Missing Interface in dhcp-server Parameter”Wrong:
/ipv6 dhcp-relay add interface=bridge-lan dhcp-server=2001:db8::1Right:
/ipv6 dhcp-relay add interface=bridge-lan dhcp-server=2001:db8::1%ether1-wan2. Using DHCPv6 Relay on Old RouterOS Versions
Section titled “2. Using DHCPv6 Relay on Old RouterOS Versions”Problem: Routes for delegated prefixes not installed, breaking prefix delegation.
Solution: Upgrade to RouterOS 7.18+ or use DHCPv6 client/server approach.
3. Firewall Blocking DHCPv6 Traffic
Section titled “3. Firewall Blocking DHCPv6 Traffic”Problem: DHCPv6 uses UDP ports 546 (client) and 547 (server), which may be blocked.
Solution: Add explicit firewall rules for DHCPv6:
/ipv6 firewall filter add chain=forward action=accept protocol=udp dst-port=546,5474. Expecting Relay to Replace SLAAC
Section titled “4. Expecting Relay to Replace SLAAC”Problem: DHCPv6 relay handles prefix delegation and stateful addresses, not SLAAC.
Solution: Configure Router Advertisements separately via /ipv6 nd for SLAAC. DHCPv6 and SLAAC serve different purposes and often work together.
Alternatives to DHCPv6 Relay
Section titled “Alternatives to DHCPv6 Relay”For RouterOS versions before 7.18, or when relay proves unreliable, use this alternative approach:
DHCPv6 Client + Local DHCPv6 Server
Section titled “DHCPv6 Client + Local DHCPv6 Server”Instead of relaying, obtain a prefix from upstream and serve it locally:
Step 1: Configure DHCPv6 Client on WAN
/ipv6 dhcp-client add interface=ether1-wan request=prefix pool-name=isp-prefix pool-prefix-length=64 add-default-route=yesStep 2: Configure Local DHCPv6 Server for LAN
# Create pool from ISP-delegated prefix/ipv6 pool add name=lan-pool prefix=::/48 prefix-length=64 depends-on=isp-prefix
# Configure DHCPv6 server/ipv6 dhcp-server add name=lan-dhcp6 interface=bridge-lan address-pool=lan-poolStep 3: Configure SLAAC for LAN Clients
/ipv6 address add address=::1/64 from-pool=isp-prefix interface=bridge-lan advertise=yesThis approach is more reliable and well-documented than DHCPv6 relay for older RouterOS versions.
Version History
Section titled “Version History”| Version | DHCPv6 Relay Status |
|---|---|
| 6.x | Basic functionality, routes not installed for PD |
| 7.0-7.17 | Similar limitations to v6 |
| 7.18+ | Bindings support added, route installation working |
References
Section titled “References”- MikroTik DHCP Documentation
- RFC 8415 - DHCPv6 - Dynamic Host Configuration Protocol for IPv6
- RFC 3633 - IPv6 Prefix Options for DHCPv6 - Prefix Delegation
Related Topics
Section titled “Related Topics”Prerequisites
Section titled “Prerequisites”- IPv6 Addresses - IPv6 addressing fundamentals
Alternative Approaches
Section titled “Alternative Approaches”- IPv6 DHCP Client - obtain prefix from ISP directly
- IPv6 DHCP Server - serve prefixes locally instead of relaying
LAN Configuration
Section titled “LAN Configuration”- IPv6 ND - Router Advertisements for SLAAC (separate from DHCPv6)
- IPv6 Firewall - must allow UDP ports 546/547 for DHCPv6
Related Topics
Section titled “Related Topics”- DHCP Relay (IPv4) - IPv4 DHCP relay for comparison
- Bridge Configuration - relay interface configuration