Skip to content

IPv6 Configure on Mikrotik RouterOS v7.x

0. Brief

IPv6 configuration on Mikrotik RouterOS is much more complicated than Merlin on ASUS. We are going to config IPv6 in this aritical.

Configurations are based on Mikrotik RouterOS 7.6 .

1. Configure DHCPv6 Client

Login Terminal in RouterOS, with following commands:

# Accept ISP RA, Get IPv6 Address with SLAAC
/ipv6 settings set accept-router-advertisements=yes

# Configure DHCPv6 client:
# - Add default route: yes
# - WAN interface: pppoe-ether1
# - IPv6 address pool: IPv6 (You can change to whatever you want)
# - Prefix length for DHCPv6 server's offering cascading routers: 60
# - Request LAN prefix from ISP
/ipv6 dhcp-client add add-default-route=no interface=pppoe-ether1 \ 
    pool-name=IPv6 pool-prefix-length=60 \
    request=prefix
CMCC in Nanjing, Jiangsu provide /60 prefix, if prefix length less than /63, it's impossible to use DHCPv6.

2. Add necessary IPv6 firewall rule

# Accept DHCPv6 client prefix delegation
/ipv6 firewall filter add action=accept chain=input \
    comment="Accept DHCPv6 client prefix delegation" \ 
    dst-port=546 protocol=udp src-address=fe80::/10

This rule is default, if you configured your router with default script.

3. Assign IPv6 address to interfaces

/ipv6 address add address=::1 from-pool=IPv6 interface=bridge

4. Configure DHCPv6-PD server

# Delegate IPv6 addresses from pool `delegation`
# Lease is valid for 1 day
/ipv6 dhcp-server add address-pool=IPv6 \
    interface=bridge lease-time=7d name=Home-IPv6

REF

[1]. https://wu.renjie.im/blog/network/ros-dhcpv6/zh-cn/