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 ...
|bgp-as-path (list of AS numbers; Default: )||Value of BGP AS_PATH attribute.
|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:
|bgp-local-pref (integer; Default: 100)||Value of BGP LOCAL_PREF attribute.
|bgp-med (integer; Default: 0)||Value of BGP MULTI_EXIT_DISC BGP attribute.
|bgp-origin (igp | egp | incomplete; Default: )||Value of BGP ORIGIN attribute.
|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).
|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:
|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.
|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:
|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
|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|
|ospf (yes | no)||OSPF route|
|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.|
[ Top | Back to Content ]