Router Advertisements mit radvd unter Arch Linux einrichten und nutzen

Bild: Icon Router Advertisement Damon In diesem Kapitel wollen wir uns eingehender mit der Thematik Router Advertisements zusammen mit dem Daemon radvd unter Arch Linux beschäftigen.

Das Thema Router Advertisement ist unter anderem im RFC 4861 - Neighbor Discovery in IPv6 definiert. Hosts und Router verwenden dieses Protokoll, um z.B. die Link-Layer-Adressen für Nachbarn zu ermitteln oder auch zwischengespeicherte Werte von ungültigen Verbindungen wieder zu löschen. Für Hosts ist dieses Neighbor Discovery Protokoll auch wichtig um benachbarte Router zu finden und auch herauszufinden, welche Variante bei der IP-v6-Adresszuweisung benutzt werden soll, SLAAC oder DHCPv6.

Der Router Advertisement Daemon (radvd) implementiert das Ankündigen (Advertisement) von link-local IPv6-Adressen und IPv6_Präfixen mit Hilfe des Neighbor Discovery für IP Version 6 (IPv6) - RFC 2461.

Bevor wir uns nun aber mit der Installation und Konfiguration unseres Router Advertisement Daemon beschäftigen, werden wir noch kurz einen Blick auf die grundlegende Idee und Theorie dahinter. Verbindet sich ein Client mit einem IPv6-Netzwerk benötigt er diverse Informationen, wie z.B.:

  • Welche IP-Adressen habe ich bzw. werde ich haben, wie z.B. Global Unified Adress (GUA), oder habe ich auch noch eine Unique Local Address (ULA) und wie komme ich an diese oder woher beziehe ich diese?
  • Gibt es Router und wie erreiche ich diese und ist dieses Routing statisch oder dynamisch?
  • Gibt es Dinge wie Time- oder DNS-Server?
  • Muss ich bei der Suche spezielle DNA-Suchreichenfolgen bzw. -listen beachten?

Bei einer statischen Konfiguration, z.B. mit Hilfe von Ansible konfiguriert, werden all diese Parameter i.d.R. mit Hilfe von Konfigurationsdateien bekannt gegeben. Bei dynamischen sich oft ändernden Geräten/Clients wird dies praktikabel nicht mehr möglich sein. Wir brauchen also eine andere Art und Weise, wie wir all die Daten den Clients zur Verfügung stellen können. Hier bedienen wir uns den Router Advertisement um die Informationen zu verteilen.

Das Router Discovery Protokoll ermöglicht es Clients/Hosts Router im Netz zu erkennen und alle relevante Routing-Informationen zu bekommen.

  • Router senden von sich aus regelmässig per SOLICITED ROUTER ADVERTISEMENTS (Multicast) an alle Clients im eigenen Netz.
  • Verbindet sich ein Host mit dem Netzwerk, kann er eine Router Solicitation (RS)-Nachricht an die Router per Multicast senden.
  • Der oder die Router im Netzwerk antworten auf die RS-Nachricht ihrerseits mit einer Router Advertisement (RA)-Nachrichten.
  • RA-Nachrichten enthalten alle wichtige Informationen wie die Standard-Gateway-Adresse, Präfix-Informationen so wie andere/weitere Konfigurationsoptionen.
  • Der Host wertet diese RA-Nachrichten aus um so an die Adresse des Default-Routers zu gelangen, seine eigenen Netzwerkparameter entsprechend den Vorgaben zu setzen oder ggf. einen DHCPv6 Server zu befragen um an diese Konfigurationsoptionen zu gelangen.

Nachfolgendes Schaubild fasst den grundlegenden Ablauf zusammen:

erfolgreiche Ablauf aus Sicht des Clients bei der Kommunikation mit dem RADV-/DHCPv6-Serverserfolgreiche Ablauf aus Sicht des Clients bei der Kommunikation mit dem RADV-/DHCPv6-Servers <rect fill="#000000" fill-opacity="0.00000" height="578.8516" width="8" x="346.834" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="350" x2="350" y1="122.4844" y2="701.3359"/></g><g><title/><rect fill="#000000" fill-opacity="0.00000" height="578.8516" width="8" x="797.4092" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="800.9214" x2="800.9214" y1="122.4844" y2="701.3359"/></g><g><title/><rect fill="#000000" fill-opacity="0.00000" height="578.8516" width="8" x="1212.9263" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1216.0146" x2="1216.0146" y1="122.4844" y2="701.3359"/></g><g class="participant participant-head" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="239.668" x="231" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="176.7158" x="264.7012" y="94.8857">RADV - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="239.668" x="231" y="700.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="720.3311"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="176.7158" x="264.7012" y="736.6279">RADV - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="752.9248"> </text></g><g class="participant participant-head" data-participant="mitte"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="148.9756" x="726.9214" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="86.0234" x="760.6226" y="94.8857">Client / Host</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="mitte"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="148.9756" x="726.9214" y="700.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="720.3311"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="86.0234" x="760.6226" y="736.6279">Client / Host</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="752.9248"> </text></g><g class="participant participant-head" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="247.8232" x="1093.0146" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="193.7715" x="1126.7158" y="94.8857">DHCPv6 - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="247.8232" x="1093.0146" y="700.3359"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="720.3311"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="193.7715" x="1126.7158" y="736.6279">DHCPv6 - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="752.9248"> </text></g><g class="message" data-participant-1="mitte" data-participant-2="links"><polygon fill="#181818" points="361.834,175.3164,351.834,179.3164,361.834,183.3164,357.834,179.3164" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="355.834" x2="800.4092" y1="179.3164" y2="179.3164"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="326.0347" x="367.834" y="174.2505">(Port 547) ROUTER SOLICITATION</text></g><path d="M806,137.4844 L806,207.4844 L1070,207.4844 L1070,147.4844 L1060,137.4844 L806,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1060,137.4844 L1060,147.4844 L1070,147.4844 L1060,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="239.8208" x="812" y="154.5513">1. Der Hosts erkundigt sich mit einer</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="203.3979" x="828.5293" y="169.6841">Router Solicitation-Nachrichten</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="149.8682" x="828.5293" y="184.8169">nach Routern auf einer</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="195.7871" x="828.5293" y="199.9497">angeschlossenen Verbindung.</text><g class="message" data-participant-1="links" data-participant-2="mitte"><polygon fill="#181818" points="789.4092,255.8477,799.4092,259.8477,789.4092,263.8477,793.4092,259.8477" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="350.834" x2="795.4092" y1="259.8477" y2="259.8477"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="359.7852" x="357.834" y="254.7817">UNSOLICATED ROUTER ADVERTISEMENTS (Port 546)</text></g><path d="M7,218.0156 L7,288.0156 L345,288.0156 L345,228.0156 L335,218.0156 L7,218.0156" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M335,218.0156 L335,228.0156 L345,228.0156 L335,218.0156" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="243.6357" x="13" y="235.0825">2. Der Router gibt seine Anwesenheit</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="287.4536" x="29.5293" y="250.2153">zusammen mit verschiedenen Verbindungs-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="296.626" x="29.5293" y="265.3481">und Internet-Parametern als Antwort auf eine</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="249.3042" x="29.5293" y="280.481">Router-Solicitation-Nachricht bekannt.</text><g class="message" data-participant-1="mitte" data-participant-2="links"><polygon fill="#181818" points="361.834,336.3789,351.834,340.3789,361.834,344.3789,357.834,340.3789" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="355.834" x2="800.4092" y1="340.3789" y2="340.3789"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="426.5752" x="367.834" y="335.313">(Port 547) SOLICIT an alle Router/DHCPv6 Server</text></g><path d="M806,298.5469 L806,368.5469 L1089,368.5469 L1089,308.5469 L1079,298.5469 L806,298.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1079,298.5469 L1079,308.5469 L1089,308.5469 L1079,298.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="258.5845" x="812" y="315.6138">3. Der Host fordert mit dieser Nachricht</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="220.9238" x="828.5293" y="330.7466">Router Advertisements sofort und</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="227.1572" x="828.5293" y="345.8794">nicht erst zum nächsten geplanten</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="137.9282" x="816.1323" y="361.0122">Zeitpunkt zu senden.</text><g class="message" data-participant-1="links" data-participant-2="mitte"><polygon fill="#181818" points="789.4092,409.3438,799.4092,413.3438,789.4092,417.3438,793.4092,413.3438" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="350.834" x2="795.4092" y1="413.3438" y2="413.3438"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="343.751" x="357.834" y="408.2778">SOLICITED ROUTER ADVERTISEMENTS (Port 546)</text></g><path d="M5,379.0781 L5,434.0781 L345,434.0781 L345,389.0781 L335,379.0781 L5,379.0781" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M335,379.0781 L335,389.0781 L345,389.0781 L335,379.0781" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="319.8647" x="11" y="396.145">4. Der Router sendet gezielt an den anfragenden</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="297.7939" x="31.6616" y="411.2778">Host die zugehörigen Verbindungs- und Inter-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="98.376" x="31.6616" y="426.4106">net-Parameter.</text><g class="message" data-participant-1="mitte" data-participant-2="rechts"><polygon fill="#181818" points="1204.9263,535.2734,1214.9263,539.2734,1204.9263,543.2734,1208.9263,539.2734" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="801.4092" x2="1210.9263" y1="539.2734" y2="539.2734"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="391.5171" x="808.4092" y="534.2075">REQUEST bzw. INFORMATION REQUEST Unicast (Port 547)</text></g><path d="M551,444.4766 L551,620.4766 L795,620.4766 L795,454.4766 L785,444.4766 L551,444.4766" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M785,444.4766 L785,454.4766 L795,454.4766 L785,444.4766" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="213.3003" x="557" y="461.5435">5. Im Falle von SLAAC erfolgt die</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="207.4033" x="573.5293" y="476.6763">Aushandlung der IPv6-Adressen</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="202.8521" x="573.5293" y="491.8091">mit den anderen Hosts im Netz</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="101.3213" x="573.5293" y="506.9419">vom Client aus.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="4.1323" x="557" y="522.0747"> </text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="171.4819" x="577.6616" y="537.2075">Im Falle von DHCPv6 frägt</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="188.7222" x="577.6616" y="552.3403">der Client beim betreffenden</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="181.9365" x="577.6616" y="567.4731">DHCPv6-Server nach der IP-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="171.2915" x="577.6616" y="582.606">Adresse und ggf. weiteren</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="168.6318" x="577.6616" y="597.7388">Parametern wie DNS oder</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="92.7329" x="573.5293" y="612.8716">Search-Listen.</text><g class="message" data-participant-1="rechts" data-participant-2="mitte"><polygon fill="#181818" points="812.4092,661.2031,802.4092,665.2031,812.4092,669.2031,808.4092,665.2031" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="806.4092" x2="1215.9263" y1="665.2031" y2="665.2031"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="378.7329" x="818.4092" y="660.1372">(Port 546) Antwort mit REQUESTED INFORMATION Unicast</text></g><path d="M1221,630.9375 L1221,685.9375 L1475,685.9375 L1475,640.9375 L1465,630.9375 L1221,630.9375" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1465,630.9375 L1465,640.9375 L1475,640.9375 L1465,630.9375" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="233.9111" x="1227" y="648.0044">6. Bei DHCPv6 antwortet der Server</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="194.3652" x="1243.5293" y="663.1372">und teilt dem Client die ange-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="162.792" x="1243.5293" y="678.27">forderten Parameter mit.</text><!--SRC=[dLNDRfj04BxxAKOvDGU8sYQfP5MLg4qKgmbEmSwXocLj1bWP5cjtiIK_JvwXBv0Nw-oFVqYJ7ie113kp-_tC39hh6W5bqTQbHBwi4A95pRe2MASWemyQSbGmgZaAhM21dDub_6YRfXDynJHl1JJSH3MGHkF7u69yEthON0SPoWrAzIG6WpMJcY_vcWaDPqy2x6M28O0iJX_Zz68SnVVJn2uyYJDW2cekLkhjL8S6Bk2sLVeqXu1eV3l7eNhZG9ygaRYgmS0U2r-3m6q6G_Zmq4eDLvTVpk7zAvtEPt4AsVHkCfhCejbacWn4I_cIbwJX43w6C2RX3695WgywaVDIWoA9hNx81Iqxj6dRQNh9sffeQAjnaB1b9OqVA7oKe2y-L82nx7GB9afKowfkbK91AOye5rpadIX3Jp7uTc0uJopkQ1QFzqJ8d3YTJRBuFavccQMur-7wt36hiI3nX_39CVEWIxuWLWOAH6ABT7g5HC-XsdMADGswYZ7LiQmuvgy0gi17aqGm4OOUwk21ITQWurehsbjl3PmzxvvomTlAKVMkc10w_5-JlRiaBc6Wld6d-O87L_1zrpyVNOUYbTGwsdKB9sKa7A7rZ8zosaXpXOrjEjKM1foHmpjlKqW-JOes85wUbvKoXL7YkgQgToNoYtHVTs9bWiWHGJg7yBVvdjG_hN_V_CkU-VOKJJ1s76jjTA93wL58Lbe0lXkj7gG18IknUlbDShqkWOFvWS_f5K4uSF29XsjSWfB6F-TnDeF5RXl29BcPflUs3myBSzADkO5njFk4pX3WYZ8RkB7kRcYoPNTHDFBpqI5sQA9ELKpaDM6ryt1Y9bwKIpJjvaBSK3JiAO2UhlDv0mdgdGlPjCr-bj6u3MblpxM7mPTN8L-UI-q3p9a-aqPoGpSjiIYinXuYzEQmcnOEwbvHZzTANPP525kg68FLhv-qt9QOZvCCslmmOJ9aSba5TznKtjuFqr87GuurSsXN8ugtWmhkr2HlJhzzhaFuJdyShm1pcw2sF1oluwJGo6lt6_B26BVC6FHqVVkHFWTU1axu1m00]--></g></svg></div> </p> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> <strong>Hinweis.:</strong> Das <strong>N</strong>eighbor <strong>D</strong>iscovery <strong>P</strong>rotocol basiert auf <strong><a href="https://de.wikipedia.org/wiki/ICMPv6" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/ICMPv6" rel="ugc nofollow noopener">ICMPv6-Nachrichten</a></strong> und nutzt die beiden <strong>UDP</strong>-Ports <strong><code>546</code></strong> und <strong><code>547</code></strong>. <strong>R</strong>outer <strong>A</strong>dvertisement (<strong><a href="https://de.wikipedia.org/wiki/Neighbor_Discovery_Protocol#Router_Advertisement_%E2%80%93_Type_134" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Neighbor_Discovery_Protocol#Router_Advertisement_%E2%80%93_Type_134" rel="ugc nofollow noopener">RA</a></strong> ) Typ <strong><code>134</code></strong> und auch <strong>R</strong>outer <strong>S</strong>olicitation (<strong><a href="https://de.wikipedia.org/wiki/Neighbor_Discovery_Protocol#Router_Solicitation_%E2%80%93_Type_133" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Neighbor_Discovery_Protocol#Router_Solicitation_%E2%80%93_Type_133" rel="ugc nofollow noopener">RS</a></strong>) Typ <strong><code>133</code></strong> sind wesentliche Bestandteile des <strong>N</strong>eighbor <strong>D</strong>iscovery <strong>P</strong>rotocol. Router Solicitation (RS) und Router Advertisement (RA) Messages sind in <strong><a href="https://www.rfc-editor.org/rfc/rfc4861.html" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4861.html" rel="ugc nofollow noopener">RFC 4861</a></strong> definiert. </p> </div> </div> <h3 class="sectionedit5 page-header pb-3 mb-4 mt-5" id="router_solicitation_rs_-_und_router_advertisement_ra_-nachrichten">Router Solicitation (RS)- und Router Advertisement (RA)-Nachrichten</h3> <div class="level3"> </div> <h4 class="sectionedit6" id="rs_router_solicitation_icmpv6_type_133">RS — Router Solicitation (ICMPv6 type 133)</h4> <div class="level4"> <p> Mit Hilfe von <strong>Router Solicitation Nachrichten</strong> versucht ein Client Router im Netzwerk zu finden. So kann dieser bei einer Antwort direkt mit der Konfiguration seines Netzwerks fortfahren und muss nicht warten bis der Router selbst per multicast eine entsprechende Router Advertisement Nachricht verschickt. Bei einer Router Solicitation Nachricht handelt sich um eine ICMPv6-Nachricht, die an die All-Router-Multicast-Adresse (ff02::2) gesendet wird. </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Hosts erfragen mit Hilfe von RS-Nachrichten, ob ein Routern im Netzwerk verfügbar ist.</div> </li> <li class="level1"><div class="li"> Auf RS-Nachrichten antworten Router mit einer RA-Nachrichten und liefern so wichtige Informationen zur Netzwerkseitigen Konfiguration.</div> </li> </ul> </div> <h4 class="sectionedit7" id="ra_router_advertisement_icmpv6_type_134">RA — Router Advertisement (ICMPv6 type 134)</h4> <div class="level4"> <p> <strong>Router Advertisment Nachrichten</strong> werden vom Server entweder regelmässig an alle Clients im Netz oder ebnen speziell auf An Anfrage durch einen Client versandt. Es handelt sich also im ersten Fall um eine ICMPv6-Nachricht, die an die All-Nodes-Multicast-Adresse (ff02::1) oder eben als Unicast-Nachricht an einen bestimmten Host gesendet wird.e </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Ein Router verwenden diese RA-Nachrichten, um seine Anwesenheit, Netzwerkparameter und weitere Konfigurationsoptionen für Hosts bekannt zu geben.</div> </li> <li class="level1 node"><div class="li"> Hosts verwerten diese RA-Nachrichten, um daraus z.B. den Default-Router, den bzw. die Netzwerk-Präfixe, die Link-MTU oder ob z.B. ein DHCPv6-Server im Netz verfügbar ist, sowie weitere relevante Netzwerkinformationen abzuleiten. <br/> Ist ein DHCPv6-Server verfügbar ist, wird dies durch zwei Flags in der Router-Ankündigung angezeigt. Diese Flags sind das Konfigurationsflag für die verwaltete Adresse und das andere Konfigurationsflag. Das M-Bit und das O-Bit werden verwendet, um diese Flaggen zu setzen. Das M-Bit zeigt an, dass DHCPv6-Dienste für Adress- und Konfigurationseinstellungen verfügbar sind. Das O-Bit zeigt an, ob andere Konfigurationsparameter als die IP-Adresse über den DHCPv6-Dienst verfügbar sind. RAs bestehen also aus bestimmten Flags und Optionen (Präfix, MTU, <abbr title="Domain Name System">DNS</abbr>, SLLA - Src Link-Layer Address). Die wichtigsten Optionen sind hierbei:</div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Address Autoconfiguration A-Flag</strong> : Eine '1' bedeutet, dass der Host seine eigene IPv6-Adresse mittels SLAAC erstellt.</div> </li> <li class="level2"><div class="li"> <strong>Home-Agent H-Flag</strong>: Dieses Flag wird verwendet, um anzuzeigen, dass es sich bei dem beworbenen Präfix um ein Heimnetzwerk-Präfix handelt, insbesondere für Mobile IPv6, dass sie also somit als Home Agent für Mobile IPv6 fungieren und Dienste für mobile Knoten bereitstellen können.</div> </li> <li class="level2"><div class="li"> <strong>On-link L-Flag</strong>: Ist dieses Flag gesetzt, wird definiert dass ein bestimmtes Präfix als „on-link“ betrachtet wird, d.h. dass Hosts Adressen innerhalb dieses Präfixes verwenden können, um direkt mit anderen Hosts auf demselben Link zu kommunizieren. Ist das L-Flag nicht gesetzt, müssen Hosts einen Router verwenden um Hosts in diesem Präfix erreichen zu können.</div> </li> <li class="level2"><div class="li"> <strong>Managed M-Flag</strong> : Eine '1' bedeutet, dass die Adresse durch Stateful DHCPv6 bereitgestellt wird.</div> </li> <li class="level2"><div class="li"> <strong>Other O-Flag</strong> : Eine '1' bedeutet, dass die Adresse von Stateless DHCPv6 bereitgestellt wird, was für die Bereitstellung von Optionen nützlich ist, wenn der Client SLAAC-StatelessAddress Autoconfiguration durchführt.</div> </li> <li class="level2"><div class="li"> <strong>Router-Präferenz (Prf)</strong>: Der Wert in diesem Feld steht für die Präferenzstufe des Routers, der die RA-Nachricht sendet. So wird z.B. darüber ermittelt ob das Gateway als Standardgateway fungieren soll. Das Prf-Feld kann drei Werte annehmen: Hoch (0x00), Mittel (0x40) oder Niedrig (0x80). Router mit einem höheren Präferenzwert werden gegenüber Routern mit niedrigeren Werten bevorzugt.</div> </li> </ul> </li> </ul> </div> <h2 class="sectionedit8 page-header pb-3 mb-4 mt-5" id="linux_ipv6_router_advertisement_daemon_radvd">Linux IPv6 Router Advertisement Daemon (radvd)</h2> <div class="level2"> <p> Der Router Advertisement Daemon <strong><a href="https://radvd.litech.org/" class="urlextern" target="_tab" title="https://radvd.litech.org/" rel="ugc nofollow noopener">radvd</a></strong> wird auf Linux-Systemen häufig dort ausgeführt, die als IPv6-Router fungieren. Dieser sendet in regelmässigen Abständen bzw. auch auf Anforderung eines Hosts/Clients, sofern dieser eine Router-Solicitation-Nachricht gesendet hatte, Router-Advertisement-Nachrichten gemäss <strong><a href="https://www.rfc-editor.org/rfc/rfc2461" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc2461" rel="ugc nofollow noopener">RFC 2461</a></strong> an ein lokales Ethernet-<abbr title="Local Area Network">LAN</abbr>. </p> <p> Das Projekt selbst ist in einem Git-Repo auf <strong><a href="https://github.com/radvd-project/radvd-project.github.io" class="urlextern" target="_tab" title="https://github.com/radvd-project/radvd-project.github.io" rel="ugc nofollow noopener">GitHub</a></strong> geführt. </p> <p> Die Installation des IPv6 Router Advertisement Daemon (radvd) erfolgt unter <a href="https://archlinux.org/" class="urlextern" target="_tab" title="https://archlinux.org/" rel="ugc nofollow noopener">Arch Linux</a> mit dem Paket <strong><a href="https://archlinux.org/packages/extra/x86_64/radvd/" class="urlextern" target="_tab" title="https://archlinux.org/packages/extra/x86_64/radvd/" rel="ugc nofollow noopener">radvd</a></strong> aus dem <strong><a href="https://wiki.archlinux.org/title/Official_repositories#extra" class="urlextern" target="_tab" title="https://wiki.archlinux.org/title/Official_repositories#extra" rel="ugc nofollow noopener">Extra Repository</a></strong> </p> </div> <h3 class="sectionedit9 page-header pb-3 mb-4 mt-5" id="installation_des_radvd">Installation des radvd</h3> <div class="level3"> <p> Die Installation erfolgt einfach unter Arch Linux mit Hilfe des Paketmanagers <strong><code>pacman</code></strong>. </p> <pre class="code"> # pacman -S radvd</pre> <p> bzw. </p> <pre class="code"> $ sudo pacman -S radvd</pre> <p> Bei Bedarf können wir uns hier gezielt informieren woher das Paket kommt und was es beinhaltet. </p> <pre class="code"> # pacman -Qil radvd</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_1">Paketinhalt und -info des Pakets radvd </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_1"><pre class="code">Name : radvd Version : 2.19-1 Description : IPv6 Router Advertisement Daemon Architecture : x86_64 URL : http://www.litech.org/radvd/ Licenses : custom Groups : None Provides : None Depends On : glibc Optional Deps : None Required By : None Optional For : None Conflicts With : None Replaces : None Installed Size : 141.49 KiB Packager : Thore Bödecker <foxxx0@archlinux.org> Build Date : Sat 06 Mar 2021 03:20:43 PM CET Install Date : Sat 04 May 2024 11:25:47 AM CEST Install Reason : Explicitly installed Install Script : No Validated By : Signature radvd /etc/ radvd /etc/radvd.conf radvd /usr/ radvd /usr/bin/ radvd /usr/bin/radvd radvd /usr/bin/radvdump radvd /usr/lib/ radvd /usr/lib/systemd/ radvd /usr/lib/systemd/system/ radvd /usr/lib/systemd/system/radvd.service radvd /usr/share/ radvd /usr/share/licenses/ radvd /usr/share/licenses/radvd/ radvd /usr/share/licenses/radvd/COPYRIGHT radvd /usr/share/man/ radvd /usr/share/man/man5/ radvd /usr/share/man/man5/radvd.conf.5.gz radvd /usr/share/man/man8/ radvd /usr/share/man/man8/radvd.8.gz radvd /usr/share/man/man8/radvdump.8.gz</pre> </div> </div> <h3 class="sectionedit10 page-header pb-3 mb-4 mt-5" id="grund-konfiguration">Grund-Konfiguration</h3> <div class="level3"> </div> <h4 class="sectionedit11" id="firewall_paketfilter_-_firewalld">Firewall/Paketfilter - firewalld</h4> <div class="level4"> <p> Bevor wir nun unseren <strong>radvd</strong> Konfigurieren und starten müssen wir natürlich sicherstellen, dass auf dem betreffendem Host auch die Kommunikationsbeziehungen entsprechend erlaubt sind. </p> <p> Wie auch schon früher bei <strong>CentOS</strong> ab Release <strong>7</strong> bzw. den nachfolgenden Relaese-Kandidaten <strong>Stream von RHEL</strong> nutzen wir auch unter <strong>Arch Linux</strong> den dynamischen <strong><a href="https://firewalld.org/" class="urlextern" target="_tab" title="https://firewalld.org/" rel="ugc nofollow noopener">firewalld</a></strong> Service. Ein grosser Vorteil der dynamischen Paketfilterregeln ist unter anderem, dass zur Aktivierung der neuen Firewall-Regel(n) nicht der Daemon durchgestartet werden muss und somit alle aktiven Verbindungen kurz getrennt werden. Sondern unsere Änderungen können <strong><em>on-the-fly</em></strong> aktiviert oder auch wieder deaktiviert werden. </p> <p> In folgendem Konfigurationsbeispiel gehen wir von einem Host aus, der zwei Firewall-Zonen hält, einmal die Zone <strong><code>idmz</code></strong> und einmal die Zone <strong><code>intra</code></strong>. Nur in der Zone <strong><code>intra</code></strong> soll später der <strong>radvd</strong> seine Router Advertisement Nachrichten verschicken bzw. auf entsprechende Anfragen antworten. </p> <p> Damit unsere Clients Verbindungen zu dem geöffneten <strong>dhcpv6-client</strong>-Port <strong>546/udp</strong> und <strong>dhcpv6-server</strong>-Port <strong>547/udp</strong> unseres radvd-Daemons aufbauen können, müssen wir für diese noch Änderungen am Paketfilter <strong>firewalld</strong> vornehmen. </p> <p> Mit Hilfe des Programms <strong>firewall-cmd</strong> legen wir nun eine <strong>permanente</strong> Regel in der Zone <strong>intra</strong> an. Genug der Vorrede, mit nachfolgendem Befehl werden die Ports für den Service <strong>dhcpv6</strong> geöffnet. </p> <pre class="code"> # firewall-cmd --permanent --zone=intra --add-service=dhcpv6</pre> <pre class="code">success </pre> <p> Anschliessend können wir den Firewall-Daemon einmal neu laden und überprüfen, ob die Regeln auch entsprechend unserer Definition, gezogen haben. </p> <pre class="code"> # firewall-cmd --reload</pre> <pre class="code">success</pre> <p> Werfen wir noch kurz einen Blick in die Zone <strong><code>intra</code></strong>: </p> <p> # firewall-cmd –zone=intra –list-services </p> <pre class="code">dhcpv6</pre> </div> <h4 class="sectionedit12" id="automatischer_start_des_daemon">automatischer Start des Daemon</h4> <div class="level4"> <p> Damit der Daemon <strong>radvd</strong> automatisch bei jedem Systemstart startet, kann die Einrichtung eines Start-Scriptes über folgenden Befehl erreicht werden: </p> <pre class="code"> # systemctl enable radvd.service</pre> <pre class="code"> Created symlink '/etc/systemd/system/multi-user.target.wants/radvd.service' → '/usr/lib/systemd/system/radvd.service'.</pre> <p> Ein Überprüfung ob der Dienst (Daemon) <strong>radvd</strong> wirklich bei jedem Systemstart automatisch mit gestartet wird, kann durch folgenden Befehl erreicht werden: </p> <pre class="code"> # systemctl is-enabled radvd.service</pre> <pre class="code"> enabled</pre> <div class="wrap_center wrap_round wrap_info plugin_wrap" style="width: 80%;"> <p> Starten werden wir den <strong>radvd</strong>-Daemon erst einmal noch nicht, da wir diesen ja noch konfigurieren müssen. Nachfolgend werden wir noch detailliert zu einzelnen Anwendungsfällen eingehen: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="#slaac_-_ipv6_stateless_address_auto-configuration" title="linux:radvd ↵" class="wikilink1">Konfigurationsbeispiel: SLAAC - IPv6 Stateless Address Auto-configuration</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="#router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6" title="linux:radvd ↵" class="wikilink1">Konfigurationsbeispiel: DHCPv6 - stateless und stateful</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="#musterkonfiguration_gua_via_slaac_und_ula_via_dhcpv6" title="linux:radvd ↵" class="wikilink1">Musterkonfiguration für GUA via SLAAC und statischen festen ULA mit Hilfe von DHCPv6</a></strong></div> </li> </ol> </div> </div> <h3 class="sectionedit15 page-header pb-3 mb-4 mt-5" id="konfigurationsbeispiel_fuer_slaac">Konfigurationsbeispiel für SLAAC</h3> <div class="level3"> </div> <h4 class="sectionedit16" id="was_ist_slaac_ipv6_stateless_address_autoconfiguration_und_wie_funktioniert_es">Was ist SLAAC (IPv6 Stateless Address Autoconfiguration) und wie funktioniert es</h4> <div class="level4"> <p> Bevor wir uns nun mit der Konfiguration unseres <strong>radvd</strong> beschäftigen, machen wir erst einmal klar, was SLAAC ist und wie es funktioniert. Jeder IPv6-Host in unserem Netz benötigt eine weltweit eindeutige Adresse, damit dieser auch ausserhalb dessen lokalen Segments kommunizieren zu können. </p> <p> <strong>SLAAC</strong><sup><a href="#fn__1" id="fnt__1" class="fn_top">1)</a></sup> ist von der Grundidee her ein einfacher und unkomplizierter Ansatz für die IPv6-Autoadressierung. SLAAC wird im <strong><a href="https://www.rfc-editor.org/rfc/rfc4862" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4862" rel="ugc nofollow noopener">RFC 4862</a></strong> beschrieben. In seiner aktuellen Implementierung, wie sie in <abbr title="Request for Comments">RFC</abbr> 4862 definiert ist, stellt SLAAC den Hosts keine <abbr title="Domain Name System">DNS</abbr>-Serveradressen zur Verfügung, weshalb es derzeit noch nicht allzu weit verbreitet ist. Dennoch kann SLAAC eine Option sein, wenn Host in unserem Netz diese, ohne einen Separaten Server/Dienst der verwaltet welcher Knoten welche IPv6-Adresse nun hat, diese ihre eigene IPv6-Adressen selbst automatisch konfigurieren sollen. Daher nennt man diesen Mechanismus auch zustandslose Adress-Autokonfiguration. SLAAC stellt jedoch keine <abbr title="Domain Name System">DNS</abbr>-Informationen bereit! Wobei ein hier von der Theorie her, in den Router Advertisement ein eigenen Header der dieses Problem künftig mal lösen können sollte. Eine weitere Herausforderung bei SLAAC ist das Thema <strong>DAD</strong><sup><a href="#fn__2" id="fnt__2" class="fn_top">2)</a></sup>. Wie bereits angemerkt gibt es keine übergeordnete Instanz, die die Vergabe der IPv6-Adressen überwacht, sprich es gibt keinen Server der verfolgt, welche Adressen bereits zugewiesen wurden und welche Adressen noch für eine Zuweisung verfügbar sind. Daher müssen die Knoten selbst, eigenständig und eigenverantwortlich alle doppelten Adresskonflikte nach folgender Logik aufzulösen: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Generieren der eigenen <strong><a href="#llago" title="linux:radvd ↵" class="wikilink1">LLA</a></strong><sup><a href="#fn__3" id="fnt__3" class="fn_top">3)</a></sup></div> </li> <li class="level1 node"><div class="li"> Ausführen der <strong><a href="#dadgo" title="linux:radvd ↵" class="wikilink1">DAD</a></strong></div> <ul class=" fix-media-list-overlap"> <li class="level2 node"><div class="li"> dabei jeweils Auswerten des DAD-Ergebnisses:</div> <ul class=" fix-media-list-overlap"> <li class="level3"><div class="li"> ist dieses positiv, die erzeugte IPv6-Adresse <strong><em class="u">bereits in</em></strong> Verwendung zurück zum Punkt Erzeugen einer IPv6-Adresse…</div> </li> <li class="level3"><div class="li"> ist dieses negativ, die erzeugte IPv6-Adresse ist noch <strong><em class="u">nicht in</em></strong> Verwendung, SLAAC ist erfolgreich und die IPv6-Adresse kann benutzt werden.</div> </li> </ul> </li> </ul> </li> <li class="level1"><div class="li"> Senden einer <strong><a href="#rssend" title="linux:radvd ↵" class="wikilink1">RS</a></strong><sup><a href="#fn__4" id="fnt__4" class="fn_top">4)</a></sup> Nachricht in das Netzsegment </div> </li> <li class="level1"><div class="li"> <a href="#ipgeneration" title="linux:radvd ↵" class="wikilink1">Erzeugen</a> einer <strong>ULA</strong><sup><a href="#fn__5" id="fnt__5" class="fn_top">5)</a></sup> bzw. <strong>GUA</strong><sup><a href="#fn__6" id="fnt__6" class="fn_top">6)</a></sup>-IPv6-Adresse</div> </li> <li class="level1 node"><div class="li"> Ausführen der <strong>DAD</strong></div> <ul class=" fix-media-list-overlap"> <li class="level2 node"><div class="li"> dabei jeweils Auswerten des DAD-Ergebnisses:</div> <ul class=" fix-media-list-overlap"> <li class="level3"><div class="li"> ist dieses positiv, die erzeugte IPv6-Adresse <strong><em class="u">bereits in</em></strong> Verwendung zurück zum Punkt Erzeugen einer IPv6-Adresse…</div> </li> <li class="level3"><div class="li"> ist dieses negativ, die erzeugte IPv6-Adresse ist noch <strong><em class="u">nicht in</em></strong> Verwendung, SLAAC ist erfolgreich und die IPv6-Adresse kann benutzt werden.</div> </li> </ul> </li> </ul> </li> </ol> <p> Werfen wir nun noch einen Blick auf die einzelnen Schritte: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>Der Host generiert sich selbst eine LLA (Link Local Address)</strong> <a name="anchor_llago"> </a> : <br/> Verbindet sich ein Host mit unserem IPv6-Netzwerk, konfiguriert sich dieser zunächst eine <strong><a href="https://www.rfc-editor.org/rfc/rfc3927" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc3927" rel="ugc nofollow noopener">Link Local Address</a></strong>. Dies ist notwendig, da der Host für alle weiteren Schritte auf Layer 3 mit den anderen Hosts im gleichen Netzwerksegment in Verbindung treten zu können. Hierzu wird aller Voraussicht nach sofern der Client sich an <strong><a href="https://www.rfc-editor.org/rfc/rfc3927" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc3927" rel="ugc nofollow noopener">RFC 3927</a></strong> hält, aus der Kombination <strong>Link Lokal Prefix</strong> <strong><code>FE80::/64</code></strong> und der EUI-64-Schnittstellenkennung, welche er aus der MAC-Adresse der Netzwerkkarte/WLAN-Adapter generiert, eine entsprechende Adresse erzeugen. <br/> Benutzen wir z.B unter Arch Linux auf unserem Client-Host den NetworkMangers können wir uns die generierte LLA wie folgt anzeigen lassen <strong><code>ip addr show <-linkname-> | grep scope\ link</code></strong> Im Falle des Netzwerkadapters <strong><code>enp0s25</code></strong> wäre das dann: <pre class="code"> # ip addr show enp0s25 | grep scope\ link</pre> <pre class="code"> inet6 fe80::fa4e:fbee:c806:f070/64 scope link noprefixroute</pre> <p> Die generierte DUID können wir uns wie folgt anzeigen lassen <strong><code>nmcli connection show <-linkname-> | grep dhcp6_client_id</code></strong>. Im Falle unseres Netzwerkadapters mit dem Namen <strong><code>enp0s25</code></strong> wäre das dann: </p> <pre class="code"> # nmcli connection show enp0s25 | grep dhcp6_client_id</pre> <pre class="code">DHCP6.OPTION[1]: dhcp6_client_id = 00:04:80:6f:6d:f5:a6:44:99:a4:3f:9f:09:7c:69:8d:e8:d2</pre> <p> <br/> </p> </div> </li> <li class="level1"><div class="li"> <strong>Der Host führt eine DDA (Duplicate Address Detection) durch</strong> <a name="anchor_dadgo"> </a> : <br/> Unter <strong><a href="#lla" title="linux:radvd ↵" class="wikilink1">Aufgabe 1</a></strong> haben wir gesehen, dass sich der Clienthost selbst eine Link Local Address generiert hat. Theoretisch könnte es nun passieren, dass warum auch immer ein Host sich eine <strong>LLA</strong> gegeben hat, die bereits schon in Verwendung ist. Er muss also selbst sicherstellen, dass seine <strong>LLA</strong> im lokalen Netzwerk eindeutig und noch nicht in Verwendung ist, auch wenn die Wahrscheinlichkeit dass das passieren könnte durchaus sehr gering ist, aber ausgeschlossen kann dies def. <em class="u">nicht</em> werden!! Der Host muss also eine <strong>DAD</strong> anstossen. <br/> Im <strong><a href="https://www.rfc-editor.org/rfc/rfc4429" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4429" rel="ugc nofollow noopener">RFC 4429 - Optimistic Duplicate Address Detection (DAD) for IPv6</a></strong> ist genau beschrieben, was DAS ist und wie es funktioniert. Grundlegend kann man festhalten, dass jeder Host einer Multicast-Gruppe beitritt, welche durch Adresse <strong><code>FF02::1:FFnn:nnnn</code></strong> identifiziert wird, wobei <strong><code>nn.nnnn</code></strong> die letzten sechs hexadezimalen Werte der IPv6-Unicast-Adresse entspricht, egal ob nun dies eine GUA oder eine ULA ist. Aus diesem Grund tritt der Host nun automatisch jeder generierten Solicited-Node-Multicast-Gruppe bei, egal ob es sich um eine link-lokale oder globale IPv6-Adresse handelt. Dieser Vorgang wird als Duplicate Address Detection (DAD) bezeichnet und wird bei jeder neuen Adresszuweisung durchgeführt. <br/> <br/> </div> </li> <li class="level1"><div class="li"> <strong>Der Host sendet eine RS (Router Solicitation) Nachricht in das Netzsegment</strong> <a name="anchor_rssend"> </a> : <br/> Damit <strong>SLAAC</strong> ordnungsgemäss funktionieren kann, ist es notwendig, dass die beiden ersten Schritte erfolgreich abgearbeitet worden sind. Ohne Erfolgreiche Generierung einer <strong>LLA</strong> und anschliessender <strong>DAD</strong> dieser erzeugten Adresse, kann nicht weiter fortgefahren werden, auch wenn diese beiden Funktionen nicht direkt Teil der Stateless Autoconfiguration-Funktion sind, denn <strong><em class="u">ohne</em></strong> eine gültige link-local-Adresse kann der neue Host <strong><em class="u">nicht</em></strong> auf Layer 3 mit allen anderen IPv6-Knoten im selben Netzwerk-Segment kommunizieren. <br/> Der neue Host sendet zunächst eine ICMPv6-Nachricht, genauer gesagt eine Router Solicitation (RS) in das Netzwerksegment und frägt somit alle IPv6-Router, die an dieses Segment angeschlossen sind, nach dem verwendeten globalen Unicast-Präfix. Als Zieladresse verwendet er dabei <strong><code>FF02::2</code></strong> und Quell-IP-Adresse benutzt er seine zuvor generierte <strong>LLA</strong>. Nur Router, die selbst auch der Multicast-Gruppe <strong><code>FF02::2</code></strong> zugehörig sind, werden auf die empfangene outer Solicitation-Nachricht mit einer ICMPv6-Nachricht namens Router Advertisement (RA) antworten. Diese RA-Nachricht enthält das globale IPv6-Präfix auf dem Link und sowie die Präfixlänge. Bei der Quell-IPv6-Adresse verwendet dann der Router eine eigene link-lokale Adresse und als Ziel die All-Nodes-Multicast-Adresse <strong><code>FF02::1</code></strong>. Aktuell gibt es noch keine Möglichkeit DNA-Informationen in dem RA-ICMPv6-Paket mitzuschicken und so dem Client bekannt zu geben, obgleich theoretisch hierzu ein Feld in der <strong>RA</strong>-Nachricht existiert. <br/> <br/> </div> </li> <li class="level1"><div class="li"> <strong>Der Host generiert seine GUA (Global Unicast Address)</strong> <a name="anchor_llago"> </a> : <br/> Sobald der neue Host die Router Advertisement ICMPv6-NAchricht vom Router empfangen hat, kann der Host nun mit dem erhaltenen Präfix und seiner eigenen EUI-64-Schnittstellenkennung seine Global Unified Address (GUA) bzw, seine Unified Local Address (ULA) generieren, je nachdem welchen Präfix erhalten hat. Die Default-Route zu dieser gerade eben erzeugten IPv6-Adresse kann der Client-Host entsprechend setzen, die diese entweder in der RA-Nachricht explizit gesetzt wurde oder falls dies nicht der FAll war, an Hand der link-lokale Adresse des Routers der die RA-Meldung versandt hatte. Der SLAAC-Prozess ist aber noch nicht abgeschlossen, denn auch hier <strong><em class="u">muss</em></strong> der Client mit Hilfe einer <strong>DAD</strong> sicherstellen, dass seine automatisch generierte Adresse im lokalen Segment eindeutig ist! <br/> <br/> </div> </li> <li class="level1"><div class="li"> <strong>Der Host führt eine DAD (Duplicate Address Detection) durch</strong> : Wie auch schon bei <a href="#dadgo" title="linux:radvd ↵" class="wikilink1">Schritt 2</a> führt der Client-Host nun die erforderliche <strong>DAD</strong>-Überprüfung durch, damit sichergestellt ist, dass seine selbst generierte Adresse eindeutig ist! </div> </li> </ol> </div> <h4 class="sectionedit17" id="unique_local_ipv6_prefix">Unique Local IPv6 prefix</h4> <div class="level4"> <p> Nachdem wir uns nun eingehend mit den Grundlagen und Hintergründen zu SLAAC auseinander gesetzt haben, machen wir uns nun noch an die Konfiguration unseres <strong>radvd</strong>. Bevor wir zu Tat schreiten gehen wir noch speziell auf ein ganz besonderes Thema ein, nämlich dem <strong>unique local IPv6 prefix</strong> so wie dies im <strong><a href="https://datatracker.ietf.org/doc/html/rfc4193" class="urlextern" target="_tab" title="https://datatracker.ietf.org/doc/html/rfc4193" rel="ugc nofollow noopener">RFC 4193</a></strong> definiert wurde. </p> <p> IPv6-Unique-Local-Adressen (ULAs) werden ähnlich wie die IPv4-Local-Adressen 192.168.0.0/16 verwendet, wie wir diese aus der früheren IPv4-only Welt kannten, kurz Private IP-Adresse genannt. IPv4-Privatadressen wurden durch <strong><a href="https://datatracker.ietf.org/doc/html/rfc1918" class="urlextern" target="_tab" title="https://datatracker.ietf.org/doc/html/rfc1918" rel="ugc nofollow noopener">RFC 1918</a></strong> definiert, während IPv6-ULAs durch <strong><a href="https://datatracker.ietf.org/doc/html/rfc4193" class="urlextern" target="_tab" title="https://datatracker.ietf.org/doc/html/rfc4193" rel="ugc nofollow noopener">RFC 4193</a></strong> festgelegt wurden. Im Gegensatz zu ihrem IPv4-Gegenstück haben IPv6-Lokaladressen einen 40-Bit-Zufallsanteil, der sie eindeutig macht. Ziel der lokalen IPv6-Adressen ist es, dass bei einer Verbindung zweier privater IPv6-Netze/Lokationen, die über VPN verbunden sind, Adresskonflikte mit hoher Wahrscheinlichkeit ausgeschlossen werden können. </p> <p> Die empfohlene Methode zur Erzeugung einer globalen ID ist im <strong><a href="https://datatracker.ietf.org/doc/html/rfc4193#section-3.2.2" class="urlextern" target="_tab" title="https://datatracker.ietf.org/doc/html/rfc4193#section-3.2.2" rel="ugc nofollow noopener">RFC 4193 , Abschnitt 3.2.2</a></strong> definiert: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Bestimmen der aktuellen Uhrzeit.</div> </li> <li class="level1"><div class="li"> Beschaffung einer eindeutigen Systemkennung, z.B. einer EUI-64, einer MAC-Adresse oder Generierung einer einigermassen zufälligen Zahl.</div> </li> <li class="level1"><div class="li"> Durch die Verkettung der beiden vorgenannten Werte, wie Uhrzeit und Zufallszahl wird ein eindeutiger Schlüssel generiert.</div> </li> <li class="level1"><div class="li"> Anschliessend wird ein SHA1-Digest des generierten Schlüssels berechnet.</div> </li> <li class="level1"><div class="li"> Aus den letzten 40 Bit des ermittelten SHA1-Digest wird als globale ID verwendet.</div> </li> </ol> <p> Das Ganze brauchen wir natürlich <em class="u">nicht</em> manuell durchführen, sondern wir bedienen uns hierzu des <strong><a href="https://cd34.com/rfc4193/" class="urlextern" target="_tab" title="https://cd34.com/rfc4193/" rel="ugc nofollow noopener">ULA-Generators von cd34</a></strong>. Bei unserem Konfigurationsbeispiel gehen wir mal davon aus, dass uns <strong><code>fdb6:cb48:9d77:0::/64</code></strong> als <strong>unique local IPv6 prefix</strong> vorgeschlagen wurde. </p> </div> <h4 class="sectionedit18" id="slaac_konfiguration_beim_radvd">SLAAC Konfiguration beim radvd</h4> <div class="level4"> <p> Bei der Installation des Paketes <strong><a href="https://radvd.litech.org/" class="urlextern" target="_tab" title="https://radvd.litech.org/" rel="ugc nofollow noopener">radvd</a></strong> aus dem <strong><a href="https://archlinux.org/packages/extra/x86_64/radvd/" class="urlextern" target="_tab" title="https://archlinux.org/packages/extra/x86_64/radvd/" rel="ugc nofollow noopener">extra-Repository von ArchLinux</a></strong> ist eine default Konfigurationsdatei <strong><code>/etc/radvd.conf</code></strong> dabei. Diese sichern wir uns jedoch und beginnen von the scratch mit unserer eigenen individuellen Konfigurationsdatei. </p> <pre class="code"> # cp -a /etc/radvd.conf /etc/radvd.conf.orig</pre> <p> Im Abschnitt Grundlagen haben wir u.a. im Kapitel <strong><a href="#ra_router_advertisement_icmpv6_type_134" title="linux:radvd ↵" class="wikilink1">RA — Router Advertisement (ICMPv6 type 134)</a></strong> gelernt, dass mit Hilfe von diversen Flags definiert werden kann, wie den Clients mitgeteilt werden kann, welche Art und Weise bei der IPv6-Zuweisung beschritten werden soll. </p> <p> Bei unserem Konfigurationsbeispiel hier gehen wir für den Router Advertisement Daemon <strong>radvd</strong> für die Adressvergabe über <strong>SLAAC</strong> von folgenden Eckwerten aus: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>Netzwerkinterface</strong> : <br/> Der <strong>radvd</strong> soll nure auf dem Netzwerkinterface <strong><code>eth1</code></strong> operieren, also dort lauscht er auf Router Solicitation ICMPv6-Nachrichten neuer Clients und beantwortet selbige mit Router Advertisements ICMPv6-Nachrichten bzw. sendet auf dieser Netzwerkschnittstelle regelmäßig seine Router Advertisements ICMPv6-Nachrichten an alle Clients im lokalen betreffenden Netz.</div> </li> <li class="level1"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>off</code></strong> (Adresskonfiguration über SLAAC)</div> </li> <li class="level1"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level1"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>on</code></strong> (Adresskonfiguration über SLAAC)</div> </li> <li class="level1 node"><div class="li"> <strong>Global-Scope Address Prefix</strong> : <br/> <strong><code>2001:a:bcd:1234</code></strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Route</strong> : <br/> <strong><code>2001:a:bcd:1234::/64</code></strong> und eine Gültigkeit von einer 1/2 Stunde, also <strong><code>1800</code></strong> Sekunden.</div> </li> </ul> </li> <li class="level1 node"><div class="li"> <strong>Unique Local IPv6 prefix</strong> : <br/> Hier verwenden wir den zuvor erzeugten Prefix von <strong><code>fdb6:cb48:9d77:0::/64</code></strong>.</div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Route</strong> : <br/> <strong><code>fdb6:cb48:9d77:0::/64</code></strong> ebenfalls eine Gültigkeit von <strong><code>1800</code></strong> Sekunden.</div> </li> </ul> </li> </ul> <p> Daraus ergibt sich folgende Konfigurationsdatei für unseren <strong>radvd</strong>: </p> <pre class="code"> # vim /etc/radvd.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=5" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/radvd.conf</a></dt> <dd><pre class="code file bash"><span class="co0"># Configuration example for the router advertisement daemon radvd </span> <span class="co0"># for address assignment via SLAAC:</span> <span class="co0"># - M-flag: AdvManagedFlag = off (address configuration via SLAAC)</span> <span class="co0"># - O-flag: AdvOtherConfigFlag = on (obtaining a DNS server list </span> <span class="co0"># and a domain name from a Stateless DHCPv6 server, but</span> <span class="co0"># not addressing information. </span> <span class="co0"># - A-flag: AdvAutonomous = on (address configuration via SLAAC)</span>   interface eth1 <span class="br0">{</span> <span class="co0"># A flag indicating whether or not the router sends periodic </span> <span class="co0"># router advertisements and responds to router solicitations.</span> <span class="co0"># This option no longer has to be specified first, but it needs</span> <span class="co0"># to be on to enable advertisement on this interface.</span> AdvSendAdvert on;   <span class="co0"># The maximum time allowed between sending unsolicited multi-</span> <span class="co0"># cast router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 4 seconds and no greater than 1800 seconds.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.07.</span> <span class="co0"># For values less than 0.2 seconds, 0.02 seconds is added to </span> <span class="co0"># account for scheduling granularities as specified in RFC3775.</span> MaxRtrAdvInterval <span class="nu0">600</span>;   <span class="co0"># The minimum time allowed between sending unsolicited multicast</span> <span class="co0"># router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 3 seconds and no greater than </span> <span class="co0"># 0.75 * MaxRtrAdvInterval.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.03.</span> MinRtrAdvInterval <span class="nu0">200</span>;   <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvDefaultPreference medium;   <span class="co0"># Mobile IPv6 support, when set, indicates that sending router is </span> <span class="co0"># able to serve as Mobile IPv6 Home Agent.</span> <span class="co0"># When set, minimum limits specified by Mobile IPv6 are used for </span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvHomeAgentFlag off;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># address autoconfiguration in addition to any addresses </span> <span class="co0"># autoconfigured using stateless address autoconfiguration.</span> <span class="co0"># The use of this flag is described in RFC 4862.</span> <span class="co0"># M-flag - if it is set to 1, this informs hosts that they can </span> <span class="co0"># obtain a global address as well as DNS and a domain name from</span> <span class="co0"># a Stateful DHCPv6 server. Typically this means that auto-</span> <span class="co0"># addressing using SLAAC is not allowed on this segment and both</span> <span class="co0"># the A-flag and the O-flag are set to 0.</span> AdvManagedFlag off;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># autoconfiguration of other (non-address) information.</span> <span class="co0"># The use of this flag is described in RFC 4862</span> <span class="co0"># O-flag - if it is set to on, this informs hosts that they can</span> <span class="co0"># obtain a DNS server list and a domain name from a Stateless </span> <span class="co0"># DHCPv6 server, but not addressing information. Typically it </span> <span class="co0"># works in conjunction with SLAAC for auto-addressing and both</span> <span class="co0"># the A-flag and the O-flag are set to on.</span> <span class="co0">#</span> AdvOtherConfigFlag on;   <span class="co0"># The time, in milliseconds, that a node assumes a neighbor is </span> <span class="co0"># reachable after having received a reachability confirmation.</span> <span class="co0"># Used by the Neighbor Unreachability Detection algorithm (see</span> <span class="co0"># Section 7.3 of RFC 4861).</span> <span class="co0"># A value of zero means unspecified (by this router).</span> <span class="co0"># Must be no greater than 3,600,000 milliseconds (1 hour).</span> AdvReachableTime <span class="nu0">0</span>;   <span class="co0"># The time,in milliseconds, between retransmitted Neighbor Soli-</span> <span class="co0"># citation messages. Used by address resolution and the Neighbor</span> <span class="co0"># Unreachability Detection algorithm (see Sections 7.2 and 7.3 </span> <span class="co0"># of RFC 4861). A value of zero means unspecified (by this router).</span> AdvRetransTimer <span class="nu0">0</span>;   <span class="co0"># The default value that should be placed in the Hop Count field of</span> <span class="co0"># the IP header for outgoing (unicast) IP packets. The value should</span> <span class="co0"># be set to the current diameter of the Internet.</span> <span class="co0"># The value zero means unspecified (by this router).</span> AdvCurHopLimit <span class="nu0">64</span>;   <span class="co0"># The lifetime associated with the default router in units of seconds.</span> <span class="co0"># The maximum value corresponds to 18.2 hours. A lifetime of 0 indi-</span> <span class="co0"># cates that the router is not a default router and should not appear</span> <span class="co0"># on the default router list. The router lifetime applies only to the</span> <span class="co0"># router's usefulness as a default router; it does not apply to in-</span> <span class="co0"># formation contained in other message fields or options. Options that</span> <span class="co0"># need time limits for their information include their own lifetime </span> <span class="co0"># fields.</span> <span class="co0"># Must be either zero or between MaxRtrAdvInterval and 9000 seconds.</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval (Minimum 1 second).</span> AdvDefaultLifetime <span class="nu0">1800</span>;   <span class="co0"># When set, the link-layer address of the outgoing interface is </span> <span class="co0"># included in the RA.</span> AdvSourceLLAddress on;   <span class="co0"># global-scope address prefix</span> prefix <span class="nu0">2001</span>:a:bcd:<span class="nu0">1234</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous on;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   <span class="co0"># route for global-scope address prefix</span> route <span class="nu0">2001</span>:a:bcd:<span class="nu0">1234</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0">#</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   <span class="co0"># unique local prefix</span> prefix fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous on;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   <span class="co0"># route for unique local prefix</span> route fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0"># </span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   <span class="br0">}</span>;</pre> </dd></dl> <p> Wollen wir die Kondfigurationsdate ohne die Kommentare sehen, grep'en wir einfach entspprechend danach. </p> <pre class="code"> # grep -Ev '(^.*#|^$)' /etc/radvd.conf</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_2">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_2"><pre class="code">interface eth1 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; AdvDefaultPreference medium; AdvHomeAgentFlag off; AdvManagedFlag off; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; prefix fdb6:cb48:9d77:0::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route fdb6:cb48:9d77:0::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; };</pre> </div> <p> Bevor wir nun unseren <strong>radvd</strong> starten, führen wir noch einen Konfigurationstest durch. Hierbei hilft uns das <strong><code>radvd</code></strong>-Binary. Alle möglichen Optionen können wir uns hier mit der Option <strong><code>--help</code></strong> anzeigen lassen. </p> <pre class="code"> # radvd --help</pre> <pre class="code">usage: radvd -C, --config=PATH Set the config file. Default is /etc/radvd.d. -c, --configtest Parse the config file and exit. -d, --debug=NUM Set the debug level. Values can be 1, 2, 3, 4 or 5. -f, --facility=NUM Set the logging facility. -h, --help Show this help screen. -l, --logfile=PATH Set the log file. -m, --logmethod=X Set method to: syslog, stderr, stderr_syslog, logfile, stderr_clean, or none. -n, --nodaemon Prevent the daemonizing. -p, --pidfile=PATH Set the pid file. -t, --chrootdir=PATH Chroot to the specified path. -u, --username=USER Switch to the specified user. -v, --version Print the version and quit.</pre> <p> Wir prüfen also nun die Konfigurationsdatei unseres <strong>radvd</strong> auf syntaktische Fehler. </p> <pre class="code"> # radvd -cC /etc/radvd.conf</pre> <pre class="code">[Jun 28 17:38:26] radvd (1284): config file, /etc/radvd.conf, syntax ok</pre> <p> Nun starten wir unseren <strong>radvd</strong> Daemon. </p> <pre class="code"> # systemctl start radvd.service</pre> <p> Im journald wir der Start entsprechend dokumentiert. </p> <pre class="code"> # journalctl -fu radvd</pre> <pre class="code">Jun 28 17:42:47 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jun 28 17:42:47 vml000110 radvd[1317]: [Jun 28 17:42:47] radvd (1317): version 2.19 started</pre> <p> Bei Beadrf können wir natürlich auch den Status unseres Daemons jederzeit abfragen. </p> <pre class="code"> # systemctl status radvd.service</pre> <p> <pre class="code"> <font style="color: rgb(29, 180, 29)"><b>●</b></font> radvd.service - IPv6 Router Advertisement Daemon Loaded: loaded (/usr/lib/systemd/system/radvd.service; </font><font style="color: rgb(29, 180, 29)"><b>disabled</b></font>; preset: <font style="color: rgb(201, 214, 95)"><b>disabled</b></font>) Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Fri 2024-06-28 17:42:47 CEST; 11min ago Invocation: 3d6734874ec54a44b3e94fa6cbebee0a Main PID: 1317 (radvd) Tasks: 2 (limit: 9510) Memory: 380K (peak: 1.5M) CPU: 15ms CGroup: /system.slice/radvd.service ├─1317 /usr/bin/radvd --nodaemon └─1318 /usr/bin/radvd --nodaemon Jun 28 17:42:47 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jun 28 17:42:47 vml000110 radvd[1317]: [Jun 28 17:42:47] radvd (1317): version 2.19 started</font></pre> </p> <p> Nun prüfen wir, ob unser <strong>radvd</strong> auch die richtigen Router Advertisement ICMPv6 Nachrichten ins Netz schickt. Hier bieten sich zwei mögliche Varianten an: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Mit dem Programm <strong><code>radvdump</code></strong> aus dem Paket <strong>radvd</strong>. Hierzu starten wir dias besagte Binary auf einem unserer Clients im lokalen Netzwerk-Segment dieses Binary. <pre class="code"> # radvdump</pre> <pre class="code"># # radvd configuration generated by radvdump 2.18 # based on Router Advertisement from fe80::10:ff:fe10:110 # received by interface enp0s25 # interface enp0s25 { AdvSendAdvert on; # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump AdvManagedFlag off; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvHomeAgentFlag off; AdvDefaultPreference medium; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; }; # End of prefix definition prefix fdb6:cb48:9d77::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; }; # End of prefix definition route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition route fdb6:cb48:9d77::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition }; # End of interface definition</pre> <p> In regelmäßigen Abständen tauchen also diese RA-Meldungen auf. </p> </div> </li> <li class="level1"><div class="li"> Mit Hilfe von <strong><code>tcpdump</code></strong> können wir auch die RA-Meldungen mitschneiden und darstellen, in nachfolgenden Beispiel ist der Name des Netzwerkinterfaces <strong><code>enp0s15</code></strong>.<pre class="code"> # tcpdump -vi enp0s25 "icmp6[icmp6type] == icmp6-routeradvert"</pre> <pre class="code">tcpdump: listening on enp0s25, link-type EN10MB (Ethernet), snapshot length 262144 bytes 18:09:46.840357 IP6 (flowlabel 0xc155a, hlim 255, next-header ICMPv6 (58) payload length: 136) _gateway > nitrop hop limit 64, Flags [other stateful], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0m prefix info option (3), length 32 (4): 2001:a:bcd:1234::/64, Flags [onlink, auto], valid time 5400s, pref. t prefix info option (3), length 32 (4): fdb6:cb48:9d77::/64, Flags [onlink, auto], valid time 5400s, pref. ti route info option (24), length 24 (3): 2001:a:bcd:1234::/64, pref=medium, lifetime=1800s route info option (24), length 24 (3): fdb6:cb48:9d77::/64, pref=medium, lifetime=1800s source link-address option (1), length 8 (1): 52:54:00:41:11:02 ^C 1 packet captured 1 packet received by filter 0 packets dropped by kernel</pre> </div> </li> </ol> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 60%;"> <p> Verbindet sich nun ein Client mit dem Netzwerk, handelt dieser eigenständig seine IPv6-Adressen, wie unter <strong><a href="#was_ist_slaac_und_wie_funktioniert_es" title="linux:radvd ↵" class="wikilink1">Was ist SLAAC und wie funktioniert es</a></strong> beschrieben, aus. Der <strong>radvd</strong> protokolliert dies aber <strong><em class="u">nicht</em></strong> im <strong>journald</strong>, da diese von der Adressgenerierung und erfolgreichen <strong>DOD</strong> nicht weiß! </p> </div> </div> <h4 class="sectionedit21" id="slaac_und_privacy_extension_-_konfiguration_der_arch_linux_clients">SLAAC und privacy extension - Konfiguration der (Arch Linux) Clients</h4> <div class="level4"> <p> Wie wir im Abschnitt <strong><a href="#was_ist_slaac_und_wie_funktioniert_es" title="linux:radvd ↵" class="wikilink1">Was ist SLAAC und wie funktioniert es</a></strong> gesehen haben wird mit unter die MAC-Adresse der Netzwerkschnittstelle bei der automatischen Generierung der IPv6-Adressen herangezogen. MAC-Adressen sind weltweit eindeutig d.h. die Ethernet-Schnittstelle des Client-Rechners hat eine MAC-Adresse, die es nirgendwo sonst auf der Welt gibt, ebenso das Interface für WLAN oder WWAN, je nachdem was im Rechner verbaut ist. Durch die Verwendung der MAC-Adresse einer Schnittstelle als Teil der IPv6-Adresse wird sicher gestellt, dass jedes Mal eine bzw. mehrere eindeutige IPv6-Adresse generiert werden. </p> <div class="wrap_center wrap_round wrap_important plugin_wrap" style="width: 80%;"> <p> Das Problem mit der Eindeutigkeit ist jedoch auch, dass sie auch als Kennung fungieren kann und man unter Umständen über diese Kennung dann weltweit trackbar ist, egal mit welchem IPv6-Netzwerk man sich verbunden hat! </p> <p> Nutzt der Netzbetreiber bzw. der Betreiber eines IPv6-fähigen Netzwerkes SLAAC, ist man anhand der letzten 48 Bits der IPv6-Adresse trackbar, da diese eindeutig ja eineindeutig ist. Betreiber von Websites, die man nun besucht, können sehen, dass man zwar eine neue IP-Adresse haben, weil man zu einem anderen Betreiber wechselte. Die Webseitenanbieter können nun aber auch sehen, dass die letzten 48 Bits der Adresse jedes Mal gleich bleiben. Daher kennt jede Website, die man besucht, das Gerät, unabhängig davon, in welchem Netz man sich befindet! So kann man sehr leicht anbieterübergreifend nachverfolgt werden! </p> </div> <p> Dieses Problematik hat man erkannt und das SLAAC-Protokoll im <strong><a href="https://www.rfc-editor.org/rfc/rfc4941" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4941" rel="ugc nofollow noopener"> RFC 4941 - Privacy Extensions for Stateless Address Autoconfiguration in IPv6</a></strong> „erweitert“ bzw. die Lösung beschrieben. Vereinfacht dargestellt, verwendet der Host nicht mehr die MAC-Adresse der Netzwerkschnittstelle, um die letzten 48 Stellen seiner IPv6-Adresse auszufüllen. Stattdessen eine Reihe von Bits nach dem Zufallsprinzip ausgewählt und statt der MAC-Adresse der Schnittstelle verwendet um die letzten 48 Bits der IPv6-Adresse zu generieren. </p> <p> Ein weiterer grosser Vorteil der Privacy Extensions bei SLAAC ist, dass Adressen eine Zeitüberschreitung erfahren. Nach einer konfigurierbaren Zeitspanne werden die Schnittstellenadressen veraltet und können nicht mehr von der Netzwerkschnittstelle verwendet werden. In der Regel beträgt dieser Zeitraum 24 Stunden, also einen Tag - das bedeutet, dass die Schnittstelle jeden Tag eine neue IP-Adresse erhält. Dies macht es nun schwieriger, einen einzelnen Benutzer einer bestimmten MAC- oder sogar IP-Adresse zuzuordnen. </p> <p> Sehen wir uns also an, wie ein Client seine IPv6-Adressen generiert. Unser Laptop hat noch keine Verbindung zum Netzwerk, da das Ethernet-Kabel nicht angesteckt ist. Wir sehen das unter anderem an der IP-Adress-Einstellungen: </p> <pre class="code"> # p addr show enp0s25</pre> <pre class="code">2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 link/ether 50:7b:9d:91:52:54 brd ff:ff:ff:ff:ff:ff</pre> <p> Unser Laptop hat also noch keine <strong>LLA</strong> generiert. Wie wir wissen passiert das am Anfang beim <strong><a href="#llago" title="linux:radvd ↵" class="wikilink1">1. Schritt - Der Host generiert sich selbst eine LLA (Link Local Address)</a></strong>. </p> <p> Stecken wir nun das Netzwerkkabel an unseren Laptop und beobachten <strong>journald</strong>. </p> <pre class="code"> # journalctl -fu NetworkManager</pre> <pre class="code">Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2177] device (enp0s25): carrier: link connected Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2185] device (enp0s25): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2213] policy: auto-activating connection 'enp0s25' (8b61d72d-e99c-3480-b588-4dac6f16086e) Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2230] device (enp0s25): Activation: starting connection 'enp0s25' (8b61d72d-e99c-3480-b588-4dac6f16086e) Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2234] device (enp0s25): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2243] manager: NetworkManager state is now CONNECTING Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2249] device (enp0s25): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2263] device (enp0s25): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2288] dhcp4 (enp0s25): activation: beginning transaction (timeout in 45 seconds) Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.2331] dhcp4 (enp0s25): state changed new lease, address=10.0.10.74, acd pending Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.3881] dhcp4 (enp0s25): state changed new lease, address=10.0.10.74 Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.3885] policy: set 'enp0s25' (enp0s25) as default for IPv4 routing and DNS Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.3962] device (enp0s25): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.4330] device (enp0s25): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.4332] device (enp0s25): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed') Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.4337] manager: NetworkManager state is now CONNECTED_SITE Jun 28 21:21:39 pml010074 NetworkManager[1149]: <info> [1719602499.4340] device (enp0s25): Activation: successful, device activated. Jun 28 21:21:40 pml010074 NetworkManager[1149]: <info> [1719602500.5188] dhcp6 (enp0s25): activation: beginning transaction (timeout in 45 seconds) Jun 28 21:21:40 pml010074 NetworkManager[1149]: <info> [1719602500.5201] policy: set 'enp0s25' (enp0s25) as default for IPv6 routing and DNS Jun 28 21:21:40 pml010074 NetworkManager[1149]: <info> [1719602500.5221] dhcp6 (enp0s25): state changed new lease</pre> <p> Fragen wir die IP-Adresse des Netzwerkinterfaces ab sehen wir: </p> <pre class="code"> # ip addr show enp0s25 </pre> <pre class="code">2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 50:7b:9d:91:52:54 brd ff:ff:ff:ff:ff:ff inet 10.0.10.74/24 brd 10.0.10.255 scope global dynamic noprefixroute enp0s25 valid_lft 3558sec preferred_lft 3558sec inet6 2001:a:bcd:1234:32f4:2aac:f2e1:5f73/64 scope global dynamic noprefixroute valid_lft 5358sec preferred_lft 2658sec inet6 fdb6:cb48:9d77:0:e596:e316:4695:85b6/64 scope global dynamic noprefixroute valid_lft 5358sec preferred_lft 2658sec inet6 fe80::fa4e:fbee:c806:f070/64 scope link noprefixroute valid_lft forever preferred_lft forever</pre> <div class="wrap_center wrap_round wrap_important plugin_wrap" style="width: 80%;"> <p> Moment mal, das sieht doch eigentlich wie gewohnt aus, nichts besonderes, nichts von einer <strong><code>scope global dynamic mngtmpaddr</code></strong> (stabile dynamische IPv6 Adresse) für eingehende Verbindungen oder <strong><code>scope global temporary dynamic</code></strong> (temporäre „privacy“ IPv6 Adresse) für ausgehende Verbindungen zu sehen! </p> </div> <p> Warum ist das nun so? Ganz einfach, weil am Client-Rechner noch keine Privacy Extension ausgewählt wurde. Werfen wir einen Blick in die betreffende Konfigurationsdatei <strong><code>/etc/sysctl.d/10-ipv6-privacy.conf</code></strong>. </p> <pre class="code"> # vim /etc/sysctl.d/10-ipv6-privacy.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=15" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/sysctl.d/10-ipv6-privacy.conf</a></dt> <dd><pre class="code file bash"><span class="co0"># Django : manual on 2024-06-27</span> <span class="co0"># IPv6 Privacy Extensions (RFC 4941)</span> <span class="co0"># ---</span> <span class="co0"># IPv6 typically uses a device's MAC address when choosing an IPv6 address</span> <span class="co0"># to use in autoconfiguration. Privacy extensions allow using a randomly</span> <span class="co0"># generated IPv6 address, which increases privacy.</span> <span class="co0">#</span> <span class="co0"># Acceptable values:</span> <span class="co0"># 0 - don’t use privacy extensions.</span> <span class="co0"># 1 - generate privacy addresses</span> <span class="co0"># 2 - prefer privacy addresses and use them over the normal addresses.</span> net.ipv6.conf.all.use_tempaddr = <span class="nu0">0</span> net.ipv6.conf.default.use_tempaddr = <span class="nu0">0</span></pre> </dd></dl> <p> O.K. dann stellen wir das doch gleich mal um auf <strong><code>2</code></strong> = <strong>prefer privacy addresses and use them over the normal addresses</strong>. Zuvor trennen wir aber noch die Netzwerkverbindung in dem wir das Netzwerkkabel ziehen. </p> <pre class="code"> # vim /etc/sysctl.d/10-ipv6-privacy.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=16" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/sysctl.d/10-ipv6-privacy.conf</a></dt> <dd><pre class="code file bash"><span class="co0"># Django : manual on 2024-06-28</span> <span class="co0"># IPv6 Privacy Extensions (RFC 4941)</span> <span class="co0"># ---</span> <span class="co0"># IPv6 typically uses a device's MAC address when choosing an IPv6 address</span> <span class="co0"># to use in autoconfiguration. Privacy extensions allow using a randomly</span> <span class="co0"># generated IPv6 address, which increases privacy.</span> <span class="co0">#</span> <span class="co0"># Acceptable values:</span> <span class="co0"># 0 - don’t use privacy extensions.</span> <span class="co0"># 1 - generate privacy addresses</span> <span class="co0"># 2 - prefer privacy addresses and use them over the normal addresses.</span> net.ipv6.conf.all.use_tempaddr = <span class="nu0">2</span> net.ipv6.conf.default.use_tempaddr = <span class="nu0">2</span></pre> </dd></dl> <p> Nach Änderung der Konfigurationsdatei müssen wir zum Aktivieren der geänderten Optionen in der sysctl-Datei ohne Neustart des Rechners folgenden Befehl ausführen: </p> <pre class="code"> # sysctl --system</pre> <p> Stecken wir nun das Netzwerkkabel wie ein und fragen erneut die IP-Adressen der Netzwerkschnittstelle ab. </p> <pre class="code"> # ip addr show enp0s25 </pre> <pre class="code">2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 50:7b:9d:91:52:54 brd ff:ff:ff:ff:ff:ff inet 10.0.10.74/24 brd 10.0.10.255 scope global dynamic noprefixroute enp0s25 valid_lft 3597sec preferred_lft 3597sec inet6 2001:a:bcd:1234:d4d0:5fec:f740:3561/64 scope global temporary dynamic valid_lft 5398sec preferred_lft 2698sec inet6 2001:a:bcd:1234:32f4:2aac:f2e1:5f73/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 5398sec preferred_lft 2698sec inet6 fdb6:cb48:9d77:0:4ec1:8ad3:1549:fc33/64 scope global temporary dynamic valid_lft 5398sec preferred_lft 2698sec inet6 fdb6:cb48:9d77:0:e596:e316:4694:85b7/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 5398sec preferred_lft 2698sec inet6 fe80::fa4e:fbee:c806:f070/64 scope link noprefixroute valid_lft forever preferred_lft forever</pre> <p> Wie sehen also nun, dass jeweils bei der <strong>GUA</strong> und bei der <strong>ULA</strong> jeweils zwei Adressen auftauchen, jeweils mit einer Gültigkeit von noch <strong><code>2698</code></strong> Sekunden, also kanpp eine 3/4 Stunde, dann werden diese neu ausgehandelt! </p> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> Wir haben zwei Adressen via SLACC bekommen, eine stabile dynamische IPv6 Adresse <strong><code>scope global dynamic mngtmpaddr</code></strong> und temporäre „privacy“ IPv6 Adresse <strong><code>scope global temporary dynamic</code></strong>. Erstere ist für eingehende Verbindungen und letztere ist für ausgehende Verbindungen und wird alle gemäß der RA-Option <strong><code>AdvPreferredLifetime 2700</code></strong> alle 45 Minuten neu ausgewürfelt. </p> </div><div class="wrap_center wrap_round wrap_alert plugin_wrap" style="width: 80%;"> <p> <strong>WICHTIG</strong>: </p> <p> Bei der zuvor angestellten Frage <strong><a href="#was_ist_slaac_und_wie_funktioniert_es" title="linux:radvd ↵" class="wikilink1">Was ist SLAAC und wie funktioniert es?</a></strong> haben wir bereits erkannt, dass in seiner aktuellen Implementierung, wie sie in <a href="https://www.rfc-editor.org/rfc/rfc4862" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4862" rel="ugc nofollow noopener">RFC 4862 - IPv6 Stateless Address Autoconfiguration</a> definiert ist, SLAAC den Hosts keine <abbr title="Domain Name System">DNS</abbr>-Serveradressen zur Verfügung stellt! Diese Informationen müssen wir noch gesondert den Clients mitgeben, sprich wir werden mit Hilfe eines Stateless DHCPv6-<span class="search_hit">Servers</span> realisieren. Bei der Konfiguration der Router Advertisement Nachrichten bei unserem <strong>radvd</strong> haben wir bereits mit der Definition des sog. <strong>O-Flags</strong> <strong><code>AdvOtherConfigFlag = on</code></strong> schon vorgenommen, dass das Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber keine keine Adressierungsinformationen zu erfolgen hat! Solch ein zustandsloser DHCPv6-Server stellt überhaupt keine IPv6-Adressen bereit, sondern liefert nur „andere Informationen“ wie eine <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domänennamen, mehr nicht. Wir werden im Kapitel <strong><a href="/doku.php/linux:kea" class="wikilink1" title="linux:kea" data-wiki-id="linux:kea">DHCPv4|v6-Server mit DHCP ISC Kea unter Arch Linux einrichten und nutzen</a></strong> noch detailliert eingehen! </p> </div> </div> <h3 class="sectionedit30 page-header pb-3 mb-4 mt-5" id="konfigurationsbeispiel_dhcpv6">Konfigurationsbeispiel DHCPv6</h3> <div class="level3"> </div> <h4 class="sectionedit31" id="router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6">Router Advertisement ICMPv6-Nachrichten für Stateful DHCPv6</h4> <div class="level4"> <p> Ein <strong>Stateful DHCPv6-Server</strong> liefert neben IPv6-Adressen auch weitere Informationen, wie z.B. wie eine <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domänennamen, an einen Host aus. Hosts. Dieser Stateful DHCPv6-Server behält auch den Status jeder Zuweisung im Auge, sprich er verfolgt die Verfügbarkeit des Adresspools und löst doppelte Adresskonflikte auf. Darüber hinaus protokolliert er jede Zuweisung und behält die Ablaufzeiten im Auge. Im Gegensatz zu IPv4 stellt ein Stateful DHCPv6-Server den Hosts keine Standard-Gateway-Adressen zur Verfügung, das kann bei IPv6 nur Router, die Router Advertisement-Nachrichten sendet wie z.B. unser <strong>radvd</strong>! </p> </div> <h4 class="sectionedit32" id="stateful_dhcpv6_konfiguration_beim_radvd">Stateful DHCPv6 Konfiguration beim radvd</h4> <div class="level4"> <p> Im Abschnitt Grundlagen haben wir u.a. im Kapitel <strong><a href="#ra_router_advertisement_icmpv6_type_134" title="linux:radvd ↵" class="wikilink1">RA — Router Advertisement (ICMPv6 Type 134)</a></strong> gelernt, dass mit Hilfe von diversen Flags definiert werden kann, wie den Clients mitgeteilt werden kann, welche Art und Weise bei der IPv6-Zuweisung beschritten werden soll. </p> <p> Bei unserem Konfigurationsbeispiel hier gehen wir für den Router Advertisement Daemon <strong>radvd</strong> für die Adressvergabe durch einen <strong>Stateful DHCPv6-Server</strong> von folgenden Eckwerten aus: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>Netzwerkinterface</strong> : <br/> Der <strong>radvd</strong> soll nur auf dem Netzwerkinterface <strong><code>eth1</code></strong> operieren, also dort lauscht er auf Router Solicitation ICMPv6-Nachrichten neuer Clients und beantwortet selbige mit Router Advertisements ICMPv6-Nachrichten bzw. sendet auf dieser Netzwerkschnittstelle regelmäßig seine Router Advertisements ICMPv6-Nachrichten an alle Clients im lokalen betreffenden Netz.</div> </li> <li class="level1"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>on</code></strong> (Adresskonfiguration via Stateful DHCPv6)</div> </li> <li class="level1"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level1"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>off</code></strong> (Adresskonfiguration via Statful DHCPv6)</div> </li> <li class="level1"><div class="li"> <strong>Route</strong> für den <strong>Global-Scope Address Prefix</strong> <strong><code>2001:a:bcd:1234</code></strong>: <br/> <strong><code>2001:a:bcd:1234::/64</code></strong> und eine Gültigkeit von einer 1/2 Stunde, also <strong><code>1800</code></strong> Sekunden.</div> </li> <li class="level1"><div class="li"> <strong>Route</strong> für den <strong>Unique Local IPv6 prefix</strong> : <strong><code>fdb6:cb48:9d77:0::/64</code></strong><br/> <strong><code>fdb6:cb48:9d77:0::/64</code></strong> ebenfalls eine Gültigkeit von <strong><code>1800</code></strong> Sekunden.</div> </li> </ul> <p> Daraus ergibt sich folgende Konfigurationsdatei für unseren <strong>radvd</strong>: </p> <pre class="code"> # vim /etc/radvd.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=18" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/radvd.conf</a></dt> <dd><pre class="code file bash"><span class="co0"># Configuration example for the router advertisement daemon radvd </span> <span class="co0"># for address assignment via DHCPv6:</span> <span class="co0"># - M-flag: AdvManagedFlag = on (address configuration via DHCPv6)</span> <span class="co0"># - O-flag: AdvOtherConfigFlag = on (obtaining a DNS server list </span> <span class="co0"># and a domain name from a Stateless DHCPv6 server, but</span> <span class="co0"># not addressing information. </span> <span class="co0"># - A-flag: AdvAutonomous = off (address configuration via DHCPv6)</span>   interface eth1 <span class="br0">{</span> <span class="co0"># A flag indicating whether or not the router sends periodic </span> <span class="co0"># router advertisements and responds to router solicitations.</span> <span class="co0"># This option no longer has to be specified first, but it needs</span> <span class="co0"># to be on to enable advertisement on this interface.</span> AdvSendAdvert on;   <span class="co0"># The maximum time allowed between sending unsolicited multi-</span> <span class="co0"># cast router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 4 seconds and no greater than 1800 seconds.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.07.</span> <span class="co0"># For values less than 0.2 seconds, 0.02 seconds is added to </span> <span class="co0"># account for scheduling granularities as specified in RFC3775.</span> MaxRtrAdvInterval <span class="nu0">600</span>;   <span class="co0"># The minimum time allowed between sending unsolicited multicast</span> <span class="co0"># router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 3 seconds and no greater than </span> <span class="co0"># 0.75 * MaxRtrAdvInterval.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.03.</span> MinRtrAdvInterval <span class="nu0">200</span>;   <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvDefaultPreference medium;   <span class="co0"># Mobile IPv6 support, when set, indicates that sending router is </span> <span class="co0"># able to serve as Mobile IPv6 Home Agent.</span> <span class="co0"># When set, minimum limits specified by Mobile IPv6 are used for </span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvHomeAgentFlag off;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># address autoconfiguration in addition to any addresses </span> <span class="co0"># autoconfigured using stateless address autoconfiguration.</span> <span class="co0"># The use of this flag is described in RFC 4862.</span> <span class="co0"># M-flag - if it is set to 1, this informs hosts that they can </span> <span class="co0"># obtain a global address as well as DNS and a domain name from</span> <span class="co0"># a Stateful DHCPv6 server. Typically this means that auto-</span> <span class="co0"># addressing using SLAAC is not allowed on this segment and both</span> <span class="co0"># the A-flag and the O-flag are set to 0.</span> AdvManagedFlag on;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># autoconfiguration of other (non-address) information.</span> <span class="co0"># The use of this flag is described in RFC 4862</span> <span class="co0"># O-flag - if it is set to on, this informs hosts that they can</span> <span class="co0"># obtain a DNS server list and a domain name from a Stateless </span> <span class="co0"># DHCPv6 server, but not addressing information. Typically it </span> <span class="co0"># works in conjunction with SLAAC for auto-addressing and both</span> <span class="co0"># the A-flag and the O-flag are set to on.</span> <span class="co0">#</span> AdvOtherConfigFlag on;   <span class="co0"># The time, in milliseconds, that a node assumes a neighbor is </span> <span class="co0"># reachable after having received a reachability confirmation.</span> <span class="co0"># Used by the Neighbor Unreachability Detection algorithm (see</span> <span class="co0"># Section 7.3 of RFC 4861).</span> <span class="co0"># A value of zero means unspecified (by this router).</span> <span class="co0"># Must be no greater than 3,600,000 milliseconds (1 hour).</span> AdvReachableTime <span class="nu0">0</span>;   <span class="co0"># The time,in milliseconds, between retransmitted Neighbor Soli-</span> <span class="co0"># citation messages. Used by address resolution and the Neighbor</span> <span class="co0"># Unreachability Detection algorithm (see Sections 7.2 and 7.3 </span> <span class="co0"># of RFC 4861). A value of zero means unspecified (by this router).</span> AdvRetransTimer <span class="nu0">0</span>;   <span class="co0"># The default value that should be placed in the Hop Count field of</span> <span class="co0"># the IP header for outgoing (unicast) IP packets. The value should</span> <span class="co0"># be set to the current diameter of the Internet.</span> <span class="co0"># The value zero means unspecified (by this router).</span> AdvCurHopLimit <span class="nu0">64</span>;   <span class="co0"># The lifetime associated with the default router in units of seconds.</span> <span class="co0"># The maximum value corresponds to 18.2 hours. A lifetime of 0 indi-</span> <span class="co0"># cates that the router is not a default router and should not appear</span> <span class="co0"># on the default router list. The router lifetime applies only to the</span> <span class="co0"># router's usefulness as a default router; it does not apply to in-</span> <span class="co0"># formation contained in other message fields or options. Options that</span> <span class="co0"># need time limits for their information include their own lifetime </span> <span class="co0"># fields.</span> <span class="co0"># Must be either zero or between MaxRtrAdvInterval and 9000 seconds.</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval (Minimum 1 second).</span> AdvDefaultLifetime <span class="nu0">1800</span>;   <span class="co0"># When set, the link-layer address of the outgoing interface is </span> <span class="co0"># included in the RA.</span> AdvSourceLLAddress on;   <span class="co0"># global-scope adress prefix</span> prefix <span class="nu0">2001</span>:a:bcd:<span class="nu0">1234</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous off;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   <span class="co0"># route for global-scope address prefix</span> route <span class="nu0">2001</span>:a:bcd:<span class="nu0">1234</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0">#</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   <span class="co0"># unique local prefix</span> prefix fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous off;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   <span class="co0"># </span> route fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0"># </span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   <span class="br0">}</span>;</pre> </dd></dl> <p> Wollen wir die Kondfigurationsdate ohne die Kommentare sehen, grep'en wir einfach entsprechend danach. </p> <pre class="code"> # grep -Ev '(^.*#|^$)' /etc/radvd.conf</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_3">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_3"><pre class="code">interface eth1 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; AdvDefaultPreference medium; AdvHomeAgentFlag off; AdvManagedFlag off; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; prefix fdb6:cb48:9d77:0::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route fdb6:cb48:9d77:0::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; };</pre> </div> <p> Bevor wir nun unseren <strong>radvd</strong> starten, führen wir noch einen Konfigurationstest durch. Wir prüfen also nun die Konfigurationsdatei unseres <strong>radvd</strong> auf syntaktische Fehler. </p> <pre class="code"> # radvd -cC /etc/radvd.conf</pre> <pre class="code">[Jun 28 22:39:23] radvd (1835): config file, /etc/radvd.conf, syntax ok</pre> <p> Nun starten wir unseren <strong>radvd</strong> Daemon. </p> <pre class="code"> # systemctl start radvd.service</pre> <p> Im journald wir der Start entsprechend dokumentiert. </p> <pre class="code"> # journalctl -fu radvd</pre> <pre class="code">Jun 28 22:49:30 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jun 28 22:49:30 vml000110 radvd[1876]: [Jun 28 22:49:30] radvd (1876): version 2.19 started</pre> <p> Bei Bedarf können wir natürlich auch den Status unseres Daemons jederzeit abfragen. </p> <pre class="code"> # systemctl status radvd.service</pre> <p> <pre class="code"> <font style="color: rgb(29, 180, 29)"><b>●</b></font> radvd.service - IPv6 Router Advertisement Daemon Loaded: loaded (/usr/lib/systemd/system/radvd.service; </font><font style="color: rgb(29, 180, 29)"><b>disabled</b></font>; preset: <font style="color: rgb(201, 214, 95)"><b>disabled</b></font>) Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Fri 2024-06-28 22:49:30 CEST; 53s ago Invocation: 52f7f18768e246f2b63a5bad4717658b Main PID: 1876 (radvd) Tasks: 2 (limit: 9510) Memory: 368K (peak: 1.5M) CPU: 13ms CGroup: /system.slice/radvd.service ├─1876 /usr/bin/radvd --nodaemon └─1877 /usr/bin/radvd --nodaemon Jun 28 22:49:30 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jun 28 22:49:30 vml000110 radvd[1876]: [Jun 28 22:49:30] radvd (1876): version 2.19 started</font></pre> </p> <p> Nun prüfen wir, ob unser <strong>radvd</strong> auch die richtigen Router Advertisement ICMPv6 Nachrichten ins Netz schickt. Hier bieten sich zwei mögliche Varianten an: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Mit dem Programm <strong><code>radvdump</code></strong> aus dem Paket <strong>radvd</strong>. Hierzu starten wir dias besagte Binary auf einem unserer Clients im lokalen Netzwerk-Segment dieses Binary. <pre class="code"> # radvdump</pre> <pre class="code"># # radvd configuration generated by radvdump 2.18 # based on Router Advertisement from fe80::10:ff:fe10:110 # received by interface enp0s25 # interface enp0s25 { AdvSendAdvert on; # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump AdvManagedFlag on; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvHomeAgentFlag off; AdvDefaultPreference medium; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; }; # End of prefix definition prefix fdb6:cb48:9d77::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; }; # End of prefix definition route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition route fdb6:cb48:9d77::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition }; # End of interface definition</pre> <p> In regelmäßigen Abständen tauchen also diese RA-Meldungen auf. </p> </div> </li> <li class="level1"><div class="li"> Mit Hilfe von <strong><code>tcpdump</code></strong> können wir auch die RA-Meldungen mitschneiden und darstellen, in nachfolgenden Beispiel ist der Name des Netzwerkinterfaces <strong><code>enp0s25</code></strong>.<pre class="code"> # tcpdump -vi enp0s25 "icmp6[icmp6type] == icmp6-routeradvert"</pre> <pre class="code">cpdump: listening on enp0s25, link-type EN10MB (Ethernet), snapshot length 262144 bytes 22:58:47.643378 IP6 (flowlabel 0xc155a, hlim 255, next-header ICMPv6 (58) payload length: 136) _gateway > nitropad: [icmp6 sum ok] ICMP6, router advertisement, length 136 hop limit 64, Flags [managed, other stateful], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0ms prefix info option (3), length 32 (4): 2001:a:bcd:1234::/64, Flags [onlink], valid time 5400s, pref. time 2700s prefix info option (3), length 32 (4): fdb6:cb48:9d77::/64, Flags [onlink], valid time 5400s, pref. time 2700s route info option (24), length 24 (3): 2001:a:bcd:1234::/64, pref=medium, lifetime=1800s route info option (24), length 24 (3): fdb6:cb48:9d77::/64, pref=medium, lifetime=1800s source link-address option (1), length 8 (1): 52:54:00:41:11:02 ^C 1 packet captured 1 packet received by filter 0 packets dropped by kernel</pre> </div> </li> </ol> <p> Verbindet sich nun ein Client mit dem Netzwerk, handelt dieser <strong><em class="u">nicht</em></strong> eigenständig seine IPv6-Adressen aus, sondern richtet eine entsprechende Anfrage an den DHCPv6-Server! </p> </div> <h3 class="sectionedit33 page-header pb-3 mb-4 mt-5" id="musterkonfiguration_gua_via_slaac_und_ula_via_dhcpv6">Musterkonfiguration GUA via SLAAC und ULA via DHCPv6</h3> <div class="level3"> </div> <h4 class="sectionedit34" id="grundueberlegungen">Grundüberlegungen</h4> <div class="level4"> <p> In den beiden vorgenannten Konfigurationsbeispielen <strong><a href="#konfigurationsbeispiel_fuer_slaac" title="linux:radvd ↵" class="wikilink1">Konfigurationsbeispiel für SLAAC</a></strong> und <strong><a href="#konfigurationsbeispiel_dhcpv6" title="linux:radvd ↵" class="wikilink1">Konfigurationsbeispiel DHCPv6</a></strong> haben wir gesehen, dass wir mit den <strong><code>M</code></strong>- und <strong><code>A</code></strong>-Flag steuern können, wie ein Client, wenn er sich mit unserem Netzwerk verbindet, zu einer oder mehreren IP-v6-Adressen kommen kann. Auch da Thema <strong><a href="#slaac_und_privacy_extension_-_konfiguration_der_arch_linux_clients" title="linux:radvd ↵" class="wikilink1">SLAAC und Privacy Extension</a></strong> bei de Konfiguration der (Arch Linux) Clients haben wir uns im Detail vorgenommen. </p> <p> Wenn wir uns mit dem Thema IPv6 im Intranet befassen, wird sich in aller Regel folgende Frage stellen: Welche Typen von Adressen werden benötigt und welche sollen letztendlich auch wirklich genutzt werden. Nun Gut, die <strong>L</strong>ink <strong>L</strong>ocla <strong>A</strong>ddress generiert ein Host selbst wie wir bereits wissen, denn ohne diese könnte er z.B. kein SLAAC initiieren. </p> <div class="wrap_center wrap_round wrap_important plugin_wrap" style="width: 80%;"> <p> Betrachten wir also nun die <strong>U</strong>nified <strong>L</strong>ocal <strong>A</strong>ddress, können wir erkennen, dass mit Hilfe dieser Adressen z.B. ein Laptop den Drucker im Netz direkt erreichen kann, denn wollen wir unserem Drucker eine öffentliche IP-Adresse verpassen? Nein, sicherlich nicht! Ausserdem soll es ja unter anderem <strong>ISP</strong><sup><a href="#fn__7" id="fnt__7" class="fn_top">7)</a></sup> geben, die ihren Kunden mit Hinweis von <em>Privatsphäre</em> <strong><em class="u">keine</em></strong> statischen <strong><code>/56</code></strong> oder <strong><code>/64</code></strong> zuweisen sondern lediglich dynamische Prefixe, die sich bei jeder Neueinwahl oder auch 1x Pro Tag ändern. Würde man mit Hilfe von Prefix-Delegation nun diesen vom ISP zugewiesenen dynamischen Prefix im Intranet weiterverwenden wollen, würde sich in unserem Beispiel auch jedes mal die <strong>GUA</strong> des Drucker ändern - welch gruselige Vorstellung und administrativ kaum handelbar! <img src="/lib/images/smileys/confused.svg" class="icon smiley" alt=":-?" /> Gar nicht toll, gar nicht schön … Moment, da war doch noch so ein Thema, statische feste IPv6 <strong>GUA</strong>: Wie wir beim Abschnitt <strong><a href="#slaac_und_privacy_extension_-_konfiguration_der_arch_linux_clients" title="linux:radvd ↵" class="wikilink1">SLAAC und privacy extension</a></strong> bereits bemerkt haben, können einzelnen Nutzer mit ihren Geräten anhand der letzten 48 Bits der IPv6-Adresse weltweit trackbar werden. Nun Gut unter SLAAC gibt es die Option <strong><em>privacy extension</em></strong>, in den RFCs zu <strong>DHCPv6</strong> sucht man aber leider vergebens nach einer derartigen Option - O.K. zumindest im Jahre 2024 noch! Als sind statische eineindeutige <strong>GUA</strong> im Intranet eigentlich auch nichts was man sehen und haben möchte! </p> </div><div class="wrap_center wrap_round wrap_info plugin_wrap" style="width: 80%;"> <p> Je länger man sich nun mit der ganzen Thematik um nicht Misere zu sagen beschäftigt kommt man zu folgender Musterkonfigurationslösung: </p> <ol class=" fix-media-list-overlap"> <li class="level1 node"><div class="li"> <strong>ULA</strong>:</div> <ol class=" fix-media-list-overlap"> <li class="level2"><div class="li"> Wir wollen statische eineindeutige wiederkehrende feste <strong>ULA</strong>s die wir per <strong>DHCPv6</strong> auf Basis der <strong>DUID</strong> oder anderen dem Host zuordenbare Eigenschafte fest vergeben.</div> </li> <li class="level2"><div class="li"> Gästen oder entsprechenden Geräte lassen wir aus einem dynamischen Pool <strong>ULA</strong> zuweisen.</div> </li> </ol> </li> <li class="level1 node"><div class="li"> <strong>GUA</strong>: </div> <ol class=" fix-media-list-overlap"> <li class="level2"><div class="li"> Die öffentlichen <strong>IPv6</strong> Adressen (<strong>GUA</strong>)) vergeben wir dynamisch via SLAAC.</div> </li> <li class="level2"><div class="li"> Laptops oder Notebooks auf denen ein aktuelles fortschrittliches Linux, wie z.B. <strong><a href="https://archlinux.org/" class="urlextern" target="_tab" title="https://archlinux.org/" rel="ugc nofollow noopener">Arch Linux</a></strong> läuft, konfigurieren wir so, dass diese sich regelmässig mit den Optionen der privacy extension, neu Adressen via SLAAC holen.</div> </li> <li class="level2"><div class="li"> Bei mobilen Geräten aus dem Hause Apple mit ihrem <strong><a href="https://de.wikipedia.org/wiki/IOS_(Betriebssystem)" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/IOS_(Betriebssystem)" rel="ugc nofollow noopener">IOS Betriebssystem</a></strong> oder Google mit ihrem <strong><a href="https://de.wikipedia.org/wiki/Android_(Betriebssystem)" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Android_(Betriebssystem)" rel="ugc nofollow noopener">Android Betriebssystem</a></strong> sind wir auf Gedeih und Verderben diesen Firmen ausgeliefert und müssen vertrauen, dass diese doch irgendwann andere MAC-Adressen in kurzen Zeitabständen selbst generieren. Spoiler: Besser nicht danach suchen, die Ergebnisse im Jahre 2024 sind mehr als <strong><-redacted-></strong> und vorab von dem was man eigentlich erhoffen und erwarten würde!</div> </li> </ol> </li> </ol> <p> Wir wollen uns also nun ansehen, wie wir solch ein Muster-Szenario abbilden können </p> </div><div class="wrap_center wrap_round wrap_alert plugin_wrap" style="width: 80%;"> <p> Der geneigte Leser wir sich nun fragen, ja wie macht man denn nun das beim <strong>radvd</strong>? Denn schliesslich wissen wir ja dass wir bei Nutzung von <strong>SLAAC</strong> die bekannten Flags wir folgt setzen müssen: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>off</code></strong> (Adresskonfiguration über SLAAC)</div> </li> <li class="level1"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level1"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>on</code></strong> (Adresskonfiguration über SLAAC)</div> </li> </ul> <p> Hingegen bei <strong>DHCPv6</strong> hingegen müssen wir die Flags wie folgt setzen. </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>on</code></strong> (Adresskonfiguration via Stateful DHCPv6)</div> </li> <li class="level1"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level1"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>off</code></strong> (Adresskonfiguration via Stateful DHCPv6)</div> </li> </ul> <p> O.K. das <strong><code>O</code></strong>-Flag macht uns keine Sorgen, das setzen wir ja immer auf <strong><code>on</code></strong>. Das <strong>A-Flag</strong> wird über die Konfigurationsoption <strong><code>AdvAutonomous</code></strong> entweder auf <strong><code>on</code></strong> bei <strong>SLAAC</strong> gesetzt und auf <strong><code>off</code></strong> <strong>bei DHCPv6</strong>. Da diese Option im jeweiligen Prefix-Abschnitt in der Konfigurationsdatei <strong><code>radvd.conf</code></strong> definiert wird, ist das auch keine allzu grosse Herausforderung. O.K. was bleibt übrig? Richtig, das <strong><code>M</code></strong>-Flag, welches bei <strong>SLAAC</strong> mit der Konfigurationsoption <strong><code>AdvManagedFlag</code></strong> auf <strong><code>off</code></strong> gesetzt werden muss und bei <strong>DHCPv6</strong> eben auf <strong><code>on</code></strong>. Tja aber leider ist die Konfigurationsoption <strong><code>AdvManagedFlag</code></strong> <strong><em class="u">global</em></strong> in der Konfigurationsdatei <strong><code>radvd.conf</code></strong>, sie kann also nur <strong><em class="u">1x</em></strong> definiert werden und leider nicht <strong><em class="u">2-mal</em></strong> wie wir es eigentlich bräuchten! </p> </div> </div> <h4 class="sectionedit41" id="radvd_konfiguration">radvd Konfiguration</h4> <div class="level4"> <p> Wie wir aber dennoch eine funktionierende Konfiguration des <strong>radvd</strong> hierzu hinbekommen werden wir uns nun ansehen. <strong>SPOILER</strong>: Ja die Konfiguration läuft wirklich uns wurde in fast Tagelangen nein Nächtelangen <strong><a href="https://de.wikipedia.org/wiki/Versuch_und_Irrtum" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Versuch_und_Irrtum" rel="ugc nofollow noopener">triel-and-error</a></strong> Runden mehrfach validiert1 In unserem Konfigurationsbeispiel gehen wir von folgenden Rahmenbedingungen aus: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>Netzwerkinterface</strong> : <br/> Der <strong>radvd</strong> soll auf dem Netzwerkinterface <strong><code>eth1</code></strong> operieren, also dort lauscht er auf Router Solicitation ICMPv6-Nachrichten neuer Clients und beantwortet selbige mit Router Advertisements ICMPv6-Nachrichten bzw. sendet auf dieser Netzwerkschnittstelle regelmässig seine Router Advertisements ICMPv6-Nachrichten an alle Clients im lokalen betreffenden Netz.</div> </li> <li class="level1 node"><div class="li"> <strong>GUA</strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>SLAAC</strong> : <br/> Clients sollen sich über den Mechanismus <strong>SLAAC</strong> selbst öffentliche IPv6-Adressen generieren und das ohne Zuhilfenahme eines DHCPv6-<span class="search_hit">Servers</span> bei der Adressvergabe!</div> </li> <li class="level2"><div class="li"> <strong>Global-Scope Address Prefix</strong> : <br/> <strong><code>2001:a:bcd:1234</code></strong></div> </li> <li class="level2"><div class="li"> <strong>Route</strong> : <br/> <strong><code>2001:a:bcd:1234::/64</code></strong> </div> </li> <li class="level2"><div class="li"> <strong>AdvRouteLifetime</strong> : <br/> Gültigkeit der Routen Lifetime von einer 1/2 Stunde, also <strong><code>1800</code></strong> Sekunden.</div> </li> <li class="level2"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>off</code></strong> (Adresskonfiguration über SLAAC)</div> </li> <li class="level2"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level2"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>on</code></strong> (Adresskonfiguration über SLAAC)</div> </li> </ul> </li> <li class="level1 node"><div class="li"> <strong>ULA</strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>DHCPv6</strong> : <br/> Der <strong>radvd</strong> lauscht auf dem Netzwerkinterface <strong><code>eth1</code></strong> des <strong>radvd</strong>-/<strong>kea-dhcp6</strong>-Host auf Router Solicitation ICMPv6-Nachrichten neuer Clients und beantwortet selbige mit Router Advertisements ICMPv6-Nachrichten bzw. sendet auf dieser Netzwerkschnittstelle regelmäßig seine Router Advertisements ICMPv6-Nachrichten an alle Clients im lokalen betreffenden Netz.</div> </li> <li class="level2"><div class="li"> <strong>Unique Local IPv6 prefix</strong> : <br/> Hier verwenden wir den zuvor erzeugten Unique Local IPv6 prefix von <strong><code>fdb6:cb48:9d77:0::/64</code></strong>.</div> </li> <li class="level2"><div class="li"> <strong>Route</strong> : <br/> <strong><code>fdb6:cb48:9d77:0::/64</code></strong></div> </li> <li class="level2"><div class="li"> <strong>AdvRouteLifetime</strong> : <br/> Gültigkeit der Routen Lifetime von einer 1/2 Stunde, also <strong><code>1800</code></strong> Sekunden.</div> </li> <li class="level2"><div class="li"> <strong>M-Flag</strong>: <br/> O.K. das <strong>M-Flag</strong> müssten wir ja eigentlich auf <strong><code>1</code></strong> AdvManagedFlag = <strong><code>on</code></strong> (Adresskonfiguration via Stateful DHCPv6) setzen. <img src="/lib/images/smileys/exclaim.svg" class="icon smiley" alt=":!:" /> Wir haben aber bereits bemerkt dass wir diese globale Option in der radvd.conf nur einmal setzen können - wir ignorieren also geflissentlich diese Option bei der <strong>ULA</strong> und <strong>DHCPv6</strong> <img src="/lib/images/smileys/exclaim.svg" class="icon smiley" alt=":!:" /></div> </li> <li class="level2"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level2"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>off</code></strong> (Adresskonfiguration via Stateful DHCPv6)</div> </li> </ul> </li> </ul> <p> Daraus ergibt sich nun folgende Konfigurationsdatei für unseren radvd: </p> <pre class="code"> # vim /etc/radvd.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=24" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/radvd.conf</a></dt> <dd><pre class="code file bash"><span class="co0"># Configuration example for the router advertisement daemon radvd </span> <span class="co0"># for GUA and SLAAC as well as ULA with DHCPv6</span> <span class="co0">#</span> <span class="co0"># - O-flag: AdvOtherConfigFlag = on (obtaining a DNS server list </span> <span class="co0"># and a domain name from a Stateless DHCPv6 server, but</span> <span class="co0"># not addressing information.</span> <span class="co0"># - M-flag: AdvManagedFlag = off (address configuration via SLAAC for GUA)</span> <span class="co0"># - A-flag: AdvAutonomous = on (address configuration via SLAAC for GUA)</span> <span class="co0"># - A-flag: AdvAutonomous = off (address configuration via DHCPv6 for static ULA)</span>   interface eth1 <span class="br0">{</span> <span class="co0"># A flag indicating whether or not the router sends periodic </span> <span class="co0"># router advertisements and responds to router solicitations.</span> <span class="co0"># This option no longer has to be specified first, but it needs</span> <span class="co0"># to be on to enable advertisement on this interface.</span> AdvSendAdvert on;   <span class="co0"># The maximum time allowed between sending unsolicited multi-</span> <span class="co0"># cast router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 4 seconds and no greater than 1800 seconds.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.07.</span> <span class="co0"># For values less than 0.2 seconds, 0.02 seconds is added to </span> <span class="co0"># account for scheduling granularities as specified in RFC3775.</span> MaxRtrAdvInterval <span class="nu0">600</span>;   <span class="co0"># The minimum time allowed between sending unsolicited multicast</span> <span class="co0"># router advertisements from the interface, in seconds.</span> <span class="co0"># Must be no less than 3 seconds and no greater than </span> <span class="co0"># 0.75 * MaxRtrAdvInterval.</span> <span class="co0"># Minimum when using Mobile IPv6 extensions: 0.03.</span> MinRtrAdvInterval <span class="nu0">200</span>;   <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvDefaultPreference medium;   <span class="co0"># Mobile IPv6 support, when set, indicates that sending router is </span> <span class="co0"># able to serve as Mobile IPv6 Home Agent.</span> <span class="co0"># When set, minimum limits specified by Mobile IPv6 are used for </span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvHomeAgentFlag off;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># address autoconfiguration in addition to any addresses </span> <span class="co0"># autoconfigured using stateless address autoconfiguration.</span> <span class="co0"># The use of this flag is described in RFC 4862.</span> <span class="co0"># M-flag - if it is set to 1, this informs hosts that they can </span> <span class="co0"># obtain a global address as well as DNS and a domain name from</span> <span class="co0"># a Stateful DHCPv6 server. Typically this means that auto-</span> <span class="co0"># addressing using SLAAC is not allowed on this segment and both</span> <span class="co0"># the A-flag and the O-flag are set to 0.</span> AdvManagedFlag on;   <span class="co0"># When set, hosts use the administered (stateful) protocol for </span> <span class="co0"># autoconfiguration of other (non-address) information.</span> <span class="co0"># The use of this flag is described in RFC 4862</span> <span class="co0"># O-flag - if it is set to on, this informs hosts that they can</span> <span class="co0"># obtain a DNS server list and a domain name from a Stateless </span> <span class="co0"># DHCPv6 server, but not addressing information. Typically it </span> <span class="co0"># works in conjunction with SLAAC for auto-addressing and both</span> <span class="co0"># the A-flag and the O-flag are set to on.</span> <span class="co0">#</span> AdvOtherConfigFlag on;   <span class="co0"># The time, in milliseconds, that a node assumes a neighbor is </span> <span class="co0"># reachable after having received a reachability confirmation.</span> <span class="co0"># Used by the Neighbor Unreachability Detection algorithm (see</span> <span class="co0"># Section 7.3 of RFC 4861).</span> <span class="co0"># A value of zero means unspecified (by this router).</span> <span class="co0"># Must be no greater than 3,600,000 milliseconds (1 hour).</span> AdvReachableTime <span class="nu0">0</span>;   <span class="co0"># The time,in milliseconds, between retransmitted Neighbor Soli-</span> <span class="co0"># citation messages. Used by address resolution and the Neighbor</span> <span class="co0"># Unreachability Detection algorithm (see Sections 7.2 and 7.3 </span> <span class="co0"># of RFC 4861). A value of zero means unspecified (by this router).</span> AdvRetransTimer <span class="nu0">0</span>;   <span class="co0"># The default value that should be placed in the Hop Count field of</span> <span class="co0"># the IP header for outgoing (unicast) IP packets. The value should</span> <span class="co0"># be set to the current diameter of the Internet.</span> <span class="co0"># The value zero means unspecified (by this router).</span> AdvCurHopLimit <span class="nu0">64</span>;   <span class="co0"># The lifetime associated with the default router in units of seconds.</span> <span class="co0"># The maximum value corresponds to 18.2 hours. A lifetime of 0 indi-</span> <span class="co0"># cates that the router is not a default router and should not appear</span> <span class="co0"># on the default router list. The router lifetime applies only to the</span> <span class="co0"># router's usefulness as a default router; it does not apply to in-</span> <span class="co0"># formation contained in other message fields or options. Options that</span> <span class="co0"># need time limits for their information include their own lifetime </span> <span class="co0"># fields.</span> <span class="co0"># Must be either zero or between MaxRtrAdvInterval and 9000 seconds.</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval (Minimum 1 second).</span> AdvDefaultLifetime <span class="nu0">1800</span>;   <span class="co0"># When set, the link-layer address of the outgoing interface is </span> <span class="co0"># included in the RA.</span> AdvSourceLLAddress on;   <span class="co0"># global-scope adress prefix</span> prefix <span class="nu0">2003</span>:a:e0d:<span class="nu0">7607</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous on;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   route <span class="nu0">2003</span>:a:e0d:<span class="nu0">7607</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0">#</span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   prefix fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># When set, indicates that this prefix can be used for on-link </span> <span class="co0"># determination. When not set the advertisement makes no statement</span> <span class="co0"># about on-link or off-link properties of the prefix. For instance,</span> <span class="co0"># the prefix might be used for address configuration with some of</span> <span class="co0"># the addresses belonging to the prefix being on-link and others </span> <span class="co0"># being off-link.</span> AdvOnLink on;   <span class="co0"># When set, indicates that this prefix can be used for autonomous </span> <span class="co0"># address configuration as specified in RFC 4862.</span> <span class="co0"># A-flag - if it is set to on, this informs hosts that they can </span> <span class="co0"># auto-generate GUA address using SLAAC. If it is set to off means</span> <span class="co0"># that auto-configuration is not allowed for this segment.</span> AdvAutonomous off;   <span class="co0"># When set, indicates that the address of interface is sent instead</span> <span class="co0"># of network prefix, as is required by Mobile IPv6. When set, </span> <span class="co0"># minimum limits specified by Mobile IPv6 are used for</span> <span class="co0"># MinRtrAdvInterval and MaxRtrAdvInterval.</span> AdvRouterAddr off;   <span class="co0"># The length of time in seconds (relative to the time the packet is </span> <span class="co0"># sent) that the prefix is valid for the purpose of on-link de-</span> <span class="co0"># termination. The symbolic value infinity represents infinity </span> <span class="co0"># (i.e. a value of all one bits (0xffffffff)). The valid lifetime</span> <span class="co0"># is also used by RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note that clients will ignore AdvValidLifetime of an existing</span> <span class="co0"># prefix if the lifetime is below two hours, as required in RFC</span> <span class="co0"># 4862 Section 5.5.3 point e).</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 30 days.</span> AdvValidLifetime <span class="nu0">5400</span>;   <span class="co0"># The length of time in seconds (relative to the time the packet</span> <span class="co0"># is sent) that addresses generated from the prefix via stateless</span> <span class="co0"># address autoconfiguration remain preferred. The symbolic value</span> <span class="co0"># infinity represents infinity (i.e. a value of all one bits</span> <span class="co0"># (0xffffffff)). See RFC 4862.</span> <span class="co0">#</span> <span class="co0"># Note: RFC4861's suggested default value is significantly longer:</span> <span class="co0"># 7 days.</span> AdvPreferredLifetime <span class="nu0">2700</span>; <span class="br0">}</span>;   route fdb6:cb48:9d77:<span class="nu0">0</span>::<span class="sy0">/</span><span class="nu0">64</span> <span class="br0">{</span> <span class="co0"># The preference associated with the default router, as either </span> <span class="co0"># "low", "medium", or "high".</span> AdvRoutePreference medium;   <span class="co0"># The lifetime associated with the route in units of seconds. The</span> <span class="co0"># symbolic value infinity represents infinity (i.e. a value of</span> <span class="co0"># all one bits (0xffffffff)).</span> <span class="co0"># </span> <span class="co0"># Default: 3 * MaxRtrAdvInterval</span> AdvRouteLifetime <span class="nu0">1800</span>; <span class="br0">}</span>;   <span class="br0">}</span>;</pre> </dd></dl> <p> Wollen wir die Kondfigurationsdate ohne die Kommentare sehen, grep'en wir einfach entspprechend danach. </p> <pre class="code"> # grep -Ev '(^.*#|^$)' /etc/radvd.conf</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_4">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_4"><pre class="code">interface eth1 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; AdvDefaultPreference medium; AdvHomeAgentFlag off; AdvManagedFlag on; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvSourceLLAddress on; prefix 2003:a:e0d:7607::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route 2003:a:e0d:7607::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; prefix fdb6:cb48:9d77:0::/64 { AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; AdvValidLifetime 5400; AdvPreferredLifetime 2700; }; route fdb6:cb48:9d77:0::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; };</pre> </div> <p> Bevor wir nun unseren <strong>radvd</strong> starten, führen wir noch einen Konfigurationstest durch. Wir prüfen also nun die Konfigurationsdatei unseres <strong>radvd</strong> auf syntaktische Fehler. </p> <pre class="code"> # radvd -cC /etc/radvd.conf</pre> <pre class="code">[Jul 09 17:59:05] radvd (1264): config file, /etc/radvd.conf, syntax ok</pre> <p> Nun starten wir unseren <strong>radvd</strong> Daemon. </p> <pre class="code"> # systemctl start radvd.service</pre> <p> Im journald wir der Start entsprechend dokumentiert. </p> <pre class="code"> # journalctl -fu radvd</pre> <pre class="code">Jul 09 18:00:37 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jul 09 18:00:37 vml000110 radvd[1296]: [Jul 09 18:00:37] radvd (1296): version 2.19 started</pre> <p> Bei Bedarf können wir natürlich auch den Status unseres Daemons jederzeit abfragen. </p> <pre class="code"> # systemctl status radvd.service</pre> <p> <pre class="code"> <font style="color: rgb(29, 180, 29)"><b>●</b></font> radvd.service - IPv6 Router Advertisement Daemon Loaded: loaded (/usr/lib/systemd/system/radvd.service; </font><font style="color: rgb(29, 180, 29)"><b>disabled</b></font>; preset: <font style="color: rgb(201, 214, 95)"><b>disabled</b></font>) Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Tue 2024-07-09 18:00:37 CEST; 1min 19s ago Invocation: bc40f348d21e45bf83b5976494e7fe39 Main PID: 1296 (radvd) Tasks: 2 (limit: 9510) Memory: 368K (peak: 1.5M) CPU: 13ms CGroup: /system.slice/radvd.service ├─1296 /usr/bin/radvd --nodaemon └─1297 /usr/bin/radvd --nodaemon Jul 09 18:00:37 vml000110 systemd[1]: Started IPv6 Router Advertisement Daemon. Jul 09 18:00:37 vml000110 radvd[1296]: [Jul 09 18:00:37] radvd (1296): version 2.19 started</font></pre> </p> <p> Nun prüfen wir, ob unser <strong>radvd</strong> auch die richtigen Router Advertisement ICMPv6 Nachrichten ins Netz schickt. Hier bieten sich zwei mögliche Varianten an: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Mit dem Programm <strong><code>radvdump</code></strong> aus dem Paket <strong>radvd</strong>. Hierzu starten wir dias besagte Binary auf einem unserer Clients im lokalen Netzwerk-Segment dieses Binary. <pre class="code"> # radvdump</pre> <pre class="code"># # radvd configuration generated by radvdump 2.18 # based on Router Advertisement from fe80::10:ff:fe10:110 # received by interface enp0s25 # interface enp0s25 { AdvSendAdvert on; # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump AdvManagedFlag on; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvHomeAgentFlag off; AdvDefaultPreference medium; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous on; AdvRouterAddr off; }; # End of prefix definition prefix fdb6:cb48:9d77::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; }; # End of prefix definition route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition route fdb6:cb48:9d77::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition }; # End of interface definition</pre> <p> In regelmäßigen Abständen tauchen also diese RA-Meldungen auf. </p> </div> </li> <li class="level1"><div class="li"> Mit Hilfe von <strong><code>tcpdump</code></strong> können wir auch die RA-Meldungen mitschneiden und darstellen, in nachfolgenden Beispiel ist der Name des Netzwerkinterfaces <strong><code>enp0s15</code></strong>.<pre class="code"> # tcpdump -vi enp0s25 "icmp6[icmp6type] == icmp6-routeradvert"</pre> <pre class="code">tcpdump: listening on enp0s25, link-type EN10MB (Ethernet), snapshot length 262144 bytes 18:08:04.399616 IP6 (flowlabel 0x37bf6, hlim 255, next-header ICMPv6 (58) payload length: 136) _gateway > nitropad: [icmp6 sum ok] ICMP6, router adver hop limit 64, Flags [managed, other stateful], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0ms prefix info option (3), length 32 (4): 2003:a:e0d:7607::/64, Flags [onlink, auto], valid time 5400s, pref. time 2700s prefix info option (3), length 32 (4): fdb6:cb48:9d77::/64, Flags [onlink], valid time 5400s, pref. time 2700s route info option (24), length 24 (3): 2003:a:e0d:7607::/64, pref=medium, lifetime=1800s route info option (24), length 24 (3): fdb6:cb48:9d77::/64, pref=medium, lifetime=1800s source link-address option (1), length 8 (1): 52:54:00:41:11:02 ^C 1 packet captured 1 packet received by filter 0 packets dropped by kernel</pre> </div> </li> </ol> </div> <h4 class="sectionedit42" id="kea-dhcp6_konfiguration">kea-dhcp6 Konfiguration</h4> <div class="level4"> <p> Wir brauchen jetzt natürlich für die statischen <strong>ULA</strong> noch eine passende Konfigurationsdatei. Wir greifen nun kurz dem Kapitel <strong><a href="/doku.php/linux:kea" class="wikilink1" title="linux:kea" data-wiki-id="linux:kea">DHCPv4/v6-Server mit DHCP ISC Kea unter Arch Linux einrichten und nutzen</a></strong> vor und werfen einen kurzen Blick auf die unkommentierte Konfigurationsdatei <strong><code>/etc/kea/kea-dhcp6.conf</code></strong> des <strong>kea-dhcp6</strong>-Daemon. Im besagten <a href="/doku.php/linux:kea" class="wikilink1" title="linux:kea" data-wiki-id="linux:kea">Kapitel</a> werden wir uns noch mit dem <strong><a href="/doku.php/linux:radvd" class="wikilink1" title="linux:radvd" data-wiki-id="linux:radvd">DHCP ISC Kea</a></strong> ähnlich detailliert auseinander setzen wir hier in diesem Kapitel <strong><a href="#dokuwiki_top" title="linux:radvd ↵" class="wikilink1">Router Advertisements mit radvd unter Arch Linux einrichten und nutzen</a></strong>! </p> <pre class="code"> # vim /etc/kea/kea-dhcp6.conf</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_5">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_5"><pre class="code">{ "Dhcp6": { "valid-lifetime": 4000, "renew-timer": 1000, "rebind-timer": 2000, "preferred-lifetime": 3000, "control-socket": { "socket-type": "unix", "socket-name": "/var/lib/kea/kea6-ctrl-socket" }, "interfaces-config": { "interfaces": [ "eth1" ] }, "lease-database": { "type": "memfile", "persist": true, "name": "/var/lib/kea/kea-leases6.csv", "lfc-interval": 1800, "max-row-errors": 100 }, "expired-leases-processing": { "reclaim-timer-wait-time": 10, "flush-reclaimed-timer-wait-time": 25, "hold-reclaimed-time": 3600, "max-reclaim-leases": 100, "max-reclaim-time": 250, "unwarned-reclaim-cycles": 5 }, "option-data": [ { "name": "dns-<span class="search_hit">servers</span>", "data": "fdb6:cb48:9d77:10:0:10:110" }, { "name": "domain-search", "data": "intra.nausch.org" } ], "subnet6": [ { "interface": "eth1", "id": 857665, "subnet": "fdb6:cb48:9d77::/64", "pools": [ { "pool": "fdb6:cb48:9d77:10:0:10:300/120" } ], "option-data": [ { "name": "dns-<span class="search_hit">servers</span>", "data": "fdb6:cb48:9d77:10:0:10:110" } ], "reservations": [ { "duid": "00:04:28:b0:df:3d:fd:11:6b:62:82:5c:14:95:dc:27:97:98", "ip-addresses": [ "fdb6:cb48:9d77:10:0:10:73" ] }, { "duid": "00:04:80:6f:6d:f5:a6:44:99:a4:3f:9f:09:7c:69:8d:e8:d2", "ip-addresses": [ "fdb6:cb48:9d77:10:0:10:74" ] } ] } ], "loggers": [ { "name": "kea-dhcp6", "output_options": [ { "output": "/var/log/kea-dhcp6.log", "maxsize": 1048576, "maxver": 8 } ], "severity": "DEBUG", "debuglevel": 99 } ] } }</pre> </div> </div> <h4 class="sectionedit43" id="ip-adresse_am_client">IP-Adresse am Client</h4> <div class="level4"> <p> Fragen wir die IP-Adresse des Netzwerkinterfaces ab sehen wir: </p> <pre class="code">django@nitropad:~$ ip addr show enp0s25 </pre> <pre class="code">2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 3c:97:0e:18:e4:dd brd ff:ff:ff:ff:ff:ff inet 10.0.10.73/24 brd 10.0.10.255 scope global dynamic noprefixroute enp0s25 valid_lft 3594sec preferred_lft 3594sec inet6 fdb6:cb48:9d77:10:0:10:73/128 scope global dynamic noprefixroute valid_lft 3995sec preferred_lft 2995sec inet6 2001:a:bcd:1234:c79d:9c68:ff37:3f53/64 scope global temporary dynamic valid_lft 5395sec preferred_lft 2695sec inet6 2001:a:bcd:1234:2688:fdb0:775:c02c/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 5395sec preferred_lft 2695sec inet6 fe80::e9a6:bb03:1544:b000/64 scope link noprefixroute valid_lft forever preferred_lft forever</pre> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> Wir haben neben der <strong>IPv4</strong> Adresse <strong><code>10.0.10.73</code></strong> und der vom Client-System generierten <strong>LLA</strong> <strong><code>fe80::e9a6:bb03:1544:b000/64</code></strong> mit <strong>*<code>scope link noprefixroute</code></strong> noch drei weitere IPv6-Adressen erhalten. Das wäre zum einen die statische feste <strong>ULA</strong> <strong><code>fdb6:cb48:9d77:10:0:10:73/128</code></strong> mit <strong><code>scope global dynamic noprefixrout</code></strong> noch eine stabile dynamische IPv6 Adresse <strong><code>2001:a:bcd:1234:2688:fdb0:775:c02c/64</code></strong> mit <strong><code>scope global dynamic mngtmpaddr</code></strong> und eine temporäre „privacy“ IPv6 Adresse <strong><code>2001:a:bcd:1234:c79d:9c68:ff37:3f53/64</code></strong> mit <strong><code>scope global temporary dynamic</code></strong>. Erstere ist für eingehende Verbindungen und letztere ist für ausgehende Verbindungen und wird alle gemäß der RA-Option <strong><code>AdvPreferredLifetime 2700</code></strong> alle 45 Minuten neu ausgewürfelt. </p> </div> </div> <h2 class="sectionedit46 page-header pb-3 mb-4 mt-5" id="orchestrierung_-_installation_und_konfiguration_des_radvd_mit_hilfe_von_ansible">Orchestrierung - Installation und Konfiguration des radvd mit Hilfe von Ansible</h2> <div class="level2"> </div> <h3 class="sectionedit47 page-header pb-3 mb-4 mt-5" id="aufgabenstellung">Aufgabenstellung</h3> <div class="level3"> <p> Natürlich wird man im Jahr 2024 nicht mehr ernsthaft, manuell Server aufsetzen und betreiben wollen. Vielmehr wird man auf ein Orchestrierungswerkzeug wie z.B. <strong><a href="/doku.php/linux:ansible:start" class="wikilink1" title="linux:ansible:start" data-wiki-id="linux:ansible:start">Ansible</a></strong> zurückgreifen. Setzen wir einen neue virtuellen Server unter Arch Linux neu auf, oder wollen wir bei einem bestehenden Host die Konfiguration aktualisieren, verwenden wir wie zuvor schon angeschnitten <a href="https://www.ansible.com/" class="urlextern" target="_tab" title="https://www.ansible.com/" rel="ugc nofollow noopener">Ansible</a> als Orchestrierungswerkzeug. So ist sichergestellt dass zum einen all unsere Hosts entsprechend gleich aufgebaut, konfiguriert und betrieben werden. </p> <p> Wir werden uns nun nachfolgend die Server-Installation und -konfiguration genauer betrachten. </p> </div> <h3 class="sectionedit48 page-header pb-3 mb-4 mt-5" id="loesung">Lösung</h3> <div class="level3"> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> Der ungeduldigen Leser kann auch direkt zur Tat schreiten und das manuelle Anlegen der Inventory-Hülle, des Playbooks und der zugehörigen Rolle überspringen und diese Aufgaben mit folgendem Befehl sozusagen auf einem Rutsch erledigen: </p> <pre class="code"> $ mkdir -p ~/devel/ansible ; wget https://gitlab.nausch.org/django/example_radvd/-/archive/main/example_radvd-main.tar.gz -O - | tar -xz --strip-components=1 -C ~/devel/ansible</pre> <p> Nach Anpassung der Daten im Inventory kann man anschliessend direkt <strong><a href="#ausfuehrung_-_playbooklauf" title="linux:radvd ↵" class="wikilink1">zur Ausführung schreiten</a></strong>. </p> </div> </div> <h4 class="sectionedit51" id="vorbereitung_-_server-_daten_im_inventory">Vorbereitung - (Server-)Daten im Inventory</h4> <div class="level4"> <p> Bei unserem Konfigurationsbeispiel hier gehen wir von folgenden Host-Parametern aus: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><code>zone: intra</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>hostname: vml010110</code></strong> </div> </li> </ul> <p> Die Konfigurationsdatei unseres <strong>inventory</strong> in unsere, Ansible-Verzeichnis beinhaltet demnach unter anderem: </p> <pre class="code"> $ vim inventories/production/hosts</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_6">inventories/production/hosts </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_6"><dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=34" title="Schnipsel herunterladen" class="mediafile mf_">inventories/production/hosts</a></dt> <dd><pre class="code file bash"><span class="co0"># Inventory Datei für die System-Umgebung im SOHO</span> <span class="co0">#</span> <span class="co0"># Hinweise:</span> <span class="co0"># - Kommentare beginnen mit einem '#'-Zeichen</span> <span class="co0"># - leere Zeilen werden ignoriert</span> <span class="co0"># - Host- und Gruppendefinitionen werden mit [] abgegrenzt</span> <span class="co0"># - Hosts können über ihren Hostnamen, FQN oder ihrer IP-Adresse definiert</span> <span class="co0"># - übergeordnete Gruppen werden durch [:children] abgegrenzt</span> <span class="co0">#</span> <span class="co0"># Host-Definitionen</span>   <span class="co0"># Hosts ohne Gruppenzuordnung</span> localhost   <span class="br0">[</span>edmz<span class="br0">]</span> vml000210   <span class="br0">[</span>idmz<span class="br0">]</span> vml000110   <span class="br0">[</span>intra<span class="br0">]</span> vml010110     <span class="co0"># Host-Gruppen-Definitionen </span> <span class="co0"># (zu welcher Gruppe gehören Untergruppen bzw. Hosts)</span>   <span class="br0">[</span>linux:children<span class="br0">]</span> intra edmz idmz</pre> </dd></dl> </div> <p> Bei den Host-Variablen definieren wir über die Variable <strong><code>radvd_ipv6_mode</code></strong>, wie in unserer Umgebung die IPv6-Adressen letztlich generiert bzw. verteilt werden sollen. Wollen wir <strong><a href="#slaac_-_ipv6_stateless_address_auto-configuration" title="linux:radvd ↵" class="wikilink1">SLAAC - IPv6 Stateless Address Auto-Configuration</a></strong> in unserem Netzwerk-(segment) nutzen, so setzen die die Variable <strong><code>radvd_ipv6_mode: „slaac“</code></strong>. Wollen wir hingegen <strong><a href="#router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6" title="linux:radvd ↵" class="wikilink1">IPv6 Stateful DHCPv6</a></strong> nutzen, so setzen wir die Variable <strong><code>radvd_ipv6_mode: „dhcp6“</code></strong>. </p> <p> Bei der Definition unseres KVM-Hosts hatten wir unter anderem definiert: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><code>guest_nic_2 : "eth1"</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>guest_ip6_net_2 : "2003:a:bcd:1234::"</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>guest_mask6_2 : "/64"</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>guest_ip6_ls_fx_2 : "fdb6:cb48:9d77:0::"</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>guest_zone_2 : "intra"</code></strong></div> </li> </ul> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_7">inventories/production/host_vars/vml010110/kvm_vhost </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_7"><dl class="file"> <dt><a href="/doku.php/linux:radvd?do=export_code&codeblock=35" title="Schnipsel herunterladen" class="mediafile mf_">inventories/production/host_vars/vml010110/kvm_vhost</a></dt> <dd><pre class="code file bash">guest_nic_2: <span class="st0">"eth1"</span> guest_ip6_net_2: <span class="st0">"2001:a:bcd:1234::"</span> guest_mask6_2: <span class="st0">"/64"</span> guest_ip6_ls_fx_2: <span class="st0">"fdb6:cb48:9d77:0::"</span> guest_zone_2: <span class="st0">"intra"</span></pre> </dd></dl> </div> <p> Die für den <strong>radvd</strong> relevanten Konfigurationsparameter legen wir in der Inventrory-Datei <strong><code>inventories/production/host_vars/vml010110/radvd</code></strong> ab. </p> <pre class="code"> $ vim inventories/production/host_vars/vml010110/radvd </pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_8">inventories/production/host_vars/vml010110/radvd </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_8"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/inventories/production/host_vars/vml010110/radvd" class="mediafile mf_">inventories/production/host_vars/vml010110/radvd</a></dt> <dd><pre class="file"># GUA-/LUA-Mode bei IPv6-Adressen: # - noone = weder SLAAC noch DHCPv6, keine Adresse # - slaac = Adresse via SLAAC generieren # - dhcp6 = Adresse via DHCPv6 beziehen radvd_gua_mode: 'dhcp6' radvd_ula_mode: 'noone' radvd_nic: '{{ guest_nic_2 }}' radvd_gua_prefix: '{{ guest_ip6_net_2 }}' radvd_gua_netmask: '{{ guest_mask6_2 }}' radvd_gua_preference: "medium" radvd_gua_valid_time: "5400" radvd_gua_route_time: "1800" radvd_gua_prefd_time: "2700" radvd_ula_prefix: '{{ guest_ip6_ls_fx_2 }}' radvd_ula_netmask: '{{ radvd_gua_netmask }}' radvd_ula_preference: '{{ radvd_gua_preference }}' radvd_ula_valid_time: '{{ radvd_gua_valid_time }}' radvd_ula_route_time: '{{ radvd_gua_route_time }}' radvd_ula_prefd_time: '{{ radvd_gua_prefd_time }}'</pre> </dd></dl></div> </div> <h4 class="sectionedit52" id="playbook">Playbook</h4> <div class="level4"> <p> Unser Playbook zum Installieren und Konfigurieren unseres Router Advertisement Daemon <strong>radvd</strong>, ist unscheinbar und unspektakulär. </p> <pre class="code"> $ vim playbooks/arch_radvd.yml</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/playbooks/arch_radvd.yml" class="mediafile mf_yml">playbooks/arch_radvd.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span>   <span class="co1"># Ansible Playbook zum Konfigurieren des Router Advertisement Daemon unter Arch-Linux.</span> <span class="co1"># Aufruf via $ ansible-playbook playbooks/arch_radvd.yml :</span> <span class="co1"># $ ansible-playbook playbooks/arch_radvd.yml</span> <span class="co1"># für einen Host aus der Hostgruppe DMZ.</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Playbook-Name: arch_chrony_server.yml"</span> <span class="co1"># Name des Playbooks</span><span class="co3"> hosts</span><span class="sy2">: </span>vml010110 <span class="co1"># Hostname/-gruppe für die das Playbook gelten soll</span> <span class="co4"> roles</span>:<span class="co3"> - role</span><span class="sy2">: </span>radvd <span class="co1"># radvd installieren und konfigurieren</span><span class="co3"> tags</span><span class="sy2">: </span>radvd <span class="co1"># Tag-Kennzeichnung der definierten Rolle</span> <span class="sy1">...</span></pre> </dd></dl> </div> <h4 class="sectionedit53" id="rolle">Rolle</h4> <div class="level4"> <p> Für die Konfiguration unseres <strong>radvd</strong> verwenden wir eine eigene Rolle <strong><code>radvd</code></strong>, die wir bei unserem zuvor angelegten Playbooks später einfach mit aufrufen werden. hierzu kopieren wir uns zunächst die Mustervorlage <strong><code>common</code></strong>. </p> <pre class="code"> $ cp -avr roles/common/ roles/radvd</pre> <pre class="code">'roles/common/' -> 'roles/radvd' 'roles/common/defaults' -> 'roles/radvd/defaults' 'roles/common/defaults/.gitkeep' -> 'roles/radvd/defaults/.gitkeep' 'roles/common/files' -> 'roles/radvd/files' 'roles/common/files/.gitkeep' -> 'roles/radvd/files/.gitkeep' 'roles/common/handlers' -> 'roles/radvd/handlers' 'roles/common/handlers/.gitkeep' -> 'roles/radvd/handlers/.gitkeep' 'roles/common/library' -> 'roles/radvd/library' 'roles/common/library/.gitkeep' -> 'roles/radvd/library/.gitkeep' 'roles/common/lookup_plugins' -> 'roles/radvd/lookup_plugins' 'roles/common/lookup_plugins/.gitkeep' -> 'roles/radvd/lookup_plugins/.gitkeep' 'roles/common/meta' -> 'roles/radvd/meta' 'roles/common/meta/.gitkeep' -> 'roles/radvd/meta/.gitkeep' 'roles/common/module_utils' -> 'roles/radvd/module_utils' 'roles/common/module_utils/.gitkeep' -> 'roles/radvd/module_utils/.gitkeep' 'roles/common/tasks' -> 'roles/radvd/tasks' 'roles/common/tasks/main.yml' -> 'roles/radvd/tasks/main.yml' 'roles/common/templates' -> 'roles/radvd/templates' 'roles/common/templates/.gitkeep' -> 'roles/radvd/templates/.gitkeep' 'roles/common/vars' -> 'roles/radvd/vars' 'roles/common/vars/.gitkeep' -> 'roles/radvd/vars/.gitkeep'</pre> <p> Bei Bedarf können wir uns die Struktur die somit angelegt wurde mit nachfolgendem Befehl anzeigen lassen. </p> <pre class="code"> $ tree roles/radvd/</pre> <p><a class="folder" href="#folded_a36c165e1e3dec9576505d3ac66a0f61_9">Ausgabe von tree roles/radvd/ </a></p><div class="folded hidden" id="folded_a36c165e1e3dec9576505d3ac66a0f61_9"><pre class="code">roles/radvd/ ├── defaults ├── files ├── handlers ├── library ├── lookup_plugins ├── meta ├── module_utils ├── tasks │   ├── firewalld.yml │   ├── install.yml │   ├── main.yml │   └── variablencheck.yml ├── templates │   ├── radvd_both_config.j2 │   └── radvd_single_config.j2 └── vars</pre> </div> <p> Wie wir sehen ist die Rolle durchaus überschaubar, im Task <strong><code>main.yaml</code></strong> verweisen wir lediglich auf die eigentlichen Tasks <strong><code>variablencheck</code></strong>, <strong><code>install.yml</code></strong> und <strong><code>firewalld.yml</code></strong> </p> <pre class="code"> $ vim roles/radvd/tasks/main.yml</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/tasks/main.yml" class="mediafile mf_yml">roles/radvd/tasks/main.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Prüfen ob die Variablen für GUA und ULA valide Werte haben."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>variablencheck.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>variablencheck <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Installation und Konfiguration des Router Advertisement Daemon radvd."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>install.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>install <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Konfiguration des firewalld für den Router Advertisement Daemon radvd."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>firewalld.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>firewalld   <span class="sy1">...</span></pre> </dd></dl> <p> Bei der Konfiguration unseres <strong>radvd</strong> haben wir in unserem Konfigurationsbeispiel, ob nur eine <strong>GUA</strong> oder eine <strong>ULA</strong> oder eben beide Adresstypen genutzt werden sollen. Zusätzlich haben wir noch die Wahl ob eine IPv6 mit Hilfe von <strong><a href="https://www.rfc-editor.org/rfc/rfc4862" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc4862" rel="ugc nofollow noopener">SLAAC</a></strong> oder <strong><a href="https://www.rfc-editor.org/rfc/rfc8415" class="urlextern" target="_tab" title="https://www.rfc-editor.org/rfc/rfc8415" rel="ugc nofollow noopener">Statful DHCPv6</a></strong> bezogen werden soll. </p> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> Für die Überlegungen welche Adressen und wie diese bezogen werden, hilf unter anderem der <strong><a href="https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Internetsicherheit/isi_lana_leitfaden_IPv6_pdf.pdf?__blob=publicationFile" class="urlextern" target="_tab" title="https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Internetsicherheit/isi_lana_leitfaden_IPv6_pdf.pdf?__blob=publicationFile" rel="ugc nofollow noopener">Leitfaden für eine sichere IPv6-Netzwerkarchitektur</a></strong> vom <strong><a href="https://www.bsi.bund.de" class="urlextern" target="_tab" title="https://www.bsi.bund.de" rel="ugc nofollow noopener">Bundesamt für Sicherheit in der Informationstechnik</a></strong>. </p> </div> <p> Die Konfiguration welcher Adresstyp und ob <strong>SLAAC</strong> und|oder <strong>DHCPv6</strong> zum Einsatz kommen wird, wird im Inventory mit den beiden Variablen <strong><code>radvd_gua_mode</code></strong> und <strong><code>radvd_ula_mode</code></strong> gesetzt: </p> <p> GUA-/LUA-Mode bei IPv6-Adressen: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><code>noone</code></strong> = weder SLAAC noch DHCPv6, keine Adresse</div> </li> <li class="level53"><div class="li"> <strong><code>slaac</code></strong> = Adresse via SLAAC generieren</div> </li> <li class="level53"><div class="li"> <strong><code>dhcp6</code></strong> = Adresse via DHCPv6 beziehen</div> </li> </ul> <p> Um sicher zu stellen, dass die beiden Variablen <strong><code>radvd_gua_mode</code></strong> und <strong><code>radvd_ula_mode</code></strong> mit validen Daten gefüttert werden, überprüfen wir in einem Task die Gültigkeit der Daten. </p> <pre class="code"> $ vim roles/radvd/tasks/variablencheck.yml</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/tasks/variablencheck.yml" class="mediafile mf_yml">roles/radvd/tasks/variablencheck.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Prüfen ob die Variable radvd_gua_mode gesetzt wurde."</span><span class="co4"> ansible.builtin.assert</span>:<span class="co4"> that</span><span class="sy2">: </span> - radvd_gua_mode is defined and <span class="br0">(</span>radvd_gua_mode == 'noone' or radvd_gua_mode == 'slaac' or radvd_gua_mode == 'dhcp6'<span class="br0">)</span><span class="co3"> fail_msg</span><span class="sy2">: </span><span class="st0">"Die Variable radvd_gua_mode ist nicht vorhanden, leer, oder nicht noone, slaac oder dhcp6 !"</span><span class="co3"> quiet</span><span class="sy2">: </span>true <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Prüfen ob die Variable radvd_ula_mode gesetzt wurde."</span><span class="co4"> ansible.builtin.assert</span>:<span class="co4"> that</span><span class="sy2">: </span> - radvd_ula_mode is defined and <span class="br0">(</span>radvd_ula_mode == 'noone' or radvd_ula_mode == 'slaac' or radvd_ula_mode == 'dhcp6'<span class="br0">)</span><span class="co3"> fail_msg</span><span class="sy2">: </span><span class="st0">"Die Variable radvd_ula_mode ist nicht vorhanden, leer, oder nicht noone, slaac oder dhcp6 !"</span><span class="co3"> quiet</span><span class="sy2">: </span>true <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Prüfen ob die beiden Variable raddv_gua_mode und radvd_ula_mode = noone sind."</span><span class="co4"> ansible.builtin.fail</span>:<span class="co3"> fail_msg</span><span class="sy2">: </span><span class="st0">"Die beiden Variable radvd_gua_mode und raddv_ula_mode können nicht beide noone sein !"</span><span class="co3"> when</span><span class="sy2">: </span>radvd_gua_mode == 'noone' and radvd_ula_mode == 'noone'   <span class="sy1">...</span></pre> </dd></dl> <p> Die eigentliche Installation und Konfiguration erfolgt dann im Task <strong><code>install.yml</code></strong>. </p> <pre class="code"> $ vim roles/radvd/tasks/install.yml</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/tasks/install.yml" class="mediafile mf_yml">roles/radvd/tasks/install.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Installation des Router Advertisement Daemon radvd."</span><span class="co4"> community.general.pacman</span>:<span class="co3"> name</span><span class="sy2">: </span>radvd<span class="co3"> state</span><span class="sy2">: </span>present <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Checken ob es bereits eine Backupdatei der radvd.conf gibt."</span><span class="co4"> ansible.builtin.stat</span>:<span class="co3"> path</span><span class="sy2">: </span>/etc/radvd.conf.orig<span class="co3"> register</span><span class="sy2">: </span>check_radvd_config <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Backupdatei der radvd.conf Konfigurationsdatei erstellen."</span><span class="co4"> ansible.builtin.copy</span>:<span class="co3"> remote_src</span><span class="sy2">: </span>true<span class="co3"> src</span><span class="sy2">: </span>/etc/radvd.conf<span class="co3"> dest</span><span class="sy2">: </span>/etc/radvd.conf.orig<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> when</span><span class="sy2">: </span>not check_radvd_config.stat.exists <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"GUA _oder_ ULA: Generieren und kopieren der radvd Konfigurationsdatei /etc/radvd.conf"</span><span class="co4"> ansible.builtin.template</span>:<span class="co3"> src</span><span class="sy2">: </span>templates/radvd_single_config.j2<span class="co3"> dest</span><span class="sy2">: </span>/etc/radvd.conf<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> when</span><span class="sy2">: </span>radvd_gua_mode == 'noone' or radvd_ula_mode == 'noone' <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"GUA _und_ ULA: Generieren und kopieren der radvd Konfigurationsdatei /etc/radvd.conf"</span><span class="co4"> ansible.builtin.template</span>:<span class="co3"> src</span><span class="sy2">: </span>templates/radvd_both_config.j2<span class="co3"> dest</span><span class="sy2">: </span>/etc/radvd.conf<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> when</span><span class="sy2">: </span>radvd_gua_mode != 'noone' and radvd_ula_mode != 'noone' <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Restart des radvd zur Aktivierung der Konfiguration."</span><span class="co4"> ansible.builtin.systemd_service</span>:<span class="co3"> name</span><span class="sy2">: </span>radvd<span class="co3"> state</span><span class="sy2">: </span>restarted <span class="co1"># enabled: true</span>   <span class="sy1">...</span></pre> </dd></dl> <p> Die Anpassung an unserer Firewall-Konfiguration erfolgt im Task <strong><code>firewalld</code></strong>. </p> <pre class="code"> $ vim roles/radvd/tasks/firewalld.yml</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/tasks/firewalld.yml" class="mediafile mf_yml">roles/radvd/tasks/firewalld.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Sicherstellen, dass der Firewall-Daemon reboot(-fest) starten."</span><span class="co4"> ansible.builtin.systemd</span>:<span class="co3"> state</span><span class="sy2">: </span>reloaded<span class="co3"> enabled</span><span class="sy2">: </span>true<span class="co3"> name</span><span class="sy2">: </span>firewalld <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Service basierte Rules je Zone definieren"</span><span class="co4"> ansible.posix.firewalld</span>:<span class="co3"> zone</span><span class="sy2">: </span>'<span class="br0">{</span><span class="br0">{</span> guest_zone_2 <span class="br0">}</span><span class="br0">}</span>'<span class="co3"> service</span><span class="sy2">: </span>dhcpv6<span class="co3"> immediate</span><span class="sy2">: </span>true<span class="co3"> permanent</span><span class="sy2">: </span>true<span class="co3"> state</span><span class="sy2">: </span>enabled <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Zum Schluss den aktuellen permanenten Regelsatz final neu laden."</span><span class="co4"> ansible.builtin.service</span>:<span class="co3"> name</span><span class="sy2">: </span>firewalld<span class="co3"> state</span><span class="sy2">: </span>reloaded   <span class="sy1">...</span></pre> </dd></dl> <p> Die beiden Templates <strong><code>radvd_single_config.j2</code></strong> und <strong><code>radvd_both_config.j2</code></strong> werden verwendet entsprechend der Auswahl ob nun Nur <strong>GUA</strong> oder <strong>ULA</strong> verwendet werden sollen oder beide. Das Template <strong><code>radvd_single_config.j2</code></strong> für die Generierung der Konfigurationsdatei <strong><code>/etc/radvd.conf</code></strong>, wenn nur eine der beiden Adressarten gewählt wurde, hat folgenden Aufbau. </p> <pre class="code"> $ vim roles/radvd/templates/radvd_single_config.j2</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/templates/radvd_single_config.j2" class="mediafile mf_j2">roles/radvd/templates/radvd_single_config.j2</a></dt> <dd><pre class="code file j2"># BEGIN ANSIBLE MANAGED - DO NOT EDIT BLOCK # Ansible managed configuration file, do not modify manually! # # Configuration file for the router advertisement daemon radvd, # in which either GUA or ULA are distributed via SLAAC or DHCPv6, # but not both!   {% if (radvd_gua_mode == "dhcp6") or (radvd_ula_mode == "dhcp6") %} # - M-flag: AdvManagedFlag = on (address configuration via DHCPv6) {% else %} # - M-flag: AdvManagedFlag = off (address configuration via SLAAC) {% endif %} # - O-flag: AdvOtherConfigFlag = on (obtaining a DNS server list # and a domain name from a Stateless DHCPv6 server, but # not addressing information. {% if (radvd_gua_mode == "dhcp6") or (radvd_ula_mode == "dhcp6" )%} # - A-flag: AdvAutonomous = off (address configuration via DHCPv6) {% else %} # - A-flag: AdvAutonomous = on (address configuration via SLAAC) {% endif %}   interface {{ radvd_nic }} { # A flag indicating whether or not the router sends periodic # router advertisements and responds to router solicitations. # This option no longer has to be specified first, but it needs # to be on to enable advertisement on this interface. AdvSendAdvert on;   # The maximum time allowed between sending unsolicited multi- # cast router advertisements from the interface, in seconds. # Must be no less than 4 seconds and no greater than 1800 seconds. # Minimum when using Mobile IPv6 extensions: 0.07. # For values less than 0.2 seconds, 0.02 seconds is added to # account for scheduling granularities as specified in RFC3775. MaxRtrAdvInterval 600;   # The minimum time allowed between sending unsolicited multicast # router advertisements from the interface, in seconds. # Must be no less than 3 seconds and no greater than # 0.75 * MaxRtrAdvInterval. # Minimum when using Mobile IPv6 extensions: 0.03. MinRtrAdvInterval 200;   # The preference associated with the default router, as either # "low", "medium", or "high". {% if radvd_gua_mode == "dhcp6" %} AdvDefaultPreference {{ radvd_gua_preference }}; {% else %} AdvDefaultPreference {{ radvd_ula_preference }}; {% endif %}   # Mobile IPv6 support, when set, indicates that sending router is # able to serve as Mobile IPv6 Home Agent. # When set, minimum limits specified by Mobile IPv6 are used for # MinRtrAdvInterval and MaxRtrAdvInterval. AdvHomeAgentFlag off;   # When set, hosts use the administered (stateful) protocol for # address autoconfiguration in addition to any addresses # autoconfigured using stateless address autoconfiguration. # The use of this flag is described in RFC 4862. # M-flag - if it is set to 1, this informs hosts that they can # obtain a global address as well as DNS and a domain name from # a Stateful DHCPv6 server. Typically this means that auto- # addressing using SLAAC is not allowed on this segment and both # the A-flag and the O-flag are set to 0. {% if (radvd_gua_mode == "dhcp6") or (radvd_ula_mode == "dhcp6") %} AdvManagedFlag on; {% else %} AdvManagedFlag off; {% endif %}   # When set, hosts use the administered (stateful) protocol for # autoconfiguration of other (non-address) information. # The use of this flag is described in RFC 4862 # O-flag - if it is set to on, this informs hosts that they can # obtain a DNS server list and a domain name from a Stateless # DHCPv6 server, but not addressing information. Typically it # works in conjunction with SLAAC for auto-addressing and both # the A-flag and the O-flag are set to on. AdvOtherConfigFlag on;   # The time, in milliseconds, 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 4861). # A value of zero means unspecified (by this router). # Must be no greater than 3,600,000 milliseconds (1 hour). AdvReachableTime 0;   # The time,in milliseconds, between retransmitted Neighbor Soli- # citation messages. Used by address resolution and the Neighbor # Unreachability Detection algorithm (see Sections 7.2 and 7.3 # of RFC 4861). A value of zero means unspecified (by this router). AdvRetransTimer 0;   # The default value that should be placed in the Hop Count field of # the IP header for outgoing (unicast) IP packets. The value should # be set to the current diameter of the Internet. # The value zero means unspecified (by this router). AdvCurHopLimit 64;   # The lifetime associated with the default router in units of seconds. # The maximum value corresponds to 18.2 hours. A lifetime of 0 indi- # cates that the router is not a default router and should not appear # on the default router list. The router lifetime applies only to the # router´s usefulness as a default router; it does not apply to in- # formation contained in other message fields or options. Options that # need time limits for their information include their own lifetime # fields. # Must be either zero or between MaxRtrAdvInterval and 9000 seconds. # Default: 3 * MaxRtrAdvInterval (Minimum 1 second). {% if radvd_gua_mode == "dhcp6" %} AdvDefaultLifetime {{ radvd_gua_route_time }}; {% else %} AdvDefaultLifetime {{ radvd_ula_route_time }}; {% endif %}   # When set, the link-layer address of the outgoing interface is # included in the RA. AdvSourceLLAddress on;   {% if radvd_gua_mode == "dhcp6" or (radvd_gua_mode == "slaac") %} # global unified address prefix prefix {{ radvd_gua_prefix }}{{ radvd_gua_netmask }} {% else %} # unique local address prefix prefix {{ radvd_ula_prefix }}{{ radvd_ula_netmask }} {% endif %} { # 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. AdvOnLink on;   # When set, indicates that this prefix can be used for autonomous # address configuration as specified in RFC 4862. # A-flag - if it is set to on, this informs hosts that they can # auto-generate GUA address using SLAAC. If it is set to off means # that auto-configuration is not allowed for this segment. {% if (radvd_gua_mode == "dhcp6") or (radvd_ula_mode == "dhcp6") %} AdvAutonomous off; {% else %} AdvAutonomous on; {% endif %}   # When set, indicates that the address of interface is sent instead # of network prefix, as is required by Mobile IPv6. When set, # minimum limits specified by Mobile IPv6 are used for # MinRtrAdvInterval and MaxRtrAdvInterval. AdvRouterAddr off;   # The length of time in seconds (relative to the time the packet is # sent) that the prefix is valid for the purpose of on-link de- # termination. The symbolic value infinity represents infinity # (i.e. a value of all one bits (0xffffffff)). The valid lifetime # is also used by RFC 4862. # # Note that clients will ignore AdvValidLifetime of an existing # prefix if the lifetime is below two hours, as required in RFC # 4862 Section 5.5.3 point e). # Note: RFC4861's suggested default value is significantly longer: # 30 days. {% if radvd_gua_mode == "dhcp6" %}   AdvValidLifetime {{ radvd_gua_valid_time }}; {% else %} AdvValidLifetime {{ radvd_ula_valid_time }}; {% endif %}   # The length of time in seconds (relative to the time the packet # is sent) that addresses generated from the prefix via stateless # address autoconfiguration remain preferred. The symbolic value # infinity represents infinity (i.e. a value of all one bits # (0xffffffff)). See RFC 4862. # # Note: RFC4861's suggested default value is significantly longer: # 7 days. {% if radvd_gua_mode == "dhcp6" %}   AdvPreferredLifetime {{ radvd_gua_prefd_time}}; {% else %} AdvPreferredLifetime {{ radvd_ula_prefd_time}}; {% endif %} };   {% if (radvd_gua_mode == "dhcp6") or (radvd_gua_mode == "slaac") %} # route for global scope address prefix route {{ radvd_gua_prefix }}{{ radvd_gua_netmask }} {% else %} # route for unique local address prefix prefix {{ radvd_ula_prefix }}{{ radvd_ula_netmask }} {% endif %} { # The preference associated with the default router, as either # "low", "medium", or "high".{% if (radvd_gua_mode == "dhcp6") or (radvd_gua_mode == "slaac") %}   AdvRoutePreference {{ radvd_gua_preference }}; {% else %}   AdvRoutePreference {{ radvd_ula_preference }}; {% endif %}   # The lifetime associated with the route in units of seconds. The # symbolic value infinity represents infinity (i.e. a value of # all one bits (0xffffffff)). # # Default: 3 * MaxRtrAdvInterval {% if (radvd_gua_mode == "dhcp6") or (radvd_gua_mode == "slaac") %}   AdvRouteLifetime {{ radvd_gua_route_time }}; {% else %}   AdvRouteLifetime {{ radvd_ula_route_time }}; {% endif %} };   }; # # END ANSIBLE MANAGED - DO NOT EDIT BLOCK</pre> </dd></dl> <p> Sollen sowohl <strong>GUA</strong> wie <strong>ULA</strong> zum Einsatz kommen wird das zweite Template <strong><code>radvd_both_config.j2</code></strong> herangezogen. </p> <pre class="code"> $ vim roles/radvd/templates/radvd_both_config.j2</pre> <dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_radvd/-/blob/main/roles/radvd/templates/radvd_both_config.j2" class="mediafile mf_j2">roles/radvd/templates/radvd_both_config.j2</a></dt> <dd><pre class="code file j2"># BEGIN ANSIBLE MANAGED - DO NOT EDIT BLOCK # Ansible managed configuration file, do not modify manually! # # Configuration file for the router advertisement daemon radvd, # in which either GUA or ULA are distributed via SLAAC or DHCPv6.     # - O-flag: AdvOtherConfigFlag = on (obtaining a DNS server list # and a domain name from a Stateless DHCPv6 server, but # not addressing information. # SLAAC: # - A-flag: AdvAutonomous = on (address configuration via SLAAC) # - M-flag: AdvManagedFlag = off (address configuration via SLAAC) # # DHCPv6: # - A-flag: AdvAutonomous = off (address configuration via DHCPv6) # - M-flag: AdvManagedFlag = on (address configuration via DHCPv6)   interface {{ radvd_nic }} { # A flag indicating whether or not the router sends periodic # router advertisements and responds to router solicitations. # This option no longer has to be specified first, but it needs # to be on to enable advertisement on this interface. AdvSendAdvert on;   # The maximum time allowed between sending unsolicited multi- # cast router advertisements from the interface, in seconds. # Must be no less than 4 seconds and no greater than 1800 seconds. # Minimum when using Mobile IPv6 extensions: 0.07. # For values less than 0.2 seconds, 0.02 seconds is added to # account for scheduling granularities as specified in RFC3775. MaxRtrAdvInterval 600;   # The minimum time allowed between sending unsolicited multicast # router advertisements from the interface, in seconds. # Must be no less than 3 seconds and no greater than # 0.75 * MaxRtrAdvInterval. # Minimum when using Mobile IPv6 extensions: 0.03. MinRtrAdvInterval 200;   # The preference associated with the default router, as either # "low", "medium", or "high". AdvDefaultPreference {{ radvd_gua_preference }};   # Mobile IPv6 support, when set, indicates that sending router is # able to serve as Mobile IPv6 Home Agent. # When set, minimum limits specified by Mobile IPv6 are used for # MinRtrAdvInterval and MaxRtrAdvInterval. AdvHomeAgentFlag off;   # When set, hosts use the administered (stateful) protocol for # address autoconfiguration in addition to any addresses # autoconfigured using stateless address autoconfiguration. # The use of this flag is described in RFC 4862. # M-flag - if it is set to 1, this informs hosts that they can # obtain a global address as well as DNS and a domain name from # a Stateful DHCPv6 server. Typically this means that auto- # addressing using SLAAC is not allowed on this segment and both # the A-flag and the O-flag are set to 0. {% if (radvd_gua_mode == "dhcp6") %} AdvManagedFlag on; {% else %} AdvManagedFlag off; {% endif %}   # When set, hosts use the administered (stateful) protocol for # autoconfiguration of other (non-address) information. # The use of this flag is described in RFC 4862 # O-flag - if it is set to on, this informs hosts that they can # obtain a DNS server list and a domain name from a Stateless # DHCPv6 server, but not addressing information. Typically it # works in conjunction with SLAAC for auto-addressing and both # the A-flag and the O-flag are set to on. AdvOtherConfigFlag on;   # The time, in milliseconds, 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 4861). # A value of zero means unspecified (by this router). # Must be no greater than 3,600,000 milliseconds (1 hour). AdvReachableTime 0;   # The time,in milliseconds, between retransmitted Neighbor Soli- # citation messages. Used by address resolution and the Neighbor # Unreachability Detection algorithm (see Sections 7.2 and 7.3 # of RFC 4861). A value of zero means unspecified (by this router). AdvRetransTimer 0;   # The default value that should be placed in the Hop Count field of # the IP header for outgoing (unicast) IP packets. The value should # be set to the current diameter of the Internet. # The value zero means unspecified (by this router). AdvCurHopLimit 64;   # The lifetime associated with the default router in units of seconds. # The maximum value corresponds to 18.2 hours. A lifetime of 0 indi- # cates that the router is not a default router and should not appear # on the default router list. The router lifetime applies only to the # router´s usefulness as a default router; it does not apply to in- # formation contained in other message fields or options. Options that # need time limits for their information include their own lifetime # fields. # Must be either zero or between MaxRtrAdvInterval and 9000 seconds. # Default: 3 * MaxRtrAdvInterval (Minimum 1 second). AdvDefaultLifetime {{ radvd_gua_route_time }};   # When set, the link-layer address of the outgoing interface is # included in the RA. AdvSourceLLAddress on;   # global unified address prefix prefix {{ radvd_gua_prefix }}{{ radvd_gua_netmask }} { # 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. AdvOnLink on;   # When set, indicates that this prefix can be used for autonomous # address configuration as specified in RFC 4862. # A-flag - if it is set to on, this informs hosts that they can # auto-generate GUA address using SLAAC. If it is set to off means # that auto-configuration is not allowed for this segment. {% if (radvd_gua_mode == "dhcp6") %} AdvAutonomous off; {% else %} AdvAutonomous on; {% endif %}   # When set, indicates that the address of interface is sent instead # of network prefix, as is required by Mobile IPv6. When set, # minimum limits specified by Mobile IPv6 are used for # MinRtrAdvInterval and MaxRtrAdvInterval. AdvRouterAddr off;   # The length of time in seconds (relative to the time the packet is # sent) that the prefix is valid for the purpose of on-link de- # termination. The symbolic value infinity represents infinity # (i.e. a value of all one bits (0xffffffff)). The valid lifetime # is also used by RFC 4862. # # Note that clients will ignore AdvValidLifetime of an existing # prefix if the lifetime is below two hours, as required in RFC # 4862 Section 5.5.3 point e). # Note: RFC4861's suggested default value is significantly longer: # 30 days. AdvValidLifetime {{ radvd_gua_valid_time }};   # The length of time in seconds (relative to the time the packet # is sent) that addresses generated from the prefix via stateless # address autoconfiguration remain preferred. The symbolic value # infinity represents infinity (i.e. a value of all one bits # (0xffffffff)). See RFC 4862. # # Note: RFC4861's suggested default value is significantly longer: # 7 days.i AdvPreferredLifetime {{ radvd_gua_prefd_time}}; };   # route for global scope address prefix route {{ radvd_gua_prefix }}{{ radvd_gua_netmask }} { # The preference associated with the default router, as either # "low", "medium", or "high". AdvRoutePreference {{ radvd_gua_preference }};   # The lifetime associated with the route in units of seconds. The # symbolic value infinity represents infinity (i.e. a value of # all one bits (0xffffffff)). # # Default: 3 * MaxRtrAdvInterval AdvRouteLifetime {{ radvd_gua_route_time }}; };   # unique local address prefix prefix {{ radvd_ula_prefix }}{{ radvd_gua_netmask }} { # 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. AdvOnLink on;   # When set, indicates that this prefix can be used for autonomous # address configuration as specified in RFC 4862. # A-flag - if it is set to on, this informs hosts that they can # auto-generate GUA address using SLAAC. If it is set to off means # that auto-configuration is not allowed for this segment. {% if radvd_ula_mode == "dhcp6" %} AdvAutonomous off; {% else %} AdvAutonomous on; {% endif %}   # When set, indicates that the address of interface is sent instead # of network prefix, as is required by Mobile IPv6. When set, # minimum limits specified by Mobile IPv6 are used for # MinRtrAdvInterval and MaxRtrAdvInterval. AdvRouterAddr off;   # The length of time in seconds (relative to the time the packet is # sent) that the prefix is valid for the purpose of on-link de- # termination. The symbolic value infinity represents infinity # (i.e. a value of all one bits (0xffffffff)). The valid lifetime # is also used by RFC 4862. # # Note that clients will ignore AdvValidLifetime of an existing # prefix if the lifetime is below two hours, as required in RFC # 4862 Section 5.5.3 point e). # Note: RFC4861's suggested default value is significantly longer: # 30 days. AdvValidLifetime {{ radvd_ula_valid_time }};   # The length of time in seconds (relative to the time the packet # is sent) that addresses generated from the prefix via stateless # address autoconfiguration remain preferred. The symbolic value # infinity represents infinity (i.e. a value of all one bits # (0xffffffff)). See RFC 4862. # # Note: RFC4861's suggested default value is significantly longer: # 7 days. AdvPreferredLifetime {{ radvd_ula_prefd_time}}; };   # route for global scope address prefix route {{ radvd_ula_prefix }}{{ radvd_ula_netmask }} { # The preference associated with the default router, as either # "low", "medium", or "high". AdvRoutePreference {{ radvd_ula_preference }};   # The lifetime associated with the route in units of seconds. The # symbolic value infinity represents infinity (i.e. a value of # all one bits (0xffffffff)). # # Default: 3 * MaxRtrAdvInterval AdvRouteLifetime {{ radvd_ula_route_time }}; };   }; # # END ANSIBLE MANAGED - DO NOT EDIT BLOCK</pre> </dd></dl> </div> <h4 class="sectionedit56" id="ausfuehrung_-_playbooklauf">Ausführung - Playbooklauf</h4> <div class="level4"> <p> Die orchestrierte Variante der Installation und Konfiguration unseres <strong>radvd</strong>-Daemon gestaltet sich ab sofort sehr einfach, brauchen wir doch lediglich die Konfigurationswerte im Inventory zu hinterlegen und zu pflegen und letztendlich das Playbook entsprechend aufzurufen: </p> <pre class="code"> $ ansible-playbook playbooks/arch_radvd.yml</pre> <p> <pre class="code"> <font style="color: rgb(0, 0, 0)">[22:15:26] Gathering Facts</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 1.98s</font> <font style="color: rgb(0, 0, 0)">[22:15:28] radvd : Installation und Konfiguration des Router Advertisement Daemon radvd.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 12ms</font> <font style="color: rgb(0, 0, 0)">[22:15:28] ↳ install: Installation des Router Advertisement Daemon radvd.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 3.14s</font> <font style="color: rgb(0, 0, 0)">[22:15:31] ↳ install: Checken ob es bereits eine Backupdatei der radvd.conf gibt.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 654ms</font> <font style="color: rgb(0, 0, 0)">[22:15:32] ↳ install: Backupdatei der radvd.conf Konfigurationsdatei erstellen.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 705s</font> <font style="color: rgb(0, 0, 0)">[22:15:32] ↳ install: Generieren und kopieren der radvd Konfigurationsdatei /etc/radvd.conf</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 1.13s</font> <font style="color: rgb(0, 0, 0)">[22:15:34] radvd : Konfiguration des firewalld für den Router Advertisement Daemon radvd.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 17ms</font> <font style="color: rgb(0, 0, 0)">[22:15:34] ↳ firewalld: Sicherstellen, dass der Firewall-Daemon reboot(-fest) starten.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 1.40s</font> <font style="color: rgb(0, 0, 0)">[22:15:35] ↳ firewalld: Service basierte Rules je Zone definieren.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 872ms</font> <font style="color: rgb(0, 0, 0)">[22:15:36] ↳ firewalld: Zum Schluss den aktuellen permanenten Regelsatz final neu laden.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 928ms</font> <font style="color: rgb(0, 0, 0)">[22:15:37] system</font> <font style="color: rgb(25, 100, 5)">-- Play recap --</font> <font style="color: rgb(196, 160, 0)">vml010110 </font><font style="color: rgb(0, 0, 0)">: </font><font style="color: rgb(25, 100, 5)">ok=10 </font><font style="color: rgb(196, 160, 0)">changed=5 </font>unreachable=0 failed=0 skipped=0 rescued=0 ignored=0</font> </pre> <img src="/lib/images/smileys/fixme.svg" class="icon smiley" alt="FIXME" /> </p> </div> <h4 class="sectionedit57" id="ergebniskontrolle">Ergebniskontrolle</h4> <div class="level4"> <p> Nun prüfen wir, ob unser <strong>radvd</strong> auch die richtigen Router Advertisement ICMPv6 Nachrichten ins Netz schickt. Hier bieten sich zwei mögliche Varianten an: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Mit dem Programm <strong><code>radvdump</code></strong> aus dem Paket <strong>radvd</strong>. Hierzu starten wir dias besagte Binary auf einem unserer Clients im lokalen Netzwerk-Segment dieses Binary. <pre class="code"> # radvdump</pre> <pre class="code"># # radvd configuration generated by radvdump 2.18 # based on Router Advertisement from fe80::10:ff:fe10:110 # received by interface enp0s25 # interface enp0s25 { AdvSendAdvert on; # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump AdvManagedFlag on; AdvOtherConfigFlag on; AdvReachableTime 0; AdvRetransTimer 0; AdvCurHopLimit 64; AdvDefaultLifetime 1800; AdvHomeAgentFlag off; AdvDefaultPreference medium; AdvSourceLLAddress on; prefix 2001:a:bcd:1234::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; }; # End of prefix definition prefix fdb6:cb48:9d77::/64 { AdvValidLifetime 5400; AdvPreferredLifetime 2700; AdvOnLink on; AdvAutonomous off; AdvRouterAddr off; }; # End of prefix definition route 2001:a:bcd:1234::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition route fdb6:cb48:9d77::/64 { AdvRoutePreference medium; AdvRouteLifetime 1800; }; # End of route definition }; # End of interface definition</pre> <p> In regelmäßigen Abständen tauchen also diese RA-Meldungen auf. </p> </div> </li> <li class="level1"><div class="li"> Mit Hilfe von <strong><code>tcpdump</code></strong> können wir auch die RA-Meldungen mitschneiden und darstellen, in nachfolgenden Beispiel ist der Name des Netzwerkinterfaces <strong><code>enp0s25</code></strong>.<pre class="code"> # tcpdump -vi enp0s25 "icmp6[icmp6type] == icmp6-routeradvert"</pre> <pre class="code">cpdump: listening on enp0s25, link-type EN10MB (Ethernet), snapshot length 262144 bytes 22:23:42.141271 IP6 (flowlabel 0xc155a, hlim 255, next-header ICMPv6 (58) payload length: 136) _gateway > nitropad: [icmp6 sum ok] ICMP6, router advertisement, length 136 hop limit 64, Flags [managed, other stateful], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0ms prefix info option (3), length 32 (4): 2001:a:bcd:1234::/64, Flags [onlink], valid time 5400s, pref. time 2700s prefix info option (3), length 32 (4): fdb6:cb48:9d77::/64, Flags [onlink], valid time 5400s, pref. time 2700s route info option (24), length 24 (3): 2001:a:bcd:1234::/64, pref=medium, lifetime=1800s route info option (24), length 24 (3): fdb6:cb48:9d77::/64, pref=medium, lifetime=1800s source link-address option (1), length 8 (1): 52:54:00:41:11:02 ^C 1 packet captured 1 packet received by filter 0 packets dropped by kernel</pre> </div> </li> </ol> </div> <h1 class="sectionedit58 page-header pb-3 mb-4 mt-5" id="links">Links</h1> <div class="level1"> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="/doku.php/linux:ansible:detail" class="wikilink1" title="linux:ansible:detail" data-wiki-id="linux:ansible:detail">zurück zum Kapitel "Ansible - Erweiterte Konfigurationsbeispiele"</a> ⇐ </strong></div> </li> <li class="level1"><div class="li"> <strong>⇒ <a href="/doku.php/linux:kea" class="wikilink1" title="linux:kea" data-wiki-id="linux:kea">weiter zum Kapitel "DHCPv4|v6-Server mit DHCP ISC Kea unter Arch Linux einrichten und nutzen</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="/doku.php/linux:start#ansible" class="wikilink1" title="linux:start" data-wiki-id="linux:start">Zurück zur "Ansible"-Übersicht</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="/doku.php/wiki:start" class="wikilink1" title="wiki:start" data-wiki-id="wiki:start">Zurück zu >>Projekte und Themenkapitel<<</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="http://dokuwiki.nausch.org/doku.php/" class="urlextern" target="_tab" title="http://dokuwiki.nausch.org/doku.php/" rel="ugc nofollow noopener">Zurück zur Startseite</a></strong></div> </li> </ul> </div> <hr/><div class="footnotes"> <div class="fn"><sup><a href="#fnt__1" id="fn__1" class="fn_bot">1)</a></sup> <div class="content"><strong>S</strong>tateless <strong>A</strong>ddress <strong>A</strong>utoconfiguration</div></div> <div class="fn"><sup><a href="#fnt__2" id="fn__2" class="fn_bot">2)</a></sup> <div class="content"><strong>D</strong>uplicate <strong>A</strong>ddress <strong>D</strong>etection</div></div> <div class="fn"><sup><a href="#fnt__3" id="fn__3" class="fn_bot">3)</a></sup> <div class="content"><strong>L</strong>ink <strong>L</strong>ocal <strong>A</strong>ddress</div></div> <div class="fn"><sup><a href="#fnt__4" id="fn__4" class="fn_bot">4)</a></sup> <div class="content"><strong>R</strong>outer <strong>S</strong>olicitation</div></div> <div class="fn"><sup><a href="#fnt__5" id="fn__5" class="fn_bot">5)</a></sup> <div class="content"><strong>U</strong>nique <strong>L</strong>ocal <strong>A</strong>ddress</div></div> <div class="fn"><sup><a href="#fnt__6" id="fn__6" class="fn_bot">6)</a></sup> <div class="content"><strong>G</strong>lobal <strong>U</strong>nicast <strong>A</strong>ddress</div></div> <div class="fn"><sup><a href="#fnt__7" id="fn__7" class="fn_bot">7)</a></sup> <div class="content"><strong>I</strong>nternet <strong>S</strong>ervice <strong>P</strong>rovider</div></div> </div> <div class="cookielaw-banner cookielaw-bottom">Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.<button>OK</button><a href="https://de.wikipedia.org/wiki/Cookie" target="_blank">Weitere Information</a></div></div><!-- /content --></div> </div> </div> <div class="small text-right"> <span class="docInfo"> <ul class="list-inline"><li><span class="iconify text-muted" data-icon="mdi:file-document-outline"></span> <span title="linux/radvd.txt">linux/radvd.txt</span></li><li><span class="iconify text-muted" data-icon="mdi:calendar"></span> Zuletzt geändert: <span title="10.07.2024 18:40. ">10.07.2024 18:40. </span></li><li class="text-muted">von <bdi><img src="/lib/exe/fetch.php/user:django.png" alt="" width="16" height="16" class="img-rounded" /> <bdi>django<bdi></bdi></li></ul> </span> </div> </article> </div> </main> <footer id="dw__footer" class="dw-container py-5 dokuwiki container-fluid"> <!-- footer --> <div class="dw-container small container-fluid mx-5"> <div class="footer-dw-title"> <div class="media"> <div class="media-left"> <img src="/lib/exe/fetch.php/logo.png" alt="Linux - Wissensdatenbank" class="media-object" style="height:32px" /> </div> <div class="media-body"> <div class="row"> <div class="col-sm-2"> <h4 class="media-heading">Linux - Wissensdatenbank</h4> <p> </p> </div> <div class="col-sm-10"> </div> </div> </div> </div> </div> <div class="footer-license row"> <hr/> <div id="dw__license" class="col-sm-6"> <p> <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de" title="CC Attribution-Share Alike 4.0 International" target="_tab" itemscope itemtype="http://schema.org/CreativeWork" itemprop="license" rel="license" class="license"><img src="/lib/tpl/bootstrap3/images/license/cc.png" width="24" height="24" alt="cc" /> <img src="/lib/tpl/bootstrap3/images/license/by.png" width="24" height="24" alt="by" /> <img src="/lib/tpl/bootstrap3/images/license/sa.png" width="24" height="24" alt="sa" /> </a> </p> <p class="small"> Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:<br/><a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de" title="CC Attribution-Share Alike 4.0 International" target="_tab" itemscope itemtype="http://schema.org/CreativeWork" itemprop="license" rel="license" class="license">CC Attribution-Share Alike 4.0 International</a> </p> </div> <div class="col-sm-6"> <!-- badges --> <div class="text-right"> <ul id="dw__badges" class="list-inline hidden-print"> <li> <a href="https://www.dokuwiki.org/template:bootstrap3" title="Bootstrap template for DokuWiki" target="_tab"> <img src="/lib/tpl/bootstrap3/images/bootstrap.png" width="20" alt="Bootstrap template for DokuWiki" /> </a> </li> <li> <a href="https://www.php.net" title="Powered by PHP" target="_tab"> <img src="/lib/tpl/bootstrap3/images/php.png" width="20" alt="Powered by PHP" /> </a> </li> <li> <a href="http://validator.w3.org/check/referer" title="Valid HTML5" target="_tab"> <img src="/lib/tpl/bootstrap3/images/html5.png" width="20" alt="Valid HTML5" /> </a> </li> <li> <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" target="_tab"> <img src="/lib/tpl/bootstrap3/images/css3.png" width="20" alt="Valid CSS" /> </a> </li> <li> <a href="https://www.dokuwiki.org/" title="Driven by DokuWiki" target="_tab"> <img src="/lib/tpl/bootstrap3/images/logo.png" width="20" alt="Driven by DokuWiki" /> </a> </li> </ul> </div> <!-- /badges --> </div> </div> </div> <!-- /footer --> </footer> <a href="#dokuwiki__top" class="back-to-top hidden-print btn btn-default" title="zum Inhalt springen" accesskey="t"> <span class="iconify" data-icon="mdi:chevron-up"></span> </a> <div id="screen__mode"> <span class="visible-xs-block"></span> <span class="visible-sm-block"></span> <span class="visible-md-block"></span> <span class="visible-lg-block"></span> </div> <img src="/lib/exe/taskrunner.php?id=linux%3Aradvd&1743456064" width="2" height="1" alt="" /> </div> </body> </html>