Difference between revisions of "IPv6: Mikrotik: Router Advertisement RA"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "{{Versions|v3, v4 +}} __TOC__ <div class=manual> ==Summary== <p id="shbox"><b>Sub-menu:</b> <code>/ipv6 nd</code><br /> <b>Standards:</b> <code>RFC 2462, RFC 2461</code><br...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Versions|v3, v4 +}}
 
  
__TOC__
+
==Summary==
  
<div class=manual>
+
Sub-menu: ipv6 nd
 
+
Standards: RFC 2462, RFC 2461
==Summary==
+
Package: IPv6
<p id="shbox"><b>Sub-menu:</b> <code>/ipv6 nd</code><br />
 
<b>Standards:</b> <code>RFC 2462, RFC 2461</code><br />
 
<b>Package :</b> <code>IPv6</code>
 
</p>
 
<br />
 
  
 
RouterOS has Ipv6 Neighbor Detection and stateless address autoconfiguration support using Router Advertisement Daemon (RADVD).
 
RouterOS has Ipv6 Neighbor Detection and stateless address autoconfiguration support using Router Advertisement Daemon (RADVD).
Line 56: Line 50:
  
 
==Neighbor discovery==
 
==Neighbor discovery==
<p id="shbox"><b>Sub-menu:</b> <code>/ipv6 nd</code>
+
 
</p>
+
ipv6 nd
<br />
 
  
 
In this submenu IPv6 Neighbor Discovery (ND) protocol is configured.  
 
In this submenu IPv6 Neighbor Discovery (ND) protocol is configured.  
Line 78: Line 71:
 
===Properties===
 
===Properties===
  
{{Mr-arg-table-h
+
* advertise-dns (yes | no; Default: no)
|prop=Property
+
* advertise-mac-address (yes | no; Default: yes)
|desc=Description
+
* comment (string; Default: )
}}
+
* disabled (yes | no; Default: no)
 
+
* hop-limit (unspecified | integer[0..4294967295]; Default: unspecified)
{{Mr-arg-table
+
* interface (all | string; Default: )
|arg=advertise-dns
+
* managed-address-configuration (yes | no; Default: no)
|type=yes {{!}} no
+
* mtu (unspecified | integer[0..4294967295]; Default: unspecified)
|default=no
+
* other-configuration (yes | no; Default: no)
|desc=Option to redistribute DNS server information using RADVD. You will need a running client side software with Router Advertisement DNS support to take advantage of the advertised [[M:IP/DNS | DNS]] information. [[#Stateless_autoconfiguration_example | <code>Read more >></code>]]
+
* ra-delay (time; Default: 3s)
}}
+
* ra-interval (time[3s..20m50s]-time[4s..30m]; Default: 3m20s-10m)
 
+
* ra-lifetime (none | time; Default: 30m)
{{Mr-arg-table
+
* reachable-time (unspecified | time[0..1h]; Default: unspecified)
|arg=advertise-mac-address
+
* retransmit-interval (unspecified | time; Default: unspecified)
|type=yes {{!}} no
 
|default=yes
 
|desc=When set, the link-layer address of the outgoing interface is included in the RA.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=comment
 
|type=string
 
|default=
 
|desc=Descriptive name of an item
 
}}
 
 
 
 
 
{{Mr-arg-table
 
|arg=disabled
 
|type=yes {{!}} no
 
|default=no
 
|desc=Whether item is disabled or not. By default entry is enabled.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=hop-limit
 
|type=unspecified {{!}} integer[0..4294967295]
 
|default=unspecified
 
|desc=The default value that should be placed in the Hop Count field of the IP header for outgoing (unicast) IP packets.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=interface
 
|type=all {{!}} string
 
|default=
 
|desc=Interface on which to run neighbor discovery.
 
* <var>all</var> - run ND on all running interfaces.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=managed-address-configuration
 
|type=yes {{!}} no
 
|default=no
 
|desc=Flag indicates whether hosts should use stateful autoconfiguration (DHCPv6) to obtain addresses.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=mtu
 
|type=unspecified {{!}} integer[0..4294967295]
 
|default=unspecified
 
|desc=The MTU option is used in router advertisement messages to insure that all nodes on a link use the same MTU value in those cases where the link MTU is not well known.
 
* '''unspecified''' - do not send MTU option.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=other-configuration
 
|type=yes {{!}} no
 
|default=no
 
|desc=Flag indicates whether hosts should use stateful autoconfiguration to obtain additional information (excluding addresses).
 
}}
 
 
 
{{Mr-arg-table
 
|arg=ra-delay
 
|type=time
 
|default=3s
 
|desc=The minimum time allowed between sending multicast router advertisements from the interface.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=ra-interval
 
|type=time[3s..20m50s]-time[4s..30m]
 
|default=3m20s-10m
 
|desc=min-max interval allowed between sending unsolicited multicast router advertisements from the interface.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=ra-lifetime
 
|type=none {{!}} time
 
|default=30m
 
|desc=
 
}}
 
 
 
{{Mr-arg-table
 
|arg=reachable-time
 
|type=unspecified {{!}} time[0..1h]
 
|default=unspecified
 
|desc=The time that a node assumes a neighbor is reachable after having received a reachability confirmation. Used by the Neighbor Unreachability Detection algorithm (see Section 7.3 of RFC 2461)
 
}}
 
 
 
{{Mr-arg-table-end
 
|arg=retransmit-interval
 
|type=unspecified {{!}} time
 
|default=unspecified
 
|desc=The time between retransmitted Neighbor Solicitation messages. Used by address resolution and the Neighbor Unreachability Detection algorithm (see Sections 7.2 and 7.3 of RFC 2461)
 
}}
 
  
 
==Prefix==
 
==Prefix==
<p id="shbox"><b>Sub-menu:</b> <code>/ipv6 nd prefix</code>
 
</p>
 
<br />
 
  
Prefix information sent in RA messages used by stateless address auto-configuration.
+
ipv6 nd prefix
  
{{ Note | The autoconfiguration process applies only to hosts and not routers. }}
+
Prefix information sent in RA messages used by stateless address auto-configuration.
  
 
===Properties===
 
===Properties===
  
{{Mr-arg-table-h
+
* 6to4-interface (none | string; Default: )
|prop=Property
+
* autonomous (yes | no; Default: yes)
|desc=Description
+
* comment (string; Default: )
}}
+
* disabled (yes | no; Default: no)
 
+
* on-link (yes | no; Default: yes)
{{Mr-arg-table
+
* preferred-lifetime (infinity | time; Default: 1w)
|arg=6to4-interface
+
* prefix (ipv6 prefix; Default: ::/64)
|type=none {{!}} string
+
* valid-lifetime (infinity | time; Default: 4w2d)
|default=
+
* interface (string; Default: )
|desc=If this option is specified, this prefix will be combined with the IPv4 address of interface name to produce a valid 6to4 prefix. The first 16 bits of this prefix will be replaced by 2002 and the next 32 bits of this prefix will be replaced by the IPv4 address assigned to interface name at configuration time. The remaining 80 bits of the prefix (including the SLA ID) will be advertised as specified in the configuration file.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=autonomous
 
|type=yes {{!}} no
 
|default=yes
 
|desc=When set, indicates that this prefix can be used for autonomous address configuration. Otherwise prefix information is silently ignored.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=comment
 
|type=string
 
|default=
 
|desc=Descriptive name of an item
 
}}
 
 
 
 
 
{{Mr-arg-table
 
|arg=disabled
 
|type=yes {{!}} no
 
|default=no
 
|desc=Whether item is disabled or not. By default entry is enabled.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=on-link
 
|type=yes {{!}} no
 
|default=yes
 
|desc=When set, indicates that this prefix can be used for on-link determination. When not set the advertisement makes no statement about on-link or off-link properties of the prefix. For instance, the prefix might be used for address configuration with some of the addresses belonging to the prefix being on-link and others being off-link.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=preferred-lifetime
 
|type=infinity {{!}} time
 
|default=1w
 
|desc=Timeframe (relative to the time the packet is sent) after which generated address becomes "deprecated". Deprecated is used only for already existing connections and is usable until <var>valid-lifetime</var> expires. [[ #Address states | <code>Read more >></code>]]
 
}}
 
 
 
{{Mr-arg-table
 
|arg=prefix
 
|type=ipv6 prefix
 
|default=::/64
 
|desc=Prefix from which stateless address autoconfiguration generates the valid address.
 
}}
 
 
 
{{Mr-arg-table
 
|arg=valid-lifetime
 
|type=infinity {{!}} time
 
|default=4w2d
 
|desc=The length of time (relative to the time the packet is sent) an address remains in the valid state. The <var>valid-lifetime</var> must be greater than or equal to the <var>preferred-lifetime</var>. [[ #Address states | <code>Read more >></code>]]
 
 
 
}}
 
 
 
{{Mr-arg-table-end
 
|arg=interface
 
|type=string
 
|default=
 
|desc=Interface name on which stateless auto-configuration will be running.
 
}}
 
  
 
==Examples==
 
==Examples==
 
===Stateless autoconfiguration example===
 
===Stateless autoconfiguration example===
<pre>
+
 
 
  [admin@MikroTik] > ipv6 address print
 
  [admin@MikroTik] > ipv6 address print
 
  Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
 
  Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
 
   #    ADDRESS                                    INTERFACE        ADVERTISE
 
   #    ADDRESS                                    INTERFACE        ADVERTISE
 
   0  G 2001:db8::1/64                                ether1            yes
 
   0  G 2001:db8::1/64                                ether1            yes
</pre>
+
 
 
As in example above <b>advertise</b> flag is enabled which indicates that dynamic <code>/ipv6 nd prefix</code> entry is added.
 
As in example above <b>advertise</b> flag is enabled which indicates that dynamic <code>/ipv6 nd prefix</code> entry is added.
<pre>
+
 
 
  [admin@MikroTik] > ipv6 nd prefix print
 
  [admin@MikroTik] > ipv6 nd prefix print
 
  Flags: X - disabled, I - invalid, D - dynamic
 
  Flags: X - disabled, I - invalid, D - dynamic
 
   0 D prefix=2001:db8::/64 interface=ether1 on-link=yes autonomous=yes
 
   0 D prefix=2001:db8::/64 interface=ether1 on-link=yes autonomous=yes
 
       valid-lifetime=4w2d preferred-lifetime=1w
 
       valid-lifetime=4w2d preferred-lifetime=1w
</pre>
 
  
 
On a host that is directly attached to the router we see that an address was added. The address consists of prefix part (first 64 bits) that takes prefix from the prefix advertisement, and host part (last 64 bits) that is automatically generated from local MAC address:
 
On a host that is directly attached to the router we see that an address was added. The address consists of prefix part (first 64 bits) that takes prefix from the prefix advertisement, and host part (last 64 bits) that is automatically generated from local MAC address:
Line 296: Line 134:
  
 
There is also an option to redistribute [[M:IP/DNS | DNS]] server information using RADVD:
 
There is also an option to redistribute [[M:IP/DNS | DNS]] server information using RADVD:
<pre>
+
 
 
  [admin@MikroTik] > ip dns set server=2001:db8::2
 
  [admin@MikroTik] > ip dns set server=2001:db8::2
 
  [admin@MikroTik] > ip dns print
 
  [admin@MikroTik] > ip dns print
Line 302: Line 140:
 
  ...
 
  ...
 
  [admin@MikroTik] > ipv6 nd set [f] advertise-dns=yes
 
  [admin@MikroTik] > ipv6 nd set [f] advertise-dns=yes
</pre>
+
 
 
You will need a running client side software with Router Advertisement DNS support to take advantage of the advertised DNS information.
 
You will need a running client side software with Router Advertisement DNS support to take advantage of the advertised DNS information.
  
 
On Ubuntu/Debian linux distributions you can install '''rdnssd''' package which is capable of receiving advertised DNS address.
 
On Ubuntu/Debian linux distributions you can install '''rdnssd''' package which is capable of receiving advertised DNS address.
<pre>
 
mrz@bumba:/$ sudo apt-get install rdnssd
 
</pre>
 
  
<pre>
+
mrz@bumba:/$ sudo apt-get install rdnssd
mrz@bumba:/$ cat /etc/resolv.conf  
+
 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
+
mrz@bumba:/$ cat /etc/resolv.conf  
#    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
+
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
nameserver 2001:db8::2
+
#    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
 +
nameserver 2001:db8::2
 +
 
 +
mrz@bumba:/$ ping6 www.mikrotik.com
 +
PING www.mikrotik.com(2a02:610:7501:1000::2) 56 data bytes
 +
64 bytes from 2a02:610:7501:1000::2: icmp_seq=1 ttl=61 time=2.11 ms
 +
64 bytes from 2a02:610:7501:1000::2: icmp_seq=2 ttl=61 time=1.33 ms
 +
^C
 +
--- www.mikrotik.com ping statistics ---
 +
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
 +
rtt min/avg/max/mdev = 1.334/1.725/2.117/0.393 ms
 +
mrz@bumba:/$
  
mrz@bumba:/$ ping6 www.mikrotik.com
+
==Referensi==
PING www.mikrotik.com(2a02:610:7501:1000::2) 56 data bytes
 
64 bytes from 2a02:610:7501:1000::2: icmp_seq=1 ttl=61 time=2.11 ms
 
64 bytes from 2a02:610:7501:1000::2: icmp_seq=2 ttl=61 time=1.33 ms
 
^C
 
--- www.mikrotik.com ping statistics ---
 
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
 
rtt min/avg/max/mdev = 1.334/1.725/2.117/0.393 ms
 
mrz@bumba:/$
 
  
</pre>
+
* https://wiki.mikrotik.com/wiki/Manual:IPv6/ND
  
==See Also==
 
* http://www.tcpipguide.com/free/t_IPv6Addressing.htm
 
</div>
 
  
  
{{cont}}
+
==Pranala Menarik==
  
[[Category:Manual]]
+
* [[IPv6: Mikrotik: ND / RA contoh konfigurasi]]

Latest revision as of 09:48, 6 February 2019

Summary

Sub-menu: ipv6 nd
Standards: RFC 2462, RFC 2461
Package: IPv6

RouterOS has Ipv6 Neighbor Detection and stateless address autoconfiguration support using Router Advertisement Daemon (RADVD).

Node description

Node is a device that implements IPv6. In IPv6 networks nodes are divided into two types:

  • Routers - a node that forwards IPv6 packets not explicitly addressed to itself.
  • Hosts - any node that is not a router.

Routers and hosts are strictly separated, meaning that router cannot be host and host cannot be router at the same time.

Stateless address autoconfiguration

There are several types of autoconfiguration:

  • stateless - address configuration is done by received Router Advertisement messages. These messages include stateless address prefixes and require that host is not using stateful address configuration protocol.
  • stateful - address configuration is done by using stateful address configuration protocol (DHCPv6). Stateful protocol is used if RA messages do not include address prefixes.
  • both - RA messages include stateless address prefixes and require that hosts use a stateful address configuration protocol.

A highly useful feature of IPv6 is the ability to automatically configure itself without the use of a stateful configuration protocol like DHCP ( See example).

Template:Note

It is called stateless address autoconfiguration, since there is no need to manage state in the router side. It is a very simple, robust and effective autoconfiguration mechanism.

RouterOS uses RADVD to periodically advertise information about the link to all nodes on the same link. The information is carried by ICMPv6 "router advertisement" packet, and includes following fields:

  • IPv6 subnet prefix
  • Default router link local address
  • Other parameters that may be optional: link MTU, default hoplimit, and router lifetime.

Then host catches the advertisement, and configures the global IPv6 address and the default router. Global IPv6 address is generated from advertised subnet prefix and EUI-64 interface identifier.

Optionally, the host can ask for an advertisement from the router by sending an ICMPv6 "router solicitation" packet. On linux rtsol utility transmits the router solicitation packet. If you are running a mobile node, you may want to transmit router solicitations periodically.

Address states

When auto-configuration address is assigned it can be in one of the following states:

  • tentative - in this state host verifies that the address is unique. Verification occurs through duplicate address detection.
  • preferred - at this state address is verified as unique and node can send and receive unicast traffic to and from a preferred address. The period of time of preferred state is included in the RA message.
  • deprecated - address is still valid, but is not used for new connections.
  • invalid - node can no longer send or receive unicast traffic. An address enters the invalid state after the valid lifetime expires.

Image belove ilustrates relation between states and lifetimes. File:Ipv6-lifetime.png

Neighbor discovery

ipv6 nd

In this submenu IPv6 Neighbor Discovery (ND) protocol is configured.

Neighbor Discovery (ND) is a set of messages and processes that determine relationships between neighboring nodes. ND, compared to IPv4, replaces Address Resolution Protocol (ARP), Internet Control Message Protocol (ICMP) Router Discovery, and ICMP Redirect and provides additional functionality.

ND is used by hosts to:

  • Discover neighboring routers.
  • Discover addresses, address prefixes, and other configuration parameters.

ND is used by routers to:

  • Advertise their presence, host configuration parameters, and on-link prefixes.
  • Inform hosts of a better next-hop address to forward packets for a specific destination.

ND is used by nodes to:

  • Both resolve the link-layer address of a neighboring node to which an IPv6 packet is being forwarded and determine when the link-layer address of a neighboring node has changed.
  • Determine whether IPv6 packets can be sent to and received from a neighbor.

Properties

  • advertise-dns (yes | no; Default: no)
  • advertise-mac-address (yes | no; Default: yes)
  • comment (string; Default: )
  • disabled (yes | no; Default: no)
  • hop-limit (unspecified | integer[0..4294967295]; Default: unspecified)
  • interface (all | string; Default: )
  • managed-address-configuration (yes | no; Default: no)
  • mtu (unspecified | integer[0..4294967295]; Default: unspecified)
  • other-configuration (yes | no; Default: no)
  • ra-delay (time; Default: 3s)
  • ra-interval (time[3s..20m50s]-time[4s..30m]; Default: 3m20s-10m)
  • ra-lifetime (none | time; Default: 30m)
  • reachable-time (unspecified | time[0..1h]; Default: unspecified)
  • retransmit-interval (unspecified | time; Default: unspecified)

Prefix

ipv6 nd prefix

Prefix information sent in RA messages used by stateless address auto-configuration.

Properties

  • 6to4-interface (none | string; Default: )
  • autonomous (yes | no; Default: yes)
  • comment (string; Default: )
  • disabled (yes | no; Default: no)
  • on-link (yes | no; Default: yes)
  • preferred-lifetime (infinity | time; Default: 1w)
  • prefix (ipv6 prefix; Default: ::/64)
  • valid-lifetime (infinity | time; Default: 4w2d)
  • interface (string; Default: )

Examples

Stateless autoconfiguration example

[admin@MikroTik] > ipv6 address print
Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
 #    ADDRESS                                     INTERFACE         ADVERTISE
 0  G 2001:db8::1/64                                ether1            yes

As in example above advertise flag is enabled which indicates that dynamic /ipv6 nd prefix entry is added.

[admin@MikroTik] > ipv6 nd prefix print
Flags: X - disabled, I - invalid, D - dynamic
 0 D prefix=2001:db8::/64 interface=ether1 on-link=yes autonomous=yes
      valid-lifetime=4w2d preferred-lifetime=1w

On a host that is directly attached to the router we see that an address was added. The address consists of prefix part (first 64 bits) that takes prefix from the prefix advertisement, and host part (last 64 bits) that is automatically generated from local MAC address:

atis@atis-desktop:~$ ip -6 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:db8::21a:4dff:fe56:1f4d/64 scope global dynamic
       valid_lft 2588363sec preferred_lft 601163sec
    inet6 fe80::21a:4dff:fe56:1f4d/64 scope link
       valid_lft forever preferred_lft forever

The host has received the 2001:db8::/64 prefix from the router and configured an address with it.

There is also an option to redistribute DNS server information using RADVD:

[admin@MikroTik] > ip dns set server=2001:db8::2
[admin@MikroTik] > ip dns print
          servers: 2001:db8::2
...
[admin@MikroTik] > ipv6 nd set [f] advertise-dns=yes

You will need a running client side software with Router Advertisement DNS support to take advantage of the advertised DNS information.

On Ubuntu/Debian linux distributions you can install rdnssd package which is capable of receiving advertised DNS address.

mrz@bumba:/$ sudo apt-get install rdnssd
mrz@bumba:/$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 2001:db8::2
mrz@bumba:/$ ping6 www.mikrotik.com
PING www.mikrotik.com(2a02:610:7501:1000::2) 56 data bytes
64 bytes from 2a02:610:7501:1000::2: icmp_seq=1 ttl=61 time=2.11 ms
64 bytes from 2a02:610:7501:1000::2: icmp_seq=2 ttl=61 time=1.33 ms
^C
--- www.mikrotik.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.334/1.725/2.117/0.393 ms
mrz@bumba:/$ 

Referensi


Pranala Menarik