From MikroTik Wiki
Jump to navigation Jump to search

Applies to RouterOS: v3, v4 +


Sub-menu: /ipv6 route
Standards: RFC 4291

For static routing, the basic principles of IPv6 are exactly the same as for IPv4.

Simple ipv6 routing example:

[admin@MikroTik] > ipv6 route add dst-address=2001::/16 gateway=fc00:dead:beef::2
[admin@MikroTik] > ipv6 route print detail
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
 0 A S  dst-address=2001::/16 gateway=fc00:dead:beef::2 reachable ether1 distance=1
        scope=30 target-scope=10

Most notable difference between ipv4 and ipv6 is that link local addresses can be used as route nexthops if interface is specified:

[admin@MikroTik] > ipv6 route add dst-address=2002::/16 gateway=fe80::21a:4dff:fe56:1f4d%ether1
[admin@MikroTik] > ipv6 route print detail
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
 1 A S  dst-address=2002::/16
        gateway=fe80::21a:4dff:fe56:1f4d%ether1 reachable distance=1
        scope=30 target-scope=10

Another small difference is that there are no blackhole or prohibit routes, only unreachable.

IPv4 and IPv6 routing also differs in the area of multipath route. Technically speaking, in Linux kernel there is no support for multiple nexthops for a IPv6 route. However, RouterOS allows to set more than one gateway address for a single route. In this case, a route is installed in the kernel for each of the different interfaces to which route's nexthops belong.


[admin@MikroTik] > ipv6 address p
Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
 #    ADDRESS                                     INTERFACE         ADVERTISE
 0  G fc00:1::1/64                                ether1            no
 1  G fc00:2::1/64                                ether2            no
[admin@MikroTik] > ipv6 route add dst-address=2001::/16 gateway=fc00:1::2,fc00:2::2
[admin@MikroTik] > ipv6 route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
 #      DST-ADDRESS              GATEWAY                      DISTANCE
 0 A S  2001::/16                fc00:2::2 reachable ether1,  1
                                 fc00:1::2 reachable ether2

When printing the Linux kernel route table, we see that two routes were added, not one:

# ip -6 route
2001::/16 via fc00:2::2 dev eth1  proto static  metric 1024  mtu 1500 advmss 1440 metric10 4294967295
2001::/16 via fc00:1::2 dev eth0  proto static  metric 1024  mtu 1500 advmss 1440 metric10 4294967295


Property Description
bgp-as-path (list of AS numbers; Default: ) Value of BGP AS_PATH attribute. Read more>>
bgp-atomic-aggregate (yes | no; Default: )
bgp-communities (list of two integers separated by :; Default: ) Value of BGP communities list. This attribute can be used to group or filter routes. Named values have special meanings:
  • internet - advertise this route to the Internet community (i.e. all routers)
  • no-advertise - do not advertise this route to any peers
  • no-export - do not advertise this route to EBGP peers
  • local-as - same as no-export, except that route is also advertised to EBGP peers inside local confederation
bgp-local-pref (integer; Default: 100) Value of BGP LOCAL_PREF attribute. Read more>>
bgp-med (integer; Default: 0) Value of BGP MULTI_EXIT_DISC BGP attribute. Read more>>
bgp-origin (igp | egp | incomplete; Default: ) Value of BGP ORIGIN attribute. Read more>>
bgp-prepend (integer [0..16]; Default: ) How many times to prepend router's own AS number to AS_PATH attribute when announcing route via BGP. Affects only routes sent to eBGP peers (for iBGP value 0 is always used). Read more>>
check-gateway (ping | arp; Default: ) Periodically (every 10 seconds) check gateway by sending either ICMP echo request (ping) or ARP request (arp). If no response from gateway is received for 10 seconds, request times out. After two timeouts gateway is considered unreachable. After receiving reply from gateway it is considered reachable and timeout counter is reset.
comment (string; Default: ) Descriptive name of an item
disabled (yes | no; Default: yes) Whether interface is disabled or not. By default it is disabled.
distance (integer; Default: ) Value used in route selection. Routes with smaller distance value are given preference. If value of this property is not set, then the default depends on route protocol:
  • connected routes: 0
  • static routes: 1
  • eBGP: 20
  • OSPF: 110
  • RIP: 120
  • MME: 130
  • iBGP: 200
dst-address (IPv6/Netmask; Default: ::/0) IPv6 prefix of route, specifies destination addresses that this route can be used for. Netmask (integer [0..128]) part of this property specifies how many of the most significant bits in packet destination address must match this value. If there are several active routes that match destination address of packet, then the most specific one (with largest netmask value) is used.
gateway (ipv6 address[,ipv6 address[,..]]; Default: ) Specifies which host or interface packets should be sent to. Link Local addresses can also be used as gateways if interface is specified. Read more>>
route-tag (integer; Default: ) Value of route tag attribute for RIP or OSPF. For RIP only values 0..65535 are valid.
scope (integer [0..255]; Default: ) Used in nexthop resolution. Route can resolve nexthop only through routes that have scope less than or equal to the target-scope of this route. Default value depends on route protocol:
  • connected routes: 10 (if interface is running)
  • OSPF, RIP, MME routes: 20
  • static routes: 30
  • BGP routes: 40
  • connected routes: 200 (if interface is not running)
target-scope (integer [0..255]; Default: 10 (30 for iBGP)) Used in nexthop resolution. This is the maximum value of scope for a route through which a nexthop of this route can be resolved. See nexthop lookup.
type (unicast | unreachabe; Default: unicast) Routes that do not specify nexthop for packets, but instead perform some other action on packets have type different from the usual unicast.

Read-only properties

Property Description
active (yes | no) Whether route is currently active and is used for packet forwarding.
bgp (yes | no) BGP route
bgp-weight (integer) BGP weight attribute
connect (yes | no) Directly connected route
dynamic (yes | no) Dynamically added route
gateway-status ()
ospf (yes | no) OSPF route
ospf-metric (integer)
ospf-type (external-type-1 | intra-area | ...) Type of the OSPF route
received-from (string) Name of the BGP peer from which this route was received.
rip (yes | no) RIP route
static (yes | no) Statically added route by user.
unreachable (yes | no) Discard packet forwarded by this route. Notify sender with ICMP host unreachable (type 3 code 1) message.

See Also

[ Top | Back to Content ]