Skip to content
MikroTik RouterOS Docs

IPv6 Static Routes

For the impatient: add a default IPv6 route to your ISP gateway.

/ipv6 route add dst-address=::/0 gateway=2001:db8::1

For link-local gateway (common with ISPs):

/ipv6 route add dst-address=::/0 gateway=fe80::1%ether1

Verify with:

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

What this does: IPv6 static routes define paths for IPv6 traffic to reach destination networks. The routing principles are identical to IPv4, but IPv6 introduces link-local addresses as gateways, requiring interface specification.

When to use this:

  • Configuring default gateway for IPv6 internet access
  • Routing traffic to specific IPv6 networks
  • Creating blackhole routes for unwanted traffic
  • Setting up policy routing with multiple routing tables
  • ECMP load balancing across multiple gateways

Prerequisites:

  • IPv6 enabled (default in RouterOS v7)
  • At least one IPv6 address configured on an interface
  • Knowledge of your ISP’s gateway address (global or link-local)

Step 1: Add Default Route with Global Gateway

Section titled “Step 1: Add Default Route with Global Gateway”

Add a default route using a global unicast gateway address.

/ipv6 route add dst-address=::/0 gateway=2001:db8::1 comment="ISP Gateway"

Check that the route is active and has a resolved gateway.

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

Expected output:

Flags: D - dynamic, X - disabled, A - active, c - connect, s - static
0 As dst-address=::/0 gateway=2001:db8::1 immediate-gw=2001:db8::1%ether1
distance=1 scope=30 target-scope=10

The A flag indicates active, and immediate-gw shows the resolved gateway with interface.

Verify IPv6 connectivity through the gateway.

/ping 2001:4860:4860::8888 count=3

Expected output:

SEQ HOST SIZE TTL TIME STATUS
0 2001:4860:4860::8888 56 57 12ms
1 2001:4860:4860::8888 56 57 11ms
2 2001:4860:4860::8888 56 57 12ms
sent=3 received=3 packet-loss=0%

Many ISPs provide a link-local address (fe80::/10) as the gateway. You must include the interface:

# First, find ISP's link-local address
/ipv6 neighbor print where interface=ether1
# Add route with interface specification
/ipv6 route add dst-address=::/0 gateway=fe80::1%ether1

Important: Without %interface, RouterOS returns “Invalid route” error because link-local addresses are only valid within a specific interface’s scope.

Add a route to reach a specific IPv6 network:

/ipv6 route add dst-address=2001:db8:100::/48 gateway=2001:db8::2 distance=10

Silently discard traffic to unwanted networks:

/ipv6 route add dst-address=2001:db8:bad::/48 type=blackhole

Other discard types:

# Return ICMPv6 prohibited
/ipv6 route add dst-address=2001:db8:blocked::/48 type=prohibit
# Return ICMPv6 unreachable
/ipv6 route add dst-address=2001:db8:gone::/48 type=unreachable

Distribute traffic across multiple gateways:

/ipv6 route add dst-address=::/0 gateway=2001:db8::1,2001:db8::2 distance=1

Traffic is distributed per-flow (same source/destination uses same path). ECMP for IPv6 hashes: source IP, destination IP, flow label, and protocol.

Specify which source address to use for traffic matching this route:

/ipv6 route add dst-address=::/0 gateway=2001:db8::1 pref-src=2001:db8::100

Use policy routing with separate tables:

# Create routing table
/routing table add name=upstream2 fib
# Add route to specific table
/ipv6 route add dst-address=::/0 gateway=2001:db8:2::1 routing-table=upstream2

Mark traffic for specific table using mangle:

/ipv6 firewall mangle add chain=prerouting src-address=2001:db8:10::/64 \
action=mark-routing new-routing-mark=upstream2

Scenario: Backup Gateway with Higher Distance

Section titled “Scenario: Backup Gateway with Higher Distance”

Configure failover with route distances:

# Primary gateway (distance=1, preferred)
/ipv6 route add dst-address=::/0 gateway=2001:db8::1 distance=1 comment="Primary"
# Backup gateway (distance=2, used when primary fails)
/ipv6 route add dst-address=::/0 gateway=2001:db8:2::1 distance=2 comment="Backup"
/ipv6 route print

Expected: List of routes with flags (A=active, D=dynamic, c=connected, s=static).

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

Expected: Active default route with resolved gateway.

/ping 2001:db8::1 count=3

Expected: Replies from gateway.

/ipv6 neighbor print where interface=ether1

Expected: Gateway address appears with reachable status.

/routing route print where afi=ip6

Expected: All IPv6 routes with detailed attributes.

SymptomCauseSolution
”Invalid route” errorLink-local gateway without interfaceAdd %interface: gateway=fe80::1%ether1
Route shows inactiveGateway not reachableVerify gateway connectivity; check neighbor table
Route disappears after minutesGateway becomes unreachableCheck gateway; verify ICMPv6 not blocked
Route shows “filtered” (v7)Routing filter or next-hop resolution failedCheck /routing route print detail for reason
ECMP uses only one gatewayPer-flow hashing expected behaviorNormal; ECMP balances flows, not packets
No connected routeNo IPv6 address on interfaceAdd IPv6 address to create connected route
Route not preferredHigher distance than competing routeLower the distance value

Common Mistakes

  • Don’t forget %interface for link-local gateways - Link-local addresses require interface specification
  • Don’t confuse ::/0 with 0.0.0.0/0 - IPv6 default is ::/0; IPv4 default is 0.0.0.0/0
  • Don’t expect packet-level ECMP - RouterOS uses per-flow load balancing
  • Don’t block ICMPv6 on WAN - Neighbor Discovery requires ICMPv6; blocking it breaks IPv6 routing
  • Don’t assume gateway is global unicast - Many ISPs use link-local addresses
TypeDescription
unicastStandard forwarding route (default)
blackholeSilently discard matching packets
prohibitDiscard and return ICMPv6 administratively prohibited
unreachableDiscard and return ICMPv6 destination unreachable
FlagMeaning
AActive - route is in use
DDynamic - created by protocol
cConnected - from IPv6 address
sStatic - manually configured
+ECMP route
XDisabled
PropertyTypeDefaultDescription
dst-addressIPv6 prefix-Destination network (e.g., ::/0, 2001:db8::/32)
gatewayIPv6/interface-Next-hop address or interface
distance1-2551Administrative distance (lower = preferred)
scope0-25530Scope for next-hop lookup
target-scope0-25510Target scope for recursive lookup
routing-tablestringmainRouting table name
pref-srcIPv6 address-Preferred source address
typeunicast/blackhole/prohibit/unreachableunicastRoute type
commentstring-Descriptive comment
disabledyes/nonoWhether route is disabled
CommandDescription
/ipv6 route addAdd static IPv6 route
/ipv6 route printShow IPv6 routes
/ipv6 route print detailShow routes with all properties
/ipv6 route removeRemove IPv6 route
/ipv6 route setModify existing route
/routing route print where afi=ip6Unified view of IPv6 routes (v7)
/ipv6 neighbor printShow IPv6 neighbor table