diff --git a/LDP/users/Peter-Bieringer/.cvsignore b/LDP/users/Peter-Bieringer/.cvsignore deleted file mode 100644 index e69de29b..00000000 diff --git a/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.de.html b/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.de.html deleted file mode 100644 index e533f969..00000000 --- a/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.de.html +++ /dev/null @@ -1,19310 +0,0 @@ - -
pb at bieringer dot de
Versionsgeschichte | ||
---|---|---|
Version 0.67.de.1wip | 2015-08-18 | Geändert durch: PB |
Version 0.66.de.1 | 2014-05-15 | Geändert durch: PB |
Version 0.65.de.1 | 2009-12-13 | Geändert durch: PB |
Version 0.64.de.1 | 2009-06-11 | Geändert durch: PB |
Version 0.61.de.1 | 2007-10-06 | Geändert durch: PB |
Das Ziel des Linux IPv6 HOWTO ist die Beantwortung von Basis- und Experten-Fragen zum Thema IPv6 mit Linux-Betriebssystemen. Dieses HOWTO will dem Leser genug Informationen bereitstellen, um IPv6-Anwendungen auf Linux Computer installieren, konfigurieren und anwenden zu können. Zwischen-Versionen sind auf mirrors.bieringer.de oder mirrors.deepspace6.net verfügbar. Änderungen sind in der Revisionshistorie aufgelistet.
Informationen über verfügbare Übersetzungen finden Sie im Abschnitt Übersetzungen.
Verfasst von und urheberrechtlich geschützt durch Peter Bieringer © 2001-2014.
Deutsche Übersetzung:
Verfasst von und urheberrechtlich geschützt durch Georg Käfer © 2002-2003, weitergeführt von Peter Bieringer © 2004-2014.
Dieses Linux IPv6 HOWTO wird unter der GNU GPL Version 2 herausgegeben:
Dieses Linux IPv6 HOWTO ist ein Handbuch zur Anwendung und Konfiguration von IPv6 auf Linux-Systemen.
Copyright © 2001-2014 Peter Bieringer -Deutsche Übersetzung Copyright © 2002-2003 Georg Käfer, weitergeführt von Peter Bieringer © 2004-2013.
Diese Dokumentation ist freie Software; Sie können diese unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation publiziert, entweder unter Version 2 oder optional jede höhere Version redistribuieren und/oder modifizieren.
Dieses Programm wird in der Hoffnung verteilt, dass es für Sie nutzvoll ist, jedoch OHNE JEDWEDER GEWÄHRLEISTUNG; sogar ohne der implizierten Gewährleistung der MARKTFÄHIGKEIT oder der FÄHIGKEIT ZU EINEM BESONDEREN ZWECK bzw. VORSATZ. Weitere Details finden Sie in der GNU General Public License.
Zusammen mit diesem Dokument sollten Sie eine Kopie der GNU General Public License erhalten haben; Wenn dem nicht so ist, können Sie sich an folgende Adresse wenden: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.
1993: In Kontakt mit dem Internet getreten, kennenlernen von konsolenbasierte E-Mail- und News-Client-Programme (z.B.: suchen Sie nach “e91abier” auf groups.google.com, das ist der Autor).
1996: Anfrage zur Gestaltung eines IPv6 Kurses inklusive eines Workshops zum Thema Linux Betriebssystem bekommen.
1997: Schreiben einer Anleitung, wie man IPv6 auf Linux Systemen installieren, konfigurieren und anwenden kann, genannt IPv6 & Linux - HowTo (siehe unter IPv6 & Linux - HowTo/History).
2001: Begonnen, dieses neue Linux IPv6 HOWTO zu schreiben.
Der Autor kann via E-Mail <pb at bieringer dot de> und auch über seine homepage kontaktiert werden.
Der Autor lebt zurzeit in München / Bayern / (Süd-)Deutschland / (Mittel-)Europa / Erde (Festland).
Die aktuelle Versionsnummer finden Sie auf der Titelseite.
Für andere verfügbare Versionen/Übersetzungen siehe auch http://www.bieringer.de/linux/IPv6/.
2001-11-30: Beginn mit der Neukonzeption dieses HOWTOs.
2002-01-02: Viel Inhalt eingearbeitet, erste Version des Kapitels 1 veröffentlicht (Version 0.10).
2002-01-14: Weitere Vervollständigung und Überprüfung des Inhalts, öffentliche Freigabe des kompletten Dokuments (Version 0.14).
2002-08-16: Polnische Übersetzung ist in Arbeit.
2002-10-31: Chinesische Übersetzung ist verfügbar.
2002-11-10: Deutsche Übersetzung ist in Arbeit.
2003-02-10: Deutsche Übersetzung ist verfügbar.
2003-04-09: Französische Übersetzung ist in Arbeit.
2003-05-09: Französische Übersetzung ist verfügbar
2003-10-16: Italienische Übersetzung ist in Arbeit.
2004-03-12: Italienische Übersetzung ist verfügbar
2004-06-18: Griechische Übersetzung ist in Arbeit
2005-07-25: Türkische Übersetzung ist verfügbar
2007-03-28: Portugiesisch-Brasilianische Übersetzung ist in Arbeit
2008-07-30: Spanische Übersetzung ist verfügbar (aber noch nicht abgeschlossen)
2011-05-09: Portugiesisch-Brasilianische Übersetzung ist wieder in Arbeit
Übersetzungen müssen den URL, die Versionsnummer und das Copyright des Originaldokuments enthalten (aber auch die Daten zu ihrer Übersetzung). Bitte übersetzen Sie nicht das Original-Changelog, das wäre nicht sehr sinnvoll. Es sieht aus, als wäre die Änderungsfrequenz dieses Dokumentes überwiegend geringer als einmal pro Monat. Seit Version 0.27 scheint der Hauptteil des vom Autor beigesteuerten Inhaltes geschrieben zu sein. Übersetzungen müssen immer das englische Original als Quelle benutzen.
Notiz: eine Übersicht mit URLs ist zu finden unter http://www.bieringer.de/linux/IPv6/.
Mit 2002-11-10 wurde von Georg Käfer <gkaefer at gmx dot at> die Deutsche Übersetzung begonnen und am 10.02.2003 erstmals publiziert. Grundlage der Übersetzung ist die CVS-Version 1.53 der Lyx-Datei, aus der das Linux IPv6 HOWTO Version 0.39.2 erstellt wurde.
Mit Sicherheit werden in dieser Übersetzung noch so manche 'Hoppalas' und auch 'grausige' Rechtschreibfehler zu finden sein. Sorry! Ebenfalls fällt es nicht immer leicht, zu entscheiden, ob ein Terminus überhaupt übersetzt werden soll, bzw. ob die Beibehaltung des englischen Originalwortes nicht zielführender wäre...
Neue deutsche Rechtschreibung: es wurde eine konservative Übersetzung angewandt, d.h. nicht alle möglichen Änderungen der Neuen deutschen Rechtschreibung wurden durchgeführt, sondern nur die notwendigen Änderungen.
Die URL für diese deutsche Übersetzung ist: http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-de/
Informationen über Übersetzungen in andere Sprachen finden Sie hier im Originaldokument: TLDP / Linux+IPv6-HOWTO / Übersetzungen.
Die originale englische Version dieses HOWTOs wurde mit LyX Version 1.6.1 auf einem Fedora 10 Linux System mit SGML-Template (DocBook book) erstellt. Alle Dateien sind unter github / tLDP / LDP / users / Peter-Bieringer verfügbar.
Auch die deutsche Version wurde mit LyX erstellt und befindet sich ebenfalls im angegebenen CVS-Verzeichnis.
Der Zeilenumbruch wird mit Hilfe eines selbst geschriebenen Tools “lyxcodelinewrapper.pl” erstellt; Sie finden das Skript am CVS unter: TLDP-CVS / users / Peter-Bieringer.
SGML wird mit Hilfe der Exportfunktion in LyX generiert.
Um korrekten SGML Code zu erstellen, müssen einige Korrekturen gemacht werden. Die entsprechenden Perl Skripts finden Sie unter TLDP-CVS / users / Peter-Bieringer:
Der Export von Lyx-Tabellen erstellt keine korrekten “colspan” Tags. Tool für die Korrektur: “sgmllyxtabletagfix.pl” (behoben seit LyX Version 1.2.0)
LyX verwendet manchmal , anstelle der normalen, spezielle Links-/Rechts-Formatierungen für Zitate, die dann auch im generierten HTML Code ausgegeben werden. Einige Browser können das Ergebnis nicht besonders schön darstellen (bekannt sind: Opera TP2 oder Konqueror). Tool für die Korrektur: “sgmllyxquotefix.pl”
Im Allgemeinen wird ein Verweis auf die Hauptindexseite empfohlen.
Da die HTML-Seiten aus einer SGML-Datei erstellt werden, werden einige HTML-Dateinamen ziemlich zufällig gewählt. Manche Seiten sind jedoch in LyX mit Tags gekennzeichnet, woraus statische Namen resultieren. Diese sollten der besseren Referenz wegen zukünftig nicht geändert werden.
Bitte lassen Sie es wissen, wenn Sie glauben, dass ein Tag vergessen wurde.
Einiges vorab:
Inklusive diesem gibt es drei (3) HOWTO-Dokumente. Pardon, wenn das zu viele sind ;-)
Das erste IPv6 bezogene Dokument wurde von Eric Osborne geschrieben und heißt Linux IPv6 FAQ/HOWTO (bitte benutzen Sie den Text nur im historischen Kontext). Die neueste Version 3.2.1 wurde am 14.Juli 1997 veröffentlicht.
Bitte um Ihre Mithilfe: Wenn jemand das Erstellungsdatum der Erstversion dieses HOWTOs kennen sollte, senden Sie mir Bitte ein E-Mail (Die Information wird im Abschnitt “Werdegang” eingearbeitet).
Ein zweites Dokument (IPv6 & Linux - HowTo) wurde vom selben Autor (Peter Bieringer) geschrieben und liegt im HTML-Format vor. Begonnen wurde mit dem Schreiben im April 1997 und die erste englische Version wurde im Juni 1997 veröffentlicht. Das Dokument wird weiterhin betreut, es wird aber langsam (jedoch nicht komplett) in das Linux IPv6 HOWTO - das Sie gerade lesen - eingearbeitet.
Da das IPv6 & Linux - HowTo in HTML geschrieben wurde, war es nicht wirklich mit dem The Linux Documentation Project (TLDP) kompatibel. Der Autor (Peter Bieringer) bekam Ende Nov. 2001 die Anfrage, das IPv6 & Linux - HowTo in SGML zu konvertieren. Er entschied sich auf Grund dieser Diskontinuität (Future of IPv6 & Linux - HowTo) und der Tatsache, dass IPv6 mehr und mehr zum Standard wird, zum Schreiben eines neuen Dokuments. Im zweiten HOWTO (IPv6 & Linux - HowTo) wird auch weiterhin dynamischer Inhalt sowie weiterführender Inhalt zu finden sein.
Dezimales Zahlensystem, das die Zahlen 0-9 beinhaltet.
Generell in Programmiersprachen verwendetes hexedezimales Zahlensystem, das die Zahlen 0-9 und die Buchstaben A-F beinhaltet (Groß/Kleinschreibung möglich).
85 verschiedene Zahlen/Buchstaben umfasst dieses Zahlensystem und ermöglicht dadurch kürzere Zeichenketten - aber niemals in der Praxis gesehen.
Kleinste Speichereinheit mit dem Wert ein/wahr (1) oder aus/falsch (0)
Meistens eine Menge von 8 bits (aber kein Muss - siehe ältere Computer Systeme)
Netzwerkgerät, siehe auch NIC
Ein Dual homed host ist ein Node mit zwei (physischen oder virtuellen) Schnittstellen auf zwei unterschiedlichen Links. Datenpakete können zwischen den zwei Verbindungen nicht weitergeleitet werden.
Im Regelfall handelt es sich um einen Rechner mit einen Link sowie einer aktiven Netzwerk-Schnittstelle, z.B. Ethernet oder (aber nicht und) PPP.
Ident mit “device”, siehe auch NIC.
Kopf eines IP-Paketes (jedes Netzwerk-Paket hat einen header, die Form des headers ist abhängig von der Netzwerkschicht).
Ein Link ist eine Schicht 2 Netzwerk-Transportmedium für Pakete; Beispiele sind Ethernet, Token Ring, PPP, SLIP, ATM, ISDN, Frame Relay,...
Ein Node (=Knoten) ist ein Host oder ein Router.
Sammlung von acht (8) realen bits, vergleichbar mit “byte”.
Information für den TCP/UDP dispatcher (Schicht 4), mit dessen Hilfe Informationen auf höhere Schichten transportiert werden.
Jede Netzwerkschicht enthält meistens ein Protokoll-Feld damit die Übergabe transportierter Informationen an höhere Netzwerkschichten erleichtert wird. Beispiele hierfür: Schicht 2 (MAC) und 3 (IP).
Ein Router ist ein Knoten mit zwei (2) oder mehr (physischen oder virtuellen) Schnittstellen, der Datenpakete zwischen den Schnittstellen versenden kann.
Ein IP socket wird durch Quell- und Zieladresse, den Ports (und der Verbindung) definiert.
Ein Stack setzt sich aus Netzwerkschichten zusammen.
IP Netzwerke verwenden Bitmasken um lokale von entfernten Netzwerken zu trennen.
Ein Tunnel ist typischerweise eine Punkt-zu-Punkt-Verbindung, über die Datenpakete eines anderen Protokolls ausgetauscht werden. Beispiel: IPv6-in-IPv4 Tunnel.
Access Control List - Zugriffsliste)
Application Programming Interface - Schnittstellen in Programmen zwischen den Applikationen
Application Specified Integrated Circuit - Applikationsspezifischer integrierter Schaltkreis
Berkeley Software Distribution
Controller Area Network Bus (physical bus system)
Internet Service Provider
Ein Projekt und gemeinsame Anstrengung von sechs (6) Firmen in Japan mit dem Ziel, einen freien IPv6 und IPsec Stack für BSD Derivate der Öffentlichkeit zur Verfügung zu stellen www.kame.net.
Local Internet Registry - Lokale Internet Registratur
Network Interface Controller - Netzwerk[schnittstellen]karte, kurz Netzwerkkarte
Request For Comments - eine Sammlung von technischen und organisatorischen Dokumenten zum Thema Internet.
UniverSAl playGround for Ipv6 Project - dieses Projekt will für das Linux System einen IPv6 Protokoll stack mit Produktionsqualität ausliefern.
Das spezielle Zeichen “¬” zeigt in den Beispielen an, dass die Zeile umgebrochen wurde. Dies wurde für eine korrekte Darstellung des Textes in den PDF- und PS-Versionen benötigt.
In allgemeinen Beispielen können Sie öfters lesen:
<myipaddress> |
In Skripts oder an Ihrer Kommandozeile müssen Sie die < und > weglassen und den Text mit dem entsprechenden Inhalt ersetzen. Das Beispiel hier z.B. könnte sein:
1.2.3.4 |
Kommandos, die nicht als Root-Benutzer ausgeführt werden, beginnen mit $, z.B.
$ whoami |
Befehle, die mit Root-Rechten ausgeführt werden, beginnen mit #, z.B.
# whoami |
Sie sollten mit den gängigsten Unix Tools wie grep, awk, find, etc. und deren Kommandozeilen-Optionen vertraut sein.
Sie sollten das Schichtmodell und die einzelnen Schichten, Protokolle, Adressarten, Kabelsorten, Stecker etc. kennen. Wenn das Neuland für Sie sein sollte, finden Sie hier einen guten Ausgangspunkt: http://www.rigacci.org/docs/biblio/online/intro_to_networking/book1.htm
Sie sollten definitiv Erfahrung mit der Konfiguration von IPv4 Netzwerken haben, andernfalls werden Sie dem Text nur schwer folgen können.
Sie sollten ebenfalls das Domain Name System (DNS) verstehen und damit umgehen können.
Sie sollten zumindest mit tcpdump umgehen und den Output des Programms interpretieren können. Andernfalls wird die Netzwerk-Fehlersuche für Sie schwierig.
Sicherlich wollen Sie mit realer Hardware experimentieren und nicht darüber an dieser Stelle lesen und an der einen oder anderen Stelle einschlummern. ;-7)
IPv6 ist ein neues Schicht 3 Vermittlungsprotokoll und es wird IPv4 (auch als IP bekannt) ablösen. IPv4 wurde vor langer Zeit entworfen (RFC 760 / Internet Protocol vom Januar 1980). Seitdem wurden viele Adressen vergeben und Erweiterungen angeregt. Die aktuelle RFC ist RFC 2460 / Internet Protocol Version 6 Specification. Hauptänderungen in IPv6 sind das neue Design des Headers sowie die Erweiterung der Adresslänge von 32 bits auf 128 bits. Die Schicht 3 ist für den Transport der Pakete von Endpunkt-zu-Endpunkt mittels adressbasierten Paket-Routings zuständig, und wie bei IPv4 müssen bei IPv6 die Adressen (Quell- und Zieladresse) inkludiert sein.
Für weitere Informationen zur IPv6 Geschichte siehe die älteren RFCs z.B. SWITCH IPv6 Pilot / References.
Die Jahre 1992, 1993 und 1994 der allgemeinen IPv6 Geschichte können Sie in folgendem Dokument nachlesen: IPv6 or IPng (IP next generation).
Zu erledigen: Bessere Chronologie, mehr Inhalt
Der erste IPv6 Netzwerk Code wurde dem Linux Kernel 2.1.8 im November 1996 durch Pedro Roque hinzugefügt. Er basierte auf dem BSD API:
diff -u --recursive --new-file v2.1.7/linux/include/linux/in6.h -¬ linux/include/linux/in6.h ---- v2.1.7/linux/include/linux/in6.h Thu Jan 1 02:00:00 1970 -+++ linux/include/linux/in6.h Sun Nov 3 11:04:42 1996 -@@ -0,0 +1,99 @@ -+/* -+ * Types and definitions for AF_INET6 -+ * Linux INET6 implementation -+ * + * Authors: -+ * Pedro Roque <******> -+ * -+ * Source: -+ * IPv6 Program Interfaces for BSD Systems -+ * <draft-ietf-ipngwg-bsd-api-05.txt> |
Diese Zeilen entstammen dem patch-2.1.8 (die E-Mail-Adresse wurde hier beim Copy & Paste absichtlich gelöscht).
Aufgrund fehlender Arbeitskraft konnte die IPv6-Kernel-Implementierung nicht mit den Drafts oder neu freigegebenen RFCs Schritt halten. Im Oktober 2000 wurde in Japan das USAGI Projekt gestartet. Das Ziel war, die fehlende bzw. bereits veraltete IPv6 Funktionalität in Linux zu implementieren. Dabei richtete man sich nach der aktuellen FreeBSD Implementierung von IPv6, die durch das KAME project umgesetzt wurde. Von Zeit zu Zeit wurden im Vergleich zu den aktuellen Standard Linux-Kernel-Quellen ein Auszug erstellt.
Bis zum Start der Entwicklungs-Kernel Serie 2.5.x, der USAGI Patch war so groß, das er von den Linux-Netzwerkcode-Maintainers nicht komplett für die Einbindung in die Produktions-Kernel Serie 2.4.x eingebunden werden konnte.
Während der Entwicklung in der Serie 2.5.x hat USAGI versucht, so viel wie möglich ihrer Erweiterungen darin zu integrieren.
Viele der von USAGI und anderen lang entwickelten IPv6-bezogenen Patches sind bereits in der Vanilla Kernel Serie 2.6.x integriert.
USAGI und andere arbeiten weiterhin an der Implementierung von neuen Features wie Mobility und anderen. Von Zeit zu Zeit werden neue Erweiterungs-Patches veröffentlicht, wie auch die Integration in die Vanilla Kernel Serie 2.6.x vorangetrieben.
Wie gesagt, IPv6 Adressen sind 128 bit lang. Diese bit-Anzahl kann sehr hohe dezimale Zahlen mit bis zu 39 Ziffern ergeben:
2^128-1: 340282366920938463463374607431768211455 |
Solche Zahlen sind nicht wirklich Adressen, die auswendig gelernt werden können. Die IPv6 Adressdarstellung ist bitweise orientiert (wie bei IPv4, aber das wird nicht oft bedacht). Eine bessere Schreibweise ist deshalb die hexadezimale Darstellung. Dabei werden 4 bits (auch ”nibble” genannt) durch die Zeichen 0-9 und a-f (10-15) dargestellt, wodurch die Länge auf 32 Zeichen reduziert wird.
2^128-1: 0xffffffffffffffffffffffffffffffff |
Diese Darstellung ist ebenfalls nicht sehr angenehm (mögliche Verwechslung oder Verlust einzelner hexadezimaler Ziffern), so dass die IPv6 Designer das hexadezimales Format mit einem Doppelpunkt als Trennzeichen nach jedem 16 bit Block erweiterten. Ferner wird das führende ”0x” (ein in Programmiersprachen verwendetes Identifizierungsmerkmal für hexadezimale Werte) entfernt:
2^128-1: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
Eine gültige Adresse (s.u. Adress-Typen) ist z.B.:
2001:0db8:0100:f101:0210:a4ff:fee3:9566 |
Der Vereinfachung halber können führende Nullen jedes 16 bit-Blocks weggelassen werden:
2001:0db8:0100:f101:0210:a4ff:fee3:9566 -> -¬ 2001:0db8:100:f101:210:a4ff:fee3:9566 |
Eine Sequenz von 16 bit-Blöcken, die nur Nullen enthaltet, kann durch ein “::“ ersetzt werden. Diese Komprimierung kann aber nicht öfters als einmal durchgeführt werden
2001:0db8:100:f101:0:0:0:1 -> 2001:0db8:100:f101::1 |
Die höchstmögliche Reduktion sieht man bei der IPv6 Localhost Adresse:
0000:0000:0000:0000:0000:0000:0000:0001 -> ::1 |
Es gibt auch eine so genannte kompakte Darstellung (base 85 codiert) RFC 1924 / A Compact Representation of IPv6 Addresses (publiziert am 1. April 1996). Diese Notation wurde allerdings nie in der Praxis gesehen und ist wahrscheinlich ein Aprilscherz. Ein Beispiel:
# ipv6calc --addr_to_base85 2001:0db8:0100:f101:0210:a4ff:fee3:9566 -Itu&-ZQ82s>J%s99FJXT |
Info: ipv6calc ist ein IPv6 Adressen-Format-Umrechner und Konvertierungsprogramm und ist hier zu finden: ipv6calc homepage (Mirror)
In jedem IP-Header werden die ersten 4 Bits für die Protokollversion reserviert. So sind theoretisch die Protokollnummern 0 bis 15 möglich:
4: Wird schon für IPv4 verwendet
5: Ist für das Stream Protocol (STP, RFC 1819 / Internet Stream Protocol Version 2) reserviert (das aber nie den Weg in die Öffentlichkeit fand)
So war die nächste freie Zahl 6. IPv6 war geboren!
Bei der Entwicklung von IPv4 dachte man, dass 32 Bits für die Welt ausreichend wären. Blickt man zurück, so waren bis heute 32 bits ausreichend. Vielleicht ist dies auch noch für ein paar Jahre so. Jedoch werden 32 bits nicht ausreichen, um in der Zukunft jedes Netzwerkgerät mit einer globalen Adresse ausstatten zu können. Denken Sie an Mobiltelefone, Autos (mit elektronischen Geräten an einem CAN Bus), Toaster, Kühlschränken, Lichtschalter usw.
Die IPv6 Designer haben 128 Bit gewählt, 4-mal mehr als im heutigen IPv4.
Aber die benutzbare Größe ist kleiner als es erscheinen mag, da in dem gegenwärtig definierten Adress-Schema 64 Bits für die Schnittstellen-Identifizierung verwendet werden. Die zweiten 64 Bit werden für das Routing verwendet. Die derzeitigen Aggregation-Levels (= Größe der zugeteilten IP-Blöcke) vorausgesetzt (/48, /32,...), ist eine Verknappung der Adressen weiterhin denkbar. Aber mit Sicherheit nicht in naher Zukunft.
Weitere Informationen finden Sie unter RFC 1715 / The H Ratio for Address Assignment Efficiency und RFC 3194 / The Host-Density Ratio for Address Assignment Efficiency.
Es gibt (wahrscheinlich) eine Gruppe (bekannt ist nur Jim Fleming...) von Personen am Internet, die über IPv8 und IPv16 nachdenken. Für diese Designs gibt es aber keine hohe Akzeptanz und auch keine Kernel-Implementierungen. 128 bits sind die beste Wahl bezogen auf Header-Overhead und dem Datentransport. Denken Sie an die minimalste Maximum Transfer Unit (MTU) in IPv4 (575 octets) und in IPv6 (1280 octets), die Header-Länge in IPv4 (20 octets Minimum, kann bis zu 60 octets mit IPv4 Optionen ansteigen) und in IPv6 sind es 40 octets (fixer Wert). Dies ist 3.4 % der minimalen MTU in IPv4 und 3.1 % der minimalen MTU in IPv6. Dies bedeutet, dass der Overhead beim Header fast identisch ist. Mehr bits für die Adressierung würden größere Header und deshalb mehr Overhead erfordern. Bedenken Sie auch die maximale MTU von 1500 octets (in speziellen Fällen bei Jumbo-Paketen bis zu 9k octets) bei normalen Verbindungen (z.B. Ethernet). Letztlich wäre es kein korrektes Design, wenn 10 % oder 20 % der transportierten Daten in einem Schicht 3-Paket für Adressen und nicht für die ”Nutzlast” benötigt würden.
Wie bei IPv4 können IPv6-Adressen mittels Subnetzmasken (subnet masks) in einen Netz- und einen Host-Teil unterteilt werden.
Bei IPv4 hat sich gezeigt, dass es manchmal von Nutzen wäre, einem Interface mehr als eine IP-Adresse zuweisen zu können, je nach Bedarf und Zweck (aliases, multicast etc.). Um in Zukunft flexibler bleiben zu können, geht man bei IPv6 weiter und erlaubt pro Interface mehr als eine zugewiesene IP-Adresse. Derzeit sind durch die RFCs kein Limit gesetzt, wohl aber in der Implementierung des IPv6 Stacks (um DoS Attacken vorzubeugen).
Neben der großen Bit-Anzahl für Adressen definiert IPv6 basierend auf einigen vorangestellten Bits verschiedene Adress-Typen. Diese werden hoffentlich in der Zukunft niemals aufgehoben (zum Unterschied zu IPv4 heute und die Entwicklung der class A, B und C Netze).
Zur Unterstützung einer automatischen Konfiguration wird die Bitanzahl in einen Netzwerk-Teil (vordere 64 Bits) und einen Hostteil (hintere 64 Bits).
Dies ist eine spezielle Adresse für das Loopback Interface, vergleichbar zur “127.0.0.1” bei IPv4. Bei IPv6 lautet die localhost Adresse:
0000:0000:0000:0000:0000:0000:0000:0001 |
bzw. komprimiert:
::1 |
Pakete mit dieser Quell- bzw. Ziel-Adresse sollten niemals den sendenden Host verlassen.
Dies ist eine spezielle Adresse vergleichbar mit “any” oder “0.0.0.0” bei IPv4. In IPv6 lautet sie:
0000:0000:0000:0000:0000:0000:0000:0000 |
oder:
:: |
Diese Adresse wird meistens in Routing-Tabellen und beim “socket binding” (zu jeder IPv6 Adresse) angewendet bzw. gesehen.
Beachten: Die Unspezifizierte Adresse kann nicht als Ziel-Adresse verwendet werden.
Es gibt zwei Adressen-Typen, die IPv4 Adressen enthalten können.
IPv4-only IPv6-kompatible Adressen kommen manchmal bei IPv6 kompatiblen Daemon zur Anwendung, die allerdings ausschließlich an IPv4 Adressen gebunden sind.
Diese Adressen sind mit einer speziellen Präfixlänge von 96 definiert (a.b.c.d. ist die IPv4 Adresse):
0:0:0:0:0:ffff:a.b.c.d/96 |
oder in komprimiertem Format:
::ffff:a.b.c.d/96 |
Die IPv4 Adresse 1.2.3.4. z.B. sieht wie folgt aus:
::ffff:1.2.3.4 |
Dieser Adress-Typ wurde für das automatische Tunneln (RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers) verwendet, welches aber durch das 6to4 tunneling ersetzt wurde.
0:0:0:0:0:0:a.b.c.d/96 |
oder in komprimierter Form:
::a.b.c.d/96 |
Es wurden einige Adress-Typen definiert und zugleich blieb für zukünftige Anforderungen ausreichend Raum für weitere Definitionen. In RFC 4291 / IP Version 6 Addressing Architecture wird das aktuelle Adress-Schema definiert.
Lassen Sie uns nun einen Blick auf die verschiedenen Präfixe (und somit auf die Adress-Arten) werfen::
Es handelt sich um spezielle Adressen, die ausschließlich auf einem Link eines Interfaces gültig sind. Wird diese Adresse als Zieladresse verwendet, so kann das Paket niemals einen Router passieren. Die Adresse wird bei der Link-Kommunikation eingesetzt, z.B.:
Ist noch jemand anderer auf diesem Link?
Ist jemand mit einer speziellen Adresse hier (z.B. Suche nach einem Router)?
Die Adresse beginnt mit (wobei “x” für ein hexadezimales Zeichen steht, im Normalfall “0”)
fe8x: <- zurzeit als einziger in Benutzung -fe9x: -feax: -febx: |
Eine Adresse mit diesem Präfix gibt es an jedem IPv6 fähigen Interface nach einer stateless automatischen Konfiguration (dies ist der Regelfall).
Diese Adressen sind vergleichbar zu den RFC 1918 / Address Allocation for Private Internets im heutigen IPv4. Eine Neuerung und Vorteil hierbei ist, vergleichbar zum 10.0.0.0/8 im IPv4, die Nutzbarkeit von 16 bits bzw. ein Maximum von 65536 Subnetzen.
Ein weiterer Vorteil: Da man bei IPv6 mehr als eine Adresse an ein Interface binden kann, ist auch die Zuweisung einer site-local Adresse zusätzlich zu einer globalen Adresse möglich.
Die Adresse beginnt mit:
fecx: <- meistens genutzt. -fedx: -feex: -fefx: |
(“x” ist ein hexadezimales Zeichen, normalerweise “0”)
Dieser Adresstyp ist nun abgekündigt RFC 3879 / Deprecating Site Local Addresses und sollte nicht mehr verwendet werden. Für Tests im Labor sind solche Adressen meineserachtens aber immer noch eine gute Wahl.
Weil die schon früh definierten site-local Adressen nicht eindeutig sind, kann dies zu großen Problemen führen, wenn z.B. einst unabhängige Netzwerke später zusammengeschlossen werden (Überlappung von Subnetzen). Aufgrund dessen und anderer Gründe wurde ein neuer Adresstyp definiert, genant RFC 4193 / Unique Local IPv6 Unicast Addresses.
Die Adresse beginnt mit:
fcxx: -fdxx: <- zurzeit als einziger in Benutzung |
Ein Teil des Präfix (40 Bits) werden pseudozufällig generiert. Es ist sehr unwahrscheinlich, daß zwei generierte Präfixe identisch sind.
Ein Beispiel für einen Präfix (generiert mit Hilfe des web-basierten Werkzeugs: Goebel Consult / createLULA):
fd0f:8b72:ac90::/48 |
Heute gibt es ist per Definition eine globale Adress-Art (Das erste Design, ''Provider based'' genannt, wurde bereits vor einigen Jahren wieder aufgegeben RFC 1884 / IP Version 6 Addressing Architecture [obsolete]. Einige Überbleibsel hiervon sind in älteren Linux Kernelquellen noch zu finden.
Die Adresse beginnt mit (x sind hexadezimale Zeichen)
2xxx: -3xxx: |
Hinweis: Der Zusatz “aggregatable” im Namen wird in aktuellen Drafts abgelegt. -Es sind weitere Subarten definiert:
Diese globalen Adressen waren die Ersten definierten und auch benutzen Adressen. Sie alle beginnen mit:
3ffe: |
Beispiel:
3ffe:ffff:100:f102::1 |
Eine spezielle 6bone Test-Adresse, die niemals weltweit einmalig ist, beginnt mit
3ffe:ffff: |
und wird zumeist in alten Beispielen benutzt, um zu vermeiden, dass Anwender diese mit Copy & Paste in Ihre Konfigurationen übernehmen können. Auf diese Weise können Duplikate weltweit einmaliger Adressen aus Versehen bzw. Unachtsamkeit vermieden werden. Es würde für den Original-Host ernste Probleme bedeuten (z.B. Antwortpakete für niemals gesendete Anfragen bekommen...). -Aufgrund dessen, daß IPv6 nun produktiv ist, wird dieser Präfix nicht mehr länger delegiert und nach dem 6.6.2006 vom Routing ausgenommen (mehr unter RFC 3701 / 6bone Phaseout ).
Diese Adressen werden für einen speziellen Tunnelmechanismus verwendet [RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds und RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers]. Sie kodieren eine gegebene IPv4 Adresse, ein eventuelles Subnetz und beginnen mit
2002: |
z.B. wird 192.168.1.1/5 repräsentiert durch:
2002:c0a8:0101:5::1 |
Ein kleines Shell-Kommando kann aus einer IPv4 eine 6to4 Adresse erstellen:
ipv4="1.2.3.4"; sla="5"; printf "2002:%02x%02x:%02x%02x:%04x::1" `echo $ipv4 -¬ | tr "." " "` $sla |
Siehe auch tunneling using 6to4 und information about 6to4 relay routers.
Diese Adressen werden an Internet Service Provider (ISP) delegiert und beginnen mit:
2001: |
Präfixe für große ISPs (mit eigenem Backbone) werden durch local registries vergeben. Zurzeit wird ein Präfix mit der Länge 32 zugeteilt.
Grosse ISPs delegieren ihrerseits an kleinere ISPs ein Präfix mit der Länge 48.
Momentan sind zwei Adressbereiche für Beispiele und Dokumentationen RFC 3849 / IPv6 Address Prefix Reserved for Documentation reserviert:
3ffe:ffff::/32 -2001:0DB8::/32 EXAMPLENET-WF |
Diese Adressbereiche sollten nicht geroutet werden und am Übergangsrouter zum Internet (basierend auf Absendeadressen) gefiltert werden.
Multicast-Adressen werden für entsprechende Dienste verwendet.
Sie beginnen immer mit (xx ist hierbei der Wert der Reichweite)
ffxy: |
Die Adressen werden in Reichweiten und Typen unterteilt:
Die Multicast Reichweite ist ein Parameter, mit dem die maximale Distanz angegeben werden kann, die ein Multicast Paket sich von der versendenden Einheit entfernen kann.
Zurzeit sind folgende Regionen (reichweiten) definiert:
ffx1: Node-lokal, Pakete verlassen niemals den Knoten
ffx2: Link-lokal, Pakete werden niemals von Routers weitergeleitet, der angegebene Link wird nie verlassen.
ffx5: Site-lokal, Pakete verlassen niemals den Standort (Site)
ffx8: organisationsweit, Pakete verlassen niemals eine Organisation (nicht einfach zu implementieren, dies muss durch das Routing Protokoll abgedeckt werden)
ffxe: Globale Reichweite
Sonstige sind reserviert
Es sind bereits viele Typen definiert bzw. reserviert (siehe RFC 4291 / IP Version 6 Addressing Architecture für weitere Details), einige Beispiele:
All Nodes Adresse: ID = 1h, alle Hosts am lokalen Node (ff01:0:0:0:0:0:0:1) oder am angeschlossenen Link (ff02:0:0:0:0:0:0:1) werden adressiert.
All Routers Adresse: ID = 2h, alle Router am lokalen Node (ff01:0:0:0:0:0:0:2), am angeschlossenen Link (ff02:0:0:0:0:0:0:2) oder am lokalen Standort werden adressiert.
Diese spezielle Multicast Adresse wird als Zieladresse bei der Erkundung des Nahbereichs verwendet, da es ARP bei IPv6 im Gegensatz zu IPv4 nicht mehr gibt.
Ein Beispiel für diese Adresse könnte sein:
ff02::1:ff00:1234 |
Das benutzte Präfix zeigt, dass es sich um eine link-lokale Multicast Adresse handelt. Dass Suffix wird aus der Zieladresse erstellt. In diesem Beispiel soll ein Paket zur Adresse “fe80::1234” gesendet werden, aber die Netzwerk-Schicht hat keine Kenntnis der aktuellen Schicht 2 MAC Adresse. Die oberen 104 bits werde mit “ff02:0:0:0:01:ff00::/104” ersetzt und die unteres 24 bits bleiben unverändert. Diese Adresse wird nun ”am Link” verwendet, um den entsprechenden Node zu finden, der wiederum seine Schicht 2 MAC Adresse als Antwort zurücksendet.
Anycast Adressen sind spezielle Adressen und werden verwendet, um besondere Bereiche wie den nächstgelegenen DNS-Server, den nächstliegenden DHCP Server und vergleichbare dynamische Gruppen abzudecken. Die Adressen werden dem Pool des Unicast Adressraums (global-aggregierbar oder Site-lokal zurzeit) entnommen. Der Anycast-Mechanismus (client view) wird von dynamischen Routing-Protokollen gehandhabt.
Hinweis: Anycast Adressen können nicht als Quelladresse verwendet werden, sondern ausschließlich als Zieladressen.
Die Subnet-Router Anycast Adresse ist ein einfaches Beispiel für eine Anycast Adresse. Angenommen, der Knoten hat folgende global zugewiesene IPv6 Adresse:
2001:0db8:100:f101:210:a4ff:fee3:9566/64 <- Node's address |
Die Subnet-Router Anycast Adresse wird durch komplette Streichung des Suffixes (die letzten gültigen 64 bits) erstellt:
2001:0db8:100:f101::/64 <- subnet-router anycast address |
In Hinblick auf Auto-Konfigurations- und Mobilitätsfragen wurde entschieden, die niedrigeren 64 bits als Host-Bestandteil zu nutzen. Jedes einzelne Subnetz kann deshalb eine große Anzahl an Adressen enthalten.
Der Host-Teil kann aus unterschiedlichen Blickwinkeln betrachtet werden:
Bei der Auto-Konfiguration wird der Hostteil der Adresse durch die Konvertierung der MAC-Adresse eines Interfaces (falls vorhanden) zu einer einmaligen IPv6 Adresse (mittels EUI-64 Methode) generiert. Falls keine MAC-Adresse verfügbar ist (z.B. bei virtuellen Interfaces), wird anstelle dessen etwas anderes herangezogen (wie z.B. die IPv4 Adresse oder die MAC-Adresse eines physikalischen Interfaces).
Als Beispiel hat hier ein NIC folgende MAC-Adresse (48 bit):
00:10:a4:01:23:45 |
Diese wird gemäß demIEEE-Tutorial EUI-64 Design für EUI-48 Identifiers zum 64 bit Interface Identifier erweitert:
0210:a4ff:fe01:2345 |
Mit einem gegebenen Präfix wird daraus die schon oben gezeigte IPv6-Adresse:
2001:0db8:0100:f101:0210:a4ff:fe01:2345 |
Der "automatisch generierte" Hostteil ist weltweit einmalig (mit Ausnahme, wenn der Hersteller einer NIC die gleiche MAC-Adresse bei mehr als einer NIC einsetzt). Die Client-Verfolgung am Host wird dadurch möglich, solange kein Proxy verwendet wird.
Dies ist ein bekanntes Problem und eine Lösung wurde dafür definiert: Datenschutz-Erweiterung, definiert in RFC 3041 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6 (es gibt bereits ein neueres Draft: draft-ietf-ipv6-privacy-addrs-v2-*). Es wird von Zeit zu Zeit mittels eines statischen und eines Zufallswertes ein neues Suffix erstellt. Hinweis: Dies ist nur für ausgehende Client-Verbindungen sinnvoll und bei bekannten Servern nicht wirklich sinnvoll.
Bei Servern ist es wahrscheinlich leichter, sich einfachere Adressen zu merken. Dies kann z.B. mit der Zuweisung einer zusätzlichen IPv6 Adresse an ein Interface geschehen.
2001:0db8:100:f101::1 |
Für das manuelle Suffix, wie “::1” im obigen Beispiel, muss das siebte höchstwertige Bit auf 0 gesetzt sein (das universale/local Bit des automatisch generierten Identifiers). Es sind auch noch andere (ansonsten nichtausgewählte) Bit-Kombinationen für Anycast-Adressen reserviert.
Um eine maximale Reduktion an Routing-Tabellen zu erzielen, war in der frühen Design-Phase noch ein vollkommen hierarchischer Routing-Ansatz vorgesehen. Die Überlegungen hinter diesem Ansatz waren die gegenwärtigen IPv4 Routing-Einträge in den Haupt-Routern (mit über 400.000 Einträgen im Jahr 2013) sowie die Reduktion des Speicherbedarfs für die Routing-Tabellen bei Hardware-Routern (ASIC “Application Specified Integrated Circuit”, speziell konstuierter Chip) sowie ein daraus resultierender Geschwindigkeitszuwachs (weniger Einträge ergeben hoffentlich schnellere Abfragen).
Heutiger Standpunkt ist, dass das Routing für Netzwerke mit nur einem Service Provider hauptsächlich mit einem hierarchischen Design realisiert wird. Eine solche Vorgehensweise ist nicht möglich, wenn mehr als eine ISP-Verbindung besteht. Diese Problematik wird unter dem Thema multi-homing diskutiert (Infos zu multi-homing: drafts-ietf-multi6-*,IPv6 Multihoming Solutions).
Vergleichbar zu IPv4, handelt es sich hierbei um den routbaren Netzwerkpfad für das stattfindende Routing. Da die Standard-Notierung der Netzmaske von 128 bit nicht sehr fein aussieht, verwenden die Designer das aus IPv4 bekannte Classless Inter Domain Routing Schema (CIDR, RFC 1519 / Classless Inter-Domain Routing). Mit Hilfe des CIDR wird die Bitanzahl der IP Adresse festgelegt, welche für das Routing verwendet werden. Diese Methode wird auch als "Slash"-Notation genannt.
Ein Beispiel:
2001:0db8:100:1:2:3:4:5/48 |
Diese Notation wird erweitert zu:
Netzwerk:
2001:0db8:0100:0000:0000:0000:0000:0000 |
Netzmaske:
ffff:ffff:ffff:0000:0000:0000:0000:0000 |
Im Normalfall (ohne QoS) ergibt eine Suche in der Routing-Tabelle eine Route mit der signifikantesten Adress-Bit-Anzahl, d.h. jene Route mit der größten Präfix-Länge wird zuerst herangezogen.
Wenn z.B. eine Routing-Tabelle folgende Einträge zeigt (Liste ist nicht komplett):
2001:0db8:100::/48 :: U 1 0 0 sit1 -2000::/3 ::192.88.99.1 UG 1 0 0 tun6to4 |
Die gezeigten Zieladressen der IPv6 Pakete werden über die entsprechenden Geräte geroutet
2001:0db8:100:1:2:3:4:5/48 -> routed through device sit1 -2001:0db8:200:1:2:3:4:5/48 -> routed through device tun6to4 |
Bevor Sie IPv6 auf einem Linux Host einsetzen können, müssen sie überprüfen, ob das System IPv6 fähig ist. Eventuell haben Sie Änderungen vorzunehmen, um IPv6 zu ermöglichen.
Neuere Linux Distributionen beinhalten bereits einen IPv6-fähigen Kernel. Die IPv6-Funktionalität wird im Allgemeinen als Modul kompiliert. Es ist aber durchaus möglich, dass das Modul nicht automatisch beim Start des Betriebssystems geladen wird.
Hinweis: Sie sollten die Kernel Serie 2.2.x nicht mehr verwenden, da die IPv6-Implementierung nicht mehr aktuell ist. Auch die in der Serie 2.4.x wird nicht mehr weiterentwickelt bzgl. der Definitionen in den neueren RFCs. Es wird empfohlen, einen aus der Serie 2.6.x zu verwenden.
Um zu überprüfen, ob ihr aktueller Kernel IPv6 unterstützt, sollten sie einen Blick in ihr /proc-Dateisystem werfen. Folgende Einträge müssen existieren:
/proc/net/if_inet6 |
Einen kleinen automatischen Test können Sie wie folgt durchführen:
# test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready" |
Wenn dieser Test negativ verläuft, ist das IPv6 Modul aller Wahrscheinlichkeit noch nicht geladen.
Mit folgenden Befehl können Sie versuchen, das Modul zu laden:
# modprobe ipv6 |
Wenn dieser Befehl positiv verläuft, dann sollten Sie das Modul mit folgendem Befehl auflisten können:
# lsmod |grep -w 'ipv6' && echo "IPv6 module successfully loaded" |
Der obige Test sollte nun erfolgreich verlaufen.
Hinweis: Ein Entfernen des Moduls im laufenden System wird derzeit nicht unterstützt und kann unter gewissen Bedingungen zu einem Absturz des Kernels führen.
Es ist möglich das IPv6 Modul bei Bedarf automatisch zu laden. Sie müssen nur folgende Zeile in die Konfigurationsdatei des kernel modul loaders eintragen (normalerweise: /etc/modules.conf oder /etc/conf.modules):
alias net-pf-10 ipv6 # automatically load IPv6 module on demand |
Mit der folgenden Zeile ist es auch möglich, das automatische Laden des IPv6 Moduls auszuschalten.
alias net-pf-10 off # disable automatically load of IPv6 module on demand |
Anmerkung: In Kernel Series 2.6.x wurde der Modul-Lade-Mechanismus geändert. Die neue Konfigurationsdatei wird anstelle /etc/modules.conf nun /etc/modprobe.conf genannt.
Wenn beide oben gezeigten Methoden ohne Erfolg blieben und ihr Kernel somit keine IPv6 Unterstützung bietet, dann haben Sie folgende Optionen:
Aktualisieren Sie Ihre Distribution mit einer Version, die von Haus aus IPv6 unterstützt (empfohlen für Anfänger),
Sie können einen Standard-Kernel kompilieren (einfach, wenn Sie die benötigten Optionen kennen)
Kompilieren Sie die Kernel-Quellen ihrer Distribution (manchmal nicht ganz so einfach)
Kompilieren Sie einen Kernel mit den USAGI-Erweiterungen
Falls Sie sich dazu entscheiden, einen neuen IPv6 kompatiblen Kernel zu kompilieren, sollten Sie auf jeden Fall bereits Erfahrung mit der Kernel-Kompilierung haben sowie das Linux Kernel HOWTO lesen.
Ein Vergleich zwischen dem Standard-Kernel und dem Kernel mit USAGI-Erweiterungen ist verfügbar unter IPv6+Linux-Status-Kernel.
Detailliertere Ausführungen zur Kompilierung eines IPv6 fähigen Kernels finden Sie unter IPv6-HOWTO-2#kernel.
Hinweis: Sie sollten wann immer möglich die Kernel Serie 2.6.x oder höher einsetzen, da die IPv6 Unterstützung der Serie 2.4.x nur einige Backports erhält und die IPv6-Unterstützung von Serie 2.2.x hoffnungslos veraltet ist und nicht mehr weiterentwickelt wird.
Wie für den Standard-Kernel gilt auch hier, dass das Kompilieren des Kernels nur fortgeschrittenen Benutzern empfohlen wird, die mit IPv6 und dem Kompilieren des Kernels bereits vertraut sind.
Siehe auch USAGI project / FAQ und Obtaining the best IPv6 support with Linux (Article) (Spiegel).
Nicht alle Netzwerkgeräte sind bereits (bzw. überhaupt) dazu in der Lage, IPv6 Pakete übertragen zu können. Den aktuellen Status können Sie unter IPv6+Linux-status-kernel.html#transport.
Ein entscheidender Punkt ist die Tatsache, dass ein IPv6 Paket wegen der Struktur der Netzwerkschicht in der Kernel-Implementierung nicht wirklich aufgrund der IP-Header-Nummer (6 anstelle 4) wiedererkannt wird. Es wird aufgrund der Protokollnummer der Schicht 2 Transport-Protokolls wiedererkannt. Folglich können IPv6 Pakete von keinem Transport-Protokoll verwendet werden, welche diese Protokoll-Nummer nicht nutzen. Hinweis: Das Paket wird nach wie vor über den Link transportiert, aber auf der Empfänger-Seite kann das Paket nicht verarbeitet werden (Sie können dies z.B. mit tcpdump sehen).
Serial Line IP (RFC 1055 / SLIP), auch SLIPv4 genannt; das Gerät heißt: s1X
Parallel Line IP (PLIP), gleich dem SLIP, Gerätename: plipX
ISDN mit rawip Encapsulation; Gerätename: isdnX
ISDN mit syncppp Encapsulation; Gerätename: ipppX (Designfrage des ipppd; in der Kernel Serie 2.5.x wird ipppX in einer allgemeinen PPP Schicht inkludiert)
Ohne entsprechende Tools zur Konfiguration von IPv6 würden Sie mit einem IPv6 fähigen Kernel nicht weit kommen. Es gibt verschiedene Pakete womit IPv6 konfiguriert werden kann.
Das Paket net-tool beinhaltet einige Tools wie ifconfig und route. Mit den Tools kann IPv6 auf einem Interface konfiguriert werden. Sehen Sie sich die Ausgabe des Befehls ifconfig -? Bzw. route -? an. Finden Sie in der Ausgabe die Worte IPv6, inet6 oder Ähnliches, dann ist das Tool IPv6-kompatibel.
Automatische Überprüfung:
# /sbin/ifconfig -? 2>& 1|grep -qw 'inet6' && echo "utility 'ifconfig' is -¬ IPv6-ready" |
Folgenden Check gibt es für route:
# /sbin/route -? 2>& 1|grep -qw 'inet6' && echo "utility 'route' is IPv6-ready" |
Alexey N.Kuznetsov (gegenwärtig ein Betreuer des Linux Network Codes) erstellte eine Tool-Sammlung, womit das Netzwerk mittels dem netlink Device konfiguriert wird. Diese Tool-Sammlung stellt mehr Funktionalität als das net-tools Paket zur Verfügung, ist aber nicht sehr umfangreich dokumentiert und nichts für schwache Nerven.
# /sbin/ip 2>&1 |grep -qw 'inet6' && echo "utility 'ip' is IPv6-ready" |
Wird das Programm /sbin/ip nicht gefunden, dann wird die Installation des iproute Paketes empfohlen.
Sie können dies (falls beinhaltet) von der benutzten Linux-Distribution installieren
Sie können nach einem passenden RPM Paket unter RPMfind/iproute suchen (manchmal ist auch das kompilieren eines SRPMS Paketes zu empfohlen)
Nachdem Sie ihr System auf IPv6 vorbereitet haben, wollen Sie nun IPv6 für die Netzwerkkommunikation einsetzen. Zuerst sollten Sie lernen, IPv6 Pakete mit einem Sniffer Programm zu untersuchen. Dies ist zu empfehlen, denn in Hinblick auf Fehlersuche und Troubleshooting kann das Durchführen einer schnellen Diagnose von Nutzen sein.
Das Programm ist normalerweise im Paket iputils beinhaltet. Durch senden von ICMPv6 echo-request Paketen und warten auf ICMPv6 echo-reply Paketen können einfache Transport-Tests durchgeführt werden.
Anwendung
# ping6 <hostwithipv6address> -# ping6 <ipv6address> -# ping6 [-I <device>] <link-local-ipv6address> |
Einige Implementierungen unterstützen auch %<device> Definition zusätzlich zu -I <device>, z.B.
# ping6 <link-local-ipv6address>%<device> |
Beispiel
# ping6 -c 1 ::1 -PING ::1(::1) from ::1 : 56 data bytes -64 bytes from ::1: icmp_seq=0 hops=64 time=292 usec - ---- ::1 ping statistics --- -1 packets transmitted, 1 packets received, 0% packet loss -round-trip min/avg/max/mdev = 0.292/0.292/0.292/0.000 ms |
Hinweis: ping6 benötigt direkten Zugriff auf den Socket und hierfür Root-Rechte. Wenn Nicht-Root-Benutzer ping6 nicht benutzen können, kann dies zwei Ursachen haben:
ping6 ist nicht im Pfad des Benutzers eingetragen; ping6 ist allgemein in /usr/sbin zu finden -> Lösung: Den Pfad ergänzen (nicht empfohlen)
ping6 lässt sich im Allgemeines wegen fehlender Root-Rechte nicht korrekt ausführen -> Lösung: chmod u+s /usr/sbin/ping6
Wenn link-lokale Adressen für ein IPv6 ping verwendet werden, dann hat der Kernel keine Kenntnis darüber, durch welches (physikalische oder virtuelle) Gerät das Paket gesendet werden muss - jedes Gerät hat eine link-lokale Adresse. Ein Versuch resultiert in folgender Fehlermeldung:
# ping6 fe80::212:34ff:fe12:3456 -connect: Invalid argument |
In diesem Fall müssen Sie das Interface zusätzlich spezifizieren:
# ping6 -I eth0 -c 1 fe80::2e0:18ff:fe90:9205 -PING fe80::212:23ff:fe12:3456(fe80::212:23ff:fe12:3456) from -¬ fe80::212:34ff:fe12:3478 eth0: 56 data bytes -64 bytes from fe80::212:23ff:fe12:3456: icmp_seq=0 hops=64 time=445 usec - ---- fe80::2e0:18ff:fe90:9205 ping statistics --- -1 packets transmitted, 1 packets received, 0% packet loss round-trip -¬ min/avg/max/mdev = 0.445/0.445/0.445/0.000 ms |
Beispiel für %<device> Notation:
# ping6 -c 1 fe80::2e0:18ff:fe90:9205%eth0 |
Ein interessanter Mechanismus zum Aufspüren eines IPv6 aktiven Hosts am Link ist mit ping6 an eine link-lokale all-node Multicast Adresse zu pingen.
# ping6 -I eth0 ff02::1 -PING ff02::1(ff02::1) from fe80:::2ab:cdff:feef:0123 eth0: 56 data bytes -64 bytes from ::1: icmp_seq=1 ttl=64 time=0.104 ms -64 bytes from fe80::212:34ff:fe12:3450: icmp_seq=1 ttl=64 time=0.549 ms (DUP!) |
Beispiel für %<device> Notation:
# ping6 ff02::1%eth0 |
Bei IPv6 kann dieses Verhalten zurzeit, im Gegensatz zu IPv4, wo Antworten auf ein Ping auf die Broadcast Adresse unterdrückt werden können, nicht unterbunden werden. Ausnahme hierbei ist der Einsatz der lokalen IPv6 Firewall-Funktionalität.
Dieses Programm ist normal im Paket iputils enthalten. Es ist ein Programm vergleichbar dem IPv4 traceroute. Unten sehen Sie ein Beispiel:
# traceroute6 www.6bone.net -traceroute to 6bone.net (3ffe:b00:c18:1::10) from 2001:0db8:0000:f101::2, 30 -¬ hops max, 16 byte packets - 1 localipv6gateway (2001:0db8:0000:f101::1) 1.354 ms 1.566 ms 0.407 ms - 2 swi6T1-T0.ipv6.switch.ch (3ffe:2000:0:400::1) 90.431 ms 91.956 ms 92.377 ms - 3 3ffe:2000:0:1::132 (3ffe:2000:0:1::132) 118.945 ms 107.982 ms 114.557 ms - 4 3ffe:c00:8023:2b::2 (3ffe:c00:8023:2b::2) 968.468 ms 993.392 ms 973.441 ms - 5 3ffe:2e00:e:c::3 (3ffe:2e00:e:c::3) 507.784 ms 505.549 ms 508.928 ms - 6 www.6bone.net (3ffe:b00:c18:1::10) 1265.85 ms * 1304.74 ms |
Anmerkung: Im Unterschied zu modernen IPv4 traceroute Versionen, welche den Einsatz von ICMPv4-echo-request Paketen wie auch UDP Paketen (default) ermöglichen, können mit IPv6-traceroute nur UDP Pakete versendet werden. Wie Sie vielleicht bereits wissen, werden von Firewalls bzw. von ACLs auf Routern ICMP echo-request Pakete mehr akzeptiert als UDP Pakete.
Falls ein Interface spezifiziert werden muß, kann dies durch -i <device> oder in der Form <address>%<device> erfolgen.
Dieses Programm ist normalerweise im Paket iputils enthalten. Das Programm ist dem traceroute6 ähnlich, es gibt den Weg zu einem angegebenen Ziel wieder und misst hierbei den MTU-Wert. Unten sehen Sie ein Beispiel:
# tracepath6 www.6bone.net - 1?: [LOCALHOST] pmtu 1480 - 1: 3ffe:401::2c0:33ff:fe02:14 150.705ms - 2: 3ffe:b00:c18::5 267.864ms - 3: 3ffe:b00:c18::5 asymm 2 266.145ms pmtu 1280 - 3: 3ffe:3900:5::2 asymm 4 346.632ms - 4: 3ffe:28ff:ffff:4::3 asymm 5 365.965ms - 5: 3ffe:1cff:0:ee::2 asymm 4 534.704ms - 6: 3ffe:3800::1:1 asymm 4 578.126ms !N -Resume: pmtu 1280 |
In Linux ist tcpdump ein Haupttool zum aufzeichnen von Paketen. Weiter unten sehen Sie einige Beispiele. Normalerweise ist die Ipv6-Unterstützung in der aktuellen Version 3.6 gegeben.
Bei tcpdump werden zur Geräuschminimierung bei der Paket-Filterung Ausdrücke eingesetzt:
icmp6: ICMPv6 Datenverkehr wird gefiltert
ip6: IPv6 Datenverkehr (inkl.ICMPv6) wird gefiltert
proto ipv6: getunnelter IPv6-in-IPv4 Datenverkehr wird gefiltert
not port ssh: zum unterdrücken der Anzeige von SSH Paketen während der Ausführung von tcpdump bei einer remote SSH-Sitzung
Ebenfalls sind einige Kommandozeilen-Optionen sehr hilfreich, um detailliertere Informationen über die Pakete erlangen und protokollieren zu können. Für ICMPv6 Pakete sind hauptsächlich interessant:
“-s 512”: Bei der Aufzeichnung der Pakete wird die zu Aufzeichnungslänge auf 512 bytes vergrößert
“-vv”: wirklich sehr ausführliche Ausgabe
“-n”: Adressen werden nicht in Namen aufgelöst. Dies ist hilfreich, wenn die Reverse-DNS-Auflösung nicht sauber arbeiten sollte
# tcpdump -t -n -i eth0 -s 512 -vv ip6 or proto ipv6 -tcpdump: listening on eth0 -2001:0db8:100:f101:2e0:18ff:fe90:9205 > 2001:0db8:100:f101::1: icmp6: echo -¬ request (len 64, hlim 64) -2001:0db8:100:f101::1 > 2001:0db8:100:f101:2e0:18ff:fe90:9205: icmp6: echo -¬ reply (len 64, hlim 64) |
1.2.3.4. und 5.6.7.8. sind Tunnel-Endpunkte (alle Adressen sind Beispiele)
# tcpdump -t -n -i ppp0 -s 512 -vv ip6 or proto ipv6 -tcpdump: listening on ppp0 -1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 2001:0db8:100::1: icmp6: echo request -¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124) -5.6.7.8 > 1.2.3.4: 2001:0db8:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len -¬ 64, hlim 61) (ttl 23, id 29887, len 124) -1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 2001:0db8:100::1: icmp6: echo request -¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124) -5.6.7.8 > 1.2.3.4: 2001:0db8:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len -¬ 64, hlim 61) (ttl 23, id 29919, len 124) |
Aktuelle Distributionen beinhalten bereits die gängigsten IPv6 kompatiblen Client- und Server-Programme. Weitere Infos gibt es unter IPv6+Linux-Status-Distribution. Falls ein Programm hier noch nicht gelistet sein sollte, können Sie unter Current Status of IPv6 Support for Networking Applications nachlesen, ob das Programm bereits auf IPv6 portiert wurde und unter Linux bereits läuft. Für verbreitete Programme gibt es einige Hinweise hier weiter unten.
Um die folgend abgebildeten Tests durchzuführen, benötigen Sie ein funktionierendes IPv6 System. Bei einigen Beispielen werden Adressen angezeigt, die nur bei einer verfügbaren 6bone Verbindung erreichbar sind.
Note: wenn Namen anstatt dedizierter IPv4/IPv6 Adressen benutzt werden, dann kann dieser zu einer Liste von IPv4 und IPv6 Adressen aufgelöst werden. Einige Kommandozeilenwerkzeuge unterstützen explizite Benutzung des gewünschten Protokolls. Üblicherweis haben solche Werkzeuge Optionen wie “-4” für IPv4 und “-6” für IPv6.
Jeder DNS-Server (Domain Name System) sollte aufgrund der Sicherheitsupdates der letzten Jahre bereits mit neuerer Software bestückt sein, die den Übergangs-IPv6-Adress-Standardtyp AAAA unterstützt (der neueste Standardtyp - A6 genannt - wird nur von BIND9 und höheren Versionen unterstützt und ist daher noch nicht allzu verbreitet. Ebenfalls nicht unterstützt wird die root Domain IP6.ARPA). Ein einfacher Test zum überprüfen der IPv6 Adress-Auflösung ist:
# host -t AAAA www.join.uni-muenster.de |
Die Ausgabe des Tests sollte etwa wie folgt sein:
www.join.uni-muenster.de. is an alias for tolot.join.uni-muenster.de. -tolot.join.uni-muenster.de. has AAAA address -¬ 2001:638:500:101:2e0:81ff:fe24:37c6 |
IPv6 kompatible Clients sind verfügbar. Ein einfacher Test sieht wie folgt aus:
$ telnet 3ffe:400:100::1 80 -Trying 3ffe:400:100::1... -Connected to 3ffe:400:100::1. -Escape character is '^]'. -HEAD / HTTP/1.0 - -HTTP/1.1 200 OK -Date: Sun, 16 Dec 2001 16:07:21 -GMT Server: Apache/2.0.28 (Unix) -Last-Modified: Wed, 01 Aug 2001 21:34:42 GMT -ETag: "3f02-a4d-b1b3e080" -Accept-Ranges: bytes -Content-Length: 2637 -Connection: close -Content-Type: text/html; charset=ISO-8859-1 - -Connection closed by foreign host. |
Wird ein Text wie “cannot resolve hostname” ausgegeben, dann unterstützt der Telnet Client keine IPv6 Adressen.
Aktuelle openssh-Versionen sind IPv6 kompatibel. Abhängig von der Konfiguration vor der Kompilierung gibt es zwei unterschiedliche Verhaltensweisen:
--without-ipv4-default: Der Client versucht zuerst eine IPv6-Verbindung. Misslingt dies, wird eine IPv4-Verbindung aufgebaut
--with-ipv4-default: standardmäßig wird eine IPv4-Verbindung aufgebaut. Eine IPv6-Verbindung muss, wie unten im Beispiel zu sehen ist, erzwungen werden:
$ ssh -6 ::1 -user@::1's password: ****** -[user@ipv6host user]$ |
Falls ihr ssh Client-Programm die Option “-6” nicht kennt, dann ist das Programm nicht IPv6 fähig. Dies ist bei den meisten ssh Paketen der Version 1 der Fall.
SSH.com's SSH Client und Server sind ebenfalls IPv6 kompatibel und darüber hinaus handelt es sich um freie Programme für die Linux- und FreeBSD-Plattform, unabhängig davon, ob sie zu kommerziellem oder zu persönlichen Zweck verwendet werden.
Einen aktuellen Statusüberblick zum Thema IPv6 kompatible Web-Browser ist unter Current Status of IPv6 Support for Networking Applications - HTTP verfügbar.
Die meisten Browser haben zurzeit noch ungelöste Probleme
Ist ein IPv4 Proxy in den Einstellungen eingetragen, dann werden IPv6 Anfragen zum Proxy gesendet. Der Proxy kann keine IPv6 Anfragen verstehen und somit scheitert die Anfrage. Lösung: Proxy Software aktualisieren (siehe weiter unten).
Automatik-Einstellungen des Proxy (*.pac) können aufgrund ihrer Beschaffenheit nicht derart erweitert werden, dass sie IPv6 Anfragen anders handhaben (z.B. kein Proxy verwenden) können (Sie sind in Javaskript geschrieben und ziemlich hard coded in den Quellen verankert; z.B. Mozilla Quellcode).
Ältere Browser-Versionen verstehen ebenfalls keine URL mit IPv6 Adressen wie z.B. http://[2001:4dd0:f838:a006::6]/, IPv6-Addresse von http://www.ipv6.bieringer.de/ (die angegebene URL funktioniert nur mit einem IPv6 kompatiblen Browser!).
Ein kleiner Test ist diese URL mit einem gegebenen Browser und ohne Proxy zu verwenden.
Ein guter Ausgangspunkt zum Betrachten von Webseiten mit IPv6 ist http://www.kame.net/. Ist die Schildkröte animiert, dann ist Verbindung mittels IPv6 Verbindung zustande gekommen, andererseits bleibt die Schildkröte statisch.
Andere Test-Server sind z.B.
In diesem Teil des HOWTOs wird stärker auf Client-spezifische Belange eingegangen. Folglich sei zu IPv6 kompatiblen Servern wie sshd, httpd, telnetd usw. auf diese Stelle verwiesen: Hints for IPv6-enabled daemons.
Fehlermeldung: "connect: Invalid argument"
Der Kernel hat keine Kenntnis darüber, welchen physikalischen oder virtuellen Link Sie zum versenden von ICMPv6 Paketen verwenden möchten. Aus diesem Grund wird die Fehlermeldung ausgegeben.
Lösung: Spezifizieren Sie den Link, z.B.: “ping6 -I eth0 fe80::2e0:18ff:fe90:9205”. Siehe auch program ping6 usage.
Fehlermeldung: “icmp socket: Operation not permitted”
Diese Tools erzeugen spezielle ICMPv6 Pakete und versenden diese unter Verwendung von raw sockets im Kernel. Raw sockets können aber nur vom Benutzer “root” verwendet werden. Normale Benutzer bekommen aus diesem Grund diese Fehlermeldung.
Lösung: Wenn wirklich alle Benutzer auf diese Tools zugreifen sollen, können Sie dies mit setzen des “suid” bits mittels “chmod u+s / path/to/program” erreichen (siehe auch program ping6 usage). Falls nicht alle Benutzer das Programm benötigen, können Sie die Gruppenzugehörigkeit des Programms ändern, z.B. Gruppe “wheel”. Fügen Sie alle Benutzer zu dieser Gruppe hinzu und entfernen Sie das execution bit für andere Benutzer mittels “chmod o-rwx /path/to/program”. Alternativ können Sie auch “sudo” dazu verwenden, um Ihren Sicherheitsbestimmungen Rechnung zu tragen.
Ein Knoten besitzt mehrere Netzwerk-Devices, die in Klassen zusammengefasst werden können:
Physikalische Devices wie eth0, tr0
Virtuelle Devices wie ppp0, tun0, tap0, sit0, isdn0, ippp0
Physikalische Interfaces wie Ethernet oder Token-Ring bedürfen keiner speziellen Handhabung.
Virtuelle Interfaces hingegen benötigen immer eine spezielle Konfiguration.
Diese Interfaces werden sitx genannt. Der Name sit ist eine Abkürzung für Simple Internet Transition. Das Gerät hat die Fähigkeit IPv6 Pakete in IPv4 Pakete zu verkapseln und diese dann über einen Tunnel zum entfernten Endpunkt zu transportieren.
sit0 hat eine spezielle Bedeutung: dieses Interface kann nicht für fest zugeordnete Tunnel verwendet werden.
PPP Interfaces beziehen ihre IPv6 Funktionalität von einem IPv6 kompatiblen PPP Daemon.
Für HDLC mit IP encapsulation ist die IPv6 Funktionalität bereits im Kernel integriert.
ISDN PPP Interfaces (ippp) werden durch den Kernel nicht mit IPv6 Funktionalität unterstützt. Es gibt auch keine Pläne hierfür, da im Kernel 2.5.+ dieser Interface-Typ durch eine allgemeinere ppp Interface Schicht ersetzt werden soll.
Wie bereits erwähnt, unterstützen diese Interfaces keinen IPv6 Transport (senden ist ok, das abfertigen ankommender Pakete funktioniert jedoch nicht).
Ether-tap Devices sind IPv6 kompatibel und als stateless konfiguriert. Für den Gebrauch muss das Modul “ethertap” geladen werden.
01/2002: ATM wird vom Standard-Kernel nicht, jedoch aber durch die USAGI-Erweiterungen unterstützt.
Es gibt zwei Methoden, ein Interface ein- oder auszuschalten.
Gebrauch:
# ip link set dev <interface> up -# ip link set dev <interface> down |
Beispiel:
# ip link set dev eth0 up -# ip link set dev eth0 down |
Gebrauch:
# /sbin/ifconfig <interface> up -# /sbin/ifconfig <interface> down |
Beispiel:
# /sbin/ifconfig eth0 up -# /sbin/ifconfig eth0 down |
Es gibt verschiedene Methoden zum konfigurieren einer IPv6 Adresse eines Interfaces. Sie können "ifconfig" oder "ip" dazu einsetzen.
Zuerst sollten sie überprüfen, ob und welche IPv6 Adressen bereits konfiguriert sind (etwa durch automatischer stateless Konfiguration).
Achtung: Adressen beginnend mit “fec0” sind obsolet, hier aber noch der Vollständigheit wegen gezeigt!
Anwendung:
# /sbin/ip -6 addr show dev <interface> |
Beispiel für einen statisch konfigurierten Host:
# /sbin/ip -6 addr show dev eth0 -2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_ fast qlen 100 -inet6 fe80::210:a4ff:fee3:9566/10 scope link -inet6 2001:0db8:0:f101::1/64 scope global -inet6 fec0:0:0:f101::1/64 scope site |
Just note that addresses beginning with “fec0” are deprecated!
Beispiel für einen automatisch konfigurierten Host.
Hier sehen Sie einige automatisch konfigurierte IP Adressen und deren Lebensdauer.
# /sbin/ip -6 addr show dev eth0 -3: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen -¬ 100 -inet6 2002:d950:f5f8:f101:2e0:18ff:fe90:9205/64 scope global dynamic -valid_lft 16sec preferred_lft 6sec -inet6 3ffe:400:100:f101:2e0:18ff:fe90:9205/64 scope global dynamic -valid_lft 2591997sec preferred_lft 604797sec inet6 fe80::2e0:18ff:fe90:9205/10 -¬ scope link |
Anwendung:
# /sbin/ifconfig <interface> |
Hier sehen Sie verschiedene IP Adressen mit unterschiedlichen Gültigkeitsbereichen (die Ausgabe wurde mit grep gefiltert)
# /sbin/ifconfig eth0 |grep "inet6 addr:" -inet6 addr: fe80::210:a4ff:fee3:9566/10 Scope:Link -inet6 addr: 2001:0db8:0:f101::1/64 Scope:Global -inet6 addr: fec0:0:0:f101::1/64 Scope:Site |
Die Vorgehensweise beim hinzufügen einer IPv6 Adresse ist vergleichbar mit dem "IP ALIAS"-Mechanismus bei IPv4 adressierten Interfaces.
Anwendung:
# /sbin/ip -6 addr add <ipv6address>/<prefixlength> dev <interface> |
Beispiel:
# /sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0 |
Anwendung:
# /sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength> |
Beispiel:
# /sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64 |
Diese Funktion wird selten benötigt. Vorsicht ist beim entfernen nicht existenter IPv6 Adressen geboten, da ältere Kernel dieses Fehlverhalten manchmal mit einem Crash quittieren.
Anwendung:
# /sbin/ip -6 addr del <ipv6address>/<prefixlength> dev <interface> |
Beispiel:
# /sbin/ip -6 addr del 2001:0db8:0:f101::1/64 dev eth0 |
Anwendung:
# /sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength> |
Beispiel:
# /sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64 |
Im Fall, dass ein Endgerät ein Router Advertisement empfängt und der Host kein Router ist, konfiguriert sich das Endgerät selbst eine IPv6-Adresse entsprechend dem Präfix aus dem Router Advertisement (siehe auch Abschnitt 22.4).
Privacy Extension wie beschrieben in RFC 4941 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6 (Nachfolger von RFC 3041) ersetzt die statische Interface ID (mostly basierend auf der weltweit eindeutigen MAC-Adresse), die bei der Autokonfiguration benutzt wird, durch eine pseudo-random und von Zeit zu Zeit neu generierte.
Einschalten der Privacy Extension für z.B. Interface “eth0” und zudem Präferieren dieser Adresse:
# sysctl -w net.ipv6.conf.eth0.use_tempaddr=2 |
Zur Aktivierung ist der Restart des Interfaces notwendig
# ip link set dev eth0 down -# ip link set dev eth0 up |
Nach Empfang eines Router Advertisement sollte das Interface eine entsprechende Adresse sich selbst konfiguriert haben
# ip -6 addr show dev eth0 -2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000 - inet6 2001:db8:0:1:8992:3c03:d6e2:ed72/64 scope global secondary dynamic <- pseudo-random IID - valid_lft 604711sec preferred_lft 86311sec - inet6 2001:db8:0:1::224:21ff:fe01:2345/64 scope global <- IID based on MAC - valid_lft 604711sec preferred_lft 86311sec - ... |
Für eine permanente Aktivierung muss entweder ein spezieller Initscript-Wert pro Interface gesetzt sein oder ein entsprechender Wert in /etc/sysctl.conf definiert werden:
net.ipv6.conf.eth0.use_tempaddr=2 |
Achtung: das Interface muss zu diesem Zeitpunkt bereits existieren. Wenn das nicht der Fall ist (z.B. nach einem Reboot) musses für alle Interfaces konfiguriert werden:
net.ipv6.conf.all.use_tempaddr=2 -net.ipv6.conf.default.use_tempaddr=2 |
Die Änderungen in /etc/sysctl.conf können im laufenden Betrieb geändert werden, aber zur wirklichen Aktivierung wird mindestens wird ein Interface-Restart (down/up) oder ein Reboot benötigt.
# sysctl -p |
Moderne (Client-) Systeme nutzen NetworkManager zur Interface-Konfiguration. Ein Kommandozeilen-Werkzeug ist eingebaut welches auch Parameter ändern kann, die in der GUI nicht verfügbar (oder sichtbar) sind.
Beispiele basieren auf Version 0.9.9.1-5.git20140319.fc21
Prüfen existierender Interfaces mit:
# nmcli connection -NAME UUID TYPE DEVICE -ens4v1 d0fc2b2e-5fa0-4675-96b5-b723ca5c46db 802-3-ethernet ens4v1 |
Menge von IPv6-Adressen mit Privacy Extension:
# ip -o addr show dev ens4v1 | grep temporary | wc -l -0 |
Aktuelle Einstellung der IPv6 Privacy Extension für ein Interface:
# nmcli connection show ens4v1 |grep ip6-privacy -ipv6.ip6-privacy: -1 (unknown) |
Aktivieren der IPv6 Privacy Extension und Restart des Interfaces;
# nmcli connection modify ens4v1 ipv6.ip6-privacy 2 -# nmcli connection down ens4v1; nmcli connection up ens4v1 |
Neuer Wert der IPv6 Privacy Extension prüfen:
# nmcli connection show ens4v1 |grep ip6-privacy -ipv6.ip6-privacy: 2 (active, prefer temporary IP) |
Nun sollten auch IPv6 Privacy Extension Adressen automatisch konfiguriert sein
# ip -o addr show dev ens4v1 | grep temporary | wc -l -2 |
Ob die IPv6-Adresss mit einer durch die Privacy Extension generierte Interface ID für ausgehende Verbindungen wirklich benutzt wird, kann z.B. mit Hilfe eines Web-Browers durch Aufruf von http://ip.bieringer.de/ durchgeführt werden. Wenn EUI64_SCOPE als Ausgabe “iid-privacy” zeigt, dann funktioniert alles richtig.
Wenn Sie Ihren lokalen Link verlassen und Pakete in das weltweite IPv6-Internet versenden wollen, dann benötigen Sie Routing. Wenn sich bereits ein IPv6 fähiger Router an Ihrem Link befindet, dann reicht eventuell das Hinzufügen von IPv6 Routen.
Achtung: Adressen beginnend mit “fec0” sind obsolet, hier aber noch der Vollständigheit wegen gezeigt!
Zuerst sollten sie überprüfen, ob und welche IPv6 Adressen bereits konfiguriert sind (etwa durch automatischer Konfiguration).
Anwendung:
# /sbin/ip -6 route show [dev <device>] |
Beispiel:
# /sbin/ip -6 route show dev eth0 -2001:0db8:0:f101::/64 proto kernel metric 256 mtu 1500 advmss 1440 -fe80::/10 proto kernel metric 256 mtu 1500 advmss 1440 -ff00::/8 proto kernel metric 256 mtu 1500 advmss 1440 -default proto kernel metric 256 mtu 1500 advmss 1440 |
Anwendung:
# /sbin/route -A inet6 |
Sie sehen hier mehrere IPv6 Routen mit unterschiedlichen Adressen eines einzelnen Interfaces (bei der Ausgabe wurde das Interface eth0 herausgefiltert).
# /sbin/route -A inet6 |grep -w "eth0" -2001:0db8:0:f101 ::/64 :: UA 256 0 0 eth0 <- Interface route for global -¬ address -fe80::/10 :: UA 256 0 0 eth0 <- Interface route for link-local -¬ address -ff00::/8 :: UA 256 0 0 eth0 <- Interface route for all multicast -¬ addresses -::/0 :: UDA 256 0 0 eth0 <- Automatic default route |
Eine Route wird meistens benötigt, um mit IPv6 die Außenwelt über einen IPv6 fähigen Router und über Ihren Link zu erreichen.
Anwendung:
# /sbin/ip -6 route add <ipv6network>/<prefixlength> via <ipv6address> -¬ [dev <device>] |
Beispiel:
# /sbin/ip -6 route add default via 2001:0db8:0:f101::1 |
Anwendung:
# /sbin/route -A inet6 add <ipv6network>/<prefixlength> gw -¬ <ipv6address> [dev <device>] |
Die optionale Angabe eines Devices wird dann benötigt, wenn die IPv6 Adresse des Gateways eine lokale Link-Adresse ist.
Im folgenden Beispiel wird eine Route für alle Adressen (default) über das Gateway 2001:0db8:0:f101::1 hinzugefügt.
# /sbin/route -A inet6 add default gw 2001:0db8:0:f101::1 |
Das manuelle entfernen einer Route wird nicht oft benötigt, meistens wird dies automatisch durch Netzwerk-Konfigurationsscripts beim herunterfahren (des Betriebssystems oder eines Interfaces) bewirkt.
Anwendung:
# /sbin/ip -6 route del <ipv6network>/<prefixlength> via <ipv6address> -¬ [dev <device>] |
Beispiel:
# /sbin/ip -6 route del default via 2001:0db8:0:f101::1 |
Anwendung:
# /sbin/route -A inet6 del <ipv6network>/<prefixlength> gw <ipv6address> [dev -¬ <device>] |
Beispiel zum entfernen der im obigen Beispiel hinzugefügten Route:
# /sbin/route -A inet6 del default gw 2001:0db8:0:f101::1 |
Diese Funktion wird manchmal im Fall dedizierter Punkt-zu-Punkt Verbindungen verwendet, in der Regel aber eher selten benötigt.
Anwendung:
# /sbin/ip -6 route add <ipv6network>/<prefixlength> dev <device> -¬ metric 1 |
Beispiel:
# /sbin/ip -6 route add default dev eth0 metric 1 |
Der Metrik-Wert “1” wird verwendet, um mit dem Metrik Wert von route kompatibel zu sein; der Standard-Metrik-Wert von “ip” ist “1024”.
Anwendung:
# /sbin/route -A inet6 add <network>/<prefixlength> dev <device> |
Beispiel:
# /sbin/route -A inet6 add default dev eth0 |
Dies wird manuell nicht so oft benötigt, jedoch aber beim herunterfahren von Konfigurationsscripts benutzt.
Anwendung:
# /sbin/ip -6 route del <ipv6network>/<prefixlength> dev <device> |
Beispiel:
# /sbin/ip -6 route del default dev eth0 |
Anwendung:
# /sbin/route -A inet6 del <network>/<prefixlength> dev <device> |
Beispiel:
# /sbin/route -A inet6 del default dev eth0 |
Ein Schwerpunkt bei IPv6 ist das hierarchische Routing. Aus diesem Grund werden in Routern nur wenige Routing-Einträge benötigt.
Einige Punkte sind im aktuellen Kernel zu beachten:
Ein client kann eine Default Route (z.B. “::/0” ) einrichten, diese aber auch durch automatische Konfiguration, z.B. mit radvd, erlernen:
# ip -6 route show | grep ^default -default via fe80::212:34ff:fe12:3450 dev eth0 proto kernel metric 1024 expires -¬ 29sec mtu 1500 advmss 1440 |
Ältere Linux Kernel ( zumindest <= 2.4.17) unterstützen keine Default Routen. Man kann dies einrichten, aber die Abfrage dieser Route misslingt im Fall, dass ein Paket weitergeleitet werden soll ( normaler Zwecke eines Routers).
Falls ein entsprechender Kernel noch verwendet wird, kann “default routing” eingerichtet werden, wenn hierbei das einzig globale Adress-Präfix “2000::/3” verwendet wird.
Anmerkung: Walten Sie mit Vorsicht bei der Anwendung von default routing auf exponierten Routern, wenn keine Adressfilterung eingesetzt wird. Andernfalls kann Multicast- oder lokaler Site-Datenverkehr den Router ungewollt verlassen.
Die Neighbor Discovery (Ermittlung der Netzwerkumgebung) ist der IPv6 Nachfolger für das ARP (Address Resolution Protocol) bei IPv4. Sie können Informationen über die aktuelle Netzwerkumgebung gewinnen, Einträge erstellen und entfernen.
Der Kernel merkt sich erfolgreich gelernte “Nachbarn” (wie ARP in IPv4). Sie können die gelernten Einträge mit “ip” einsehen.
Mit dem folgenden Befehl können Sie die gelernten oder konfigurierten IPv6 Nachbarn anzeigen:
# ip -6 neigh show [dev <device>] |
Das folgende Beispiel zeigt einen Nachbar, einen erreichbaren Router:
# ip -6 neigh show -fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable |
Mit folgendem Befehl können Sie einen Eintrag manuell hinzufügen:
# ip -6 neigh add <IPv6 address> lladdr <link-layer address> dev <device> |
Beispiel:
# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0 |
Sie können einen Eintrag auch löschen:
# ip -6 neigh del <IPv6 address> lladdr <link-layer address> dev <device> |
Beispiel:
# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0 |
Das Tool “ip” ist weniger ausführlich dokumentiert, dennoch ist es sehr mächtig. Sehen Sie online mit “help” für weitere Details:
# ip -6 neigh help -Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ] - [ nud { permanent | noarp | stale | reachable } ] - | proxy ADDR } [ dev DEV ] - ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ] |
Es sieht aus, als seien manche Optionen ausschließlich für IPv4 gedacht... Es wird um Ihre Mithilfe gebeten, wenn Sie Informationen zu Optionen und der erweiterten Anwendung beisteuern können.
Wenn zum Verlassen des lokalen Netzwerks keine native IPv6-Anbindung vorhanden ist, wird zum Erreichen des weltweiten IPv6 Internet ein IPv6-in-IPv4 Tunnel benötigt.
Es gibt unterschiedliche Tunnel-Mechanismen sowie einige Möglichkeiten zum Einrichten eines Tunnels.
Es steht Ihnen mehr als eine Möglichkeit zur Verfügung, IPv6 Pakete über ausschließliche IPv4 Links zu tunneln.
Ein Punkt-zu-Punkt Tunnel ist ein dedizierter Tunnel zu einem Endpunkt, der Kenntnis über das lokale IPv6 Netzwerk (für das Routing zurück...) und die IPv4 Adresse des Tunnel-Endpunktes verfügt. Definition des Punkt-zu-Punkt Tunnels siehe: RFC 4213 / Basic Transition Mechanisms for IPv6 Hosts and Routers. Anforderungen:
Die IPv4 Adresse des lokalen Tunnel-Endpunktes muss statisch sein, global eindeutig und vom entfernten Tunnel-Endpunkt aus erreichbar sein.
Wenn keine statische IPv4 Addresse verfügbar ist, muß der Tunnel-Provider die Authentifizerung der dynamischen IPv4 Addresse unterstützen, wie z.B. SixXS / AICCU oder gogo6.
Sie müssen ein globales IPv6 Präfix zugewiesen bekommen haben.
Es ist auch möglich, daß zusätzliche IPv6 Netzwerke über diesen Tunnel geroutet werden.
Ein entfernter Tunnel-Endpunkt muss dazu in der Lage sein, ihr IPv6 Präfix bis zu Ihrem lokalen Tunnel-Endpunkt zu routen (wobei meistens manuelle Konfiguration notwendig wird).
Statische Tunnelprovider:
Automatisches Tunneln tritt dann ein, wenn ein Knoten direkt einen anderen Knoten (dessen IPv4-Adresse er zuerst kennen lernen muss) über die IPv4-mapped IPv6-Adresse anspricht - dieser Mechanismus sollte nicht mehr unterstützt werden, weil er sehr unsicher ist.
6to4 Tunnel (RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds) verwenden einen einfachen Mechanismus zum erstellen eines automatischen Tunnels. Jeder Knoten mit einer weltweit einmaligen IPv4 Adresse kann zu einem 6to4 Tunnel-Endpunkt gemacht werden (solange keine IPv4-Firewall den Verkehr unterbindet). Ein 6to4 Tunnel ist zumeist kein one-to-one Tunnel. In diesem Fall wird das Untertunneln in einen Upstream- und einen Downstream-Tunnel unterteilt. Ferner zeigt eine spezielle IPv6 Adresse an, dass der Knoten einen 6to4 Tunnel für die Verbindung zum weltweiten IPv6 Netzwerk verwendet.
Die 6to4 Adresse wird wie folgt definiert (Schema ist dem RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds entnommen):
| 3+13 | 32 | 16 | 64 bits | -+---+------+-----------+--------+--------------------------------+ -| FP+TLA | V4ADDR | SLA ID | Interface ID | -| 0x2002 | | | | -+---+------+-----------+--------+--------------------------------+ |
FP und TLA zusammen haben den Wert 0x2002. V4ADDR ist die weltweit einmalige IPv4 Adresse des Knoten (in hexadezimaler Notation). Mit dem SLA wird das Subnetz identifiziert (65536 lokale Subnetze sind möglich) und benutzbar, um die lokale Netzwerstruktur abzubilden.
Für Gateways wird dieser Präfix normalerweise mit dem SLA “0000” definiert und dem 6to4 Tunnel-Interface das Suffix “::1” (kann aber auch ein beliebiger mit local-scope sein) zugewiesen. Zu bemerken ist, dass Microsoft Windows als Suffix auch immer die V4ADDR einsetzt.
Der Knoten muss die Kenntnis darüber haben, an welchen entfernten Tunnel-Endpunkt die in IPv4 Paketen eingeschlossenen IPv6 Pakete gesendet werden sollen. In den “Anfängen” der 6to4 Tunnel-Anwendung wurden dedizierte Upstream akzeptierende Router definiert. Liste der Router siehe: NSayer's 6to4 information.
Heute können Upstream Router automatisch mittels der anycast Adresse 192.88.99.1 gefunden werden. Routing Protokolle sind für die Verarbeitung im Hintergrund zuständig, siehe RFC 3068 / An Anycast Prefix for 6to4 Relay Routers für weitere Details.
Der Downstream (6bone -> Ihr 6to4 fähiger Node) ist nicht wirklich fix, er kann von jenem Host variieren, an dem ursprünglich die Pakete gesendet wurden. Es gibt zwei Möglichkeiten:
Der entfernte Host benutzt 6to4 und sendet die Pakete direkt an den lokalen Knoten zurück (siehe unten).
Der entfernte Host sendet die Pakete zurück an das weltweite IPv6 Netzwerk, und abhängig vom dynamischen Routing, erstellt dann ein Relay-Router eines ISPs, der 2002::/16 via BGP kundgibt, automatisch zum lokalen Knoten einen Tunnel.
Vom 6to4 zum 6to4: der Tunnel entsteht normalerweise direkt zwischen den beiden 6to4 fähigen Hosts.
Vom 6to4 zum non-6to4: Der Datenstrom wird mittels Upstream-Tunnel versendet.
Vom non-6to4 zum 6to4: Der Datenstrom wird mittels Downstream-Tunnel versendet.
Achtung, durch das mögliche asymmetrische Routing können Probleme mit defekten 6to4-Relays schwer zu diagnostizieren sein.
UDP gekapseltes IPv6 Tunneling wird üblicherweise benutzt, wenn am internen Endpunkt keine globale IPv4 Addresse verfügbar ist, aber via Network Adress Translation (NAT) noch entsprechende Endpunkte im Internet mit Hilfe unten beschriebener UDP Ports erreichbar sind.
RFC 4380 / Teredo: Tunneling IPv6 over UDP through Network Address Translationsbeschreibt das Tunneln von IPv6 Pakete über IPv4 UDP Pakete (Bubbles), siehe auch Wikipedia / Teredo. Üblicherweise benutzt es 3544/udp. Der Client für Linux heißt miredo und ist benutzbar ohne große Konfiguration. Über diese Tunnelmethode kann nur ein einzelner Client an das globale IPv6-Netzwerk angeschlossen werden.
Tunnel provider SixXS bietet auch einen IPv6-in-UDP-in-IPv4 (5072/udp) Tunnel an, zur Nutzung muss der Modus AYIYA aktiviert werden.
Tunnel provider gogo6 bietet auch einen IPv6-in-UDP-in-IPv4 (3653/udp) Tunnel an, zur Nutzung muss der Modus v6udpv4 aktiviert werden.
Anwendung:
# /sbin/ip -6 tunnel show [<device>] |
Beispiel:
# /sbin/ip -6 tunnel show -sit0: ipv6/ip remote any local any ttl 64 nopmtudisc -sit1: ipv6/ip remote 195.226.187.50 local any ttl 64 |
Anwendung:
# /sbin/route -A inet6 |
Beispiel (Ausgabe wurde derart gefiltert, dass nur Tunnels über das virtuelle Interface sit0 angezeigt werden):
# /sbin/route -A inet6 | grep "\Wsit0\W*$" -::/96 :: U 256 2 0 sit0 -2002::/16 :: UA 256 0 0 sit0 -2000::/3 ::193.113.58.75 UG 1 0 0 sit0 -fe80::/10 :: UA 256 0 0 sit0 -ff00::/8 :: UA 256 0 0 sit0 |
Es gibt drei Methoden ein Punkt-zu-Punkt Tunnel hinzuzufügen bzw. zu entfernen.
Eine gute Informationsquelle zum Thema Tunnel-Einrichtung mit “ip” ist folgender Artikel: Configuring tunnels with iproute2 (article) (Spiegel).
Bei einer kleinen Anzahl von Tunnels ist die Verwendung von “ip” zurzeit die Standardmethode.
Beispiel für das Erstellen eines Tunnel-Devices (das Device wird aber hiermit nicht aktiviert; ebenso muss ein TTL Wert spezifiziert werden, da der Standardwert 0 ist):
# /sbin/ip tunnel add <device> mode sit ttl <ttldefault> remote -¬ <ipv4addressofforeigntunnel> local <ipv4addresslocal> |
Anwendung (drei allgemeine Beispiele):
# /sbin/ip tunnel add sit1 mode sit ttl <ttldefault> remote -¬ <ipv4addressofforeigntunnel1> local <ipv4addresslocal> -# /sbin/ip link set dev sit1 up -# /sbin/ip -6 route add <prefixtoroute1> dev sit1 metric 1 - -# /sbin/ip tunnel add sit2 mode sit ttl <ttldefault> -¬ <ipv4addressofforeigntunnel2> local <ipv4addresslocal> -# /sbin/ip link set dev sit2 up -# /sbin/ip -6 route add <prefixtoroute2> dev sit2 metric 1 - -# /sbin/ip tunnel add sit3 mode sit ttl <ttldefault> -¬ <ipv4addressofforeigntunnel3> local <ipv4addresslocal> -# /sbin/ip link set dev sit3 up -# /sbin/ip -6 route add <prefixtoroute3> dev sit3 metric 1 |
Diese Methode zum Hinzufügen eines Tunnels wird nicht empfohlen, da Ungereimtheiten auftreten. Es gibt keine Probleme, wenn nur ein Tunnel hinzugefügt wird. Werden hingegen mehrere Tunnel hinzugefügt, dann kann der erste Tunnel nicht einfach deaktiviert werden, wenn die restlichen Tunnel aktiviert bleiben sollen.
Anwendung (drei allgemeine Beispiele):
# /sbin/ifconfig sit0 up - -# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel1> -# /sbin/ifconfig sit1 up -# /sbin/route -A inet6 add <prefixtoroute1> dev sit1 - -# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel2> -# /sbin/ifconfig sit2 up -# /sbin/route -A inet6 add <prefixtoroute2> dev sit2 - -# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel3> -# /sbin/ifconfig sit3 up -# /sbin/route -A inet6 add <prefixtoroute3> dev sit3 |
WICHTIG: NICHT VERWENDEN! Mit diesem Setup wird von überall aus dem Internet das "automatische Tunneln" vorbehaltlos aktiviert. Das ist ein unnötiges Risiko.
Sie können einen Tunnel auch im NBMA-Stil (Non Broadcast Multiple Access) einrichten. Bei dieser Vorgehensweise können Sie sehr einfach mehrere Tunnels zugleich einrichten, aber kein Tunnel kann nummeriert werden (und das ist ein kein benötigtes Feature).
Anwendung (drei allgemeine Beispiele):
# /sbin/ifconfig sit0 up - -# /sbin/route -A inet6 add <prefixtoroute1> gw -¬ ::<ipv4addressofforeigntunnel1> dev sit0 -# /sbin/route -A inet6 add <prefixtoroute2> gw -¬ ::<ipv4addressofforeigntunnel2> dev sit0 -# /sbin/route -A inet6 add <prefixtoroute3> gw -¬ ::<ipv4addressofforeigntunnel3> dev sit0 |
WICHTIG: NICHT VERWENDEN! Mit diesem Setup wird von überall aus dem Internet das "automatische Tunneln" vorbehaltlos aktiviert. Das ist ein unnötiges Risiko.
Diese Funktion wird selten manuell durchgeführt. Skripte verwenden diese Funktion zum sauberen deaktivieren bzw. beim Neustart einer IPv6 Konfiguration.
Entfernen eines Tunnel-Devices:
# /sbin/ip tunnel del <device> |
Anwendung (drei allgemeine Beispiele):
# /sbin/ip -6 route del <prefixtoroute1> dev sit1 -# /sbin/ip link set sit1 down -# /sbin/ip tunnel del sit1 - -# /sbin/ip -6 route del <prefixtoroute2> dev sit2 -# /sbin/ip link set sit2 down -# /sbin/ip tunnel del sit2 - -# /sbin/ip -6 route del <prefixtoroute3> dev sit3 -# /sbin/ip link set sit3 down -# /sbin/ip tunnel del sit3 |
Nicht nur bei der Erstellung eines Tunnels kommt es zu Ungereimtheiten, sondern auch bei dessen Entfernung. Die Tunnel müssen in umgekehrter Reihenfolge wieder entfernt werden, d.h. der zuletzt erstellte Tunnel muss als Erster entfernt werden...
Anwendung (drei allgemeine Beispiele):
# /sbin/route -A inet6 del <prefixtoroute3> dev sit3 -# /sbin/ifconfig sit3 down - -# /sbin/route -A inet6 del <prefixtoroute2> dev sit2 -# /sbin/ifconfig sit2 down - -# /sbin/route -A inet6 add <prefixtoroute1> dev sit1 -# /sbin/ifconfig sit1 down - -# /sbin/ifconfig sit0 down |
Die Vorgehensweise ist vergleichbar mit dem löschen einer normalen IPv6 Route.
Anwendung (drei allgemeine Beispiele):
# /sbin/route -A inet6 del <prefixtoroute1> gw -¬ ::<ipv4addressofforeigntunnel1> dev sit0 -# /sbin/route -A inet6 del <prefixtoroute2> gw -¬ ::<ipv4addressofforeigntunnel2> dev sit0 -# /sbin/route -A inet6 del <prefixtoroute3> gw -¬ ::<ipv4addressofforeigntunnel3> dev sit0 - -# /sbin/ifconfig sit0 down |
Manchmal ist es notwendig, einen Punkt-zu-Punkt Tunnel mit IPv6 Adresse genauso einzurichten, wie heute bei IPv4. Dies ist nur mit der ersten (ifconfig+route - nicht empfehlenswert) sowie mit der dritten (ip+route) beschriebenen Methode zur Einrichtung eines Tunnels möglich. Bei diesen Fällen können Sie den Tunnel-Interfaces die IPv6 Adressen, wie im Abschnitt zur Interface-Konfiguration beschrieben, hinzufügen.
Beachten sie Bitte, dass 6to4 Tunnel im Standard-Kernel der Serie 2.2.x (siehe systemcheck/kernel) nicht unterstützt werden. Weiter ist zu beachten, dass die Präfix-Länge für 6to4 Adressen 16 ist, da sich aus Perspektive des Netzwerks betrachtet, alle anderen 6to4 Hosts sich in der gleichen Schicht 2 befinden.
Zu Anfang müssen Sie Ihre 6to4 Präfix-Länge mittels der lokal zugewiesenen global routbaren IPv4 Adresse berechnen (sollte ihr Host keine global routebare IPv4 Adresse haben, dann ist unter speziellen Bedingungen NAT auf dem Border Gateway möglich):
Angenommen, Ihre IPv4 Adresse ist:
1.2.3.4 |
Dann ist das daraus resultierende 6to4 Präfix:
2002:0102:0304:: |
Lokalen 6to4 Gateways sollte immer (ist aber kein Muss, ein beliebiger local-scope Suffix kann benutzt werden) das Suffix “::1” zugewiesen werden. Daraus resultierend ergibt sich Ihre lokale 6to4 Adresse:
2002:0102:0304::1 |
Zum automatischen Erstellen der Adresse können Sie folgenden Befehl nutzen:
ipv4="1.2.3.4"; printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "` |
Es gibt nun zwei Möglichkeiten einen 6to4 Tunnel einzurichten.
Die empfohlene Vorgehensweise (der Wert TTL muss angegeben werden, da der Standardwert 0 ist):
Erstellen eines neues Tunnel-Device:
# /sbin/ip tunnel add tun6to4 mode sit ttl <ttldefault> remote any local -¬ <localipv4address> |
Interface aktivieren:
# /sbin/ip link set dev tun6to4 up |
Eine lokale 6to4 Adresse am Interface hinzufügen (Hinweis: Präfix-Länge 16 ist wichtig!)
# /sbin/ip -6 addr add <local6to4address>/16 dev tun6to4 |
Hinzufügen der (Standard-) Route zum globalen IPv6 Netz unter Verwendung der all-6to4-routers IPv4 anycast Adresse:
# /sbin/ip -6 route add default via ::192.88.99.1 dev tun6to4 metric 1 |
Manche Versionen von “ip” (z.B. SuSE Linux 9.0) unterstützen keine IPv4-kompatiblen IPv6-Adressen für Gateways, in diesem Fall muss die entsprechende IPv6-Adresse benutzt werden:
# /sbin/ip -6 route add default via 2002:c058:6301::1 dev tun6to4 metric 1 |
Diese Vorgehensweise wird nicht empfohlen, da bei Verwendung des allgemeinen Tunnel Device sit0 keine Filter-Spezifizierung pro Device ermöglicht wird.
Das allgemeine Tunnel Interface sit0 aktivieren:
# /sbin/ifconfig sit0 up |
Dem Interface eine lokale 6to4 Adresse hinzufügen:
# /sbin/ifconfig sit0 add <local6to4address>/16 |
Hinzufügen der (Standard-) Route zum globalen IPv6 Netz unter Verwendung der all-6to4-routers IPv4 anycast Adresse:
# /sbin/route -A inet6 add default gw ::192.88.99.1 dev sit0 |
Entfernen aller Routen über dieses bestimmten Tunnel Devices:
# /sbin/ip -6 route flush dev tun6to4 |
Interface deaktivieren:
# /sbin/ip link set dev tun6to4 down |
Ein erstelltes Tunnel Device entfernen:
# /sbin/ip tunnel del tun6to4 |
Entfernen der (Standard-) Route über ein 6to4 Tunnel Device:
# /sbin/route -A inet6 del default gw ::192.88.99.1 dev sit0 |
Eine 6to4 Adresse des Interfaces entfernen:
# /sbin/ifconfig sit0 del <local6to4address>/16 |
Ein allgemeines Tunnel Device deaktivieren (aber Achtung, eventuell ist das Interface noch in Verwendung...)
# /sbin/ifconfig sit0 down |
RFC 2473 / Generic Packet Tunneling in IPv6 Specification spezifiziert den Mechanismus, um unterschiedliche Pakettypen (einschließlich IPv4) über IPv6 zu tunneln.
ANMERKUNG: Unterstützung für IPv4-in-IPv6 Tunnel ist erst seit Kernel Version 2.6.22 verfügbar.
Anwendung:
# /sbin/ip -6 tunnel show [<device>] |
Beispiel:
# /sbin/ip -6 tunnel show mode any -ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) -ip6tnl1: ip/ipv6 remote fd00:0:0:2::a local fd00:0:0:2::1 dev eth1 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) |
ANMERKUNG: wenn "mode any" nicht angegeben wird, werde nur IPv6-in-IPv6 Tunnels angezeigt.
Anwendung für die Erzeugung einer 4over6 Tunnel-Schnittstelle (welche danach aber noch nicht aktiv ist)
# /sbin/ip tunnel add <device> mode ip4ip6 remote <ipv6addressofforeigntunnel> local <ipv6addresslocal> |
Anwendung (allgemeines Beispiel für drei Tunnels):
# /sbin/ip -6 tunnel add ip6tnl1 mode ip4ip6 remote <ipv6addressofforeigntunnel1> local <ipv6addresslocal> -# /sbin/ip link set dev ip6tnl1 up -# /sbin/ip -6 route add <prefixtoroute1> dev ip6tnl1 metric 1 - -# /sbin/ip -6 tunnel add ip6tnl2 mode ip4ip6 remote <ipv6addressofforeigntunnel2> local <ipv6addresslocal> -# /sbin/ip link set dev ip6tnl2 up -# /sbin/ip -6 route add <prefixtoroute2> dev ip6tnl2 metric 1 - -# /sbin/ip -6 tunnel add ip6tnl3 mode ip4ip6 remote <ipv6addressofforeigntunnel3> local <ipv6addresslocal> -# /sbin/ip link set dev ip6tnl3 up -# /sbin/ip -6 route add <prefixtoroute3> dev ip6tnl3 metric 1 |
Anwendung für das Löschen einer Tunnel-Schnittstelle:
# /sbin/ip -6 tunnel del <device> |
Anwendung (allgemeines Beispiel für drei Tunnels):
# /sbin/ip -6 route del <prefixtoroute1> dev ip6tnl1 -# /sbin/ip link set ip6tnl1 down -# /sbin/ip -6 tunnel del ip6tnl1 - -# /sbin/ip -6 route del <prefixtoroute2> dev ip6tnl2 -# /sbin/ip link set ip6tnl2 down -# /sbin/ip -6 tunnel del ip6tnl2 - -# /sbin/ip -6 route del <prefixtoroute3> dev ip6tnl3 -# /sbin/ip link set ip6tnl3 down -# /sbin/ip -6 tunnel del ip6tnl3 |
Anmerkung: Dieses Kapitel basiert großteils auf der Datei “ip-sysctl.txt”, welche in den aktuellen Kernel-Quellen im Verzeichnis “Documentation/networking” zu finden ist. Danke an dieser Stelle an Pekka Savola, der den IPv6 relevanten Inhalt dieser Datei wartet und betreut. Ebenso sei erwähnt, dass einige Textstellen hieraus mehr oder weniger mit Copy & Paste in dieses Dokument übernommen wurden.
Mit “cat” und “echo” können Sie am einfachsten das /proc Dateisystem einsehen. Hierfür gibt es aber einige Voraussetzungen, die erfüllt sein müssen:
Das /proc-Dateisystem muss im Kernel aktiviert sein. Hierfür muss die folgende Einstellung beim kompilieren des Kernels vorgenommen werden:
CONFIG_PROC_FS=y |
Das /proc-Dateisystem muss zuerst gemountet sein. Dies kann wie folgt getestet werden:
# mount | grep "type proc" -none on /proc type proc (rw) |
Sie benötigen Lese- und manchmal auch Schreib-Zugriff (normalerweise nur als Root-Benutzer) auf das /proc-Dateisystem.
Normalerweise sind, mit Ausnahme in /proc/sys/*, alle Einträge ausschließlich mit Leserechten ausgestattet. Die Einträge werden zum Zweck der Informationsgewinnung verwendet.
Den Inhalt eines Eintrags können sie mit “cat” anzeigen:
# cat /proc/sys/net/ipv6/conf/all/forwarding -0 |
Mit “echo” können sie einen neuen Wert zuweisen (nur wenn der Eintrag beschreibbar ist):
# echo "1" >/proc/sys/net/ipv6/conf/all/forwarding |
Die Verwendung des Programms “sysctl” ist eine zeitgemäße Methode zum Anzeigen der Kernel-Switches. Es funktioniert auch dann, wenn das /proc-Dateisystem nicht gemountet ist, wobei aber nur ein Zugriff auf /proc/sys/* möglich ist!
Das Programm “sysctl” ist (auf Red Hat Linux Systemen) im Paket “procps” enthalten.
Das sysctl-Interface muss im Kernel aktiviert sein. Hierfür muss die folgende Einstellung beim kompilieren des Kernels vorgenommen werden:
CONFIG_SYSCTL=y |
Der Wert eines Eintrags kann nun angezeigt werden:
# sysctl net.ipv6.conf.all.forwarding -net.ipv6.conf.all.forwarding = 0 |
Ein neuer Wert kann wie folgt zugewiesen werden (wenn der Eintrag beschreibbar ist):
# sysctl -w net.ipv6.conf.all.forwarding=1 -net.ipv6.conf.all.forwarding = 1 |
Anmerkung: Verwenden Sie beim setzen eines Wertes keine Leerzeichen vor oder nach dem “=”. Sollten Sie mehrere Werte in einer Zeile angeben, müssen sie diese mit Anführungszeichen umgeben:
# sysctl -w net.ipv4.ip_local_port_range="32768 61000" -net.ipv4.ip_local_port_range = 32768 61000 |
Anmerkung: Es gibt sysctl-Versionen im Umlauf, die anstelle des Punktes “.” einen slash “/” ausgeben.
Für weitere Details siehe die manpage von sysctl.
Hinweise: Um schnell einen Überblick über die Einstellungen zu bekommen, verwenden Sie einfach die Option “-a” (anzeigen aller Einträge) sowie das Tool “grep”.
Es gibt im /proc-Dateisystem unterschiedliche Formate:
BOOLEAN: einfach eine “0” (falsch) oder eine “1” (wahr)
INTEGER: Wert ist eine Ganzzahl (kann auch eine unsigned int sein)
Kompliziertere Zeilen mit verschiedenen Werten: manchmal wir eine Header-Zeile mit angezeigt... Sie können aber auch weitere Informationen zu den Werten und deren Bedeutung direkt in den Kernel Quellen beziehen.
Ändern der Interface-spezifischen Einstellungen.
Ändern aller Interface-spezifischen Einstellungen.
Ausnahme: “conf/all/forwarding” hat hier eine andere Bedeutung:
Typ: BOOLEAN
Hiermit wird die globale IPv6 Weiterleitung zwischen allen Interfaces aktiviert.
In IPv6 ist kein forwarding per Device möglich. Die Steuerung der Weiterleitung muss mittels IPv6-netfilter Regel-Sets (mit dem Programm ip6tables) und der Bestimmung der Ein- und Ausgabe-Devices (siehe Firewalling/Netfilter6 für Details) vollzogen werden. In IPv4 ist das anders, forwarding per device ist hier möglich (hier wird am Interface, wo das Paket einlangt, die entsprechende Entscheidung getroffen).
Hiermit werden die Host/Router Einstellungen 'forwarding' aller Interfaces eingestellt (auch globales Forwarding genannt). Für weitere Details Siehe unten.
Ist der Wert gleich 0, dann ist IPv6 forwarding deaktiviert. Pakete verlassen in diesem Fall niemals ein anderes Interface (weder physikalische noch logische wie z.B. Tunnel).
Spezielle Einstellungen per Interface ändern.
Das funktionale Verhalten einzelner Einstellungen ist davon abhängig, ob lokales forwarding aktiviert ist oder nicht.
Typ: BOOLEAN
Standardeinstellung: aktiviert, wenn lokales forwarding deaktiviert ist. Deaktiviert, wenn lokales forwarding aktiviert ist.
Router Advertisements werden akzeptiert; das Interface wird mit Status 'received data' automatisch konfiguriert.
Typ: BOOLEAN
Standardeinstellung: aktiviert, wenn lokales forwarding deaktiviert ist. Deaktiviert, wenn lokales forwarding aktiviert ist.
Akzeptiert von IPv6 Router gesendete Redirects.
Typ: BOOLEAN
Funktionale Standardeinstellung: aktiviert, wenn accept_ra_pinfo aktiv ist. Deaktiviert, wenn accept_ra_pinfo deaktiviert ist.
Autokonfiguriert Adressen unter Benutzung der Prefix-Information eines Router-Advertisements.
Typ: INTEGER
Standardwert: 1
Die Anzahl der gesendeten Proben zum entdecken von Adress-Duplikaten.
Typ: BOOLEAN
Standardwert: FALSCH, wenn globale forwarding deaktiviert ist (Standard), ansonst WAHR
Konfigurieren von Interface-spezifischem Host/Router-Verhalten.
Anmerkung: Es wird die gleiche Konfiguration für alle Interfaces empfohlen; Gemischte Host/Router-Szenarios sind eher unüblich.
Wert FALSCH: Per Standard wird von einem Host-Verhalten ausgegangen. Das bedeutet:
Der Schalter IsRouter ist bei Router Advertisements nicht aktiviert.
Router-Anfragen werden bei Bedarf gesendet.
Wenn accept_ra WAHR ist (Standard), dann werden Router Advertisements akzeptiert (und starte die automatische Konfiguration).
Wenn accept_redirects WAHR ist (Standard), dann akzeptiere Redirects.
Wert WAHR: Ist lokales forwarding eingeschaltet, dann wird von einem Router-Verhalten ausgegangen. Das bedeutet genau das Gegenteil zu oben:
Der Schalter IsRouter ist bei Router Advertisements aktiviert.
Router-Anfragen werden nicht gesendet.
Router Advertisements werden ignoriert.
Redirects werden ignoriert.
Typ: INTEGER
Standardwert: 64
Der Standardwert für das Hop-Limit wird hiermit eingestellt.
Type: INTEGER
Standardwert: 1280 (Minimumwert in IPv6)
Der Standardwert für die Maximum Transfer Unit wird hiermit eingestellt.
Typ: INTEGER
Standardwert: 1
Die Anzahl der nach der Aktivierung eines Interfaces zu wartenden Sekunden bevor Router-Anfragen gesendet werden.
Typ: INTEGER
Standardwert: 4
Die Anzahl der Sekunden zwischen Router-Anfragen.
Typ: INTEGER
Standardwert: 3
Die Anzahl der Router-Anfragen, bevor angenommen wird, dass keine Router verfügbar sind.
Standardeinstellungen der Neighbor-Erkennung und einige spezielle globale Intervall- sowie Threshold-Werte ändern:
Typ: INTEGER
Standardwert: 1024
Parameter zum Einstellen der Größe der Neighbour-Tabelle.
Wenn Sie viele Interfaces und Probleme mit inkorrekt oder nicht funktionierenden Routen haben, dann sollten Sie diesen Wert erhöhen. Ebenfalls erhöhen sollten Sie den Wert, wenn von einem aktiven Zebra (routing daemon) Folgendes angezeigt wird:
ZEBRA: netlink-listen error: No buffer space available, type=RTM_NEWROUTE(24), -¬ seq=426, pid=0 |
Per Interface ändern spezieller Einstellungen zur Neighbor-Erkennung.
Typ: INTEGER
Standardwert: 5
Mehr Infos hierzu in späteren Versionen.
Globale Routing-Einstellungen ändern.
In neueren Kernel-Versionen wurde diese Option entfernt - mehr Infos hierzu in späteren Versionen.
Zurzeit werden einige Schalter auch bei IPv6 eingesetzt (Dies bleibt so, bis IPv4 zur Gänze in ein unabhängiges Kernel-Modul umgewandelt wurde).
Diese Kontrolleinstellung wird ebenfalls bei IPv6 verwendet.
Diese Kontrolleinstellungen werden bei IPv6 nicht verwendet. Zum aktivieren der ICMPv6 Quoten-Limitierung (auf Grund der ICMPv6 storms Auswirkungen sehr empfohlen) müssen netfilter-v6-Regeln eingesetzt werden.
In /proc/net gibt es einige Einträge die ausschließlich Lese-Rechte besitzen. Mit “sysctl” können Sie hier keine Informationen bekommen, verwenden Sie anstelle dessen z.B. “cat”.
Typ: Eine Zeile pro Adresse mit jeweils mehreren Werten
Alle konfigurierten IPv6 Adressen werden hier in einem speziellen Format angezeigt. Im Beispiel wird ein Loopback-Interface angezeigt. Die Werte werden unten erklärt (siehe “net/ipv6/addrconf.c” für Details).
# cat /proc/net/if_inet6 -00000000000000000000000000000001 01 80 10 80 lo -+------------------------------+ ++ ++ ++ ++ ++ -| | | | | | -1 2 3 4 5 6 |
IPv6 Adresse mit 32 hexadezimalen Zeichen ohne Doppelpunkte als Trennzeichen
Netlink Device Nummer (Interface Index) im hexadezimalen Format (siehe auch “ip addr”)
Präfix-Länge in hexadezimaler Notation
Wert des Gültigkeitsbereichs (s.a. Kernel Quellen “include/net/ipv6.h” und “net/ipv6/addrconf.c”)
Interface flags (s.a. “include/linux/rtnetlink.h” und “net/ipv6/addrconf.c”)
Devicename
Typ: Eine Zeile pro Route mit jeweils mehreren Werten
Alle konfigurierten IPv6 Routen werden hier in einem speziellen Format angezeigt. Im Beispiel wird ein Loopback-Interface angezeigt. Die Werte werden unten erklärt (siehe “net/ipv6/route.c” für Details).
# cat /proc/net/ipv6_route -00000000000000000000000000000000 00 00000000000000000000000000000000 00 -+------------------------------+ ++ +------------------------------+ ++ -| | | | -1 2 3 4 - -¬ 00000000000000000000000000000000 ffffffff 00000001 00000001 00200200 lo -¬ +------------------------------+ +------+ +------+ +------+ +------+ ++ -¬ | | | | | | -¬ 5 6 7 8 9 10 |
IPv6 Zielnetzwerk mit 32 hexadezimalen Zeichen ohne Doppelpunkte als Trennzeichen
IPv6 Ziel-Präfix-Länge in hexadezimaler Notation
IPv6 Ursprungsnetzwerk mit 32 hexadezimalen Zeichen ohne Doppelpunkte als Trennzeichen
IPv6 Ursprungs-Präfix-Länge in hexadezimaler Notation
IPv6 next Hop mit 32 hexadezimalen Zeichen ohne Doppelpunkte als Trennzeichen
Metrik in hexadezimaler Schreibweise
Reference Counter
Use Counter
Flags
Devicename
Typ: Eine Zeile pro Protokoll mit Beschreibung und Wert
Statistiken über verwendete IPv6 Sockets. Beispiel:
# cat /proc/net/sockstat6 -TCP6: inuse 7 -UDP6: inuse 2 -RAW6: inuse 1 -FRAG6: inuse 0 memory 0 |
Typ: Eine Zeile pro SNMP Beschreibung und Wert
SNMP Statistiken; diese können mittels snmp server und entsprechender MIB Tabelle mit einer Network Management Software gewonnen werden.
Mehr Infos hierzu in späteren Versionen... der Autor hat hiermit keine Erfahrung...
Zusätzliche Informationen sind hier zu finden
Karl Auer's Blog: Controlling IPv6 source address selection , IPv6 Source Address Selection - what, why, how
Die Auflösung von Namen zu einer IPv4- bzw. IPv6-Adresse wird üblicherweise durch die Benutzung einer libc resolver Bibliothek durchgeführt. Dazu wird normalerweise die Funktion getaddrinfo benutzt. Im Fall, dass mehr als eine IPv6-Adresse zurückgegeben wird, soll nach RFC 3484 / Default Address Selection for Internet Protocol version 6 eine Sortierung angewandt werden, die optional auch konfiguriert werden kann.
Die “Magie” ist durch die Datei /etc/gai.conf konfigurierbar (welche fehlt oder leer ist, solange Standardwerte gelten sollen). Die vorgegebene Sortierung ist üblicherweise in der Dokumentation (z.B. /usr/share/doc/glibc-common/gai.conf) oder im Manual “man gai.conf” zu sehen.
Für die Kontrolle der Sortierung via benutzerdefinierter Konfiguration ist für Tests folgendes notwendig:
Ein Hostname im DNS, der mehr als eine IPv6-Adresse zurückgibt, z.B.
$ dig +short aaaa st1.bieringer.de -2001:4dd0:ff00:834::2 -2a01:238:423d:8800:85b3:9e6b:3019:8909 |
Lookup via DNS (mit /etc/hosts klappt es nicht)
/etc/gai.conf mit einer passenden Konfiguration, e.g.
precedence ::1/128 50 # default -precedence ::/0 40 # default -precedence 2002::/16 30 # default -precedence ::/96 20 # default -precedence ::ffff:0:0/96 10 # default -precedence 2001:4dd0:ff00:834::/64 80 # dst-A -precedence 2a01:238:423d:8800::/64 90 # dst-B |
Für Tests kann dann ein Telnet-Client benutzt werden:
$ telnet st1.bieringer.de -Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B) -... -Trying 2001:4dd0:ff00:834::2... (dst-A) -... |
Wenn nun die precedence geändert wird in der Konfiguration:
precedence 2001:4dd0:ff00:834::/64 90 # dst-A ex 80 -precedence 2a01:238:423d:8800::/64 80 # dst-B ex 90 |
Dann ändert sich die Reihenfolge entsprechend
$ telnet st1.bieringer.de -Trying 2001:4dd0:ff00:834::2... (dst-A) -... -Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B) -... |
Source address selection in Linux wird automatisch vom Kernel vorgenommen, üblicherweise abhängig von den Routing-Tabellen und unter der Vorgabe, den Scope einer Adresse beizubehalten.
Mit einer Erweiterung der internen “ip addrlabel” Tabelle kann eine Quell-Adresse zu einer Ziel-Adresse gebunden werden. Bindung wird hier durch die Angabe des gleichen Labels (einer Nummer) konfiguriert.
Standard von “ip addrlabel” (hier von CentOS 6):
# ip addrlabel -prefix ::1/128 label 0 -prefix ::/96 label 3 -prefix ::ffff:0.0.0.0/96 label 4 -prefix 2001::/32 label 6 -prefix 2001:10::/28 label 7 -prefix 2002::/16 label 2 -prefix fc00::/7 label 5 -prefix ::/0 label 1 |
Das System ist multihomed (hier an einem Interface), der Router verteilt 2 Präfixe mit Hilfe von radvd:
# ip -6 addr show dev eth1 | grep -w inet6 |grep -w global - inet6 2001:6f8:12d8:2:5054:ff:fefb:6582/64 scope global dynamic (src-A) - inet6 2001:6f8:900:8cbc:5054:ff:fefb:6582/64 scope global dynamic (src-B) |
Eine Verbindung zum Server zeigt nun:
$ telnet st1.bieringer.de -Trying 2001:4dd0:ff00:834::2... (dst-A) -... -Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B) -... |
Ein tcpdump mit filter “tcp and dst port 23” zeigt nur die Benutzung der oberen lokalen Quell-IPv6-Adresse
IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.37762 > 2001:4dd0:ff00:834::2.telnet: (src-A -> dst-A) -IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.45754 > 2a01:238:423d:8800:85b3:9e6b:3019:8909.telnet: (src-A -> dst-B) |
Wenn nun Quelle und Ziel mit Hilfe von “ip addrlabel” zusammengebunden werden:
# ip addrlabel add prefix 2001:6f8:12d8:2::/64 label 200 -# ip addrlabel add prefix 2001:6f8:900:8cbc::/64 label 300 -# ip addrlabel add prefix 2001:4dd0:ff00:834::/64 label 200 -# ip addrlabel add prefix 2a01:238:423d:8800::/64 label 300 |
Was in folgender “ip addrlabel”resultiert:
# ip addrlabel -prefix ::1/128 label 0 -prefix ::/96 label 3 -prefix ::ffff:0.0.0.0/96 label 4 -prefix 2a01:238:423d:8800::/64 label 300 # dst-B -prefix 2001:4dd0:ff00:834::/64 label 200 # dst-A -prefix 2001:6f8:900:8cbc::/64 label 300 # src-B -prefix 2001:6f8:12d8:2::/64 label 200 # src-A -prefix 2001::/32 label 6 -prefix 2001:10::/28 label 7 -prefix 2002::/16 label 2 -prefix fc00::/7 label 5 -prefix ::/0 label 1 |
Und dann nochmal eine Verbindung zum Server versucht wird
$ telnet st1.bieringer.de -Trying 2001:4dd0:ff00:834::2... (dst-A) -... -Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B) -... |
tcpdump mit filter “tcp and dst port 23” zeigt nun die Benutzung beider Quell-IPv6-Adressen wie konfiguriert
IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.37765 > 2001:4dd0:ff00:834::2.telnet: (src-A -> dst-A) -IP6 2001:6f8:900:8cbc:5054:ff:fefb:6582.39632 > 2a01:238:423d:8800:85b3:9e6b:3019:8909.telnet: (src-B -> dst-B) |
Persistente Konfiguration von “ip addrtable” ist wahrscheinlich in aktuellen Linux-Distributionen nicht unterstützt, somit wäre eine Erweiterung der Netzwerk-Init-Scripts oder rc.local notwendig. Ein Skript, welches Informationen aus /etc/gai.conf in entsprechendes “ip addrtable” umwandelt, gibt es hier: /etc/gai.conf - it ain't what you think it is
Es ist immer von Interesse welche Sockets eines Knotens gerade aktiv sind. Mit “netstat” können Sie die betreffenden Informationen abfragen:
Verwendete Optionen: -nlptu
Beispiel:
# netstat -nlptu -Active Internet connections (only servers) -Proto Recv-Q Send-Q Local Address Foreign Address State -¬ PID/Program name -tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN -¬ 1258/rpc.statd -tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN -¬ 1502/rpc.mountd -tcp 0 0 0.0.0.0:515 0.0.0.0:* LISTEN -¬ 22433/lpd Waiting -tcp 0 0 1.2.3.1:139 0.0.0.0:* LISTEN -¬ 1746/smbd -tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -¬ 1230/portmap -tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN -¬ 3551/X -tcp 0 0 1.2.3.1:8081 0.0.0.0:* LISTEN -¬ 18735/junkbuster -tcp 0 0 1.2.3.1:3128 0.0.0.0:* LISTEN -¬ 18822/(squid) -tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN -¬ 30734/named -tcp 0 0 ::ffff:1.2.3.1:993 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 :::13 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 ::ffff:1.2.3.1:143 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 :::53 :::* LISTEN -¬ 30734/named -tcp 0 0 :::22 :::* LISTEN -¬ 1410/sshd -tcp 0 0 :::6010 :::* LISTEN -¬ 13237/sshd -udp 0 0 0.0.0.0:32768 0.0.0.0:* -¬ 1258/rpc.statd -udp 0 0 0.0.0.0:2049 0.0.0.0:* -¬ - -udp 0 0 0.0.0.0:32770 0.0.0.0:* -¬ 1502/rpc.mountd -udp 0 0 0.0.0.0:32771 0.0.0.0:* -¬ - -udp 0 0 1.2.3.1:137 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:137 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 1.2.3.1:138 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:138 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:33044 0.0.0.0:* -¬ 30734/named -udp 0 0 1.2.3.1:53 0.0.0.0:* -¬ 30734/named -udp 0 0 127.0.0.1:53 0.0.0.0:* -¬ 30734/named -udp 0 0 0.0.0.0:67 0.0.0.0:* -¬ 1530/dhcpd -udp 0 0 0.0.0.0:67 0.0.0.0:* -¬ 1530/dhcpd -udp 0 0 0.0.0.0:32858 0.0.0.0:* -¬ 18822/(squid) -udp 0 0 0.0.0.0:4827 0.0.0.0:* -¬ 18822/(squid) -udp 0 0 0.0.0.0:111 0.0.0.0:* -¬ 1230/portmap -udp 0 0 :::53 :::* -¬ 30734/named |
Hier folgen einige Beispiele von (mit tcpdump) aufgezeichneten Paketen, die hoffentlich bei Ihrer Fehlersuche nützlich sein können.
... mehr Beispiele in den nächsten Versionen...
15:43:49.484751 fe80::212:34ff:fe12:3450 > ff02::1: icmp6: router -¬ advertisement(chlim=64, router_ltime=30, reachable_time=0, -¬ retrans_time=0)(prefix info: AR valid_ltime=30, preffered_ltime=20, -¬ prefix=2002:0102:0304:1::/64)(prefix info: LAR valid_ltime=2592000, -¬ preffered_ltime=604800, prefix=2001:0db8:0:1::/64)(src lladdr: -¬ 0:12:34:12:34:50) (len 88, hlim 255) |
Der Router mit der link-lokalen Adresse “fe80::212:34ff:fe12:3450” sendet eine Ankündigung mit zwei Präfixes “2002:0102:0304:1::/64” (Lebensdauer 30s) und “2001:0db8:0:1::/64” (Lebensdauer 2592000s) sowie der eigenen Schicht 2 MAC Adresse “0:12:34:12:34:50” an die all-node-on-link Multicast Adresse “ff02::1”.
15:44:21.152646 fe80::212:34ff:fe12:3456 > ff02::2: icmp6: router solicitation -¬ (src lladdr: 0:12:34:12:34:56) (len 16, hlim 255) |
Der Knoten mit der link-lokalen Adresse “fe80:212:34ff:fe12:3456” und der Schicht 2 MAC Adresse “0:12:34:12:34:56” sucht nach einem Router und sendet hierfür diese Anfrage an die all-router-on-link Multicast Adresse “ff02::2”.
Folgende Pakete werden vom Knoten mit der Schicht 2 MAC Adresse “0:12:34:12:34:56” während der automatischen Konfiguration an die solicited-node link-lokale Multicast Adresse gesendet. Es wird überprüft, ob eine potentielle Adresse bereits von einem anderen Knoten am Link verwendet wird.
Der Knoten will seine link-lokale Adresse “fe80:212:34ff:fe12:3456” konfigurieren und überprüft auf Duplikate
15:44:17.712338 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ fe80::212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim 255) |
Der Knoten will seine globale Adresse “2002:0102:0304:1:212:34ff:fe12:3456” konfigurieren (nach Empfang eines Advertisements wie weiter oben abgebildet) und überprüft auf Duplikate
15:44:21.905596 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ 2002:0102:0304:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, -¬ hlim 255) |
Der Knoten will seine globale Adresse “2001:0db8:0:1:212:34ff:fe12:3456” konfigurieren (nach Empfang eines Advertisements wie weiter oben abgebildet) und überprüft auf Duplikate
15:44:22.304028 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ 2001:0db8:0:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim -¬ 255) |
Der Knoten möchte Pakete an die Adresse “2001:0db8:0:1::10” senden, hat hierfür aber keine Schicht 2 MAC Adresse und sendet aus diesem Grund zuerst eine Anfrage
13:07:47.664538 2002:0102:0304:1:2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6: -¬ neighbor sol: who has 2001:0db8:0:1::10(src lladdr: 0:e0:18:90:92:5) (len 32, -¬ hlim 255) |
Der Knoten sucht nun nach der Adresse “fe80::10”
13:11:20.870070 fe80::2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6: neighbor -¬ sol: who has fe80::10(src lladdr: 0:e0:18:90:92:5) (len 32, hlim 255) |
Einige Linux-Distributionen unterstützen bereits eine permanente IPv6 Konfiguration. Hierbei werden sowohl bestehende oder als auch neue Konfiguration- und Skriptdateien verwendet sowie tlw. IPv4 Skripte abgeändert.
Seitdem der Autor begann das IPv6 & Linux - HowTo zu schreiben, war es seine Absicht eine permanente IPv6 Konfiguration zu ermöglichen, wobei die gebräuchlichsten Anwendungsszenarien wie Host-only, Router-only, Dual-homed-host, Router mit einem zweiten Netzwerkstrang, normale Tunnel, 6to4 Tunnel, etc. abgedeckt sein sollten. Heute gibt es eine Sammlung von Konfigurations- und Skriptdateien, die genau diesem Zweck erfüllen (es wurden nie echte Probleme gemeldet, allerdings ist unbekannt von wie vielen Personen dieses Set benutzt wird). Diese Dateien werden von Zeit zu Zeit erweitert und es gibt inzwischen eine eigene Homepage hierfür: initscripts-ipv6 homepage (Spiegel). Da der Autor seine ersten Schritte mit IPv6 auf einem Red Hat Linux 5.0 Klon gemacht habe, basieren seine IPv6 Entwicklungssysteme heute zumeist auf Red Hat Linux und die Skriptdateien sind folglich primär für diese Distributionen gedacht. Es war ebenfalls sehr einfach bestehende Konfigurationsdateien zu erweitern, neue zu erstellen und den Start des IPv6 Setup in das IPv4 Setup einzubetten.
Erfreulicherweise beinhaltet Red Hat Linux seit der Version 7.1 die IPv6-Skripts des Autors. Unterstützt wurde dies und wird auch weiterhin von Pekka Savola.
Bei Mandrake ist ab Version 8.0 ebenfalls ein IPv6-fähiges initscript Paket beinhaltet, ein kleiner Fehler verhindert aber nach wie vor die Anwendung (“ifconfig” vermisst “inet6” vor “add”).
Sie können überprüfen, ob Ihre Distribution eine permanente IPv6 Konfiguration unter Verwendung der Skript-Sammlung des Autors unterstützt. Folgende script library sollte existieren:
/etc/sysconfig/network-scripts/network-functions-ipv6 |
Automatischer Test:
# test -f /etc/sysconfig/network-scripts/network-functions-ipv6 && echo "Main -¬ IPv6 script library exists" |
Die Versionsnummer der Library ist von Interesse, wenn Sie Features vermissen sollten. Die Versionsnummer können Sie anzeigen, indem Sie folgenden Befehl ausführen (einfacher ist es sicherlich, wenn Sie im Header der Datei nachlesen):
# source /etc/sysconfig/network-scripts/network-functions-ipv6 && -¬ getversion_ipv6_functions -20011124 |
Im obigen Beispiel ist die Versionsnummer 20011124. Um zu sehen, was sich inzwischen geändert hat, können Sie hier die neuesten Informationen nachlesen: initscripts-ipv6 homepage (Spiegel). Sie finden hier auch ein Change-Log.
Überprüfen Sie, ob das IPv6 Modul auf Ihrem System bereits geladen ist:
# modprobe -c | grep net-pf-10 -alias net-pf-10 off |
Ist das Ergebnis “off”, dann aktivieren Sie IPv6 durch hinzufügen folgender Zeile in /etc/sysconfig/network
NETWORKING_IPV6=yes |
Rebooten bzw. starten Sie das Netzwerk neu mit dem Befehl
# service network restart |
Nun sollte das IPv6 Modul geladen sein
# modprobe -c | grep ipv6 -alias net-pf-10 ipv6 |
Ist ihr System an einem Link, der Router Advertisements liefert, dann wird die automatische Konfiguration automatisch durchgeführt. Zusätzlich Informationen darüber, welche Einstellungen unterstützt werden finden Sie in der Datei /usr/share/doc/initscripts-$version/sysconfig.txt.
Seit neueren 7.x Versionen gibt es eine wirklich rudimentäre Unterstützung für IPv6, siehe /etc/rc.config für Details.
Aufgrund der komplett unterschiedlichen Struktur der Konfigurations- und Scriptdateien ist es sehr schwer (oder unmöglich) das Set für Red Hat Linux und seine Klone mit dieser Distribution zu verwenden. -In Version 8.x wurde das Konfigurations-Setup bei SuSE komplett abgeändert.
Editiere Datei /etc/sysconfig/network/ifcfg-<Interface-Name> und setze folgende Variable entsprechend
IP6ADDR="<ipv6-Adresse>/<prefix>" |
Editiere Datei /etc/sysconfig/network/ifcfg-<Interface-Name> und setze folgende Variable entsprechend
IPADDR="<ipv6-Adresse>/<prefix>" |
Folgende Information wurde von Stephane Bortzmeyer <bortzmeyer at nic dot fr> beigesteuert.
Überprüfe, ob IPv6 aktiv ist, entweder weil es in den Kernel hineinkompilier oder das Modul geladen wurde. Für die letzte Möglichkeit gibt es 3 Lösungen: Editieren der Datei /etc/modules, Benutzung des Features pre-up (siehe unten) oder Benutzung von kmod (wird hier nicht weiter erklärt).
Konfiguriere die Schnittstelle (hier im Beispiel: eth0). Editiere /etc/network/interfaces :
iface eth0 inet6 static - pre-up modprobe ipv6 - address 2001:0db8:1234:5::1:1 - # To suppress completely autoconfiguration: - # up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf - netmask 64 - # The router is autoconfigured and has no fixed address. - # It is magically - # found. (/proc/sys/net/ipv6/conf/all/accept_ra). Otherwise: - #gateway 2001:0db8:1234:5::1 |
Danach rebooten oder folgendes Kommando ausführen
# ifup --force eth0 |
Danach sollte die statische IPv6-Adresse konfiguriert sein.
Jean-Marc V. Liotier's HOWTO for Freenet6 & Debian Users (am 24.12.2002 in der mailinglist users@ipv6.org angekündigt)
Wird unterstützt und kann bei der zugewiesenen link-lokalen Adressen beobachtet werden, sobald ein IPv6 fähiges Interface aktiv ist.
Beispiel:
# ip -6 addr show dev eth0 scope link -2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qlen1000 - inet6 fe80::211:d8ff:fe6b:f0f5/64 scope link - valid_lft forever preferred_lft forever |
Mehr Infos hierzu in späteren Versionen. Siehe unten im Abschnitt radvd daemon autoconfiguration.
Nach einer langen Zeit der Diskussion wurde RFC 3315 / Dynamic Host Configuration Protocol for IPv6 (DHCPv6) verabschiedet. Momentan (10/2005) existieren 2 Implementierungen:
Dibbler von Tomasz Mrugalski <thomson at klub dot com dot pl>(Tipps zur Konfiguration)
Die Unterstützung für IPv6-Mobilität in Linux kann durch die Installation der MIPL2-Implementierung aktviert werden, welche hier zu finden ist: http://www.mobile-ipv6.org/
Diese Implementierung ist konform zur RFC 3775. Sie besteht aus einem Kernel-Patch und einen Mobilitäts-Daemon (genannt mip6d). Die Version 2.0.1 passt für Linux kernel 2.6.15.
Installation und Setup sind im Linux Mobile IPv6 HOWTO beschrieben.
Zusätzlich existiert die Implementierung der Netzwerk-Mobilität für Linux, genannt NEPL, und basiert auf MIPL. Diese steht auch zur Verfügung unter: http://www.mobile-ipv6.org/.
Folgendes HOWTO Dokument beschreibt Setup und Konfiguration: http://www.nautilus6.org/doc/nepl-howto/.
Mobile IPv6 for Linux (MIPL) project: http://www.mobile-ipv6.org/
Nautilus6 working group: http://nautilus6.org/
Fast Handovers for Mobile IPv6 for Linux project: http://www.fmipv6.org/
USAGI-patched Mobile IPv6 for Linux (UMIP):http://umip.linux-ipv6.org/
Deploying IPsec/IKE-protected MIPv6 under Linux:http://natisbad.org/MIPv6/
RFC 3776 / Using IPsec to Protect Mobile IPv6 Signaling Between Mobile Nodes and Home Agents
HIP Implementierungen: http://infrahip.hiit.fi/, http://hip4inter.net/, http://www.openhip.org/
Die IPv6 Firewall-Funktionalität ist wichtig; vor allem dann, wenn Sie auf Ihren internen Netzen IPv6 mit globalen IPv6 Adressen einsetzen. In IPv6 werden - im Unterschied zu IPv4, wo interne Hosts automatisch durch private IPv6 Adressen geschützt werden (RFC 1918 / Address Allocation for Private Internets bzw. Google search for Microsoft + APIPA) - globale Adressen verwendet und jeder mit IPv6-Anbindung kann alle internen Knoten, bei denen IPv6 aktiv ist, erreichen.
Von Haus aus unterstützt wird die IPv6-Firewall-Funktionalität im Kernel erst ab Version 2.4+. In älteren 2.2+ Versionen können sie nur mit Protocol 41 das generelle Tunnel von IPv6-in-IPv4-Paketen filtern.
Achtung: Es gibt keine Garantie, dass die beschriebenen Regeln und Beispiele ihr System auch wirklich schützen können!
Beobachten Sie nach der Installation ihr Regelset, siehe Abschnitt Abschnitt 19.3.
Kernels ab Version 2.6.20 (Februar 2007) unterstützen den IPv6-Verbindungsstatus (connection tracking) vollständig.
Kernels ab Version 3.9.0 (April 2013) unterstützen NAT für IPv6 in Verbindung mit ip6tables >= 1.4.18
Kernels ab Version 3.13 (April 2014) unterstützen ein neues Framework namens: nftables
Dies ist nur notwendig, wenn der mitgelieferte Kernel und Netfilter nicht den Ansprüchen genügt und neue Featurs bereits verfügbar sind, jedoch noch nicht beinhaltet.
Besorgen Sie sich den aktuellsten Kernel: http://www.kernel.org/
Besorgen Sie sich das aktuellste iptables Paket:
Source tarball (für Kernel Patches): http://www.netfilter.org/
Wechseln Sie in das Source-Verzeichnis:
# cd /path/to/src |
Entpacken sie die Kernel-Quellen und vergeben diesen einen neuen Namen
# tar z|jxf kernel-version.tar.gz|bz2 -# mv linux linux-version-iptables-version+IPv6 |
Entpacken Sie die iptables Quellen
# tar z|jxf iptables-version.tar.gz|bz2 |
Wechseln Sie in das iptables Verzeichnis
# cd iptables-version |
Fügen Sie relevante Patches hinzu
# make pending-patches KERNEL_DIR=/path/to/src/linux-version-iptables-version/ |
Fügen Sie zusätzliche IPv6 relevante IPv6 Patches hinzu (die nach wie vor nicht im Standard-Kernel enthalten sind)
# make patch-o-matic KERNEL_DIR=/path/to/src/linux-version-iptables-version/ |
Sagen Sie zu folgenden Optionen (iptables-1.2.2) Ja:
ah-esp.patch
masq-dynaddr.patch (nur benötigt bei Systemen mit dynamischer IP-Zuweisung am WAN mittels PPP oder PPPoE)
ipv6-agr.patch.ipv6
ipv6-ports.patch.ipv6
LOG.patch.ipv6
REJECT.patch.ipv6
Überprüfen Sie die Erweiterungen
# make print-extensions -Extensions found: IPv6:owner IPv6:limit IPv6:mac IPv6:multiport |
Wechseln Sie zu den Kernel-Quellen
# cd /path/to/src/linux-version-iptables-version/ |
Editieren Sie das Makefile
- EXTRAVERSION = -+ EXTRAVERSION = -iptables-version+IPv6-try |
Starten Sie configure und aktivieren Sie IPv6 relevante Optionen
Code maturity level options - Prompt for development and/or incomplete code/drivers : yes - Networking options - Network packet filtering: yes - The IPv6 protocol: module - IPv6: Netfilter Configuration - IP6 tables support: module - All new options like following: - limit match support: module - MAC address match support: module - Multiple port match support: module - Owner match support: module - netfilter MARK match support: module - Aggregated address check: module - Packet filtering: module - REJECT target support: module - LOG target support: module - Packet mangling: module - MARK target support: module |
Konfigurieren Sie bei Bedarf Sonstiges abseits von IPv6.
Kompilieren und Installation: siehe Kapitel Kernel sowie andere HOWTOs.
Stellen Sie sicher, dass obige Kernel-Sourceverzeichnisstruktur unter /usr/src/linux liegt
Benennen sie das ältere Verzeichnis um
# mv /usr/src/linux /usr/src/linux.old |
Erstellen Sie einen neuen symbolischen Link
# ln -s /path/to/src/linux-version-iptables-version /usr/src/linux |
Erstellen Sie ein neues SRPMS
# rpm --rebuild /path/to/SRPMS/iptables-version-release.src.rpm |
Installieren Sie das neue iptables Paket (iptables + iptables-ipv6)
Bei RH 7.1 Systemen ist normalerweise eine ältere Version hiervon bereits installiert, verwenden Sie daher die Option “Freshen”:
# rpm -Fhv /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm |
Ist keine ältere Version installiert, benutzen Sie die Option “install”:
# rpm -ihv /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm |
Bei RH 6.2 Systemen ist normalerweise kein Kernel Version 2.4.x installiert und die Anforderungen sind demnach nicht gegeben. Benutzen Sie in diesem Fall “nodeps”:
# rpm -ihv --nodeps /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm |
Damit iptables die Libraries finden kann, ist es eventuell notwendig, einen symbolischen Link für die iptables Libraries zu erstellen:
# ln -s /lib/iptables/ /usr/lib/iptables |
Laden Sie das Modul (falls dies im Kernel so kompiliert wurde):
# modprobe ip6_tables |
Überprüfen der IPv6-Unterstützung:
# [ ! -f /proc/net/ip6_tables_names ] && echo "Current kernel doesn't support -¬ 'ip6tables' firewalling (IPv6)!" |
Kurze Auflistung:
# ip6tables -L |
Erweiterte Auflistung:
# ip6tables -n -v --line-numbers -L |
# ip6tables --table filter --append INPUT -j LOG --log-prefix "INPUT:" -¬ --log-level 7 |
# ip6tables --table filter --append INPUT -j DROP |
Seit Kernel-Version 2.6.20 ist die Auswertung des IPv6-Verbindungsstatus gut unterstützt. Die bis dahin statuslosen Filterregeln sollten ersetzt werden..
# ip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |
Bei älteren Kernelversionen (unpatched kernel 2.4.5 und iptables-1.2.2) kann keine nähere Spezifizierung des ICMPv6-Typs vorgenommen werden:
Eingehender ICMPv6 Verkehr durch Tunnel erlauben
# ip6tables -A INPUT -i sit+ -p icmpv6 -j ACCEPT |
Ausgehenden ICMPv6 Verkehr durch Tunnel erlauben
# ip6tables -A OUTPUT -o sit+ -p icmpv6 -j ACCEPT |
Neuere Kernel erlauben das Spezifizieren des ICMPv6-Typs:
# ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT |
Da es zu einem ICMPv6 Storm kommen kann (der Autor hat dies bereits mehrfach beobachtet), sollten sie das rate limiting zumindest für das ICMP Regelset einsetzen. Zusätzlich sollten auch die Logging Regeln mit rate limiting geschützt werden, um DoS Attacken gegen das syslog sowie gegen die Logdateien enthaltenden Patitionen entgegenzuwirken. Ein Beispiel für ein rate limited ICMPv6 sieht wie folgt aus:
# ip6tables -A INPUT --protocol icmpv6 --icmpv6-type echo-request -¬ -j ACCEPT --match limit --limit 30/minute |
Im folgenden Beispiel werden eingehende SSH-Verbindungen von einer speziellen IPv6 Adresse zugelassen:
Eingehende SSH Verbindungen werden von der Adresse 2001:0db8:100::1/128 erlaubt
# ip6tables -A INPUT -i sit+ -p tcp -s 2001:0db8:100::1/128 --sport 512:65535 -¬ --dport 22 -j ACCEPT |
Erlaube Antwortpakete (nicht mehr notwendig, wenn der IPv6-Verbindungsstatus ausgewertet wird!)
# ip6tables -A OUTPUT -o sit+ -p tcp -d 2001:0db8:100::1/128 --dport 512:65535 -¬ --sport 22 ! --syn -j ACCEPT |
Um getunnelte IPv6-in-IPv4 Pakete zu akzeptieren, müssen Sie in Ihrem IPv4 Firewall-Setup entsprechende Regeln einzufügen, z.B.
Akzeptiere eingehende IPv6-in-IPv4 Daten am interface ppp0
# iptables -A INPUT -i ppp0 -p ipv6 -j ACCEPT |
Akzeptiere ausgehende IPv6-in-IPv4 Daten am interface ppp0
# iptables -A OUTPUT -o ppp0 -p ipv6 -j ACCEPT |
Haben Sie nur einen statischen Tunnel, dann können sie die IPv4 Adresse auch dediziert angeben:
Akzeptiere eingehende IPv6-in-IPv4 Daten vom Tunnel-Endpunkt 192.0.2.2 am interface ppp0
# iptables -A INPUT -i ppp0 -p ipv6 -s 192.0.2.2 -j ACCEPT |
Akzeptiere ausgehende IPv6-in-IPv4 Daten vom Tunnel-Endpunkt 192.0.2.2 am interface ppp0
# iptables -A OUTPUT -o ppp0 -p ipv6 -d 192.0.2.2 -j ACCEPT |
SEHR EMPFOHLEN! Aus Sicherheitsgründen sollten Sie auf jeden Fall eine Regel inkludieren, wodurch eingehende TCP-Verbindungs-Anfragen geblockt werden. Wenn Sie andere Interfacenamen verwenden, müssen Sie die Option "-i" entsprechend anpassen!
Blockiere eingehende TCP-Verbindungs-Anfragen zu diesem Host
# ip6tables -I INPUT -i sit+ -p tcp --syn -j DROP |
Blockiere eingehende TCP-Verbindungs-Anfragen zu Hosts hinter diesem Router
# ip6tables -I FORWARD -i sit+ -p tcp --syn -j DROP |
Eventuell müssen diese Regeln unterhalb anderer Regeln platziert werden. Nehmen Sie sich für die Reihenfolge der Regeln etwas Zeit. Sinnvoll wird es auch sein, ein Script mit den Regeln zu erstellen, damit die Regeln in der gewünschten Reihenfolge angewendet werden.
EBENFALLS SEHR EMPHOLEN! Wie bereits im Kapitel Firewall erwähnt, ist es möglich die Ports bei ausgehenden UDP/TCP-Verbindungen zu kontrollieren. Im Falle, dass all Ihre IPv6 Systeme lokale Ports verwenden, z.B. von 32768 bis 60999, dann können sie ebenfalls UDP Verbindungen filtern (bis das Verbindungs-Tracking funktioniert):
Blockiere eingehende UDP-Pakete, die nicht Antworten ausgehender Anfragen dieses Host sein können
# ip6tables -I INPUT -i sit+ -p udp ! --dport 32768:60999 -j DROP |
Blockiere eingehende UDP-Pakete, die nicht Antworten auf Anfragen von hinter diesem Router gelegenen Hosts sein können
# ip6tables -I FORWARD -i sit+ -p udp ! --dport 32768:60999 -j DROP |
Folgende Zeilen zeigen eine einfache Firewall-Konfiguration für Fedora 6 (ab Kernel-Version 2.6.20). Ausgehend von dem Origina (generiert durch system-config-firewall) wurden Modifikationen für die Unterstützung des Verbindungsstatus und der Rückgabe der passenden ICMPv6-Meldung für Rejects. Eingehende SSH (Port 22) Verbindungen sind erlaubt.
Datei: /etc/sysconfig/ip6tables - -*filter :INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] -:RH-Firewall-1-INPUT - [0:0] --A INPUT -j RH-Firewall-1-INPUT --A FORWARD -j RH-Firewall-1-INPUT --A RH-Firewall-1-INPUT -i lo -j ACCEPT --A RH-Firewall-1-INPUT -p icmpv6 -j ACCEPT --A RH-Firewall-1-INPUT -p 50 -j ACCEPT --A RH-Firewall-1-INPUT -p 51 -j ACCEPT --A RH-Firewall-1-INPUT -p udp --dport 5353 -d ff02::fb -j ACCEPT --A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT --A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT --A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT --A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT --A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-adm-prohibited -COMMIT |
Zwecks der Vollständigkeit ist hier auch die entsprechende Konfiguration für IPv4 gezeigt:
Datei: /etc/sysconfig/iptables - -*filter :INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] -:RH-Firewall-1-INPUT - [0:0] --A INPUT -j RH-Firewall-1-INPUT --A FORWARD -j RH-Firewall-1-INPUT --A RH-Firewall-1-INPUT -i lo -j ACCEPT --A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT --A RH-Firewall-1-INPUT -p 50 -j ACCEPT --A RH-Firewall-1-INPUT -p 51 -j ACCEPT --A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT --A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT --A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT --A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT --A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT --A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited -COMMIT |
Benutzung:
Erzeugen/Modifizieren der Konfigurationsdateien
Aktivieren von IPv4 & IPv6 Firewalling
# service iptables start -# service ip6tables start |
Aktivieren des automatischen Starts nach dem Reboot
# chkconfig iptables on -# chkconfig ip6tables on |
Folgende Zeilen zeigen ein umfangreicheres Setup. Happy netfilter6 Regelset erstellen...
# ip6tables -n -v -L -Chain INPUT (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination - 0 0 extIN all sit+ * ::/0 ::/0 - 4 384 intIN all eth0 * ::/0 ::/0 - 0 0 ACCEPT all * * ::1/128 ::1/128 - 0 0 ACCEPT all lo * ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `INPUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain FORWARD (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination -¬ - 0 0 int2ext all eth0 sit+ ::/0 ::/0 - 0 0 ext2int all sit+ eth0 ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `FORWARD-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain OUTPUT (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination -¬ - 0 0 extOUT all * sit+ ::/0 ::/0 - 4 384 intOUT all * eth0 ::/0 ::/0 - 0 0 ACCEPT all * * ::1/128 ::1/128 - 0 0 ACCEPT all * lo ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `OUTPUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain ext2int (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `ext2int-default:' - 0 0 DROP tcp * * ::/0 ::/0 - 0 0 DROP udp * * ::/0 ::/0 - 0 0 DROP all * * ::/0 ::/0 - -Chain extIN (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT tcp * * 3ffe:400:100::1/128 ::/0 -¬ tcp spts:512:65535 dpt:22 - 0 0 ACCEPT tcp * * 3ffe:400:100::2/128 ::/0 -¬ tcp spts:512:65535 dpt:22 - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02 - 0 0 ACCEPT udp * * ::/0 ::/0 -¬ udp spts:1:65535 dpts:1024:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `extIN-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain extOUT (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT tcp * * ::/0 -¬ 2001:0db8:100::1/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02 - 0 0 ACCEPT tcp * * ::/0 -¬ 2001:0db8:100::2/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02 - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1024:65535 dpts:1:65535 - 0 0 ACCEPT udp * * ::/0 ::/0 -¬ udp spts:1024:65535 dpts:1:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `extOUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain int2ext (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1024:65535 dpts:1:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `int2ext:' - 0 0 DROP all * * ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `int2ext-default:' - 0 0 DROP tcp * * ::/0 ::/0 - 0 0 DROP udp * * ::/0 ::/0 - 0 0 DROP all * * ::/0 ::/0 - -Chain intIN (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT all * * ::/0 -¬ fe80::/ffc0:: - 4 384 ACCEPT all * * ::/0 ff02::/16 - -Chain intOUT (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT all * * ::/0 -¬ fe80::/ffc0:: - 4 384 ACCEPT all * * ::/0 ff02::/16 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `intOUT-default:' - 0 0 DROP all * * ::/0 ::/0 |
Seit mindestens Linux Kernel-Version 3.9.0 und ip6tables ab 1.4.18 kann Network Address Translation (NAT) genutzt werden.
Wie bei IPv4 können Systeme hinter einem Router versteckt werden mit Hilfe von IPv6 Maskierung (hide/overlap NAT), z.B.
# ip6tables -t nat -A POSTROUTING -o sixxs -s fec0::/64 -j MASQUERADE |
Eine dedizierte öffentliche IPv6-Adresse kann zu einer internen IPv6-Adresse weitergeleitet werden, z.B.
# ip6tables -t nat -A PREROUTING -d 2001:db8:0:1:5054:ff:fe01:2345 -i sixxs -j DNAT --to-destination fec0::5054:ff:fe01:2345 |
Ein dedizierter Port kann zu einem internen System weitergeleitet werden, z.B.
# ip6tables -t nat -A PREROUTING -i sixxs -p tcp --dport 8080 -j DNAT --to-destination [fec0::1234]:80 |
Mit nftables wurde die Unterstützung einer Tabelle names “inet” eingeführt in welcher Regeln für IPv4/IPv6 gleichzeitig gelten
Installieren einer Linux-Distribution, welche die Unterstützung für nftables bereits eingebaut hat. Beim Schreiben dieses Absatzes (Mai 2014) war mindestens Fedora Rawhide (Vorläufer der Version 21) mit entsprechendem Support und nftables version 0.2.0 versehen.
Laden der Kernel-Module:
# modprobe nf_tables -# modprobe nf_tables_ipv4 -# modprobe nf_tables_ipv6 -# modprobe nf_tables_inet |
Löschen der Regeln in iptables and ip6tables um Interferenzen zu vermeiden:
# iptables -F -# ip6tables -F |
Erzeugen der Filter-Tabelle:
# nft add table inet filter |
Erzeugen einer input chain in der Filter-Tabelle:
# nft add chain inet filter input { type filter hook input priority 0 \; } |
Erlauben von Paketen, die zu existierenden Einträgen in der Connection-Tracking-Tabelle gehören
# nft add rule inet filter input ct state established,related counter accept |
Erlauben von IPv4 und IPv6 ICMP echo-request (aka ping)
# nft add rule inet filter input meta nfproto ipv4 icmp type { echo-request } counter accept -# nft add rule inet filter input meta nfproto ipv6 icmpv6 type echo-request counter accept |
Erlauben einiger wichtiger IPv6 ICMP Pakete, ohne Zähler, dafür mit Hop-Limit-Prüfung (erhöht die Sicherheit)
# nft add rule inet filter input meta nfproto ipv6 -¬ icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} ip6 hoplimit 1 accept -# nft add rule inet filter input meta nfproto ipv6 -¬ icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} ip6 hoplimit 255 counter accept |
Erlauben von eingehenden SSH-Verbindungen für IPv4 und IPv6
# nft add rule inet filter input tcp dport 22 ct state new tcp flags \& \(syn \| ack\) == syn counter accept |
Reject/drop anderer Pakete
# nft add rule inet filter input tcp dport 0-65535 reject -# nft add rule inet filter input udp dport 0-65535 counter drop -# nft add rule inet filter input counter drop |
Tabelle für IP unabhängigen Filter
table inet filter { - chain input { - type filter hook input priority 0; - ct state established,related counter packets 0 bytes 0 accept - ip protocol icmp icmp type { echo-request} counter packets 0 bytes 0 accept - ip6 nexthdr ipv6-icmp icmpv6 type echo-request counter packets 0 bytes 0 accept - ip6 nexthdr ipv6-icmp ip6 hoplimit 1 icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} accept - ip6 nexthdr ipv6-icmp ip6 hoplimit 255 icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} accept - tcp dport ssh ct state new tcp flags & (syn | ack) == syn counter packets 0 bytes 0 accept - tcp dport >= 0 tcp dport <= 65535 counter packets 0 bytes 0 reject - udp dport >= 0 udp dport <= 65535 counter packets 0 bytes 0 drop - log prefix counter packets 0 bytes 0 drop - } -} |
Für Logging wird ein zusätzliches Kernelmodul benötigt:
# modprobe xt_LOG |
ACHTUNG, MOMENTAN KANN DER LOG-LEVEL NICHT ANGEGEBEN WERDEN, dadurch werden nftables-Ereignisse mit Log-Level kern.emerg ausgegeben - ES BESTEHT DIE GEFAHR, DASS DIE KONSOLE DADURCH ÜBERFLUTET WIRD!
Für erste Tests mit der Log-Option kann es nützlich sein, das Loggens für emergency-Ereignisse in z.B. /etc/rsyslog.conf zu deaktivieren mit Hilfe eines “#” am Anfang der Zeile und Neustart des logging-Daemons
#*.emerg :omusrmsg:* |
Regel von oben, welche SSH auf Port 22 erlaubt, nun mit Logging:
# nft add rule inet filter input tcp dport 22 ct state new tcp flags \& \(syn \| ack\) == syn log prefix \"inet/input/accept: \" counter accept |
Wie oben schon beschrieben, wenn die Regeln in den einzelnen Tabellen konfiguriert werden, muss gesichert sein, dass frühere “accepts” nicht aufgehoben werden. Eine einfache Lösung ist die Benutzung von Markierungen. Regeln, die Pakete erlauben, setzen die Marke mit “meta mark set xxxx”. Eine generische Regel erlaubt Pakete mit gesetzter Marke “mark xxxx”. Beispiel für ein resultierendes Filter-Regelwerk:
# for table in ip ip6 inet; do nft list table $table filter; done -table ip filter { - chain input { - type filter hook input priority 0; - ct state established,related counter packets 241 bytes 25193 accept - counter packets 2 bytes 120 mark 0x00000100 accept - icmp type { echo-request} counter packets 0 bytes 0 meta mark set 0x00000100 accept - } -} -table ip6 filter { - chain input { - type filter hook input priority 0; - ct state established,related counter packets 14 bytes 4077 accept - counter packets 4 bytes 408 mark 0x00000100 accept - icmpv6 type echo-request counter packets 1 bytes 104 meta mark set 0x00000100 - icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} counter packets 2 bytes 224 meta mark set 0x00000100 accept - } -} -table inet filter { - chain input { - type filter hook input priority 0; - ct state established,related counter packets 307 bytes 31974 accept - counter packets 6 bytes 528 mark 0x00000100 accept - tcp dport ssh ct state new tcp flags & (syn | ack) == syn log prefix "inet/input/accept: " meta mark set 0x00000100 counter packets 3 bytes 200 accept - log prefix "inet/input/reject: " counter packets 0 bytes 0 reject - } -} |
Es wird sehr empfohlen alle verfügbaren Patches einzuspielen sowie alle nicht benötigten Dienste zu deaktivieren. Ebenfalls sollten Sie lokales firewalling aktivieren und binden Sie die Dienste ausschließlich an benötigte IPv4/IPv6 Adressen.
Mehr Infos hierzu in späteren Versionen.
Viele Dienste setzen die tcp_wrapper Bibliothek für die Zugangskontrolle ein. Eine Beschreibung finden Sie unter use of tcp_wrapper.
Mehr Infos hierzu in späteren Versionen.
Aktuell gibt es keine komfortablen Sicherheitstools mit denen man ein System über ein Netzwerk nach IPv6 relevanten Sicherheitslücken hin überprüfen kann. Weder Nessus noch irgendein kommerzieller Security Scanner ist zur Zeit dazu in der Lage, IPv6-Adressen scannen zu können.
ACHTUNG: Bitte stellen Sie immer sicher, dass Sie ausschließlich ihr eigenes Netzwerk scannen oder einen Scan nur nach Erhalt einer schriftlichen Erlaubnis durchführen. Andernfalls haben sie mit rechtlichen Konsequenzen zu rechnen! -ÜBERPRÜFEN Sie die Ziel-IPv6-Adresse ZWEIMAL, bevor Sie einen Scan starten.
Mit dem IPv6 fähigen netcat (siehe IPv6+Linux-status-apps/security-auditing für Details) können Sie einen Portscan durchführen. Es wird ein Script abgearbeitet, wobei u.a. ein Port-Bereich überprüft und Banners mitprotokolliert werden. Anwendungsbeispiel:
# nc6 ::1 daytime -13 JUL 2002 11:22:22 CEST |
NMap, einer der weltweit besten Portscanner, unterstützt IPv6 seit der Version 3.10ALPHA1. Anwendungsbeispiel:
# nmap -6 -sT ::1 -Starting nmap V. 3.10ALPHA3 ( www.insecure.org/nmap/ ) -Interesting ports on localhost6 (::1): -(The 1600 ports scanned but not shown below are in state: closed) -Port State Service -22/tcp open ssh -53/tcp open domain -515/tcp open printer -2401/tcp open cvspserver -Nmap run completed -- 1 IP address (1 host up) scanned in 0.525 seconds |
Strobe ist (im Vergleich zu NMap) ein low budget Portscanner. Allerdings gibt es für Strobe einen IPv6 Patch (siehe IPv6+Linux-status-apps/security-auditing für Details). Anwendungsbeispiel:
# ./strobe ::1 strobe 1.05 (c) 1995-1999 Julian Assange <proff@iq.org>. -::1 2401 unassigned unknown -::1 22 ssh Secure Shell - RSA encrypted rsh -::1 515 printer spooler (lpd) -::1 6010 unassigned unknown -::1 53 domain Domain Name Server |
Hinweis: strobe wird nicht wirklich weiterentwickelt, die abgebildete Versionsnummer ist zudem falsch.
Es gibt einige IPv6-fähige Online-Werkzeuge, welche das Testen einer Firewall-Konfiguration bzgl. eingehenden Verbindungen unterstützen können:
Falls das Ergebnis einer Überwachung nicht Ihren IPv6 Sicherheitsrichtlinien entspricht, schließen Sie die Lücken mit Hilfe der IPv6-Firewall-Funktionalität, z.B. mit netfilter6 (siehe Firewalling/Netfilter6 für Details).
Hinweis: Detailliertere Informationen zum Thema IPv6 Sicherheit finden Sie unter folgenden Links:
Zum Unterschied zu IPv4 ist die Verschlüsselung und die Authentifizierung ein zwingendes Feature bei IPv6. Diese Features werden normalerweise mit IPsec implementiert (das auch von IPv4 verwendet wird).
Zwei Arten von Verschlüsselung und Authentifzierung einer Verbindung sind möglich:
Der Transport-Modus ist ein Modus nur für Ende-zu-Ende-Verbindungen. Hier wird nur die Nutzlast (üblicherweise ICMP, TCP oder UDP) mit deren entsprechenden Headern verschlüsselt, wogegen der IP-Header nicht verschlüsselt wird (aber üblicherweise in die Authentifizierung eingebunden wird).
Bei Nutzung von AES-128 für Verschlüsselung und SHA1 für Authentifizierung reduziert dieser Modus die MTU um 42 Oktetts.
Der Tunnel-Modus kann einerseits für eine Ende-zu-Ende wie auch für eine Gatewas-zu-Gateway-Verbindung genutzt werden. Hier wird das komplette IP-Paket verschlüsselt und ein neuer IP-Header vorangestellt .
Dieser Modus reduziert die MTU um weitere 40 Oktetts (bei IPv6), ausgehend von der MTU des Transport-Modus.
Fehlt in vanilla 2.4. In der Vergangenheit gab es einen Grund, die Linux Kernel Quellen frei von Export/Import-Kontrollgesetzen bzgl. Verschlüsselungs-Techniken zu halten. Dies ist auch ein Grund, wieso FreeS/WAN project nicht in die vanilla Quellen miteingebunden wurde.
Aktuelle Versionen (zum Zeitpunkt des Schreibens 2.6.9 und neuer) unterstützt IPsec für IPv4 und IPv6.
Die Implementierung wurde u.a. vom USAGI project unterstützt.
IPsec benötigt einen Schlüsselaustausch mit einem “Geheimnis”. Dieser Vorgang wird meistens automatisch durch sogenannte IKE-Daemons durchgeführt. Diese führen ebenso die Authentifizierung der Partner durch, entweder durch ein gemeinsam bekanntes Geheimnis (auch “pre-shared secret” genannt) oder bei RSA-Schlüssel (z.B. aus X.509 Zertifikaten).
Momentan stehen (für Linux) zwei verschiedene IKE-Daemons zur Verfügung, die aber sich ziemlich in Konfiguration und Benutzung unterscheiden.
Ich präferiere “pluto” von der *S/WAN Implementierung, wei dieser eine überschaubare (und nur eine) Konfiguration.
Der IKE-Daemon “racoon” ist vom KAME-Project und auf Linux portiert worden. Aktuelle Linux-Distributionen beinhalten diesen Daemon im Paket “ipsec-tools”. Zwei Programme sind für ein funktionierendes IPsec-Setup notwendig. Siehe dazu auch das Linux Advanced Routing & Traffic Control HOWTO / IPSEC.
“setkey” ist für die Definition der Security Policy (SP) im Kernel wichtig.
Datei: /etc/racoon/setkey.sh
Beispiel für eine Ende-zu-Ende verschlüsselte Verbindung im Transport-Modus
#!/sbin/setkey -f -flush; -spdflush; -spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec esp/transport//require; -spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec esp/transport//require; |
Beispiel für eine Ende-zu-Ende verschlüsselte Verbindung im Tunnel-Modus
#!/sbin/setkey -f -flush; -spdflush; -spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec -¬ esp/tunnel/2001:db8:1:1::1-2001:db8:2:2::2/require; -spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec -¬ esp/tunnel/2001:db8:2:2::2-2001:db8:1:1::1/require; |
Beim anderen Partner ist “in” mit “out” zu vertauschen.
“racoon” benötigt eine Konfigurationsdatei zur Ausführung. Es beinhaltet zu der Security Policy entprechenden Einstellungen, welche vorher mit “setkey” definiert wurde.
Datei: /etc/racoon/racoon.conf
# Racoon IKE daemon configuration file. -# See 'man racoon.conf' for a description of the format and entries. -path include "/etc/racoon"; -path pre_shared_key "/etc/racoon/psk.txt"; - -listen -{ - isakmp 2001:db8:1:1::1; -} - -remote 2001:db8:2:2::2 -{ - exchange_mode main; - lifetime time 24 hour; - proposal - { - encryption_algorithm 3des; - hash_algorithm md5; - authentication_method pre_shared_key; - dh_group 2; - } -} - -# gateway-to-gateway -sainfo address 2001:db8:1:1::1 any address 2001:db8:2:2::2 any -{ - lifetime time 1 hour; - encryption_algorithm 3des; - authentication_algorithm hmac_md5; - compression_algorithm deflate; -} - -sainfo address 2001:db8:2:2::2 any address 2001:db8:1:1::1 any -{ - lifetime time 1 hour; - encryption_algorithm 3des; - authentication_algorithm hmac_md5; - compression_algorithm deflate; -} |
Zudem muss das gemeinsame Geheimnis definiert werden:
Datei: /etc/racoon/psk.txt
# file for pre-shared keys used for IKE authentication -# format is: 'identifier' 'key' - -2001:db8:2:2::2 verysecret |
Zum Schluss muss der Daemon gestartet werden. Beim ersten Mal sollte Debug- & Vordergrund-Modus aktiviert werden. Das folgende Beispiel zeigt eine erfolgreiche Aushandlung von IKE-Phase 1 (ISAKMP-SA) und 2 (IPsec-SA):
# racoon -F -v -f /etc/racoon/racoon.conf -Foreground mode. -2005-01-01 20:30:15: INFO: @(#)ipsec-tools 0.3.3 (http://ipsec-tools.sourceforge.net) -2005-01-01 20:30:15: INFO: @(#)This product linked -¬ OpenSSL 0.9.7a Feb 19 2003 (http://www.openssl.org/) -2005-01-01 20:30:15: INFO: 2001:db8:1:1::1[500] used as isakmp port (fd=7) -2005-01-01 20:31:06: INFO: IPsec-SA request for 2001:db8:2:2::2 -¬ queued due to no phase1 found. -2005-01-01 20:31:06: INFO: initiate new phase 1 negotiation: -¬ 2001:db8:1:1::1[500]<=>2001:db8:2:2::2[500] -2005-01-01 20:31:06: INFO: begin Identity Protection mode. -2005-01-01 20:31:09: INFO: ISAKMP-SA established -¬ 2001:db8:1:1::1[500]-2001:db8:2:2::2[500] spi:da3d3693289c9698:ac039a402b2db401 -2005-01-01 20:31:09: INFO: initiate new phase 2 negotiation: -¬ 2001:6f8:900:94::2[0]<=>2001:db8:2:2::2[0] -2005-01-01 20:31:10: INFO: IPsec-SA established: -¬ ESP/Tunnel 2001:db8:2:2::2->2001:db8:1:1::1 spi=253935531(0xf22bfab) -2005-01-01 20:31:10: INFO: IPsec-SA established: -¬ ESP/Tunnel 2001:db8:1:1::1->2001:db8:2:2::2 spi=175002564(0xa6e53c4) |
Jede Richtung bekommt einen eigenen SPI (wie im IPsec-Standard definiert). Mit “tcpdump” kann an der entprechenden Schnittstelle dann das Ergebnis eines IPv6-pings gesehen werden:
20:35:55.305707 2001:db8:1:1::1 > 2001:db8:2:2::2: ESP(spi=0x0a6e53c4,seq=0x3) -20:35:55.537522 2001:db8:2:2::2 > 2001:db8:1:1::1: ESP(spi=0x0f22bfab,seq=0x3) |
Wie erwartet, werden die ausgehandelten SPIs angezeigt.
Mit “setkey” werden die aktiven Parameter angezeigt:
# setkey -D -2001:db8:1:1::1 2001:db8:2:2::2 - esp mode=tunnel spi=175002564(0x0a6e53c4) reqid=0(0x00000000) - E: 3des-cbc bd26bc45 aea0d249 ef9c6b89 7056080f 5d9fa49c 924e2edd - A: hmac-md5 60c2c505 517dd8b7 c9609128 a5efc2db - seq=0x00000000 replay=4 flags=0x00000000 state=mature - created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005 - diff: 577(s) hard: 3600(s) soft: 2880(s) - last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s) - current: 540(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 3 hard: 0 soft: 0 - sadb_seq=1 pid=22358 refcnt=0 -2001:db8:2:2::2 2001:db8:1:1::1 - esp mode=tunnel spi=253935531(0x0f22bfab) reqid=0(0x00000000) - E: 3des-cbc c1ddba65 83debd62 3f6683c1 20e747ac 933d203f 4777a7ce - A: hmac-md5 3f957db9 9adddc8c 44e5739d 3f53ca0e - seq=0x00000000 replay=4 flags=0x00000000 state=mature - created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005 - diff: 577(s) hard: 3600(s) soft: 2880(s) - last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s) - current: 312(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 3 hard: 0 soft: 0 - sadb_seq=0 pid=22358 refcnt=0 |
Der IKE-Daemon “pluto” ist in den Paketen der *S/WAN-Projekte beinhaltet. Das *S/WAN-Projekt startete zu Anfags als FreeS/WAN. Leider wurde die Weiterentwicklung von FreeS/WAN in 2004 eingestellt. Aufgrund der langsamen Entwicklungsgeschwindigkeit in der Vergangenheit entstanden zwei Spin-Offs: strongSwan und Openswan. Heutzutage stehen installationsfertige Pakete bereit, u.a. von Openswan (in Fedora Core 3 beinhaltet).
Ein großer Unterschied zu “racoon” ist, dass nur eine Konfigurationsdatei notwendig ist. Zudem steht ein initscript für automatisches Starten beim Booten zur Verfügung.
Die Konfiguration ist der zu IPv4 sehr ähnlich, nur eine wichtige Option ist notwendig.
Datei: /etc/ipsec.conf
# /etc/ipsec.conf - Openswan IPsec configuration file -# -# Manual: ipsec.conf.5 -version 2.0 # conforms to second version of ipsec.conf specification - -# basic configuration -config setup - # Debug-logging controls: "none" for (almost) none, "all" for lots. - # klipsdebug=none - # plutodebug="control parsing" - -#Disable Opportunistic Encryption -include /etc/ipsec.d/examples/no_oe.conf - -conn ipv6-p1-p2 - connaddrfamily=ipv6 # Important for IPv6, but no longer needed since StrongSwan 4 - left=2001:db8:1:1::1 - right=2001:db8:2:2::2 - authby=secret - esp=aes128-sha1 - ike=aes128-sha-modp1024 - type=transport - #type=tunnel - compress=no - #compress=yes - auto=add - #auto=up |
Zudem muss das gemeinsame Geheimnis definiert werden:
Datei: /etc/ipsec.secrets
2001:db8:1:1::1 2001:db8:2:2::2 : PSK "verysecret" |
Wenn die Installation von Openswan erfolgreich war, sollte ein initscript zum Starten von IPsec zur Verfügung stehen. Dann einfach auf jedem Partner folgendes ausführen:
# /etc/rc.d/init.d/ipsec start |
Danach kann die Verbindung auf einem Partner gestartet werden. Wenn im folgenden die Zeile “IPsec SA established” erscheint, hat die Aushandlung funktioniert.
# ipsec auto --up ipv6-peer1-peer2 -104 "ipv6-p1-p2" #1: STATE_MAIN_I1: initiate -106 "ipv6-p1-p2" #1: STATE_MAIN_I2: sent MI2, expecting MR2 -108 "ipv6-p1-p2" #1: STATE_MAIN_I3: sent MI3, expecting MR3 -004 "ipv6-p1-p2" #1: STATE_MAIN_I4: ISAKMP SA established -112 "ipv6-p1-p2" #2: STATE_QUICK_I1: initiate -004 "ipv6-p1-p2" #2: STATE_QUICK_I2: sent QI2, -¬ IPsec SA established {ESP=>0xa98b7710 <0xa51e1f22} |
Weil *S/WAN und setkey/racoon die gleiche IPsec-Implementation im Linux kernel 2.6.x benutzen, zeigt “setkey” auch hier die aktiven Parameter:
# setkey -D -2001:db8:1:1::1 2001:db8:2:2::2 - esp mode=transport spi=2844489488(0xa98b7710) reqid=16385(0x00004001) - E: aes-cbc 082ee274 2744bae5 7451da37 1162b483 - A: hmac-sha1 b7803753 757417da 477b1c1a 64070455 ab79082c - seq=0x00000000 replay=64 flags=0x00000000 state=mature - created: Jan 1 21:16:32 2005 current: Jan 1 21:22:20 2005 - diff: 348(s) hard: 0(s) soft: 0(s) - last: hard: 0(s) soft: 0(s) - current: 0(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 0 hard: 0 soft: 0 - sadb_seq=1 pid=23825 refcnt=0 -2001:db8:2:2::2 2001:db8:1:1::1 - esp mode=transport spi=2770214690(0xa51e1f22) reqid=16385(0x00004001) - E: aes-cbc 6f59cc30 8d856056 65e07b76 552cac18 - A: hmac-sha1 c7c7d82b abfca8b1 5440021f e0c3b335 975b508b - seq=0x00000000 replay=64 flags=0x00000000 state=mature - created: Jan 1 21:16:31 2005 current: Jan 1 21:22:20 2005 - diff: 349(s) hard: 0(s) soft: 0(s) - last: hard: 0(s) soft: 0(s) - current: 0(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 0 hard: 0 soft: 0 - sadb_seq=0 pid=23825 refcnt=0 |
Bei Linux Kernel 2.6.x kann der IPsec-Status und die Policy auch mit “ip” angezeigt werden:
# ip xfrm policy -... - -# ip xfrm state -... |
IPv6 unterstützt QoS durch die Anwendung von Flow Labels und Traffic Classes.
Zusätzliche Infos:
Vernünftig funktionierendes QoS ist nur an der ausgehenden Schnittstelle eines Routers oder Host möglich, wo der Flaschenhals anfängt. Alles andere bereitet nur Probleme und funktioniert wahrscheinlich nicht so, wie erwartet.
------------------->------- - Queue 1 \ - --->--- ---->--------->--------->------------------- -Dicke Leitung Queue 2 Queue 1 / Queue 2 / Queue 3 Dünne Leitung - --->---- ---->--------->--------->------------------- - Queue 3 / -------------------->------- |
Linux benutzt “tc” vom Paket “iproute2”, um das Bandbreitenmanagement zu konfigurieren, allgemein beschrieben in Linux Advanced Routing & Traffic Control HOWTO.
Mit dem “cbq” Planer können Röhren mit konstanter Bitrate definiert werden.
Definition einer root qdisc mit einer Bandbreite von 1000 MBit/s an eth1
# tc qdisc add dev eth1 root handle 1: cbq avpkt 1000 bandwidth 1000Mbit |
Definition einer Klasse 1:1 mit 1 MBit/s
# tc class add dev eth1 parent 1: classid 1:1 cbq rate 1Mbit allot 1500 bounded |
Definition einer Klasse 1:2 mit 50 MBit/s
# tc class add dev eth1 parent 1: classid 1:2 cbq rate 50Mbit allot 1500 bounded |
Definition einer Klasse 1:3 mit 10 MBit/s
# tc class add dev eth1 parent 1: classid 1:3 cbq rate 10Mbit allot 1500 bounded |
Definition einer Klasse 1:4 mit 200 kBit/s
# tc class add dev eth1 parent 1: classid 1:4 cbq rate 200kbit allot 1500 bounded |
Definition eines Filters für IPv4 (protocol ip), TCP (match ip protocol 6 0xff) Zielport 5001 (match ip dport 5001 0xffff) unter Benutzung der Klasse 1:2 von oben
# tc filter add dev eth1 parent 1: protocol ip u32 match ip protocol 6 0xff match ip dport 5001 0xffff flowid 1:1 |
Definition eines Filters für IPv6 (protocol ip), TCP (match ip6 protocol 6 0xff) Zielport 5001 unter der Benutzung der Klasse 1:2 von oben
# tc filter add dev eth1 parent 1: protocol ipv6 u32 match ip6 protocol 6 0xff match ip6 dport 5001 0xffff flowid 1:2 |
Definition eines Filters für IPv6 für Pakete mit Flowlabel 12345 (match ip6 flowlabel 0x12345 0x3ffff) unter der Benutzung der Klasse 1:3 von oben
# tc filter add dev eth1 parent 1: protocol ipv6 u32 match ip6 flowlabel 12345 0x3ffff flowid 1:3 |
Definition eines Filters für IPv6 für Pakete mit der Linux iptables Markierung 32 (handle 32 fw) unter der Benutzung der Klasse 1:4 von oben
# tc filter add dev eth1 parent 1: protocol ipv6 handle 32 fw flowid 1:4 |
Die letzte Filterdefinition benötigt auch einen Eintrag in ip6tables um das Paket zu markieren
# ip6tables -A POSTROUTING -t mangle -p tcp --dport 5003 -j MARK --set-mark 32 |
Starten auf Serverseite in separaten Konsolen:
# iperf -V -s -p 5001 -# iperf -V -s -p 5002 -# iperf -V -s -p 5003 |
Starten auf Clientseite und Vergleichen der Ergebnisse:
# iperf -V -c SERVER-IPv4 -p 5001 (erwartet: 1 MBit/s) -# iperf -V -c SERVER-IPv6 -p 5001 (erwartet: 50 MBit/s) -# iperf -V -c SERVER-IPv4 -p 5002 (erwartet: >> 50 MBit/s && <= 1000 MBit/s) -# iperf -V -c SERVER-IPv6 -p 5002 (erwartet: >> 50 MBit/s && <= 1000 MBit/s) -# iperf -V -c SERVER-IPv4 -p 5003 (erwartet: >> 50 MBit/s && <= 1000 MBit/s) -# iperf -V -c SERVER-IPv6 -p 5003 (erwartet: 200 kBit/s) |
Das Ergebnis der Transferraten sollten der Definitionen von oben entsprechen, das Ergebnis auf Port 5002 sollte ziemlich identisch unabhängig von der benutzten IP-Version sein.
Im folgenden Kapitel werden einige Hinweise zu IPv6 kompatiblen Daemons gegeben.
Seit der Version 9 wird IPv6 unterstützt. Setzen Sie immer die neuest verfügbare Version ein. Zumindest muss Version 9.1.3 eingesetzt werden, da ältere Versionen Sicherheitslöcher beinhalten können, die von Remote entsprechend ausgenutzt werden können.
Anmerkung: Im Gegensatz zu IPv4 können bei aktuellen Versionen Server Sockets nicht an dedizierte IPv6 Adressen gebunden werden, es ist folglich jede oder keine Adresse gültig. Da dies ein Sicherheitsproblem sein kann, lesen Sie diesbezüglich ebenfalls den Abschnitt Access Control Lists (ACL) weiter unten!
Folgende Optionen müssen geändert werden, damit IPv6 aktiviert wird
options { - # sure other options here, too - listen-on-v6 { any; }; -}; |
Nach einem Neustart (des Dienstes) sollte z.B. Folgendes zu sehen sein:
# netstat -lnptu |grep "named\W*$" -tcp 0 0 :::53 :::* LISTEN 1234/named -¬ # incoming TCP requests -udp 0 0 1.2.3.4:53 0.0.0.0:* 1234/named -¬ # incoming UDP requests to IPv4 1.2.3.4 -udp 0 0 127.0.0.1:53 0.0.0.0:* 1234/named -¬ # incoming UDP requests to IPv4 localhost -udp 0 0 0.0.0.0:32868 0.0.0.0:* 1234/named -¬ # dynamic chosen port for outgoing queries -udp 0 0 :::53 :::* 1234/named -¬ # incoming UDP request to any IPv6 |
Ein kleiner Test sieht wie folgt aus:
# dig localhost @::1 |
und sollte Ihnen ein Ergebnis anzeigen...
Folgende Optionen müssen geändert werden, damit IPv6 deaktiviert wird:
options { - # sure other options here, too - listen-on-v6 { none; }; -}; |
ACLs mit IPv6 Adressen sind realisierbar und sollten wann immer möglich eingesetzt werden. Ein Beispiel:
acl internal-net { - 127.0.0.1; - 1.2.3.0/24; - 2001:0db8:100::/56; - ::1/128; - ::ffff:1.2.3.4/128; -}; -acl ns-internal-net { - 1.2.3.4; - 1.2.3.5; - 2001:0db8:100::4/128; - 2001:0db8:100::5/128; -}; |
Diese ACLs können für Client-Anfragen und Zonentransfers zu Secondary Nameserver eingesetzt werden. Es kann auch unterbunden werden, dass ihr Caching-Nameserver mittels IPv6 von der Außenwelt verwendet wird.
options { - # sure other options here, too - listen-on-v6 { none; }; - allow-query { internal-net; }; - allow-transfer { ns-internal-net; }; -}; |
Es ist ebenfalls möglich, dass die Optionen allow-query und allow-transfer bei den meisten Single-Zonen-Definitionen verwendet werden.
Diese Option ist nicht verpflichtend, ev. aber benötigt:
query-source-v6 address <ipv6address|*> port <port|*>; |
Es ist möglich pro Zone mehrere IPv6 Adressen zu definieren.
Die Transfer source Adresse wird für ausgehende Zonentransfers verwendet:
transfer-source-v6 <ipv6addr|*> [port port]; |
Die Notify source Adresse wird für ausgehende notify Mitteilungen verwendet:
notify-source-v6 <ipv6addr|*> [port port]; |
Einige Informationen finden Sie auch unter IPv6 DNS Setup Information (article). Eventuell ebenfalls hilfreich ist folgendes Tool: IPv6 Reverse DNS zone builder for BIND 8/9 (webtool).
Für IPv6 wurden neue Reverse Lookup Arten und Root Zonen definiert:
AAAA und reverse IP6.INT: beschrieben in RFC 1886 / DNS Extensions to support IP version 6 sowie seit BIND Version 4.9.6 in Verwendung
A6, DNAME (WURDE ABGELEHNT!) und reverse IP6.ARPA: beschrieben in RFC 2874 / DNS Extensions to Support IPv6 Address Aggregation and Renumbering sowie seit BIND 9 in Verwendung. Informationen zum aktuellen Stand sind unter Domain Name System Extension (dnsext) zu finden.
Mehr Inhalt zu diesem Thema wird eventuell in späteren Versionen eingearbeitet, inzwischen können Sie in den RFCs und in folgenden Quellen nachlesen:
AAAA und reverse IP6.INT: IPv6 DNS Setup Information
A6, DNAME (WURDE ABGELEHNT!) und reverse IP6.ARPA: lesen Sie im Kapitel 4 und 6 des BIND 9 Administrator Reference Manual (ARM) nach, welches mit dem bind-Paket mitgeliefert wird. Sie können es auch hier lesen: BIND manual version 9.3
Da IP6.INT (ebenfalls) ABGELEHNT WURDE, (jedoch nach wie vor in Verwendung ist,) muss ein DNS Server, der IPv6 Informationen anbieten will, beide reverse Zonen bereitstellen.
Da es mit den neuen Formaten noch Probleme gibt, ist die aktuell beste Praxis:
Vorwärts-Auflösung mit:
AAAA
Rückwärts-Auflösung mit:
Reverse nibble format für die Zone ip6.int (FÜR RÜCKWÄRTSKOMPATIBILITÄT)
Reverse nibble format für die Zone ip6.arpa (EMPFHOHLEN)
Ob BIND auf einen IPv6 socket hört bzw. IPv6 Daten bereitstellt, können Sie anhand folgender Beispiele überprüfen.
Eine IPv6 Verbindung kann durch Angabe eines dedizierten Server, der abgefragt werden soll, erzwungen werden:
$ host -t aaaa www.6bone.net 2001:0db8:200:f101::1 -Using domain server: -Name: 2001:0db8:200:f101::1 -Address: 2001:0db8:200:f101::1#53 -Aliases: - -Host www.6bone.net. not found: 5(REFUSED) |
Ein entsprechender Log-Eintrag sieht wie folgt aus:
Jan 3 12:43:32 gate named[12347]: client -¬ 2001:0db8:200:f101:212:34ff:fe12:3456#32770: - query denied |
Wenn Sie diesen Eintrag in der Logdatei finden, prüfen Sie, ob von diesem Client Anfragen akzeptiert werden sollen und ggf. ändern Sie Ihre ACL Konfiguration.
Eine erfolgreiche IPv6 Verbindung sieht wie folgt aus:
$ host -t aaaa www.6bone.net 2001:0db8:200:f101::1 -Using domain server: -Name: 2001:0db8:200:f101::1 -Address: 2001:0db8:200:f101::1#53 -Aliases: - -www.6bone.net. is an alias for 6bone.net. -6bone.net. has AAAA address 3ffe:b00:c18:1::10 |
IPv6 wird ungefähr seit der xinetd Version 1.8.9 unterstützt. Verwenden sie immer die neueste Version, zumindest aber Version 2.3.3, da ältere Versionen Sicherheitslöcher beinhalten können, die von Remote entsprechend ausgenutzt werden können.
Einige Linux Distributionen beinhalten ein separates IPv6 kompatibles Paket des xinetd, bei anderen Distributionen wird der IPv6 kompatible xinetd mit folgender Variable zumeist in der Datei /etc/sysconfig/network (bei Red Hat kompatible Distributionen) gestartet: NETWORKING_IPV6="yes". In neuere Versionen unterstützt eine Binärdatei sowohl IPv4 als auch IPv6.
Wenn Sie nun einen "eingebauten" Service wie z.B. daytime durch folgende Änderung der Konfigurationsdatei /etc/xinetd.d/daytime aktivieren
# diff -u /etc/xinetd.d/daytime.orig /etc/xinetd.d/daytime ---- /etc/xinetd.d/daytime.orig Sun Dec 16 19:00:14 2001 -+++ /etc/xinetd.d/daytime Sun Dec 16 19:00:22 2001 -@@ -10,5 +10,5 @@ - protocol = tcp - user = root - wait = no -- disable = yes -+ disable = no - } |
dann sollten Sie nach einem Neustart des xinetd-Dienstes z.B. folgendes positive Ergebnis sehen:
# netstat -lnptu -A inet6 |grep "xinetd*" -tcp 0 0 ::ffff:192.168.1.1:993 :::* LISTEN 12345/xinetd-ipv6 -tcp 0 0 :::13 :::* LISTEN 12345/xinetd-ipv6 <- service -¬ daytime/tcp -tcp 0 0 ::ffff:192.168.1.1:143 :::* LISTEN 12345/xinetd-ipv6 |
Das Beispiel zeigt auch die xinetd Dienste IMAP und IMAP-SSL, die nur auf IPv4 Adressen hören.
Hinweis: frühere Versionen hatten ein Problem, dass der nur für IPv4 kompilierte xinetd nicht bei einem IPv6-aktivierten Knoten startete, und eine IPv6-aktivierte nicht bei einem Knoten, der nur IPv4 aktiv hatte. Dies sollte aber mindestens seit Version 2.3.11 gefixt sein.
IPv6 wird beim Apache Webserver durch die Entwickler seit der Version 2.0.14 unterstützt. Verfügbare Patches für die alte 1.3.x Serie sind inzwischen nicht mehr aktuell und sollten nicht mehr in öffentlich zugänglichen Umgebungen eingesetzt werden. Verfügbar sind die Patches noch unter KAME / Misc.
Anmerkung: Virtuelle Hosts mit IPv6 Adressen sind bis zur Version 2.0.28 nicht operabel (es gibt für die Version 2.0.28 einen Patch). Testen Sie aber immer zuerst die neueste Version, da ältere Versionen mitunter auch Sicherheitsprobleme mit sich bringen können.
Listen [2001:0db8:100::1]:80 -<VirtualHost [2001:0db8:100::1]:80> - ServerName ipv6only.yourdomain.yourtopleveldomain - # ...sure more config lines -</VirtualHost> |
Listen [2001:0db8:100::2]:80 -Listen 1.2.3.4:80 -<VirtualHost [2001:0db8:100::2]:80 1.2.3.4:80> - ServerName ipv6andipv4.yourdomain.yourtopleveldomain - # ...sure more config lines -</VirtualHost> |
Das Ergebnis sollten nach einen Neustart des Dienstes etwa Folgendes sein:
# netstat -lnptu |grep "httpd2\W*$" -tcp 0 0 1.2.3.4:80 0.0.0.0:* LISTEN 12345/httpd2 -tcp 0 0 2001:0db8:100::1:80 :::* LISTEN 12345/httpd2 -tcp 0 0 2001:0db8:100::2:80 :::* LISTEN 12345/httpd2 |
Für einfache Tests können Sie auf das bereits gezeigte telnet-Beispiel zurückgreifen.
Apache2 unterstützt eine Methode namens “sendfile”, um die Auslieferung von Datenn zu beschleunigen. Einige NIC-Treiber unterstützen auch offline das Berechnen der Checksumme. In einigen Fällen kann dies zu Verbindungsproblemen und ungültigen TCP-Checksummen führen. In diesen Fällen ist “sendfile” zu deaktivieren, entweder durch Rekompilieren unter der Benützung der configure-Option “--without-sendfile” oder durch Benützung der Direktive "EnableSendfile off" in der Konfigurationsdatei.
Der Router Advertisement Daemon ist auf einem LAN dann sehr sinnvoll, wenn die Clients automatisch konfiguriert werden sollen. Der Daemon selbst sollte auf einem Linux Gateway Router eingerichtet sein (es hat nicht notwendigerweise das default IPv4 Gateway zu sein, Vorsicht also wer am LAN Router Advertisements versendet).
Sie können einige Flags und Informationen im Advertisement spezifizieren. Allgemein werden verwendet:
Präfix (notwendige Angabe)
Lebensdauer des Präfix
Intervall der Advertisements (optional)
Nach der korrekten Konfiguration sendet der Daemon die Advertisements über angegebene Interfaces. Die Clients empfangen die Advertisements und konfigurieren automatisch Ihre Adressen mit dem empfangenen Präfix und der Default-Route.
Die Konfigurationsdatei des radvd ist normalerweise die Datei /etc/radvd.conf. Eine einfache Konfiguration sieht wie folgt aus:
interface eth0 { - AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; - prefix 2001:0db8:0100:f101::/64 { - AdvOnLink on; - AdvAutonomous on; - AdvRouterAddr on; - }; -}; |
Als Ergebnis auf der Client-Seite ergibt sich hieraus:
# ip -6 addr show eth0 -3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 - inet6 2001:0db8:100:f101:2e0:12ff:fe34:1234/64 scope global dynamic - valid_lft 2591992sec preferred_lft 604792sec - inet6 fe80::2e0:12ff:fe34:1234/10 scope link |
Ein hoher Wert für die Lebensdauer wurde verwendet, da der Wert nicht manuell konfiguriert wurde.
Seit der Version 0.6.2pl3 wird die automatische (Neu)-Erstellung des Präfixes abhängig von der IPv4 Adresse eines angegebenen Interfaces unterstützt. Dies kann dazu eingesetzt werden, die Advertisements dann in einem LAN zu verteilen, nachdem das 6to4 tunneling geändert wurde. Zumeist eingesetzt wird dies hinter einem dynamischen dial-on-demand Linux Router. Wegen der sicherlich kürzeren Lebensdauer dieser Präfixe (nach jedem dial-up ist ein anderes Präfix gültig), wird der Wert der Lebensdauer auf einen minimalen Wert gesetzt:
interface eth0 { - AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; - prefix 0:0:0:f101::/64 { - AdvOnLink off; - AdvAutonomous on; - AdvRouterAddr on; - Base6to4Interface ppp0; - AdvPreferredLifetime 20; - AdvValidLifetime 30; - }; -}; |
Das Ergebnis auf Clientseite ist (unter der Annahme, dass ppp0 die lokale IPv4 Adresse 1.2.3.4 hat):
# /sbin/ip -6 addr show eth0 -3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 - inet6 2002:0102:0304:f101:2e0:12ff:fe34:1234/64 scope global dynamic - valid_lft 22sec preferred_lft 12sec - inet6 fe80::2e0:12ff:fe34:1234/10 scope link |
Da eine kurze Lebensdauer definiert wurde, wird das Präfix bald verworfen werden, sollte kein entsprechendes Advertisement empfangen werden.
Achtung: wenn keine spezielle 6to4-Unterstützung der initscripts benutzt wird, ist eine spezielle Route am internen Interface des Routers notwendig, sonst gibt es Probleme bei eingehenden Paketen. Für das gezeigte Beispiel lautet diese:
# /sbin/ip -6 route add 2002:0102:0304:f101::/64 dev eth0 metric 1 |
Diese Route muß jedesmal, wenn der Prefix wechselt, ersetzt werden. Die ist dann der Fall, wenn das Dial-Up-Interface eine neue IPv4-Adresse bekommen hat.
Mit dem Programm “radvdump” können Sie gesendete und empfangene Advertisements detailliert betrachten. Die Anwendung ist einfach:
# radvdump -Router advertisement from fe80::280:c8ff:feb9:cef9 (hoplimit 255) - AdvCurHopLimit: 64 - AdvManagedFlag: off - AdvOtherConfigFlag: off - AdvHomeAgentFlag: off - AdvReachableTime: 0 - AdvRetransTimer: 0 - Prefix 2002:0102:0304:f101::/64 - AdvValidLifetime: 30 - AdvPreferredLifetime: 20 - AdvOnLink: off - AdvAutonomous: on - AdvRouterAddr: on - Prefix 2001:0db8:100:f101::/64 - AdvValidLifetime: 2592000 - AdvPreferredLifetime: 604800 - AdvOnLink: on - AdvAutonomous: on - AdvRouterAddr: on - AdvSourceLLAddress: 00 80 12 34 56 78 |
Im Output wird jedes Advertisement in einem lesbarem Format dargestellt. Zu sehen sollten die von Ihnen eingestellten Werte sein; falls dem nicht so ist, wurde das Advertisement eventuell nicht von Ihrem radvd gesendet... (für die Rückverfolgung des Routers können Sie die LLAddress, die MAC Adresse des Routers, verwenden...)
dhcp6s kann für stateful Konfiguration benutzt werden. Der Daemon selbst muß nicht unbedingt auf dem Linux-Standard-Router laufen.
Man kann hier mehr Informationen als bei radvd spezifizieren. Die meisten sind denen des IPv4 DHCP-Servers ähnlich.
Nach einer passenden Konfiguration reagiert der Daemon auf empfangene IPv6-Multicast-Pakete, die von einem Client an die Adresse ff02::1:2 gesendet werden.
Die Konfigurationsdatei des dhcp6s ist normalerweise /etc/dhcp6s.conf. Ein einfaches Beispiel sieht wie folgt aus:
interface eth0 { - server-preference 255; - renew-time 60; - rebind-time 90; - prefer-life-time 130; - valid-life-time 200; - allow rapid-commit; - option dns_servers 2001:db8:0:f101::1 sub.domain.example; - link AAA { - range 2001:db8:0:f101::1000 to 2001:db8:0:f101::ffff/64; - prefix 2001:db8:0:f101::/64; - }; -}; |
Die Konfigurationsdatei von dhcp6c ist normalerweise /etc/dhcp6c.conf. Ein einfaches Beispiel sieht wie folgt aus:
interface eth0 { - send rapid-commit; - request domain-name-servers; -}; |
Der Server hat einen Vordergrund und zwei Debug-Schalter (von denen beide benutzt werden sollten), hier ein Beispiel:
# dhcp6c -d -D -f eth0 |
Mit einem IPv6 Ping an die DHCP Multicast-Adresse kann getestet werden, ob der IPv6 DHCP Server überhaupt erreichbar ist am Link.
# ping6 -I eth0 ff02::1:2 |
Der Client hat einen Vordergrund und zwei Debug-Schalter, hier ein Beispiel:
# dhcp6c -d -f eth0 -Oct/03/2005 17:18:16 dhcpv6 doesn't support hardware type 776 -Oct/03/2005 17:18:16 doesn't support sit0 address family 0 -Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error -Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error -Oct/03/2005 17:18:17 status code for this address is: success -Oct/03/2005 17:18:17 status code: success -Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error -Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error -Oct/03/2005 17:18:17 assigned address 2001:db8:0:f101::1002 prefix len is not in any RAs prefix length using 64 bit instead -Oct/03/2005 17:18:17 renew time 60, rebind time 9 |
Bemerkung: die netlink-Fehlermeldungen haben keinen Einfluß auf die Funktionalität.
ISC DHCP unterstützt IPv6 seit der Version 4.x.
Es ist zu beachten, daß der ISC DHCP Server aktuell entweder IPv4 oder IPv6 bedienen kann, nicht beides, d.h. der Daemon muß zweimal gestartet werden (für IPv6 mit Option “-6”) um beide Protokolle zu unterstützen.
Erstellen einer eigenen Konfigurationsdatei /etc/dhcp/dhcpd6.conf für den IPv6-Teil des dhcpd. Es ist zu beachten, daß der router natürlich eine Schnittstelle mit einer IPv6-Adresse aus dem definierten Subnetz konfiguriert haben muß.
default-lease-time 600; -max-lease-time 7200; -log-facility local7; -subnet6 2001:db8:0:1::/64 { - # Range for clients - range6 2001:db8:0:1::129 2001:db8:0:1::254; - - # Range for clients requesting a temporary address - range6 2001:db8:0:1::/64 temporary; - - # Additional options - option dhcp6.name-servers fec0:0:0:1::1; - option dhcp6.domain-search "domain.example"; - - # Prefix range for delegation to sub-routers - prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56; - - # Example for a fixed host address - host specialclient { - host-identifier option dhcp6.client-id 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45; - fixed-address6 2001:db8:0:1::127; - } -} |
Es ist zu beachten, dass die “dhcp.client-id” nicht länger die MAC-Adresse ist, sondern eine per System eindeutige ID! “dhcp6c” (siehe oben) benutzt die Datei /var/lib/dhcpv6/dhcp6c_duid (wird beim ersten Start erstellt, falls nicht vorhanden) als eindeutige ID. Es ist eine 14 Byte lange ID, welche mit einer 2 Byte Längeninformation startet (üblicherweise “0x000e”):
# hexdump -e '"%07.7_ax " 1/2 "%04x" " " 14/1 "%02x:" "\n"' /var/lib/dhcpv6/dhcp6c_duid 0000000 000e 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45: |
Starte den Server im Vordergrund:
# /usr/sbin/dhcpd -6 -d -cf /etc/dhcp/dhcpd6.conf eth1 -Internet Systems Consortium DHCP Server 4.1.0 -Copyright 2004-2008 Internet Systems Consortium. -All rights reserved. -For info, please visit http://www.isc.org/sw/dhcp/ -Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file -Wrote 0 leases to leases file. -Bound to *:547 -Listening on Socket/5/eth1/2001:db8:0:1::/64 -Sending on Socket/5/eth1/2001:db8:0:1::/64 |
Dibbler ist auch ein DHCP server.
Erstellen der Konfigurationsdatei /etc/dibbler/server.conf . Es ist zu beachten, daß der router natürlich eine Schnittstelle mit einer IPv6-Adresse aus dem definierten Subnetz konfiguriert haben muß.
log-level 8 -log-mode short -preference 0 -iface "eth1" { - prefered-lifetime 3600 - valid-lifetime 7200 - class { - pool 2001:db8:0:1::/64 - } - option dns-server fec0:0:0:1::1 - option domain domain.example -} |
Start Server im Vorgergrund:
# dibbler-server run -| Dibbler - a portable DHCPv6, version 0.7.3 (SERVER, Linux port) -| Authors : Tomasz Mrugalski<thomson(at)klub.com.pl>,Marek Senderski<msend(at)o2.pl> -| Licence : GNU GPL v2 only. Developed at Gdansk University of Technology. -| Homepage: http://klub.com.pl/dhcpv6/ -2009.05.28 10:18:48 Server Notice My pid (1789) is stored in /var/lib/dibbler/server.pid -2009.05.28 10:18:48 Server Notice Detected iface eth0/3, MAC=54:52:00:01:23:45. -2009.05.28 10:18:48 Server Notice Detected iface eth1/2, MAC=54:52:00:67:89:ab. -2009.05.28 10:18:48 Server Notice Detected iface lo/1, MAC=00:00:00:00:00:00. -2009.05.28 10:18:48 Server Debug Skipping database loading. -2009.05.28 10:18:48 Server Debug Cache:server-cache.xml file: parsing started, expecting 0 entries. -2009.05.28 10:18:48 Server Notice Parsing /etc/dibbler/server.conf config file... -18:48 Server Debug Setting 0 generic option(s). -18:48 Server Debug 0 per-client configurations (exceptions) added. -18:48 Server Debug Parsing /etc/dibbler/server.conf done. -18:48 Server Info 0 client class(es) defined. -18:48 Server Debug 1 interface(s) specified in /etc/dibbler/server.conf -18:48 Server Info Mapping allow, deny list to class 0:0 allow/deny entries in total. -18:48 Server Info Interface eth1/2 configuration has been loaded. -18:48 Server Notice Running in stateful mode. -18:48 Server Info My DUID is 00:01:00:01:11:aa:6d:a7:54:52:00:67:89:ab. -18:48 Server Notice Creating multicast (ff02::1:2) socket on eth1/2 (eth1/2) interface. -18:48 Server Debug Cache: size set to 1048576 bytes, 1 cache entry size is 87 bytes, so maximum 12052 address-client pair(s) may be cached. -18:48 Server Notice Accepting connections. Next event in 4294967295 second(s). |
Mit der tcp_wrapper Programmbibliothek können Sie Ihre Dienste gegen Missbrauch schützen.
Sie können tcp_wrapper für folgende Zwecke einsetzen:
Nach Source-Adressen filtern (IPv4 oder IPv6)
Nach Benutzern filtern (benötigt einen aktiven ident Daemon auf der Client-Seite)
Folgende Programme sind bekannt:
Jeder Dienst, der durch den xinetd aufgerufen wird (und wenn der xinetd mit der tcp_wrapper Bibliothek kompiliert wurde)
sshd (wenn der mit der tcp_wrapper Bibliothek kompiliert wurde)
Der tcp_wrapper wird durch zwei Dateien konfiguriert und kontrolliert: /etc/hosts.allow sowie /etc/hosts.deny. Weitere Informationen finden Sie mit:
$ man hosts.allow |
In dieser Datei wird ein Dienst pro Zeile eingetragen, der positiv gefiltert werden soll (d.h. Verbindungen werden erlaubt).
sshd: 1.2.3. [2001:0db8:100:200::]/64 -daytime-stream: 1.2.3. [2001:0db8:100:200::]/64 |
Achtung: es existieren fehlerhafte Implementierungen, welche folgende fehlerhafte IPv6-Netzwerk-Beschreibung unterstützen: [2001:0db8:100:200::/64]. Hoffentlich werden diese Versionen bald gefixt.
In dieser Datei werden alle Einträge negativ gefiltert. Und normalerweise sollen alle Verbindungen unterbunden werden:
ALL: ALL |
Sie können bei Bedarf obige Standardzeile auch durch Folgende ersetzen, jedoch wird dadurch bei zu vielen Verbindungen in kurzer Zeitz eine DoS Angriff möglich (Last des Mailers sowie des Spool-Verzeichnisses). Ein logwatch ist somit wahrscheinlich die bessere Lösung.
ALL: ALL: spawn (echo "Attempt from %h %a to %d at `date`" - | tee -a /var/log/tcp.deny.log | mail root@localhost) |
Entsprechend der Syslog Daemon Konfiguration in der Datei /etc/syslog.conf protokolliert der tcp_wrapper normalerweise in die Datei /var/log/secure.
Das Logging einer abgelehnten IPv4-Verbindung zu einem durch den xinetd überwachten Daytime Dienst sieht wie folgt aus:
Jan 2 20:40:44 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap -¬ from=::ffff:1.2.3.4 -Jan 2 20:32:06 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap - from=2001:0db8:100:200::212:34ff:fe12:3456 |
Das Logging einer abgelehnten IPv4-Verbindung zu einem durch den xinetd überwachten sshd Daemon (auf IPv4 und IPv6 auf Verbindungen wartend) sieht wie folgt aus:
Jan 2 20:24:17 gate sshd[12345]: refused connect from ::ffff:1.2.3.4 -¬ (::ffff:1.2.3.4) -Jan 2 20:39:33 gate sshd[12345]: refused connect - from 2001:0db8:100:200::212:34ff:fe12:3456 -¬ (2001:0db8:100:200::212:34ff:fe12:3456) |
Das Logging einer akzeptierten IPv4-Verbindung zu einem durch den xinetd überwachten Daytime Dienst sieht wie folgt aus:
Jan 2 20:37:50 gate xinetd-ipv6[12346]: START: daytime-stream pid=0 -¬ from=::ffff:1.2.3.4 -Jan 2 20:37:56 gate xinetd-ipv6[12346]: START: daytime-stream pid=0 - from=2001:0db8:100:200::212:34ff:fe12:3456 |
Das Logging einer akzeptierten IPv4-Verbindung zu einem auf zwei Ports hörenden sshd sieht wie folgt aus:
Jan 2 20:43:10 gate sshd[21975]: Accepted password for user from ::ffff:1.2.3.4 -¬ port 33381 ssh2 -Jan 2 20:42:19 gate sshd[12345]: Accepted password for user - from 2001:0db8:100:200::212:34ff:fe12:3456 port 33380 ssh2 |
Editiere die Konfigurationsdatei, üblicherweise /etc/vsftpd/vsftpd.conf, und setze die Option für das “listen” wie folgt:
listen_ipv6=yes |
Mehr ist nicht zu tun.
Editiere die Konfigurationsdatei, üblicherweise /etc/proftpd.conf, allerdings ist hier zu beachten, daß dies in der Konfigurationsart virtueller Host nicht 100% logisch ist
<VirtualHost 192.0.2.1> - ... - Bind 2001:0DB8::1 - ... -</VirtualHost> |
Mehr ist nicht zu tun.
Seit einiger Zeit ist dies meist einfach, suchen Sie einfach nach einer Kommandozeilen-Option oder einer Konfigurationsvariable, um das Lauschen an IPv6-Adressen zu aktivieren. Schauen Sie dazu in den Manual-Seiten des Daemons oder in den entsprechenden FAQs nach. Es kann allerdings durchaus sein, daß sich der Daemon nur an die IPv6-“any”-Adresse (::) binden läßt und kein dediziertes Binden an eine spezielle IPv6-Adresse möglich ist (das hängt von der Unterstützung des Programmierers ab).
Dieser Abschnitt ist momentan nicht in Deutsch verfügbar, die englische Version ist verfügbar unter: TLDP / Linux+IPv6-HOWTO / Programming using C-API
In Sun Java Versionen ab 1.4 ist Unterstützung für IPv6 vorhanden, siehe dazu auch die Klasse Inet6Address (1.5/5.0). Weitere Tipps sind verfügbar im Networking IPv6 User Guide for JDK/JRE 1.4 und 1.5 (5.0).
Stand Mai 2007 ist nichts bekannt, daß der Kern von Perl IPv6 nativ unterstützt. Dies kann allerdings aktiviert werden durch Benützung des folgenden Moduls:
Zudem existieren weitere Module für/mit IPv6 Unterstützung (z.B. Net::IP), suche nach “IPv6” bei http://search.cpan.org/.
Das TAHI Project prüft das Zusammenspiel der verschiedenen Betriebssysteme in Hinblick auf IPv6 Funktionalität und Implementierung. Der Linux Kernel hat bereits das IPv6 Ready Logo Phase 1 bekommen.
Cisco Self-Study: Implementing IPv6 Networks (IPV6), von Regis Desmeules. Cisco Press; ISBN 1587050862; 500 Seiten; 1. Edition (April 11, 2003). -Anmerkung: Dieser Titel wird am 11. April 2003 publiziert.
Configuring IPv6 with Cisco IOS, von Sam Brown, Sam Browne, Neal Chen, Robbie Harrell, Edgar, Jr. Parenti (Editor), Eric Knipp (Editor), Paul Fong (Editor) 362 Seiten; Syngress Media Inc; ISBN 1928994849; (July 12, 2002).
IPv6 in Practice: A Unixer's Guide to the Next Generation Internet von Benedikt Stockebrand, November 2006; ISBN 3-540-24524-3
IPv6 Essentials von Silvia Hagen, zweite Auflage, Mai 2006; ISBN 0-5961-0058-2 -ToC, Index, Sample Chapter etc.; O'Reilly Pressrelease
IPv6: The New Internet Protocol. Von Christian Huitema; Publiziert von Prentice-Hall; ISBN 0138505055. -Beschreibung: Dieses Buch, geschrieben von Christian Huitema - einem Mitglied des Internet Architecture Board, bietet eine exzellente Beschreibung von IPv6, die Unterschiede zu IPv4 sowie die 'wies' und 'warums' der IPv6 Entwicklung. -Quelle: http://www.cs.uu.nl/wais/html/na-dir/internet/tcp-ip/resource-list.html
IPv6 Networks von Niles, Kitty; (ISBN 0070248079); 550 Seiten; Datum der Veröffentlichung: 05/01/1998.
Implementing IPV6. Supporting the Next Generation Internet Protocols von P. E. Miller, Mark A. Miller; Hrsg.: John Wiley & Sons; ISBN 0764545892; 2. Edition (15.März 2000); 402 Seiten.
Big Book of Ipv6 Addressing Rfcs von Peter H. Salus (Compiler), Morgan Kaufmann (Hrsg.), April 2000, 450 Seiten ISBN 0126167702.
Understanding IPV6 von Davies, Joseph; ISBN 0735612455; Datum der Veröffentlichung: 05/01/2001; 350 Seiten.
Migrating to IPv6 - IPv6 in Practice von Marc Blanchet; John Wiley & Sons (Hrsg.); ISBN 0471498920; 1. Edition (November 2002); 368 Seiten.
Ipv6 Network Programming von Jun-ichiro Hagino; ISBN 1555583180
Wireless boosting IPv6 von Carolyn Duffy Marsan, 10/23/2000.
O'reilly Network search for keyword IPv6 ergibt 29 Treffer (28. Januar 2002)
Getting Connected with 6to4 von Huber Feyrer, 06/01/2001
Transient Addressing for Related Processes: Improved Firewalling by Using IPv6 and Multiple Addresses per Host; geschrieben von Peter M. Gleiz, Steven M. Bellovin (PC-PDF-Version; Palm-PDF-Version; PDB-Version)
Internetworking IPv6 with Cisco Routers von Silvano Gai, McGrawHill Italia, 1997. Die 13 Kapitel und der Anhang A-D sind als PDF-Dokument 'downladbar'.
Migration and Co-existence of IPv4 and IPv6 in Residential Networks von Pekka Savola, CSC/FUNET, 2002
Siehe auch: liinwww.ira.uka.de/ipv6 bzw. Google / Scholar / IPv6
IPv6 Trials on UK Academic Networks: Bermuda Project Aug.2002: Participants - Getting connected - Project deliverables - Network topology - Address assignments - Wireless IPv6 access - IPv6 migration - Project presentations - Internet 2 - Other IPv6 projects - IPv6 fora and standards Bermuda 2...
Microsoft Research IPv6 Implementation (MSRIPv6): MSRIPv6 Configuring 6to4 - Connectivity with MSR IPv6 - Our 6Bone Node...
Mehr Infos in späteren Versionen... Vorschläge sind Willkommen!
Amerika: ARIN, ARIN / registration page, ARIN / IPv6 guidelines
EMEA: Ripe NCC, Ripe NCC / registration page, Ripe NCC / IPv6 registration
Asien/Pazifik: APNIC, APNIC / IPv6 ressource guide
Latein Amerika und Karikik: LACNIC, IPv6 Registration Services, IPv6 Allocation Policy
Afrika: AfriNIC
Es existiert auch eine Liste der größten Zuteilungen sortiert nach lokalen Registrierungsstellen: Ripe NCC / IPv6 allocations.
Anmerkung: Eine Tunnel-Broker Liste ist im Abschnitt Tunnel broker weiter unten zu finden.
Former IPng. Tunnelbroker and IPv6 resources, now migrated to the SixXs System.
Eckes IPv6-with-Linux Seite.
tunnelc - ein Perl basiertes Tunnel Client Script: -freshmeat.net: Project details for tunnel client -SourceForge: Project Info - tunnelc (also here)
Linux Advanced Routing & Traffic Control HOWTO, Chapter 6: IPv6 tunneling with Cisco and/or 6bone.
Viele URLs zu anderen Dokumenten von Anil Edathara
go6 - The IPv6 Portal: ein IPv6 Online-Portal mit einem WIKI-basierenden IPv6-Know-How-Schwerpunkt, einem IPv6-Diskussionsforum, einer aktuellen Sammlung von IPv6-Events und Nachrichten, freiem IPv6-Zugang und Services, IPv6 Software-Applikationen und viel mehr
Das veröffentlichen einer Liste mit IPv6 relevanter RFCs geht über den Rahmen dieses Dokumentes hinaus, unter folgenden Links können Sie jedenfalls diverse Listen finden:
sortierte Liste:IPng Standardization Status oder IPng Current Specifications von Robert Hinden
IPv6 Related Specifications auf IPv6.org
Aktuelle (auch) IPv6-bezogene Drafts finden Sie hier:
Get any information about IPv6, from overviews, through RFCs & drafts, to implementations (inklusive Verfügbarkeit der Stacks auf verschiedenen Plattformen & Quellcode diverser IPv6 Stacks)
SWITCH IPv6 Pilot / References, umfangreiche Liste mit IPv6 Quellen betreut von Simon Leinen
DeepSpace6 / Weitere interessante Links
DeepSpace6 / (Not only) Linux IPv6 Portal - Italien (Spiegel)
IPv6-HowTo for Linux by Peter Bieringer - Deutschland, und sein Bieringer / IPv6 - software archive
Linux+IPv6 status by Peter Bieringer - Deutschland
DeepSpace6 / IPv6 Status Page - Italien (Spiegel) (ersetzt das oben genannte in Zukunft)
USAGI project - Japan, und deren USAGI project - software archive
Linux Optimized Link State Routing Protocol (OLSR) IPv6 HOWTO
PLD Linux Distribution (“Marktführer” bei inkludierten IPv6 fähigen Paketen))
Red Hat Enterprise Linux, Pekka Savola's IPv6 packages (historisch)
Weitere Details siehe unter IPv6+Linux Status Distributions.
WIDE project - Japan
SWITCH IPv6 Pilot - Schweiz
IPv6 Corner of Hubert Feyrer - Deutschland
IPv6 Forum - ein weltweites Konsortium führender Internet-Hersteller, Forschungs- & Bildungseinrichtungen...
Playground.sun.com / IPv6 Info Page - betreut von Robert Hinden, Nokia. Hier gibt es jede Information zum Thema IPv6: Zusammenfassungen, RFCs & Drafts, Implementierungen (Verfügbarkeit der Stacks auf verschiedenen Plattformen & Quellcode diverser IPv6 Stacks).
6INIT - IPv6 Internet Initiative - ein Fifth Framework Projekt der EU im Rahmen des IST Programmes.
6init - IPv6 INternet IniTiative
IPv6: The New Version of the Internet Protocol, von Steve Deering.
IPv6: The Next Generation Internet Protocol, von Gary C. Kessler.
NetworkWorldFusion: Search / Doc Finder: searched for IPv6 (102 Dokumente gefunden - 22.12.2002)
The Register (Suche nach IPv6 ergab 30 Dokumente, 22.12.2002)
Fehlt etwas? Vorschläge sind Willkommen!
Delphion Research: Patent Search Page. Basic (kostenlose) Registrierung ist notwendig. Beispiele für die Suche nach IPv6 (vom 21.12.2002): -Communicating method between IPv4 terminal and IPv6 terminal and IPv4-IPv6 converting apparatus -Translator for IP networks, network system using the translator, and IP network coupling method therefor
www.ist-ipv6.org: IST IPv6 Cluster, European IPv6 Research and Development Projects
Euro6IX: European IPv6 Internet Exchanges Backbone
British Telecom IPv6 Home: BT's ISP IPv6 Versuch, Englands erster IPv6 Internet Exchange etc.
ETRI: Electronics and Telecommunications Research Institut
IPv6 Forum Korea: IPv6 Infrastruktur Projekt in Korea
IPv6 Mexico (spanische & englische Version) - IPv6 Projekt Homepage der National Autonomous University of Mexico (UNAM)
SURFnet: SURFnet IPv6 Backbone
STACK, STACK (IPv6): Computer-Studendten-Verband der Eindhoven University of Technology, Niederlande.
IPng.nl: Zusammenarbeit zwischen WiseGuys und Intouch.
IPv6@IKNnet and MIPv6 Research Group: TU Vienna, Austria (IPv6: Projekte, Publikationen, Diplom- / Doktorarbeiten, Konferenzunterlagen etc.)
IPv6 for Cisco IOS Software, Datei 2 von 3: Aug 2002 -- Inhalt: IPv6 for Cisco IOS Software; Configuring Documentation Specifics; Enabling IPv6 Routing and Configuring; IPv6 Addressing; Enabling IPv6 Processing Globally.
Cisco Internet Networking Handbook, Chapter IPv6
Now that IBM's announced the availability of z/OS V1.4, what's new in this release? Die Frage wurde am 15. August 2002 'geposted'.
MSRIPv6 - Microsoft Research Network - IPv6 Homepage
Internet Connection Firewall Does Not Block Internet Protocol Version 6 Traffic (6.11.2001)
Internet Protocol Numbers (8.10.2002)
IPv6 Technology Preview Refresh (16.10.2002)
HOW TO: Install and Configure IP Version 6 in Windows .NET Enterprise Server (26.10.2002)
Windows .NET Server 6to4 Router Service Quits When You Advertise a 2002 Address on the Public Interface (28.10.2002)
Internet Security Systems: Security Center, X-Force Database Search (21.12.2002 - 6 Themen bez. IPv6 gefunden)
NIST IPsec Project ( National Institute of Standards and Technology, NIST)
NewOrder.box.sk (search for IPv6) (Artikel, Exploits, Datei-Datenbank etc.)
Freshmeat / IPv6 search, aktuell (14 Dez. 2002) 62 Projekte
Wireshark (ehemals Ethereal) is ein kostenloser Netzwerkprotokoll-Analyseprogramm für Unix und Windows
Radcom RC100-WL - Download Radcom RC100-WL Protokollanalyseprogramm version 3.20
6wind - Lösungen für IPv4/IPv6 Router, QoS, Multicast, Mobility, Security/VPN/Firewall.
Fefe's patches for IPv6 with djbdns - Aug 2002 - Was ist djbdns und warum es IPv6 benötigt? djbdns ist ein vollwertiger DNS Server, welcher “outperforms BIND in nearly all respects”.
IPv6 routing table history erstellt von Gert Döring, Space.Net
Eine weitere Liste von IPv6 Internet Exchanges gibt es unter: IPv6 status of IXPs in Europe
French National Internet Exchange IPv6 (seit 1.11.2002 aktiv). -FNIX6 bietet ISPs im Großraum Paris den Dienst eines kostenlosen und zuverlässlichen High Speed FastEthernet Internet Exchange.
Auch interessant: http://www.deepspace6.net/docs/tunnelbrokers.html
Freenet6 - /48 Delegation, Canada -Getting IPv6 Using Freenet6 on Debian -Freenet6 creater
NTT, Großbritannien - IPv6 Versuch. IPv4 Tunnel und native IPv6 Standleitungs-Verbindungen. POPs gibt es in: London, Düsseldorf, New Jersey (USA, East Coast) Cupertino (USA, West Coast) Tokio
IPng Netherland - Intouch, SurfNet, AMS-IX, UUNet, Cistron, RIPE NCC und AT&T sind am AMS-IX angeschlossen. Unter bestimmten Voraussetzungen ist es möglich, einen statischen Tunnel zu bekommen.
UNINETT - Pilot IPv6 Service (für Kunden): tunnelbroker & address allocation -Uninett-Autoupdate-HOWTO
ESnet, USA - Energy Sciences Network: Tunnel Registry & Address Delegation für direkt angeschlossene ESnet Sites und ESnet Partner.
Hurricane Electric, US backbone; -Hurrican Electric Tunnelbroker (also available under http://tunnelbroker.com/) -Presseaussendung: Hurricane Electric Upgrades IPv6 Tunnel Broker -Tunnel Broker Endpoint Autoupdate, Perl Skript
Anmerkung: Die folgenden Dienste sind meist nur mit einer gültigen IPv6 Verbbindung erreichbar!
Weitere Listen von Mailinglisten sind verfügbar unter:
Die größten Mailinglisten sind in folgender Tabelle zusammengefasst:
.
Schwerpunkt | Request e-mail Adresse | Abonnieren | e-mail Adresse der Mailingliste | Sprache | Zugang via WWW |
Linux Kernel Networking inkl. IPv6 | majordomo (at) vger.kernel.org | netdev | netdev (at) vger.kernel.org | Englisch | Info, Archive |
Mobile IP(v6) für Linux | Web-based, see URL | mipl | mipl (at) mobile-ipv6.org | Englisch | Info, Archive |
Linux IPv6 User & USAGI | usagi-users-ctl (at) linux-ipv6.org | usagi-users (at) linux-ipv6.org | Englisch | Info / Search, Archive | |
IPv6 und Debian Linux | Web-based, siehe URL | debian-ipv6 (at) lists.debian.org | Englisch | Info/Subscription/Archive | |
6bone | majordomo (at) isi.edu | 6bone | 6bone (at) isi.edu | Englisch | Info, Archive |
IPv6 User allgemein | majordomo (at) ipv6.org | users | users (at) ipv6.org | Englisch | Info, Archive |
Bugtracking Internet Programme (1) | bugtraq-subscribe (at) securityfocus.com | bugtraq (at) securityfocus.com (3) | Englisch | Info, Archive |
.
(1) sehr empfohlen wenn Sie Server-Programme zur Verfügung stellen.
(2) Mailingliste ist moderiert.
Fehlt etwas? Vorschläge sind Willkommen!
Via Web sind auch folgende Mailinglisten & Newsgroups verfügbar:
student-ipv6 (India) -Beschreibung: Dies ist eine Newsgruppe für die 'Student Awareness group of IPv6' in Indien
sun-ipv6-users -Beschreibung: Bitte berichten Sie Probleme/Vorschläge in Bezug auf die IPng Implementation von SUN Microsystems
IPv6-BITS -Beschreibung: Diese Liste dient der Koordination des Projekts Vertebrae.
linux-bangalore-ipv6 -Beschreibung: Die IPv6 deployment Liste der Bangalore Linux User Group
packet-switching -Beschreibung: Dies Liste behandelt folgende Themen: packet switching theory, technology, implementation and application in any relevant aspect including without limitation LAPB, X.25, SDLC, P802.1d, LLC, IP, IPv6, IPX, DECNET, APPLETALK, FR, PPP, IP Telephony, LAN PBX systems, management protocols like SNMP, e-mail, network transparent window systems, protocol implementation, protocol verification, conformance testing and tools used in maintaining or developing packet switching systems.
de.comm.protocols.tcp-ip -Beschreibung: Umstellung auf IPv6 -Quelle: Chartas der Newsgruppen in de.*
Google Group: comp.protocols.tcp-ip
Google Group: linux.debian.maint.ipv6
Google Group: microsoft.public.platformsdk.networking.ipv6
Google Group: fa.openbsd.ipv6
ping, traceroute, tracepath, 6bone registry, DNS: JOIN / Testtools (nur in deutscher Sprache, sollte aber keine Probleme für nicht Deutsch sprechende Personen sein)
traceroute6, whois: IPng.nl
AAAA Lookup Checker http://www.cnri.dit.ie/cgi-bin/check_aaaa.pl
Training Pages, U.K. - Suche nach IPv6 (8 Kurse, 2006-08-21)
Fehlt etwas? Vorschläge sind willkommen!
IPv6: Addressing The Needs Of the Future von Yankee Group (Autor)
Listenpreis: $595.00
Edition: e-book (Acrobat Reader)
Seiten: 3 (drei)
Hrsg.: MarketResearch.com; ISBN B00006334Y; (1. November 2001)
;-) Die Auflagenhöhe dieses eBooks wäre doch sehr interessant...
Die Versionen x.y. werden im Internet veröffentlicht.
Die Versionen x.y.z stellen Zwischenschritte dar, die nur als LyX- und SGML-Datei im TLDP-CVS veröffentlicht werden. Dadurch, dass allerdings Deep Space 6 diese SGML-Dateien spiegelt und daraus öffentliche Versionen generiert, sind diese auch dort und auf den Servern, die Deep Space 6 spiegeln, verfügbar.
Die Historie der Änderungen der englischen Sprachversion finden Sie dort: TLDP / Linux+IPv6-HOWTO / Revision History.
2010-04-20/PB: Sync mit Original
2009-12-13/PB: Sync mit Original
2009-06-11/PB: Sync mit Original
2009-03-13/PB: remove original transator contact address, no longer responsible for further changes
2009-02-14/PB: Sync mit Original
2008-11-09/PB: Sync mit Original
2007-08-25/PB: Fix Typo
2007-08-17/PB: Fix Typo
2007-11-11/PB: Sync mit Original
2007-10-06/PB: Sync mit Original, kleine Korrekturen
2007-05-31/PB: Sync mit Original (bis auf C-API), kleine Korrekturen
2006-11-08/PB: Sync mit Original
2006-10-25/PB: Sync mit Original
2006-09-23/PB: Sync mit Original
2006-08-24/PB: Sync mit Original
2006-08-23/PB: Sync mit Original
2006-08-21/PB: Sync mit Original, Korrektur bei Adresstypen (Übersetzungsfehler)
2006-08-20/PB: Sync mit Original
2006-08-20/PB: Sync mit Original
2006-06-13/PB: Sync mit Original
2005-10-03/PB: Sync mit Original
2005-01-11/PB: Sync mit Original
2004-08-30/PB: Sync mit Original
2004-07-22/PB: Sync mit Original
2004-07-19/PB: Sync mit Original und kleine Korrekturen der Übersetzung
2004-05-22/PB: Sync mit Original
2004-04-18/PB: Sync mit Original
2004-04-04/PB: Sync mit Original (Italienische Übersetzung verfügbar, Informationen über DHCPv6, kleinere Updates)
2004-01-12/PB: Sync mit Original (kleine Erweiterung)
2004-01-11/PB: Sync mit Original (kleine Korrekturen, URL-Korrekturen und Erweiterungen)
2003-10-30/PB: Sync mit Original (kleine Korrektur)
2003-08-15/PB: Sync mit Original (URL-Korrekturen, Tipp bei tcp_wrappers und Apache2)
2003-07-26/PB: Sync mit Original (URL-Korrekturen)
2003-06-11/PB: Sync mit Original (URL-Korrekturen)
2003-06-11/PB: Typo gefixt
2003-06-07/PB: Sync mit Original (Links, IPsec)
2003-06-05/PB: Sync mit Original (SuSe-Linux-Tipps)
2003-05-02/PB: Sync mit Original (URL-Korrekturen)
2003-04-23/PB: Sync mit Original (URL-Korrektur)
2003-03-31/PB: Sync mit Original (URL-Korrektur)
2003-03-22/PB: Angabe der URL dieser Übersetzung
2003-02-27/PB: Sync mit Original (URL-Korrektur)
2003-02-12/PB: Sync mit Original (Debian-Linux-Konfiguration), Ersetzen der Info über verfügbare Übersetzungen durch einen Link zum Original.
2003-02-10/PB: Kleine sprachliche Änderungen und paar kleine Verbesserungen.
2003-02-10/GK: Erste öffentliche Version in deutscher Sprache. Diese Version entspricht inhaltlich der englischen Version 0.39.2. Der Zusatz de.1 bezeichnet die Revision der deutschen Sprachversion. Diese Version wurde unter Mandrake Linux 9.0 mit LyX Version 1.2.1 und der Klasse DocBook book (SGML) erstellt.
Dieser feinen Liste hinzugefügt werden können Sie am schnellsten, indem Sie mir Bug fixes, Korrekturen und/oder Updates schicken ;-)
Wenn Sie eine größere Überarbeitung vornehmen wollen, können Sie dazu die LyX Datei (siehe original source) verwenden und mir entsprechende diffs dann zusenden, diffs der SGML-Version sind hingegen nicht sehr nützlich.
David Ranch <dranch at trinnet dot net>: Er ermutigte mich zum Schreiben dieses HOWTOs, für seine Anmerkungen zu den ersten englischen Versionen, für seine Beiträge zu den IPv6 Test-Ergebnissen auf der IPv6-Homepage des Autors. Ebenfalls für seine größeren Überarbeitungen und Vorschläge.
Pekka Savola <pekkas at netcore dot fi>: Für größere Überarbeitungen der englischen Version, seinen Input und Vorschläge.
Georg Käfer <gkaefer at gmx dot at>: Für das Aufspüren eines Fehlers bei der PDF Erstellung (durch LDP Betreuer Greg Ferguson behoben), den Input betreff deutscher Bücher, einer großen URL-Liste, die Überprüfung aller Links und vieler weiterer Vorschläge, Korrekturen und Beiträge.
Als Neuling ein LDP HOWTO zu schreiben (in LyX schreiben sowie SGML konformer Export zu DocBook) ist nicht so einfach, wie von so manchem behauptet wird. Es gibt einige sonderbare Fallen... Nichtsdestoweniger Dank an:
Autoren des LDP Author Guide
B. Guillon: Für sein DocBook with LyX HOWTO
Mein Dank für Fixes und Hinweise ist hier aufgelistet - und die Liste wird mit der Zeit sicherlich länger werden... -Bezüglich der englischen Version finden Sie in dieser, hier werden nur diejenigen, die die deutsche Version betreffen, aufgelistet.
Nico Schottelius, Oliver Kraus, Götz Bauermann: Typo gefunden
Jens Nachtigall: Fehler gefunden
Danke für's Lesen. Hoffentlich ist es von Nutzen!
Falls Sie irgendeine Frage haben, abonnieren sie eine entsprechende maillist und diskutieren Sie ihr Problem unter Angabe möglichst vieler Informationen.
-Info: -ipv6calc ist ein IPv6 Adressen-Format-Umrechner und Konvertierungsprogramm und ist hier zu finden:ipv6calc homepage (Mirror )
pb at bieringer dot de
Historique des versions | ||
---|---|---|
Version 0.49.fr.3wip | 2015-08-18 | Revu par : PB |
Version 0.49.fr.2 | 2007-10-06 | Revu par : PB |
Version 0.49.fr.1 | 2006-02-26 | Revu par : MB |
Version 0.48.1.fr.1 | 2005-01-20 | Revu par : MB |
Version 0.47.fr.1 | 2004-09-05 | Revu par : MB |
Version 0.44.fr.1 | 2003-05-09 | Revu par : MB |
L'objet de cet HOWTO IPv6 Linux est de répondre à la fois aux questions basiques et avancées au sujet d'IPv6 sur le système d'exploitation Linux. Cet HOWTO fournira au lecteur assez d'information pour installer, configurer et utiliser les applications IPv6 sur les machines Linux. l'historique des révisions
Vous trouverez les informations concernant les différentes traductions disponibles dans la section Traductions.
Rédaction et Copyright (C) 2001-2007 Peter Bieringer, traduction francophone et Copyright (C) 2003-2006 Michel Boucey
Cet HOWTO IPv6 Linux est publié sous GPL GNU version 2: - -
L'HOWTO IPv6 Linux, un guide sur la façon de configurer et d'utiliser IPv6 sur les systèmes Linux.
Copyright (C) 2001-2007 Peter Bieringer
Ce document est libre; vous pouvez le redistribuer et/ou le modifier dans les termes de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation; soit dans sa version 2, ou (c'est à votre convenance) une quelconque version postérieure.
Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE; sans même de garantie impliquée par une COMMERCIALISATION ou d'ADÉQUATION A UNE FIN PARTICULIÈRE. Voir la Licence Publique Générale GNU pour de plus amples détails.
Vous devriez avoir reçu une copie de la Licence Publique Générale GNU allant de paire avec ce programme; sinon, écrivez à la Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1993: J'ai pris contact avec l'Internet par la pratique du mél et des news sur un client en mode texte (par exemple, rechercher "e91abier" sur groups.google.com, c'est moi).
1996: J'ai été sollicité pour concevoir un cours sur IPv6, incluant des travaux pratiques sur le système d'exploitation Linux.
1997: Début de la rédaction d'un guide sur la façon d'installer, de configurer et d'utiliser IPv6 sur les systèmes Linux, appelé HowTo - IPv6 & Linux (voir IPv6 & Linux - HowTo/History pour plus d'information).
2001: Début de la rédaction de cet HOWTO IPv6 Linux.
L'auteur peut être contacté par mél à <pb chez bieringer point de> mais aussi via sa page personnelle.
Il vit actuellement à Munich [dans la partie nord du Schwabing] / Bavière / Allemagne (sud) / Europe (centrale) / Terre (surface/continent).
La version actuelle est visible dès le début de ce document.
En ce qui concerne les autres versions/traductions, voir égalementhttp://www.bieringer.de/linux/IPv6/.
30-11-2001:Début de la conception du nouvel HOWTO.
02-01-2002: Une quantité importante du contenu est achevée, publication de la première version du premier chapitre (version 0.10).
14-01-2002: Plus achevé, avec relectures, publication de la première version complète du document (version 0.14).
16-08-2002: La traduction polonaise est en cours
31-10-2002: La traduction chinoise est disponible (voir les traductions pour en savoir plus)
10-11-2002: La traduction allemande est en cours
10-02-2003: La traduction allemande est disponible
09-04-2003: La traduction francophone est en cours
09-05-2003: La traduction francophone est disponible
15-08-2003: La traduction espagnole est en cours
16-10-2003: La traduction italienne est en cours
12-03-2004: La traduction italienne est disponible
18-06-2004: La traduction grecque est en cours
Les traductions doivent toujours contenir l'URL, le numéro de version et le copyright du document original (le vôtre aussi). Merci de ne pas traduire le journal original des modifications, ce n'est vraiment pas utile. Il apparaît que la fréquence des modifications apportées à ce document est, la plupart du temps, inférieure à une fois par mois. Depuis la version 0.27, il apparaît aussi que la plus grande part du contenu fourni par moi-même a été rédigée. Les traductions doivent toujours prendre comme source la version anglo-saxonne.
La traduction francophone par Michel Boucey a été mise en chantier le 9 avril 2003, à partir de la révision 0.41.1. Elle est disponible depuis le 9 mai 2003 sur Deep Space 6, avec pour URL original mirrors.deepspace6.net / Linux+IPv6-HOWTO-fr. Je (Michel Boucey) remercie par avance toute personne qui aidera, de quelque façon, à améliorer cette traduction. On peut me contacter à l'adresse mél <mboucey chez free point fr>.
L'information concernant les traductions disponibles en d'autres langues que l'anglais et le français peut être trouvée dans le document original: TLDP / Linux+IPv6-HOWTO / Translations
Cet HOWTO est actuellement rédigé avec la version 1.2.0 de LyX sur un système Linux Red Hat 7.3 avec un patron SGML (livre DocBook). Il est disponible en vue des contributions à l'URL github / tLDP / LDP / users / Peter-Bieringer.
Les modifications des lignes de code propres à LyX sont réalisées par un script “maison”, “lyxcodelinewrapper.pl”, que vous pouvez obtenir par CVS pour votre propre compte: TLDP-CVS / users / Peter-Bieringer (NdT: ces lignes ne gênent pas la génération au format SGML, mais celles aux formats PS et PDF à partir du SGML généré couramment, i.e. sans ce script).
Le code SGML est généré en utilisant la fonction d'exportation de LyX.
Des solutions ont été apportées afin de créer un code SGML plus propre (voir aussi ici pour le programme Perl, TLDP-CVS / users / Peter-Bieringer):
L'exportation du document LyX ne créait pas proprement les balises “colspan” - l'outil qui règle le problème: “sgmllyxtabletagfix.pl” (le problème est définitivement réglé depuis la version 1.2.0 de LyX)
LyX utilise parfois des entités spéciales gauche/droite, à la place des guillemets habituels, qui seront présentes dans le code HTML. Certains navigateurs n'interprètent pas très bien ces balises (Opéra 6 TP 2 ou Konquéror sont connus pour ce problème) - l'outil qui règle le problème: “sgmllyxquotefix.pl”
Généralement, une référence vers la page d'index maître est recommandée.
Parce que les pages HTML sont générées à partir du fichier SGML, le nommage des fichiers HTML prend une tournure aléatoire. Et cependant, certaines pages ont des balises assignées par LyX, dont il résulte un nommage constant. Ces balises sont très utiles aux références et ne devraient pas être changées à l'avenir.
Si vous pensez que j'ai oublié une balise, merci de me le faire savoir, et je l'ajouterai.
Quelques petites choses d'abord:
En incluant celui-ci, il y a trois documents HOWTO disponibles. Mes excuses si cela vous semble de trop ;)
Le premier document relatif à IPv6 a été écrit par Eric Osborne, et s'appelle FAQ/HOWTO IPv6 Linux (merci de ne l'utiliser que pour des raisons historiques). La dernière version fut la 3.2.1, publiée le 14 juillet 1997.
Merci de m'aider: si quelqu'un connaît la date anniversaire de cet HOWTO, merci de m'envoyer un mél (cette information est nécessaire à "l'historique").
Il existe une seconde version appelée HowTo - IPv6 & Linux - écrite par moi-même (Peter Bieringer) en pur HTML. Elle est née en avril 1997 et la première version anglo-saxonne a été publiée en juin 1997. Je continuerais à la maintenir, mais cela déclinera lentement (mais pas complètement) en faveur de l'HOWTO IPv6 Linux que vous lisez en ce moment.
Parce que l'HowTo - IPv6 & Linux est écrit en HTML pur, il n'est vraiment pas compatible avec le Projet de Documentation Linux (Linux Documentation Project, ou TLDP). J'ai (Peter Bieringer) reçu une demande fin novembre 2001 de réécriture de l'HowTo -IPv6 & Linux en SGML. Cependant, à cause de la discontinuité de cet HOWTO (le future de l'HowTo - IPv6 & Linux), et de la standardisation croissante d'IPv6, je décidais d'écrire un nouveau document couvrant aussi bien les questions simples ou avancées qui resteront importantes dans les toutes prochaines années. Plus dynamique, un contenu plus avancé s'y trouvera en plus, par rapport au second HOWTO (HowTo - IPv6 & Linux).
Le système bien connu des nombres décimaux, représentant n'importe quelle valeur avec les chiffres 0-9.
Habituellement utilisée dans les langages de programmation de bas et haut niveaux, connue encore en tant que système numérique hexadécimal, représentant les valeurs avec les chiffres 0-9 et les caractères A-F (insensible à la casse).
Représentation d'une valeur grâce à 85 différents chiffres/caractères, cela permet des chaînes de caractères plus courtes mais jamais vue dans la pratique.
Unité minimale de stockage, allumée(on)/vraie (1) ou éteinte(off)/fausse (0).
Le plus souvent, une collection de 8 bits (mais ce n'est pas réellement une nécessité - regardez les systèmes des anciens ordinateurs).
ici, matériel de connexion réseau, voir aussi NIC.
Un hôte à double résidence est un noeud ayant deux interfaces réseau (physique ou virtuelle) sur deux liens différents, mais qui ne réalise pas de renvoi de paquets entre les interfaces.
Généralement, un hôte simple résident, présent sur un lien. Normalement, il n'a seulement qu'une interface réseau active, par exemple Ethernet ou (non pas et) PPP.
quasi-synonyme de “périphérique”, voir aussi NIC.
En-tête d'un paquet IP (chaque paquet réseau a un en-tête, son type dépendant de la couche réseau).
Un lien est un médium de transport de paquet réseau de la couche 2, des exemples en sont Ethernet, PPP, SLIP, ATM, RNIS, Frame Relay, etc.
Un noeud est soit un hôte, soit un routeur.
Une collection véritable de 8 bits, aujourd'hui synonyme de "byte".
Information destinée au distributeur TCP/UDP (couche 4) afin de transporter l'information à la couche supérieure.
Chaque couche réseau contient la plupart du temps un champ “protocole” facilitant la distribution de l'information transportée à la couche supérieure, comme cela peut se voir dans la couche 2 (MAC) et 3 (IP)
Un routeur est un noeud possédant une ou plusieurs interface(s) réseau, capable d'envoyer les paquets entre ses interfaces.
Une socket IP est définie par ses adresses source et destination, ses ports et (association)
Une collection de couches relative au réseau.
Les réseaux IP utilisent un masque de bits afin de distinguer le réseau local de ceux qui sont distants.
Un tunnel est typiquement une connexion point-à-point sur laquelle les paquets échangés transportent les données d'un autre protocole, un tunnel IPv6-in-IPv4 en est un exemple.
Access Control List, Liste de Contrôle d'Accès
Application Programming Interface, Interface de Programmation d'Application
Application Specified Integrated Circuit, Circuit Intégré d'Application Spécifique
Berkeley Software Distribution, Distribution des Logiciels Berkeley
Système de bus physique contrôlant un réseau (NdT: voir par exemple ici pour plus d'information)
Internet Service Provider, Fournisseur d'Accès à Internet (FAI)
Projet - effort conjoint de six entreprises au Japon pour fournir, mondialement et dans le cadre du logiciel libre, une pile IPv6 et IPsec (pour IPv4 et IPv6) pour les variantes de BSD www.kame.net
Local Internet Registry, Bureau local d'enregistrement Internet
Network Interface Card, Carte d'interface réseau
Request for comments, Appel à commentaires - jeu de notes techniques et organisationnelles au sujet d'Internet.
Projet “UniverSAl playGround for IPv6” - travaille à rendre disponible une pile protocolaire IPv6 destinée au système Linux qui soit d'une qualité apte à la production.
Le caractère “¬” est utilisé pour signaler que le code est enveloppé en vue d'un meilleur affichage dans les fichiers PDF et PS.
Dans les exemples génériques vous trouverez parfois ce qui suit:
<monadresseip> |
Pour une utilisation réelle sur votre système, en ligne de commande ou dans des scripts, cela doit être remplacé par le contenu adéquate (ôtez bien sûr les chevrons), et le résultat devrait être par exemple
1.2.3.4 |
Les commandes exécutables en tant qu'utilisateur non-root commencent avec un $, par exemple
$ whoami |
Les commandes exécutables en tant qu'utilisateur root commencent avec un #, par exemple
# whoami |
Vous devriez être familiarisé avec les outils essentiels d'Unix comme grep, awk, find, etc, et connaître les options de ligne de commande les plus communément employées.
Vous devriez connaître les notions de couche, de protocole, d'adresse, de câble, de socket, etc. Si vous êtes nouveau, voici un bon point de départ pour vous: linuxports/howto/intro_to_networking
Vous devriez absolument avoir quelque expérience de la configuration IPv4, sinon ce sera difficile pour vous de comprendre ce qui se passe réellement.
Vous devriez aussi comprendre en quoi consiste le Système des Noms de Domaine (DNS), ce qu'il fournit et comment s'en servir.
Vous devriez au moins savoir comment utiliser tcpdump et avoir connaissance de ce qu'il peut vous montrer. Sinon, le déboguage réseau sera très difficile pour vous.
Vous espérez certainement pouvoir expérimenter tout cela avec du vrai matériel, et pas seulement lire cet HOWTO jusqu'à tomber de sommeil. ;-7)
IPv6 est un nouveau protocole de la couche 3 (voir le modèle OSI) qui supplantera à terme IPv4 (plus connu sous le nom d'IP). IPv4 a été conçu il y a déjà un certain de temps (RFC 760 / Le protocole Internet à partir de janvier 1980), et, dès le début, il y a eu de nombreuses demandes pour accroître la quantité d'adresses disponible et augmenter les capacités. Le RFC le plus récent est le RFC 2460 / spécification du protocole Internet version 6 (NdT: une version francophone de ce RFC). Le changement essentiel apporté par IPv6 est la nouvelle conception de l'en-tête, incluant une augmentation de la taille de l'adresse, passant de 32 à 128 bits. Parce que la couche 3 est responsable de bout en bout du transport des paquets dont le routage est basé sur des adresses, elle doit inclure les nouvelles adresses IPv6, comme pour IPv4.
Pour en savoir plus sur l'histoire d'IPv6, jetez un oeil aux anciens RFC concernant IPv6, par exemple dans le Guide / Références IPv6 SWITCH .
Les années 1992, 1993 et 1994 de l'histoire d'IPv6 (dans ses généralités) sont couvertes par le document suivant: IPv6 ou IPng (IP nouvelle génération).
A faire: plus de détails historiques, plus de contenu...
Le premier code réseau relatif à IPv6 a été ajouté au noyau Linux 2.1.8 en novembre 1996 par Pedro Roque. Il était fondé sur l'API BSD:
diff -u --recursive --new-file v2.1.7/linux/include/linux/in6.h -¬ linux/include/linux/in6.h ---- v2.1.7/linux/include/linux/in6.h Thu Jan 1 02:00:00 1970 -+++ linux/include/linux/in6.h Sun Nov 3 11:04:42 1996 -@@ -0,0 +1,99 @@ -+/* -+ * Types and definitions for AF_INET6 -+ * Linux INET6 implementation -+ * + * Authors: -+ * Pedro Roque <******> -+ * -+ * Source: -+ * IPv6 Program Interfaces for BSD Systems -+ * <draft-ietf-ipngwg-bsd-api-05.txt> |
Les lignes présentées sont copiées du patch-2.1.8 (l'adresse mél a été effacée au copier&coller).
A cause du manque de bras, l'implémentation d'IPv6 dans le noyau était incapable de suivre les projets discutés ou les RFC nouvellement mis à jour. En novembre 2000, un projet débute au Japon, appelé USAGI, dont le but était d'implémenter dans Linux tout le support IPv6 manquant ou obsolète. Ce projet suit en cela la trace de l'implémentation courante d'IPv6 pour FreeBSD, réalisée par le projet KAME . De temps à autre, ils créaient des archives de développement (snapshots) à partir des sources courantes du noyau Linux.
Malheureusement, le patch USAGI est très volumineux, à tel point que les personnes s'occupant actuellement de maintenir les fonctionnalités réseau de Linux sont incapables de l'inclure dans les sources, aptes à la production, de la série des noyaux Linux 2.4.x. En conséquence, la série 2.4.x manque de certaines (et même de nombreuses) extensions, et elle n'applique pas non plus les brouillons et RFC courants (voir le groupe de travail IP Version 6 (ipv6)). Cela peut poser des problèmes d'interopérabilité avec les autres systèmes d'exploitation.
USAGI fait maintenant usage de la série des noyaux de développement Linux 2.5.x afin d'incorporer toutes les extensions actuelles dans cette version de développement; dans l'espoir que la série des noyaux 2.6.x comprenne une véritable implémentation à jour d'IPv6.
Comme cela a été mentionné précédemment, les adresses IPv6 ont une longueur de 128 bits. Ce nombre de bits génère de très grands nombres, dont la quantité de chiffres est supérieure à 39:
2^128-1: 340282366920938463463374607431768211455 |
De tels nombres ne sont vraiment pas des adresses pouvant être mémorisées. L'adresse IPv6 en elle-même est faite à partir d'une collection de bits (comme pour IPv4, bien que cela soit rarement su). Il y a une meilleure notation pour de si grands nombres, qui est l'hexadécimal. En hexadécimal, 4 bits (mot aussi connu sous la dénomination de "nibble") sont représentés par un chiffre ou un caractère de 0-9 et a-f (10-15). Ce format réduit la longueur de l'adresse IPv6 à 32 caractères.
2^128-1: 0xffffffffffffffffffffffffffffffff |
Cette représentation est encore peu praticable (possibilité de confusion ou de perte d'un simple chiffre hexadécimal), c'est pourquoi les concepteurs d'IPv6 ont choisi un format hexadécimal scindé en blocs de 16 bits, avec comme séparateur le caractère ":". De plus, le préfixe "0x" (le marqueur des valeurs hexadécimales utilisé dans les langages de programmation) est ôté:
2^128-1: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff |
Une adresse utilisable (nous verrons les différents types d'adresse plus tard) est par exemple:
3ffe:ffff:0100:f101:0210:a4ff:fee3:9566 |
Dans un but de simplification, les zéros non significatifs de chaque bloc de 16 bits sont omis:
3ffe:ffff:0100:f101:0210:a4ff:fee3:9566 -> -¬ 3ffe:ffff:100:f101:210:a4ff:fee3:9566 |
Une séquence de blocs de 16 bits ne comprenant que des zéros peut être remplacée par “::“. Mais pas plus d'une fois par adresse, sinon il ne s'agirait plus d'une représentation unique.
3ffe:ffff:100:f101:0:0:0:1 -> 3ffe:ffff:100:f101::1 |
La plus importante réduction qui peut être observée est celle de l'adresse localhost d'IPv6:
0000:0000:0000:0000:0000:0000:0000:0001 -> ::1 |
Il existe aussi une représentation dite compacte, encodée en base85 (RFC 1924 / A Compact Representation of IPv6 Addresses, publié le 1er avril 1996), jamais vue véritablement employée, sans doute une blague de 1er avril; en voici cependant un exemple:
# ipv6calc --addr_to_base85 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566 -Itu&-ZQ82s>J%s99FJXT |
Info: ipv6calc est un programme de formatage d'adresse IPv6 et de conversion pouvant être trouvé ici: ipv6calc ( miroir )
Dans tout en-tête IP, les 4 premiers bits sont réservés à la version du protocole. C'est ainsi qu'un numéro de protocole entre 0 et 15 est théoriquement possible:
4: est déjà pris pour IPv4
5: est réservé au protocole de flux (Stream Protocol, ou STP - RFC 1819 / Internet Stream Protocol Version 2) (qui n'a jamais véritablement conquis le public)
Le prochain numéro libre était 6. Et voilà comment IPv6 était né!
Lors de la conception d'IPv4, les gens pensaient que 32 bits seraient suffisants pour le monde, dans sa globalité. Rétrospectivement, 32 bits ont été jusqu'à maintenant suffisants, et seront sans doute suffisants pour encore quelques années. Cependant, 32 bits seront insuffisants à fournir dans le futur une adresse globale à chaque périphérique réseau. Pensez aux téléphones mobiles, aux voitures (incluant les périphériques électroniques sur bus CAN), aux grille-pain, aux réfrigérateurs, aux interrupteurs d'éclairage, etc.
Les concepteurs ont alors choisi 128 bits, 4 fois plus en longueur et une quantité 2^96 fois plus importante qu'IPv4 aujourd'hui.
La quantité utilisable est cependant inférieure à ce qu'il semble. La raison en est que, dans le schéma d'adresse défini actuellement, 64 bits sont utilisés pour l'identifiant d'interface, les 64 autres bits sont utilisés pour le routage. Compte tenu des niveaux stricts actuels d'agrégation (/48, /32, ...), il est encore possible d'"épuiser" cette quantité, mais bien heureusement, pas dans un avenir proche.
Voir aussi pour plus d'information le RFC 1715 / The H Ratio for Address Assignment Efficiency et le RFC 3194 / The Host-Density Ratio for Address Assignment Efficiency.
Pendant ce temps, il y a (c'est possible) des gens sur Internet (je n'en connais qu'un, Jim Fleming...) qui pensent déjà à IPv8, et même jusqu'à IPv16, dont les conceptions sont loin d'être couramment reçues et implémentées. En attendant, 128 bits était le meilleur choix qui pouvait être fait au regard de l'en-tête placé au-dessus des données transportées. En considérant le minimum de la taille de l'Unité Maximale de Transfert (Maximum Transfer Unit, ou MTU), la longueur de l'en-tête en IPv4 est de 20 octets (c'est le minimum, car elle peut monter à 60 octets avec les options IPv4), et en IPv6, elle est de 48 octets (longueur constante). C'est 3,4 % de la MTU en IPv4 et 3,8 % de la MTU en IPv6. Cela signifie que le surplus de taille dû à l'en-tête est quasiment le même. Plus de bits dans les adresses auraient réclamé un en-tête de plus grande taille, et par conséquent, un plus grand surplus. Et si l'on prend aussi en compte la MTU maximale sur un lien courant (tel Ethernet aujourd'hui): soit 1500 octets (dans des cas particuliers: 9 Ko pour de grosses trames). Finalement, cela n'aurait pas été d'une conception correcte si 10% ou 20% des données transférées dans un paquet de la couche 3 avaient été utilisés pour les adresses et non pas pour la charge utile.
Comme pour IPv4, l'adresse IPv6 peut être scindée en une partie réseau et une partie hôte, par l'usage d'un masque de sous-réseau.
IPv4 a montré que parfois cela serait bien si plus d'une adresse IP pouvaient être assignées à une interface, chacune à un but bien précis (alias, multi-cast). Afin de demeurer ouvert à l'avenir, IPv6 offre davantage en permettant à plus d'une adresse IPv6 d'être assignées à une interface. Il n'y a actuellement aucune limite définie par aucun RFC, mais seulement par l'implémentation de la pile IPv6 (afin de prévenir les attaques DoS).
Pour employer le grand nombre de bits constitutifs de son adresse, IPv6 définit des types d'adresse basés sur certains regroupements de ces bits, qui, avec un peu de chance, ne devraient pas être modifiés à l'avenir (à la différence d'aujourd'hui avec IPv4, et l'histoire des classes A, B et C).
C'est ainsi que la totalité des bits est divisée en une partie réseau (les 64 supérieurs) et en une partie hôte (les 64 inférieurs), afin de faciliter l'auto-configuration.
C'est une adresse spéciale pour l'interface de bouclage (loopback), similaire à IPv4 avec sa "127.0.0.1".
0000:0000:0000:0000:0000:0000:0000:0001 |
ou compressée:
::1 |
Les paquets ayant cette adresse comme source ou destination ne devraient jamais quittés l'hôte émetteur.
C'est une adresse spéciale telle que “n'importe laquelle” (“any”) ou “0.0.0.0” en IPv4 . Il s'agit pour IPv6 de:
0000:0000:0000:0000:0000:0000:0000:0000 |
ou:
:: |
Ces adresses sont essentiellement utilisées/vues dans les sockets d'écoute (à toute adresse IPv6) ou dans les tables de routage.
Note: l'adresse non spécifiée ne peut pas être utilisée comme adresse de destination.
Il y a deux types d'adresse contenant une adresse IPv4
Les adresses IPv6 compatibles seulement avec IPv4 sont parfois utilisées/vues pour la création de socket par un démon disposant d'IPv6, mais à l'écoute d'une adresse IPv4.
Ces adresses sont définies par un préfixe spécial d'une longueur de 96 (a.b.c.d est l'adresse IPv4):
0:0:0:0:0:ffff:a.b.c.d/96 |
ou en format compressé:
::ffff:a.b.c.d/96 |
Par exemple, l'adresse IPv4 1.2.3.4 ressemble à ceci:
::ffff:1.2.3.4 |
Utilisée pour le tunnelage automatique (RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers), en cours de remplacement par le tunnelage 6to4.
0:0:0:0:0:0:a.b.c.d/96 |
ou en format compressé:
::a.b.c.d/96 |
Les concepteurs ont défini certains types d'adresse et laissé un vaste champ libre à de futures définitions, telles que l'émergence de nouvelles exigences encore aujourd'hui inconnues. L'architecture d'adressage IPv6 (RFC 2373 de juillet 1998) définit le schéma d'adressage actuel, mais il y a déjà un nouveau brouillon disponible: draft-ietf-ipngwg-addr-arch-*.txt.
Jetons maintenant un coup d'oeil aux différents types de préfixe (et par conséquent aux différents types d'adresse IPv6):
Ce sont des adresses particulières qui n'auront de validité que sur le lien d'une interface. En utilisant cette adresse comme adresse de destination le paquet ne devrait jamais franchir un routeur. C'est utile pour des communications sur un lien telles que:
Y a-t-il quelqu'un d'autre sur ce lien?
Y a-t-il quelqu'un d'autre sur ce lien ayant une adresse spéciale (on cherche par exemple à détecter la présence d'un routeur)?
Elles commencent par (où “x” est n'importe quel caractère hexadécimal, couramment “0”)
fe8x: <- actuellement le seul en usage. -fe9x: -feax: -febx: |
Ce type d'adresse se trouve sur chaque interface disposant d'IPv6 après une auto-configuration sans état (ce qui est couramment le cas).
Ces adresses sont similaires à ce que le RFC 1918 (RFC 1918 / Address Allocation for Private Internets) définit aujourd'hui pour IPv4, avec en plus l'avantage que celui qui utilise ce type d'adresse a la capacité d'utiliser les 16 bits fournis pour un maximum de 65536 sous-réseaux. Comparable au 10.0.0.0/8 aujourd'hui en IPv4.
Autre avantage: parce qu'il est possible avec IPv6 d'assigner plus d'une seule adresse par interface, vous pouvez assigner une telle adresse site-local en plus de l'adresse globale.
Il commence par:
fecx: <- le plus couramment utilisé. -fedx: -feex: -fefx: |
(où “x” est n'importe quel caractère hexadécimal, couramment “0”)
Notez que des discussions sont en cours concernant la dépréciation de ce type d'adresse en raison de nombreux problèmes. Pour en savoir plus, lire: draft-ietf-ipv6-deprecate-site-local-XY.txt.
Pour des tests en laboratoire, de telles adresses restent un bon choix, à mon humble avis.
Aujourd'hui, il y a un type d'adresse globale de défini (la première conception, appelée “basée sur le fournisseur” a été abandonnée il y a déjà quelques années (RFC 1884 / IP Version 6 Addressing Architecture [obsolete]), vous en trouverez des traces dans des sources anciennes du noyau Linux).
Il commence par (les x étant des caractères hexadécimaux)
2xxx: -3xxx: |
Note: la dénomination “agrégeable” est abandonnée dans les brouillons actuels. -Il y a quelques sous-types définis en plus, ci-dessous:
Elles ont été les premières adresses globales à être définies et mises en usage. Elles commencent toutes par
3ffe: |
Exemple:
3ffe:ffff:100:f102::1 |
Une adresse spéciale de test 6bone, qui ne sera jamais globalement unique, commence par
3ffe:ffff: |
Et elle est la plupart du temps montrée dans les exemples passés, car si des adresses réelles sont montrées, il est possible à quelqu'un de les copier/coller dans ses propres fichiers de configuration. Ce type d'inadvertance cause des duplications d'adresse globalement unique. Cela pose de graves problèmes à l'hôte d'origine (par exemple recevoir des paquets en réponse de requêtes qu'il n'a pas émises). -Parce qu'IPv6 est maintenant en production, ce préfixe ne sera plus délégué et probablement retiré du routage après 6 juin 2006 (voirRFC 3701 / 6bone Phaseoutpour plus d'information).
Ce type d'adresse, conçu pour un mécanisme précis de tunnelage (RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds et RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers), encode une adresse IPv4 donnée et un sous-réseau possible. Il commence par
2002: |
Par exemple, pour représenter 92.168.1.1/5:
2002:c0a8:0101:5::1 |
Une petite ligne de commande peut vous aider à générer une telle adresse à partir d'une adresse IPv4 donnée:
ipv4="1.2.3.4"; sla="5"; printf "2002:%02x%02x:%02x%02x:%04x::1" `echo $ipv4 -¬ | tr "." " "` $sla |
Voir aussi le tunnelage utilisant 6to4 et information concernant le relayage de 6to4 par les routeurs.
Ces adresses sont déléguées aux Fournisseurs d'Accès à Internet (FAI) et commencent par
2001: |
Les préfixes fournis aux FAI (aussi connus en tant que LIR) les plus importants (propriétaires de backbone) sont délégués par les centres locaux d'enregistrement (local registries) et ils possèdent actuellement un préfixe d'une longueur de 32.
Tout client peut obtenir de son FAI un préfixe d'une longueur de 48.
Actuellement, deux blocs d'adresses sont réservés aux exemples et à la documentation:
3ffe:ffff::/32 -2001:0DB8::/32 EXAMPLENET-WF |
Ces blocs d'adresses devraient être filtrés sur la base des adresses source et, si possible, NE devraient PAS être acheminés par les routeurs en bordure d'Internet vers ce dernier.
Les adresses multicast sont utilisées pour les services y afférents.
Elles commencent par (xx est la valeur de la portée)
ffxy: |
Elles se répartissent en différentes portées et types:
La portée multicast est un paramètre spécifiant la distance maximale qu'un paquet multicast peut prendre vis-à-vis de son entité émettrice.
Actuellement, les régions suivantes (portées) sont définies:
ffx1: noeud-local, ces paquets ne quittent jamais le noeud.
ffx2: lien-local, ces paquets ne sont jamais transmis par les routeurs, ils ne quittent par conséquent jamais le lien spécifié.
ffx5: site-local, ces paquets ne quittent jamais le site.
ffx8: organisation-locale, ces paquets ne quittent jamais l'organisation (pas si simple à implémenter, cela doit être par le protocole de routage).
ffxe: portée globale.
les autres sont réservées.
Il y a déjà de nombreux types définis/réservés (voir le RFC 2373 / IP Version 6 Addressing Architecture pour les détails). Quelques exemples en sont:
Adresse de tous les noeuds: ID = 1h, correspond aux adresses de tous les hôtes présents sur le noeud local (ff01:0:0:0:0:0:0:1) ou au lien connecté (ff02:0:0:0:0:0:0:1).
Adresse de tous les routeurs: ID = 2h, correspond aux adresses de tous les routeurs présents sur le noeud local (ff01:0:0:0:0:0:0:2), sur le lien connecté (ff02:0:0:0:0:0:0:2), ou encore sur le site local (ff05:0:0:0:0:0:0:2).
Adresse multicast spéciale utilisée comme adresse de destination dans la découverte de voisinage, car à la différence d'IPv4, ARP n'existe plus dans IPv6.
Un exemple de cette adresse ressemble à ceci
ff02::1:ff00:1234 |
Le préfixe utilisé montre qu'il s'agit d'une adresse multicast lien-local. Le suffixe est généré à partir de l'adresse de destination. Dans cet exemple, un paquet devrait être envoyé à l'adresse “fe80::1234”, mais la pile réseau ne connaît pas l'actuelle adresse MAC de la couche 2. Elle remplace les 104 bits supérieurs par “ff02:0:0:0:0:1:ff00::/104” et laisse les 24 bits inférieurs inchangés. Cette adresse est maintenant utilisée 'sur le lien' afin de trouver le noeud correspondant, lequel va devoir émettre une réponse contenant son adresse MAC de couche 2.
Les adresses anycast sont des adresses spéciales utilisées pour couvrir des besoins tels que déterminer le serveur DNS le plus proche, le serveur DHCP le plus proche, ou tout groupe dynamique similaire. Les adresses sont prises dans l'espace d'adressage unicast (agrégeable ou site-local pour le moment). Le mécanisme anycast (au regard du client) sera pris en compte par un protocole de routage dynamique.
Note: Les adresses anycast ne peuvent être utilisées comme adresse source, elles sont utilisables uniquement comme adresse de destination.
Un simple exemple d'une adresse anycast est celle d'un routeur de sous-réseau. Soit un noeud avec l'adresse IPv6 suivante assignée:
3ffe:ffff:100:f101:210:a4ff:fee3:9566/64 <- L'adresse du noeud |
L'adresse anycast de routeur de sous-réseau sera créée en laissant totalement blanc le suffixe (les 64 bits inférieurs):
3ffe:ffff:100:f101::/64 <- l'adresse anycast de routeur de sous-réseau |
En ce qui concerne les questions d'auto-configuration et de mobilité, Il a été décidé d'utiliser les 64 bits inférieurs de la partie hôte de l'adresse pour la plupart des types d'adresse actuels. Conséquemment, chaque sous-réseau détient une grande quantité d'adresses.
Cette partie hôte peut être différemment considérée:
Avec l'auto-configuration, la partie hôte de l'adresse est calculée en convertissant l'adresse MAC d'une interface (si disponible), avec la méthode EUI-64, en une adresse IPv6 unique. Si aucune adresse MAC n'est disponible pour le périphérique en question (ce qui arrive par exemple sur les périphériques virtuels), quelque chose d'autre (comme l'adresse IPv4 ou l'adresse MAC d'une interface physique) est utilisée à la place.
Considérons à nouveau le premier exemple:
3ffe:ffff:100:f101:210:a4ff:fee3:9566 |
ici,
210:a4ff:fee3:9566 |
est la partie hôte calculée à partir de l'adresse MAC de la NIC
00:10:A4:E3:95:66 |
en utilisant IEEE EUI-64 conçue pour les identifiants EUI-48.
Parce que la partie hôte "automatiquement calculée” est globalement unique (sauf lorsqu'un fabriquant de NIC utilise la même adresse MAC sur plus d'une NIC), la traque grâce à un client (client tracking) est possible sur l'hôte, dès lors qu'aucun proxy d'aucune sorte n'est utilisé.
C'est un problème connu, et une solution a été apportée: l'extension “sphère privée”, définie dans le RFC 3041 (RFC 3041 / Privacy Extensions for Stateless Address; il y a déjà aussi un brouillon plus récent disponible: draft-ietf-ipngwg-temp-addresses-*.txt). Le principe est d'utiliser une valeur aléatoire et une valeur statique à partir desquelles un nouveau suffixe est généré à intervalle régulier. Note: ce n'est raisonnable que pour des connexions client sortantes, et n'est pas vraiment utile pour des machines réputées être des serveurs.
Pour les serveurs, il est probablement plus aisé de se rappeler d'adresses plus simples; cela peut aussi se faire. Il est possible d'assigner une adresse IPv6 additionnelle à une interface, par exemple
3ffe:ffff:100:f101::1 |
Pour les suffixes tels que “::1”, montré dans l'exemple ci-dessus, il est requis que le septième bit le plus significatif soit positionné à 0 (le bit universel/local d'un identifiant automatiquement généré). Certaines autres (à part celles qui n'ont pas étaient choisies) combinaisons de bits sont réservées aux adresses anycast.
Dans les premières phases de la conception, il était prévu d'utiliser une approche intégrale de routage hiérarchique, et ce, afin de réduire au maximum la taille des tables de routage. A la base du raisonnement sous-tendu par cette approche, il y a la prise en compte du nombre grandissant des entrées de routage IPv4 au coeur des routeurs (supérieur à 104 000 en mai 2001), la nécessité de réduire ce nombre afin de diminuer le besoin en mémoire du matériel (piloté par Circuit Intégré d'Application Spécifique, Application Specified Integrated Circuit, ou ASIC) maintenant les tables de routage, et, en conséquence, d'accroître la vitesse (dans l'espoir que moins d'entrées génèrent des recherches plus rapides).
Aujourd'hui, le point de vue est que le routage sera conçu quasi-hiérarchiquement pour les réseaux ayant seulement un fournisseur de service. Pour plus d'une connexion à un ISP, ce n'est pas possible, et cela relève du problème de la multi-résidence (des informations sur la multi-résidence:drafts*multi6* IPv6 Multihoming Solutions
Comme pour IPv4, la notion de chemin de réseau routable nécessaire au routage a ici sa place. Parce que la notation standard d'un masque réseau n'est pas très agréable pour un adressage sur 128 bits, les concepteurs ont employé le schéma du Routage Inter-Domaines IPv4 Sans Classe (IPv4 Classless Inter Domain Routing, ou CIDR, défini dans le RFC 1519 / Classless Inter-Domain Routing), dans lequel est spécifié le nombre de bits de l'adresse devant être utilisé pour le routage. Il est aussi connu comme notation “slash”.
Un exemple:
3ffe:ffff:100:1:2:3:4:5/48 |
De cette notation seront extraits:
le réseau:
3ffe:ffff:0100:0000:0000:0000:0000:0000 |
le masque de réseau:
ffff:ffff:ffff:0000:0000:0000:0000:0000 |
Dans des conditions normales (i.e. sans QoS), de la recherche dans une table de routage résulte la route ayant le plus grand nombre de bits d'adresse significatifs; autrement dit, la route avec le plus grand préfixe correspond la première.
Par exemple, si une table de routage affiche les entrées suivantes (la liste est incomplète):
3ffe:ffff:100::/48 :: U 1 0 0 sit1 -2000::/3 ::192.88.99.1 UG 1 0 0 tun6to4 |
Ci-dessous, les adresses de destination des paquets IPv6 dont le trafic sera routé au travers du périphérique désigné
3ffe:ffff:100:1:2:3:4:5/48 -> trafic routé au travers du périphérique sit1 -3ffe:ffff:200:1:2:3:4:5/48 -> trafic routé au travers du périphérique tun6to4 |
Avant de commencer à utiliser IPv6 sur votre hôte Linux, vous avez à tester si votre système est prêt pour IPv6. Pour ce faire, vous aurez peut-être d'abord un peu de travail.
Les distributions contemporaines de Linux comportent déjà un noyau prêt pour IPv6, les capacités IPv6 sont en général compilées dans un module, mais il est possible que ce module ne soit pas chargé automatiquement au démarrage.
Voir la page IPv6+Linux-status-distributions pour obtenir les informations les plus à jour.
Note: vous ne devriez plus utiliser les noyaux de la série 2.2.x; car ils ne sont pas assez à jour vis-à-vis d'IPv6.
Afin de vérifier si oui ou non votre actuel noyau supporte IPv6, jetez un coup d'oeil dans votre système de fichiers /proc. Les entrées qui suivent doivent être présentes:
/proc/net/if_inet6 |
Un bref test automatique ressemble à:
# test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready" |
Si cela échoue, cela peut être parce que le module IPv6 n'est pas chargé.
Vous pouvez tenter de charger le module IPv6 en exécutant
# modprobe ipv6 |
Si c'est un succès, la présence de ce module sera testée comme par magie par la ligne suivante:
# lsmod |grep -w 'ipv6' && echo "IPv6 module successfully loaded" |
Et la vérification montrée plus haut devrait maintenant se faire elle aussi avec succès.
Note: enlever le module n'est actuellement pas supporté et peut aboutir, sous certaines conditions, au crash du noyau.
Il est possible d'automatiser le chargement du module IPv6 à la demande. Vous avez juste à ajouter les lignes qui suivent dans le fichier de configuration du chargeur de modules du noyau (normalement /etc/modules.conf ou /etc/conf.modules):
alias net-pf-10 ipv6 # chargement automatique du module IPv6 à la demande |
Il est aussi possible de mettre hors service le chargement automatique du module IPv6 en utilisant la ligne suivante
alias net-pf-10 off # rend indisponible le chargement automatique du module IPv6 |
Note additionnelle: pour les noyaux de la série 2.6,le mécanisme du chargeur de modules a été repensé. Le nouveau fichier de configuration s'appellera /etc/modprobe.conf au lieu de /etc/modules.conf. Pour de plus amples détails voir le module-init-tool
Compiler un noyau à partir des seules sources brutes (facile, si vous connaissez les options dont vous avez besoin)
Recompiler les sources du noyau fournies par votre distribution Linux (parfois, ce n'est si simple que ça)
Compiler un noyau avec l'extension USAGI
Si vous vous décidez à compiler un noyau, vous devriez avoir une certaine expérience dans la compilation de noyau et lire l'HOWTO sur le noyau Linux.
La comparaison pratiquement la plus à jour entre un noyau original et un noyau comprenant USAGI est disponible dans IPv6+Linux-status-kernel.
Plus d'éléments concernant la compilation d'un noyau disposant d'IPv6 peuvent par exemple être trouvés dans IPv6-HOWTO-2#kernel.
Note: vous devriez autant que possible utiliser les noyaux de la série 2.6.x ou supérieures,car le support IPv6 de la série 2.4.x n'obtiendra qu'un portage partielet celui de la série 2.2.x est désespérément obsolète.).
Comme pour le noyau vanille, seulement recommandé aux utilisateurs avancés, déjà familiarisés avec IPv6 et la compilation noyau. Voir aussi la FAQ du projet USAGI et comment obtenir le meilleur support IPv6 avec Linux (article) (miroir).
Les périphériques réseau n'ont pas tous déjà (ou n'auront jamais, pour certains) la capacité de transporter des paquets IPv6. L'état actuel de la situation quant à ce sujet peut être trouvé ici.
A cause de l'implémentation de la structure de la couche réseau du noyau, un problème majeur est qu'un paquet IPv6 n'est pas réellement reconnu par son numéro d'en-tête IP (6 au lieu de 4). Il est reconnu par le numéro de protocole de la couche transport 2. En conséquence, tout protocole n'utilisant pas un tel numéro de protocole ne peut pas distribuer les paquets IPv6. Note: le paquet est bien encore transporté sur le lien, mais, côté récepteur, la distribution ne fonctionne pas (vous pouvez observer cela par exemple avec tcpdump).
IP sur Ligne Série (Serial Line IP, SLIP, RFC 1055 / SLIP), serait aujourd'hui mieux dénommé SLIPv4, noms de périphérique: slX
IP sur Ligne Parallèle, comme pour SLIP, noms de périphérique: plipX
RNIS avec encapsulation rawip, noms de périphérique: isdnX
RNIS avec encapsulation syncppp, noms de périphérique: ipppX (au sujet de la conception de ipppd, il fusionnera dans une couche PPP plus abstraite dans la série des noyaux 2.5.x)
Vous n'irez pas loin si vous faites tourner un noyau prêt pour IPv6 mais sans avoir d'outils pour configurer IPv6. Il existe plusieurs paquetages pouvant servir à cette tâche.
Le paquetage net-tools inclut certains outils tels que ifconfig et route qui vous aideront à configurer IPv6 sur une interface. Regardez la sortie d'ifconfig? ou celle de route?, et si vous y voyez quelque chose comme IPv6, ou inet6, c'est que l'outil est prêt pour IPv6.
Vérification magique:
# /sbin/ifconfig -? 2>& 1 | grep -qw 'inet6' && echo "utility 'ifconfig' is -¬ IPv6-ready" |
La même vérification peut être réalisée pour route:
# /sbin/route -? 2>& 1 | grep -qw 'inet6' && echo "utility 'route' is IPv6-ready" |
Alexey N. Kuznetsov (actuellement la personne qui maintient le code réseau de Linux) a créé un jeu d'outils qui configure le réseau à travers le périphérique netlink. Vous aurez plus de fonctionnalités en utilisant ce jeu d'outils que n'en fournit net-tools, mais il n'est pas très bien documenté et n'est pas vraiment fait pour les êtres pusillanimes.
# /sbin/ip 2>&1 | grep -qw 'inet6' && echo "utility 'ip' is IPv6-ready" |
Si le programme /sbin/ip n'est pas trouvé, je vous recommande alors d'installer le paquetage iproute.
Vous pouvez le récupérer à partir de votre distribution Linux (s'il s'y trouve)
Vous pouvez télécharger l'archive tar et recompiler: sources sur le FTP d'origine et miroir (manquant)
Vous pouvez rechercher le bon paquetage RPM ici, RPMfind pour iproute (parfois la reconstruction d'un paquetage SRPM est recommandée)
Après avoir préparé votre système pour IPv6, vous voudrez établir des communications en utilisant IPv6. Vous devriez d'abord apprendre comment examiner les paquets IPv6 avec un programme dit “renifleur” (un sniffer). Cela est fortement conseillé, car cela peut aider à fournir très rapidement un diagnostic en cas de déboguage/dépannage.
Ce programme est normalement inclus dans le paquetage iputils. Il est conçu pour réaliser de simples tests du transport en émettant des paquets de requête d'écho (echo-request) ICMPv6 et en attendant les paquets de réponse en écho (echo-reply) ICMPv6.
Usage
# ping6 <hôteavecadresseipv6> -# ping6 <adresseipv6> -# ping6 [-I <périphérique>] <adresseipv6-lien-local> |
Exemple
# ping6 -c 1 ::1 -PING ::1(::1) from ::1 : 56 data bytes -64 bytes from ::1: icmp_seq=0 hops=64 time=292 usec - ---- ::1 ping statistics --- -1 packets transmitted, 1 packets received, 0% packet loss -round-trip min/avg/max/mdev = 0.292/0.292/0.292/0.000 ms |
Info: ping6 a besoin d'un accès brut à la socket, il faut donc les permissions root. Par conséquent, s'il n'y a pas d'utilisateur root pouvant utiliser ping6, deux problèmes peuvent se poser ici:
ping6 n'est pas sur le chemin de l'utilisateur (probablement, car ping6 est généralement stocké dans /usr/sbin -> ajouter au chemin (pas vraiment recommandé)
ping6 ne s'exécute pas proprement, généralement, c'est qu'il y a des permissions root manquantes -> chmod u+s /usr/sbin/ping6
En spécifiant uniquement une adresse lien-local à ping IPv6, le noyau ne sait pas par quel périphérique (physique ou virtuel) il doit émettre le paquet - chaque périphérique a une adresse lien-local. Un essai aura pour résultat un message d'erreur:
# ping6 fe80::212:34ff:fe12:3456 -connect: Invalid argument |
Dans ce cas vous devez en plus spécifier l'interface comme ci-dessous:
# ping6 -I eth0 -c 1 fe80::2e0:18ff:fe90:9205 -PING fe80::212:23ff:fe12:3456(fe80::212:23ff:fe12:3456) from -¬ fe80::212:34ff:fe12:3478 eth0: 56 data bytes -64 bytes from fe80::212:23ff:fe12:3456: icmp_seq=0 hops=64 time=445 usec - ---- fe80::2e0:18ff:fe90:9205 ping statistics --- -1 packets transmitted, 1 packets received, 0% packet loss round-trip -¬ min/avg/max/mdev = 0.445/0.445/0.445/0.000 ms |
Un mécanisme intéressant pour détecter les hôtes IPv6 actifs sur un lien est de lancer ping6 sur l'adresse multicast lien-local tous-noeuds (all-node):
# ping6 -I eth0 ff02::1 -PING ff02::1(ff02::1) from fe80:::2ab:cdff:feef:012356 eth0: 56 data bytes -64 bytes from ::1: icmp_seq=1 ttl=64 time=0.104 ms -64 bytes from fe80::212:34ff:fe12:3450: icmp_seq=1 ttl=64 time=0.549 ms (DUP!) |
A la différence d'IPv4, où les réponses à un ping sur l'adresse de diffusion (broadcast) peuvent être rendues indisponibles, en IPv6, ce comportement ne peut pas être actuellement rendu indisponible, sauf par un pare-feu IPv6 local.
Ce programme est normalement inclus dans le paquetage iputils. C'est un programme similaire au traceroute d'IPv4. En voici un exemple:
# traceroute6 www.6bone.net -traceroute to 6bone.net (3ffe:b00:c18:1::10) from 3ffe:ffff:0000:f101::2, 30 -¬ hops max, 16 byte packets - 1 localipv6gateway (3ffe:ffff:0000:f101::1) 1.354 ms 1.566 ms 0.407 ms - 2 swi6T1-T0.ipv6.switch.ch (3ffe:2000:0:400::1) 90.431 ms 91.956 ms 92.377 ms - 3 3ffe:2000:0:1::132 (3ffe:2000:0:1::132) 118.945 ms 107.982 ms 114.557 ms - 4 3ffe:c00:8023:2b::2 (3ffe:c00:8023:2b::2) 968.468 ms 993.392 ms 973.441 ms - 5 3ffe:2e00:e:c::3 (3ffe:2e00:e:c::3) 507.784 ms 505.549 ms 508.928 ms - 6 www.6bone.net (3ffe:b00:c18:1::10) 1265.85 ms * 1304.74 ms |
Note: à la différence de certaines versions contemporaines du traceroute d'IPv4, qui peuvent utiliser les paquets de requête d'écho ICMPv4 aussi bien que les paquets UDP (défaut), l'actuel traceroute IPv6 ne peut qu'émettre des paquets UDP. Comme vous le savez peut-être, les paquets de requête d'écho ICMP sont mieux acceptés par les pare-feu ou les ACL sur les routeurs intermédiaires que les paquets UDP.
Ce programme est normalement inclus dans le paquetage iputils. C'est un programme comme traceroute6, il trace le chemin vers une destination donnée, découvrant la MTU le long de ce chemin. En voici un exemple:
# tracepath6 www.6bone.net - 1?: [LOCALHOST] pmtu 1480 - 1: 3ffe:401::2c0:33ff:fe02:14 150.705ms - 2: 3ffe:b00:c18::5 267.864ms - 3: 3ffe:b00:c18::5 asymm 2 266.145ms pmtu 1280 - 3: 3ffe:3900:5::2 asymm 4 346.632ms - 4: 3ffe:28ff:ffff:4::3 asymm 5 365.965ms - 5: 3ffe:1cff:0:ee::2 asymm 4 534.704ms - 6: 3ffe:3800::1:1 asymm 4 578.126ms !N -Resume: pmtu 1280 |
Sur Linux, tcpdump est l'outil majeur pour la capture de paquets. Vous allez trouver ci-dessous quelques exemples. Le support IPv6 est normalement intégré aux éditions actuelles de la version 3.6.
tcpdump utilise des expressions pour filtrer les paquets, minimisant le bruit:
icmp6: filtre le trafic ICMPv6 natif
ip6: filtre le trafic IPv6 natif (incluant ICMPv6)
proto ipv6: filtre le trafic IPv6-in-IPv4 tunnelé
not port ssh: supprime l'affichage des paquets SSH, pour lancer tcpdump à partir d'une session distante SSH
Certaines options en ligne de commande sont très utiles pour capter et afficher plus d'information concernant les paquets, essentiellement intéressant pour approfondir l'information des paquets ICMPv6:
“-s 512”: augmente la quantité d'information capturée pour un paquet à 512 octets
“-vv”: sortie vraiment verbeuse
“-n”: ne pas résoudre les adresses en noms, utile si la résolution inversée ne fonctionne pas proprement
# tcpdump -t -n -i eth0 -s 512 -vv ip6 or proto ipv6 -tcpdump: listening on eth0 -3ffe:ffff:100:f101:2e0:18ff:fe90:9205 > 3ffe:ffff:100:f101::1: icmp6: echo -¬ request (len 64, hlim 64) -3ffe:ffff:100:f101::1 > 3ffe:ffff:100:f101:2e0:18ff:fe90:9205: icmp6: echo -¬ reply (len 64, hlim 64) |
1.2.3.4 et 5.6.7.8 sont les extrémités du tunnel (toutes les adresses sont des exemples)
# tcpdump -t -n -i ppp0 -s 512 -vv ip6 or proto ipv6 -tcpdump: listening on ppp0 -1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 3ffe:ffff:100::1: icmp6: echo request -¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124) -5.6.7.8 > 1.2.3.4: 3ffe:ffff:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len -¬ 64, hlim 61) (ttl 23, id 29887, len 124) -1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 3ffe:ffff:100::1: icmp6: echo request -¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124) -5.6.7.8 > 1.2.3.4: 3ffe:ffff:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len -¬ 64, hlim 61) (ttl 23, id 29919, len 124) |
Les distributions actuelles comportent déjà les clients et les serveurs IPv6 les plus couramment utilisés. Allez d'abord voir sur IPv6 & Linux / l'état actuel des distributions. Si ce que vous cherchez n'y est pas encore, vous pouvez vérifier sur IPv6 & Linux / l'état actuel des applications disponibles, où sont répertoriés les programmes déjà portés sur IPv6 et utilisables sous Linux. Pour les programmes les plus communément employés, il y a quelques éléments disponibles dans la troisième partie et la quatrième partie de l'HowTo - IPv6 & Linux.
Pour lancer les tests qui vont suivre, il est nécessaire que votre système dispose d'IPv6, et certains exemples montrent des adresses ne pouvant être atteintes que si une connexion au 6bone est disponible.
A cause des mises à jour de sécurité ces dernières années, tout serveur du Système des Noms de Domaine (DNS) devrait fonctionner avec un logiciel récent comprenant déjà le type (intermédiaire) d'adresse IPv6 AAAA (le nouveau, nommé A6 n'est pas encore assez répandu pour le moment, car uniquement supporté par BIND9 et supérieurs, mais aussi à cause de la non existence de support du domaine racine IP6.ARPA). Un simple test pour savoir si le système utilisé peut résoudre les adresses IPv6 est
# host -t AAAA www.join.uni-muenster.de |
et cela devrait affiché quelque chose comme ce qui suit:
www.join.uni-muenster.de. is an alias for tolot.join.uni-muenster.de. -tolot.join.uni-muenster.de. has AAAA address 2001:638:500:101:2e0:81ff:fe24:37c6 |
Des clients telnet prêts pour IPv6 sont disponibles. Un simple test peut être effectué par
$ telnet 3ffe:400:100::1 80 -Trying 3ffe:400:100::1... -Connected to 3ffe:400:100::1. -Escape character is '^]'. -HEAD / HTTP/1.0 - -HTTP/1.1 200 OK -Date: Sun, 16 Dec 2001 16:07:21 -GMT Server: Apache/2.0.28 (Unix) -Last-Modified: Wed, 01 Aug 2001 21:34:42 GMT -ETag: "3f02-a4d-b1b3e080" -Accept-Ranges: bytes -Content-Length: 2637 -Connection: close -Content-Type: text/html; charset=ISO-8859-1 - -Connection closed by foreign host. |
Si le client telnet ne comprend pas l'adresse IPv6 et dit quelque chose comme “ne peut résoudre le nom d'hôte” (“cannot resolve hostname”), IPv6 n'est alors pas disponible.
Les versions actuelles d'openssh sont prêtes pour IPv6. Selon la configuration précédant la compilation, il y a deux comportements possibles.
--without-ipv4-default: le client essaie automatiquement une connexion IPv6 en premier et revient à IPv4 en cas d'échec.
--with-ipv4-default: la connexion par défaut est IPv4, la connexion IPv6 doit être forcée comme dans l'exemple qui suit:
$ ssh -6 ::1 -user@::1's password: ****** -[user@ipv6host user]$ |
Si votre client ssh ne comprend pas l'option “-6”, c'est qu'il n'a pas IPv6 de disponible, comme la plupart des paquetages de ssh version 1.
Le client et le serveur SSH de chez SSH.com sont aussi prêts pour IPv6, et gratuits pour les machines Linux et FreeBSD selon l'usage - commercial ou personnel - qui en est fait.
L'état actuel de la liste des navigateurs web IPv6 est disponible.
La plupart ont des problèmes irrésolues pour le moment
Si un seul proxy IPv4 est utilisé dans les réglages, les requêtes IPv6 seront bien envoyées vers le proxy, mais celui-ci échouera à comprendre la requête, laquelle échouera. Solution: mettre à jour le logiciel proxy (à voir plus tard).
Les réglages de configuration automatique de proxy (*.pac) ne peuvent être étendus afin de prendre en charge différemment les requêtes IPv6 (par exemple ne pas utiliser le proxy) à cause de leur nature (écrits en Java-script et bien encodés en dur dans les sources, comme cela peut être observé pour le code source de Maxilla).
C'est ainsi que les anciennes versions ne comprennent pas un URL avec une adresse encodée en IPv6 comme http://[2001:4dd0:f838:a006::6]/ (cet URL ne fonctionne qu'avec un navigateur disposant d'IPv6!).
Un bref test est d'essayer l'URL fourni avec un navigateur donné, sans utiliser de proxy.
Un bon point de départ pour tester la navigation IPv6 est http://www.kame.net/. Si la tortue sur la page est animée, la connexion se fait via IPv6, sinon la tortue est statique.
Dans cette partie, de nombreuses questions concernant des clients spécifiques ont été mentionnées. En conséquence, les éléments pour les serveurs prêts pour IPv6 sont fournis plus bas dans la section Eléments d'installation des démons prêts pour IPv6.
Message d'erreur: "connect: Invalid argument"
Le noyau ne sait pas sur quel lien (physique ou virtuel) vous voulez l'utiliser et envoyer des paquets ICMPv6. C'est pourquoi est affiché un message d'erreur.
Solution: spécifier l'interface de cette façon: “ping6 -I eth0 fe80::2e0:18ff:fe90:9205”, voir aussi l'usage du programme ping6.
Message d'erreur: “icmp socket: Operation not permitted”
Ces utilitaires créent des paquets spéciaux ICMPv6 et les émettent en dehors. Ceci est réalisé par l'emploi des sockets brutes du noyau. Ces dernières ne peuvent être utilisées que par l'utilisateur “root”. C'est pourquoi les utilisateurs courants obtiennent un tel message d'erreur.
Solution: s'il est vraiment nécessaire que tous les utilisateurs puissent utiliser ces utilitaires, vous pouvez ajouter le bit “suid” en faisant ”chmod u+s /chemin/vers/le/programme”, voir aussi l'usage du programme. Si tous les utilisateurs ne doivent pas en être capables, vous pouvez changer ce programme de groupe, par exemple au profit du groupe “wheel”, ajouter les utilisateurs nécessaires à ce groupe et ôter le bit d'exécution aux autres utilisateurs par “chmod o-rwx /chemin/vers/le/programme”, ou bien configurer “sudo” pour mettre en place votre politique de sécurité.
Sur un noeud, il existe différents périphériques réseau. Ils peuvent être
Physiquement rattachés, comme eth0, tr0
Virtuellement existants, comme ppp0, tun0, tap0, sit0, isdn0, ippp0
Les interfaces physiquement rattachées, comme Ethernet ou Token-Ring, sont la norme et n'ont pas besoin d'un traitement particulier.
Les interfaces virtuellement rattachées ont toujours besoin d'un traitement particulier.
Ces interfaces sont normalement dénommées sitx. sit est l'abréviation mise pour Simple Transition Internet (Simple Internet Transition). Ce périphérique a la capacité d'encapsuler les paquets IPv6 à l'intérieur de paquets IPv4 et de les tunneler vers une extrémité étrangère.
sit0 a une signification particulière et ne peut être utilisée pour des tunnels dédiés.
Les interfaces PPP acquièrent leur capacité IPv6 grâce à un démon PPP disposant d'IPv6.
La capacité IPv6 pour HDLC avec encapsulation ip est déjà intégrée au noyau.
Les interfaces PPP RNIS (ippp) ne sont pas disponibles pour IPv6 dans le noyau. Il n'est pas prévu que cela se fasse, puisqu'elles seront remplacées par une couche d'interface ppp plus générique.
Comme il a déjà été dit, ces interfaces ne supportent pas le transport IPv6 (l'émission est OK, mais la distribution à la réception ne fonctionne pas).
Les périphériques Ether-tap sont prêts pour IPv6, et sont de plus configurables sans état. Pour être utilisés, le module “ethertap” doit être chargé au préalable.
Deux méthodes peuvent être utilisées pour (dé)monter les interfaces.
Usage:
# ip link set dev <interface> up -# ip link set dev <interface> down |
Exemple:
# ip link set dev eth0 up -# ip link set dev eth0 down |
Usage:
# /sbin/ifconfig <interface> up -# /sbin/ifconfig <interface> down |
Exemple:
# /sbin/ifconfig eth0 up -# /sbin/ifconfig eth0 down |
Il y a différentes façons de configurer une adresse IPv6 sur une interface. Vous pouvez utiliser "ifconfig" ou "ip".
Vous devriez d'abord vérifier s'il existe des adresses IPv6 configurées, et combien (peut-être y en a-t-il qui l'ont été, comme par magie, pendant l'auto-configuration sans état).
Usage:
# /sbin/ip -6 addr show dev <interface> |
Exemple pour un hôte configuré statiquement:
# /sbin/ip -6 addr show dev eth0 -2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_ fast qlen 100 -inet6 fe80::210:a4ff:fee3:9566/10 scope link -inet6 3ffe:ffff:0:f101::1/64 scope global -inet6 fec0:0:0:f101::1/64 scope site |
Exemple pour un hôte auto-configuré
Ici vous pouvez voir des adresses auto-configurées comme par magie et leurs durées de vie.
# /sbin/ip -6 addr show dev eth0 -3: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen -¬ 100 -inet6 2002:d950:f5f8:f101:2e0:18ff:fe90:9205/64 scope global dynamic -valid_lft 16sec preferred_lft 6sec -inet6 3ffe:400:100:f101:2e0:18ff:fe90:9205/64 scope global dynamic -valid_lft 2591997sec preferred_lft 604797sec inet6 fe80::2e0:18ff:fe90:9205/10 -¬ scope link |
Usage:
# /sbin/ifconfig <interface> |
Exemple (la sortie est filtrée avec grep pour n'afficher que les adresses IPv6). vous pouvez voir ici des adresses IPv6 ayant des portées différentes.
# /sbin/ifconfig eth0 |grep "inet6 addr:" -inet6 addr: fe80::210:a4ff:fee3:9566/10 Scope:Link -inet6 addr: 3ffe:ffff:0:f101::1/64 Scope:Global -inet6 addr: fec0:0:0:f101::1/64 Scope:Site |
Ajouter une adresse IPv6 est similaire au mécanisme des adresses “ALIAS IP” sur les interfaces configurées par IPv4 Linux.
Usage:
# /sbin/ip -6 addr add <adresseipv6>/<longueurdupréfixe> dev <interface> |
Exemple:
# /sbin/ip -6 addr add 3ffe:ffff:0:f101::1/64 dev eth0 |
Usage:
# /sbin/ifconfig <interface> inet6 add <adresseipv6>/<longueurdupréfixe> |
Exemple:
# /sbin/ifconfig eth0 inet6 add 3ffe:ffff:0:f101::1/64 |
Rarement nécessaire, prenez garde de ne pas ôter une adresse IPv6 n'existant pas, il en résulte parfois un crash sur les anciens noyaux.
Usage:
# /sbin/ip -6 addr del <adresseipv6ipv6address>/<longueurdupréfixe> dev <interface> |
Exemple:
# /sbin/ip -6 addr del 3ffe:ffff:0:f101::1/64 dev eth0 |
Usage:
# /sbin/ifconfig <interface> inet6 del <adresseipv6>/<longueurdupréfixe> |
Exemple:
# /sbin/ifconfig eth0 inet6 del 3ffe:ffff:0:f101::1/64 |
Si vous voulez quitter votre lien et voulez émettre des paquets vers l'Internet mondial IPv6, vous avez besoin de routage. S'il existe déjà un routeur disposant d'IPv6 sur votre lien, il est possible que cela soit suffisant pour ajouter des routes IPv6.
Vous devriez d'abord vérifier s'il existe des routes IPv6 configurées, et combien (peut-être y en a-t-il qui l'ont été, comme par magie, pendant l'auto-configuration sans état).
Usage:
# /sbin/ip -6 route show [dev <périphérique>] |
Exemple:
# /sbin/ip -6 route show dev eth0 -3ffe:ffff:0:f101::/64 proto kernel metric 256 mtu 1500 advmss 1440 -fe80::/10 proto kernel metric 256 mtu 1500 advmss 1440 -ff00::/8 proto kernel metric 256 mtu 1500 advmss 1440 -default proto kernel metric 256 mtu 1500 advmss 1440 |
Usage:
# /sbin/route -A inet6 |
Exemple (la sortie est filtrée sur l'interface eth0). Ici vous pouvez voir différentes routes IPv6 pour différentes adresses sur une même interface.
# /sbin/route -A inet6 |grep -w "eth0" -3ffe:ffff:0:f101 ::/64 :: UA 256 0 0 eth0 <- Route de l'interface de portée globale -¬ address -fe80::/10 :: UA 256 0 0 eth0 <- Route de l'interface de portée lien-local -¬ address -ff00::/8 :: UA 256 0 0 eth0 <- Route de l'interface destiné à tout le trafic multicast -¬ addresses -::/0 :: UDA 256 0 0 eth0 <- Route automatique par défaut |
Nécessaire la plupart du temps pour atteindre l'extérieur grâce à IPv6 en utilisant un routeur IPv6 sur votre lien.
Usage:
# /sbin/ip -6 route add <réseauipv6>/<longueurdupréfixe> via <adresseipv6> -¬ [dev <périphérique>] |
Exemple:
# /sbin/ip -6 route add 2000::/3 via 3ffe:ffff:0:f101::1 |
Usage:
# /sbin/route -A inet6 add <réseauipv6>/<longueurdupréfixe> gw -¬ <adresseipv6> [dev <périphérique>] |
Un périphérique peut être nécessaire également, si l'adresse IPv6 de la passerelle est un lien-local.
Suivre l'exemple montré ajoute une route à toutes les adresses globales actuelles (2000::/3) à travers la passerelle 3ffe:ffff:0:f101::1
# /sbin/route -A inet6 add 2000::/3 gw 3ffe:ffff:0:f101::1 |
Rarement nécessaire manuellement, la plupart du temps effectué par les scripts configurant le réseau à l'extinction (totale ou par interface)
Usage:
# /sbin/ip -6 route del <réseauipv6>/<longueurdupréfixe> via <ipv6address> -¬ [dev <périphérique>] |
Exemple:
# /sbin/ip -6 route del 2000::/3 via 3ffe:ffff:0:f101::1 |
Usage:
# /sbin/route -A inet6 del <réseau>/<longueurdupréfixe> [dev <périphérique>] |
Exemple pour de nouveau ôter la route précédemment ajoutée:
# /sbin/route -A inet6 del 2000::/3 gw 3ffe:ffff:0:f101::1 |
Pas si fréquent, parfois en cas de création de lien point-à-point.
Usage:
# /sbin/ip -6 route add <réseauipv6>/<longueurdupréfixe> dev <périphérique> -¬ metric 1 |
Exemple:
# /sbin/ip -6 route add 2000::/3 dev eth0 metric 1 |
La distance (metric) “1” est utilisée ici par soucis de compatibilité avec la distance utilisée par route, car la distance par défaut fixée par “ip” est “1024”.
Usage:
# /sbin/route -A inet6 add <réseau>/<longueurdupréfixe> dev <périphérique> |
Exemple:
# /sbin/route -A inet6 add 2000::/3 dev eth0 |
Rarement utiliser manuellement, les scripts de configuration font cela à l'extinction.
Usage:
# /sbin/ip -6 route del <réseauipv6>/<longueurdupréfixe> dev <périphérique> |
Exemple:
# /sbin/ip -6 route del 2000::/3 dev eth0 |
Usage:
# /sbin/route -A inet6 del <réseau>/<longueurdupréfixe> dev <périphérique> |
Exemple:
# /sbin/route -A inet6 del 2000::/3 dev eth0 |
Une idée d'IPv6 était le routage hiérarchique, avec pour conséquence une quantité moindre d'entrées dans les tables de routage nécessaires aux routeurs.
Il y a certains problèmes dans les noyaux Linux actuels:
Les clients peuvent installer une route par défaut avec pour préfixe “::/0”, ils peuvent aussi apprendre une telle route par auto-configuration, en utilisant par exemple radvd s'il est présent sur le lien, comme le montre ce qui suit:
# ip -6 route show | grep ^default -default via fe80::212:34ff:fe12:3450 dev eth0 proto kernel metric 1024 expires -¬ 29sec mtu 1500 advmss 1440 |
Dans ses grandes lignes, l'actuel noyau Linux (au moins <= 2.4.17) ne supporte pas les routes par défaut. Vous pouvez les installées, mais la recherche échouera quand un paquet devra être renvoyé (une intention normale pour un routeur).
Pour l'heure, le “routage par défaut” peut être installé en utilisant l'actuel et unique préfixe d'adresse globale “2000::/3”.
Le projet USAGI supporte déjà cela dans leurs extensions grâce à une astuce de programmation (NdT: a hack, i.e. littéralement, une”bidouille”).
Note: prenez garde au routage par défaut sans filtrage d'adresse sur les routeurs de bordure, sinon du trafic multicast ou site-local quittera l'environnement.
La découverte de voisinage est le successeur IPv6 de ARP (Address Resolution Protocol, protocole de résolution d'adresse) pour IPv4. Vous pouvez récupérer l'information concernant le voisinage actuel, de plus, vous pouvez fixer ou détruire des entrées. Le noyau garde la trace de la détection d'un voisin (comme ARP pour IPv4). Vous pouvez faire des recherches dans la table apprise, en utilisant “ip”.
Avec la commande qui suit vous pouvez afficher les voisins IPv6 appris ou configurés
# ip -6 neigh show [dev <périphérique>] |
L'exemple suivant montre un voisin, qui est un routeur pouvant être atteint
# ip -6 neigh show -fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable |
La commande suivante vous permet d'ajouter manuellement une entrée
# ip -6 neigh add <adresseIPv6> lladdr <adressedelacouche-lien> dev <périphérique> |
Exemple:
# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0 |
De même qu'une entrée peut être ajoutée, une entrée peut être détruite:
# ip -6 neigh del <adresseipv6> lladdr <adressedelacouche-lien> dev <périphérique> |
Exemple:
# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0 |
L'outil “ip” est sous-documenté, mais il est très puissant. Voir l'aide en ligne pour en savoir plus
# ip -6 neigh help -Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ] - [ nud { permanent | noarp | stale | reachable } ] - | proxy ADDR } [ dev DEV ] - ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ] |
Il semble que certaines options soient uniquement pour IPv4... si vous pouvez contribuer à en dire plus sur les drapeaux et l'emploi avancé, merci d'envoyer vos informations.
Si vous souhaitez quitter votre lien incapable d'accéder à IPv6 à partir de votre réseau local, vous avez besoin d'un tunnelage IPv6-in-IPv4 afin de rejoindre l'Internet mondial IPv6.
Il y a différents mécanismes de tunnelage, et conséquemment, différentes façons d'installer des tunnels.
Il y a plus d'une façon de tunneler des paquets IPv6 sur des liens uniquement IPv4.
Un tunnel point-à-point est un tunnel dédié à un point de connexion terminal, qui connaît votre réseau IPv6 (pour le routage en retour) et l'adresse IPv4 de votre point de connexion (terminale), comme défini dans la RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers. Pré-requis:
L'adresse IPv4 de votre point de connexion terminal doit être globalement unique, statique, et accessible à partir de l'autre point de connexion terminal distant
Un préfixe IPv6 vous est assigné (voir le bureau d'enregistrement 6bone)
Une extrémité distante du tunnel capable de router votre préfixe IPv6 jusqu'à votre extrémité locale du tunnel (la plupart du temps, une configuration manuelle distante est requise)
Le cas du tunnelage automatique se présente quand un noeud se connecte directement à un autre noeud en ayant obtenu au préalable l'adresse IPv4 de l'autre noeud.
Le tunnelage 6to4 (RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds) utilise un mécanisme simple pour créer des tunnels automatiques. Tout noeud ayant une adresse unique globale IPv4 est capable d'être le point de connexion terminal d'un tunnel 6to4 (si aucun pare-feu IPv4 ne prohibe ce trafic). Foncièrement, le tunnelage 6to4 n'est pas un tunnel en binôme (one-to-one tunnel). Ce tunnelage se subdivise en un tunnelage d'un flux montant et d'un flux descendant. Une adresse IPv6 spéciale indique que ce noeud utilisera un tunnelage 6to4 pour se connnecter au réseau mondial IPv6.
Une adresse 6to4 est définie comme suit (le schéma provient du RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds):
| 3+13 | 32 | 16 | 64 bits | -+---+------+-----------+--------+--------------------------------+ -| FP+TLA | V4ADDR | SLA ID | Interface ID | -| 0x2002 | | | | -+---+------+-----------+--------+--------------------------------+ |
FP et TLA ensemble (16 bits) ont la valeur 0x2002. V4ADDR est l'adresse IPv4 globale et unique du noeud (en notation hexadécimale). SLA est l'identifiant de sous-réseau (65536 sous-réseaux locaux possibles). Ils sont utilisés pour représenter la structure locale de votre réseau.
Pour les passerelles, un tel préfixe est généré en utilisant normalement pour SLA “0000”, et pour suffixe “::1” (ce n'est pas une nécessité, il peut être déterminé arbitrairement, mais d'une portée locale) et assigné à l'interface de tunnelage 6to4. Notez que Windows Microsoft utilise aussi V4ADDR comme préfixe.
Le noeud doit savoir à quel point de connexion terminal étranger ses paquets IPv6 dans IPv4 doivent être envoyés. Aux tout premiers jours du tunnelage 6to4, des routeurs dédiés au tunnelage de flux ascendant avaient été définis. Voir l'information 6to4 de NSayer pour une liste de ses routeurs.
De nos jours, les routeurs de flux ascendant 6to4 peuvent être découverts comme par magie par l'emploi de l'adresse anycast 192.88.99.1. Les protocoles de routage s'occupent de cela en arrière-plan, voir le RFC 3068 / An Anycast Prefix for 6to4 Relay Routers pour les détails.
La méthode servant au flux descendant (du 6bone vers votre noeud disposant de 6to4) n'est pas vraiment bien fixée et peut varier selon l'hôte étranger vers qui sont envoyés les paquets originaux. Il existe deux possibilités:
l'hôte étranger utilise 6to4 et émet directement en retour les paquets à votre noeud (voir plus bas)
l'hôte étranger émet les paquets en retour vers le réseau mondial IPv6 et selon le routage dynamique qui a lieu alors, un routeur relais créera un tunnel automatique de retour vers votre noeud.
de 6to4 vers 6to4: est normalement tunnelé directement entre chacun des hôtes disposant de 6to4
de 6to4 vers un trafic non 6to4: est émis via le flux ascendant du tunnelage
un trafic non 6to4 vers 6to4: est émis via le flux descendant du tunnelage
Usage:
# /sbin/ip -6 tunnel show [<périphérique>] |
Exemple:
# /sbin/ip -6 tunnel show -sit0: ipv6/ip remote any local any ttl 64 nopmtudisc -sit1: ipv6/ip remote 195.226.187.50 local any ttl 64 |
Usage:
# /sbin/route -A inet6 |
Exemple (la sortie est filtrée afin de ne laisser apparaître que les tunnels empreintant l'interface sit0):
# /sbin/route -A inet6 | grep "\Wsit0\W*$" -::/96 :: U 256 2 0 sit0 -2002::/16 :: UA 256 0 0 sit0 -2000::/3 ::193.113.58.75 UG 1 0 0 sit0 -fe80::/10 :: UA 256 0 0 sit0 -ff00::/8 :: UA 256 0 0 sit0 |
Il y a 3 possibilités pour ajouter ou ôter un tunnel point-à-point.
Une bonne source d'information additionnelle à propos de l'installation de tunnel grâce à “ip” est configurer les tunnels avec iproute2 (article) (miroir).
La méthode la plus commune actuellement pour une petite quantité de tunnels.
Usage en vue de créer un périphérique de tunnelage (mais il n'est pas monté pour autant, une TTL doit également être spécifiée, car la valeur par défaut est 0)
# /sbin/ip tunnel add <périphérique> mode sit ttl <ttlpardéfaut> remote -¬ <adresseipv4dutunnelétranger> local <adresseipv4locale> |
Usage (exemple générique pour trois tunnels):
# /sbin/ip tunnel add sit1 mode sit ttl <ttlpardéfaut> remote -¬ <adresseipv4dutunnelétranger1> local <adresseipv4locale> -# /sbin/ip link set dev sit1 up -# /sbin/ip -6 route add <préfixepourlaroute1> dev sit1 metric 1 - -# /sbin/ip tunnel add sit2 mode sit ttl <ttlpardéfaut> -¬ <adresseipv4dutunnelétranger2> local <adresseipv4locale> -# /sbin/ip link set dev sit2 up -# /sbin/ip -6 route add <préfixepourlaroute2> dev sit2 metric 1 - -# /sbin/ip tunnel add sit3 mode sit ttl <ttlpardéfaut> -¬ <adresseipv4dutunnelétranger3> local <adresseipv4locale> -# /sbin/ip link set dev sit3 up -# /sbin/ip -6 route add <préfixepourlaroute3> dev sit3 metric 1 |
Ce n'est véritablement pas une méthode recommandée pour ajouter un tunnel, car elle est plutôt étrange. Pas de problème lors de l'ajout d'un seul tunnel, mais si vous en montez plus d'un, il ne vous est pas possible facilement de démonter le premier tout en laissant les autres fonctionner.
Usage (exemple générique pour trois tunnels):
# /sbin/ifconfig sit0 up - -# /sbin/ifconfig sit0 tunnel <adresseipv4dutunnelétranger1> -# /sbin/ifconfig sit1 up -# /sbin/route -A inet6 add <préfixepourlaroute1> dev sit1 - -# /sbin/ifconfig sit0 tunnel <adresseipv4dutunnelétranger2> -# /sbin/ifconfig sit2 up -# /sbin/route -A inet6 add <préfixepourlaroute2> dev sit2 - -# /sbin/ifconfig sit0 tunnel <adresseipv4dutunnelétranger3> -# /sbin/ifconfig sit3 up -# /sbin/route -A inet6 add <préfixepourlaroute3> dev sit3 |
Important: NE JAMAIS FAIRE DE LA SORTE, car cette façon de faire rend implicitement disponible le "tunnelage automatique" à partir de n'importe où dans l'Internet, c'est un risque, et cela ne devrait jamais être préconisé.
Il est aussi possible d'installer des tunnels dans le style Accès Multiple Sans Diffusion (Non Broadcast Multiple Access, ou NBMA), c'est un moyen facile d'ajouter de nombreux tunnels en une fois.
Usage (exemple générique pour trois tunnels):
# /sbin/ifconfig sit0 up - -# /sbin/route -A inet6 add <préfixepourlaroute1> gw -¬ ::<adresseipv4dutunnelétranger1> dev sit0 -# /sbin/route -A inet6 add <préfixepourlaroute2> gw -¬ ::<adresseipv4dutunnelétranger2> dev sit0 -# /sbin/route -A inet6 add <préfixepourlaroute3> gw -¬ ::<adresseipv4dutunnelétranger3> dev sit0 |
Important: NE JAMAIS FAIRE DE LA SORTE, car cette façon de faire rend implicitement disponible le "tunnelage automatique" à partir de n'importe où dans l'Internet, c'est un risque, et cela ne devrait jamais être préconisé.
Rarement réalisé manuellement, mais utilisé par les scripts pour une extinction propre ou un redémarrage de la configuration IPv6.
Pour ôter un périphérique de tunnelage:
# /sbin/ip tunnel del <périphérique> |
Usage (exemple générique pour trois tunnels):
# /sbin/ip -6 route del <préfixepourlaroute1> dev sit1 -# /sbin/ip link set sit1 down -# /sbin/ip tunnel del sit1 - -# /sbin/ip -6 route del <préfixepourlaroute2> dev sit2 -# /sbin/ip link set sit2 down -# /sbin/ip tunnel del sit2 - -# /sbin/ip -6 route del <préfixepourlaroute3> dev sit3 -# /sbin/ip link set sit3 down -# /sbin/ip tunnel del sit3 |
Ce n'est pas seulement la création qui est étrange, mais l'extinction aussi... vous devez ôter les tunnels dans l'ordre inverse, ce qui signifie que le premier créé doit être le dernier ôté.
Usage (exemple générique pour trois tunnels):
# /sbin/route -A inet6 del <préfixepourlaroute3> dev sit3 -# /sbin/ifconfig sit3 down - -# /sbin/route -A inet6 del <préfixepourlaroute2> dev sit2 -# /sbin/ifconfig sit2 down - -# /sbin/route -A inet6 add <préfixepourlaroute1> dev sit1 -# /sbin/ifconfig sit1 down - -# /sbin/ifconfig sit0 down |
Comme pour ôter des routes IPv6 courantes
Usage (exemple générique pour trois tunnels):
# /sbin/route -A inet6 del <préfixepourlaroute1> gw -¬ ::<adresseipv4dutunnelétranger1> dev sit0 -# /sbin/route -A inet6 del <préfixepourlaroute2> gw -¬ ::<adresseipv4dutunnelétranger2> dev sit0 -# /sbin/route -A inet6 del <préfixepourlaroute3> gw -¬ ::<adresseipv4dutunnelétranger3> dev sit0 - -# /sbin/ifconfig sit0 down |
Il est parfois nécessaire de configurer un tunnel point-à-point avec des adresses IPv6 comme pour IPv4 aujourd'hui. C'est seulement possible avec la première méthode (ifconfig+route - dépréciée) et la troisième méthode (ip+route) d'installation de tunnel. Dans de tels cas, vous pouvez ajouter l'adresse IPv6 à l'interface de tunnelage comme montré dans la configuration d'interface.
Prenez garde au fait que le support des tunnels 6to4 est actuellement manquant sur la série des noyaux vanille 2.2.x (voir la vérification du système / noyau pour plus de détails). Notez aussi que la longueur du préfixe d'une adresse 6to4 est de 16, car, du point de vue du réseau, tous les autres hôtes 6to4 sont sur la même couche 2.
Vous avez premièrement à calculer votre préfixe 6to4 en utilisant votre adresse IPv4 routable assignée localement (si votre hôte n'a pas d'adresse IPv4 routable, dans des cas précis, NAT sur une passerelle est possible):
En considérant que votre adresse IPv4 soit
1.2.3.4 |
le préfixe 6to4 généré sera
2002:0102:0304:: |
Les passerelles locales 6to4 devraient (mais cela n'est pas une nécessité, vous pouvez choisir un préfixe arbitraire de portée locale, si cela vous sied mieux) toujours assigner le suffixe “::1”, ce qui vous donnera comme adresse 6to4 locale
2002:0102:0304::1 |
Utiliser par exemple ce qui suit pour une génération automatique:
ipv4="1.2.3.4"; printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "` |
Il y a maintenant deux façons possibles de mettre en place un tunnelage 6to4.
C'est dorénavant la façon de faire qui est recommandée (une TTL doit être spécifiée, car le défaut est 0).
Créez un nouveau périphérique tunnel
# /sbin/ip tunnel add tun6to4 mode sit ttl <ttlpardéfaut> remote any local <adresseipv4locale> |
Montez l'interface
# /sbin/ip link set dev tun6to4 up |
Ajouter une adresse 6to4 locale à l'interface (note: la longueur du préfixe, 16, est importante!)
# /sbin/ip -6 addr add <adresse6to4locale>/16 dev tun6to4 |
Ajouter une route (par défaut) au réseau global IPv6 en utilisant l'adresse anycast tous-routeurs-6to4 (all-6to4-routers)
# /sbin/ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 |
Il a été rapporté que certaines versions de “ip” (par exemple Linux SuSe 9.0) ne prennent pas en charge les adresses IPv6 compatibles IPv4 pour les passerelles. Dans ce cas, l'adresse IPv6 correspondante doit être employée:
# /sbin/ip -6 route add 2000::/3 via 2002:c058:6301::1 dev tun6to4 metric 1 |
Cela est déprécié car le périphérique de tunnel générique sit0 ne permet pas de spécifier un filtrage par périphérique.
Monter l'interface de tunnelage générique sit0
# /sbin/ifconfig sit0 up |
Ajouter une adresse 6to4 locale à une interface
# /sbin/ifconfig sit0 add <adresse6to4locale>/16 |
Ajouter une route (par défaut) au réseau global IPv6 en utilisant l'adresse anycast IPv4 tous-relais-6to4 (all-6to4-relays)
# /sbin/route -A inet6 add 2000::/3 gw ::192.88.99.1 dev sit0 |
Ôter toutes les routes traversant ce périphérique de tunnelage spécifique
# /sbin/ip -6 route flush dev tun6to4 |
Démonter l'interface
# /sbin/ip link set dev tun6to4 down |
Ôter un périphérique tunnel
# /sbin/ip tunnel del tun6to4 |
Ôter une route (par défaut) traversant une interface tunnel 6to4
# /sbin/route -A inet6 del 2000::/3 gw ::192.88.99.1 dev sit0 |
Ôter une adresse locale 6to4 d'une interface
# /sbin/ifconfig sit0 del <adresse6to4locale>/16 |
Démontage d'un périphérique de tunnelage générique (prenez garde, peut-être est-il utilisé...)
# /sbin/ifconfig sit0 down |
Cela sera complété à l'avenir. Pour le moment, de tels tunnels sont essentiellement employés en environnement de test, mais il semble que le support soit actuellement manquant pour linux (03/2004).
Pour l'heure, plus d'information dans le RFC 2473 / Generic Packet Tunneling in IPv6 Specification
Note: la source de cette section est essentiellement le fichier "ip-sysctl.txt", qui est inclus dans les sources du noyau actuel, dans le répertoire "Documentation/networking". Le crédit va à Pekka Savola qui maintient la partie de ce fichier relative à IPv6. D'autres textes sont aussi plus ou moins copier/coller dans cette partie de document.
Utiliser "cat" et "echo" est le moyen le plus simple d'accéder au système de fichiers /proc, mais certains pré-requis sont nécessaires à cela
Le système de fichiers /proc doit être rendu disponible dans le noyau, ce qui signifie qu'à la compilation le commutateur suivant doit avoir été positionné
CONFIG_PROC_FS=y |
Le système de fichiers /proc doit être auparavant monté, ce qui peut être testé en faisant
# mount | grep "type proc" -none on /proc type proc (rw) |
Vous devez pouvoir lire le système de fichiers /proc et parfois aussi y écrire (normalement seul root le peut)
Normalement, seules les entrées dans /proc/sys/* sont en écriture, les autres sont en lecture seule et servent seulement à la récupération de l'information.
La valeur de l'entrée peut être récupérée en utilisant "cat":
# cat /proc/sys/net/ipv6/conf/all/forwarding -0 |
Une nouvelle valeur peut être fixée (si l'entrée est en écriture) en utilisant echo:
# echo "1" >/proc/sys/net/ipv6/conf/all/forwarding |
Utiliser le programme "sysctl" pour accéder aux commutateurs du noyau est une méthode moderne aujourd'hui. Vous pouvez aussi l'utiliser même si le système de fichiers /proc n'est pas monté. Mais vous n'avez alors accès qu'à /proc/sys/*!
Le programme “sysctl” est compris dans le paquetage “procps” (sur le système Red Hat).
L'interface sysctl doit être disponible dans le noyau, ce qui signifie qu'à la compilation le commutateur suivant a à être fixé
CONFIG_SYSCTL=y |
La valeur de l'entrée peut maintenant être récupérée:
# sysctl net.ipv6.conf.all.forwarding -net.ipv6.conf.all.forwarding = 0 |
Une nouvelle valeur peut être fixée (si l'entrée est en écriture):
# sysctl -w net.ipv6.conf.all.forwarding=1 -net.ipv6.conf.all.forwarding = 1 |
Note: n'utilisez pas d'espaces autour du signe "=" lorsque vous fixez les valeurs. De même pour une valeur multiple sur une même ligne, mettez des guillemets comme ceci
# sysctl -w net.ipv4.ip_local_port_range="32768 61000" -net.ipv4.ip_local_port_range = 32768 61000 |
Note: il existe dans la pratique certaines versions de sysctl qui affichent “/” au lieu de “.”
Pour plus de détails jetez un coup d'oeil dans la page de manuel de sysctl.
une astuce: pour une recherche rapide parmi les réglages, utiliser “-a” (afficher toutes les entrées) en conjonction avec “grep”.
IL y a plusieurs formats observés dans le système de fichiers /proc:
BOOLÉEN: simple “0” (faux) ou “1” (vrai)
ENTIER: une valeur entière, peut être également non signée
Des lignes plus sophistiquées avec plusieurs valeurs: parfois un en-tête est aussi affiché, sinon, jetez un coup d'oeil aux sources du noyau pour savoir quel sens possède telle ou telle valeur...
Changer les réglages par défaut spécifiques à chaque interface.
Changer tous les réglages spécifiques aux interfaces.
Exception: “conf/all/forwarding” a une signification différente ici
Type: BOOLÉEN
Ceci rend disponible le renvoi global IPv6 entre toutes les interfaces.
En IPv6, vous ne pouvez contrôler le renvoi par périphérique, le contrôle du renvoi doit être réalisé en utilisant les jeux de règles de netfilter-IPv6 (contrôlés grâce à ip6tables) en spécifiant les périphériques d'entrée et de sortie (voir comment mettre en place un pare-feu/Netfilter6 pour plus d'information); à la différence d'IPv4, où vous pouvez contrôler le renvoi périphérique par périphérique (la décision est prise sur l'interface qui reçoit des paquets).
Ceci fixe aussi le réglage du renvoi Hôte/Routeur de toutes les interfaces à la valeur spécifiée. Voir plus bas pour plus de détails. Tout ceci relève du renvoi global.
Si cette valeur est à 0, aucun renvoi IPv6 n'est disponible, jamais aucun paquet ne part vers une autre interface, ni physique, ni logique, comme par exemple un tunnel.
Changer les réglages spécifiques à chaque interface.
Le comportement fonctionnel de certains réglages est dépendant du positionnement du renvoi local, disponible ou non.
Type: BOOLÉEN
Défaut fonctionnel: disponible si le renvoi local est disponible; indisponible si le renvoi local est disponible.
Accepter les annonces de routeur, et auto-configurer cette interface avec les données reçues.
Type: BOOLÉEN
Défaut fonctionnel: disponible si le renvoi local est indisponible. Indisponible si le renvoi local est disponible.
Accepter les redirections émises par un routeur IPv6.
Type: BOOLÉEN
Défaut: VRAI
Configurer les adresses lien-local (voir aussi Les types d'adresse) utilisant les adresses matérielles L2. Par exemple, ceci génère, comme par magie, une adresse telle que “fe80::201:23ff:fe45:6789” sur une interface ayant une adresse MAC-L2.
Type: ENTIER
Défaut: 1
Quantité de message de détection d'adresse dupliquée à émettre.
Type: BOOLÉEN
Défaut: FAUX si le renvoi global est indisponible (défaut), sinon VRAI
Configurer le comportement spécifique à chaque interface Hôte/Routeur.
Note: Il est recommandé d'avoir le même réglage sur toutes les interfaces; mélanger les scénarii routeur/hôte est plutôt atypique.
Valeur FAUX: Par défaut, le comportement d'hôte est assumé. Cela signifie que:
Le drapeau IsRouter n'est pas positionné dans les annonces de voisinage.
Les sollicitations de routeur sont envoyées dès que nécessaires.
Si accept_ra est VRAI (défaut), accepte les annonces de routeur (et réalise une auto-configuration).
Si accept_redirects est VRAI (défaut), accepte les redirections.
Valeur VRAI: si le renvoi local est disponible, le comportement d'un routeur est assumé. Ceci signifie l'opposé de ce qui précéde:
Le drapeau IsRouter est positionné dans les annonces de voisinage.
Les sollicitations de routeur ne sont pas émises.
Les annonces de routeur sont ignorées.
Les redirections sont ignorées.
Type: ENTIER
Défaut: 1280 (minimum requis pour IPv6)
Unité de transfert maximum par défaut
Type: ENTIER
Défaut: 1
Nombre de secondes à attendre après le montage d'une interface avant d'émettre des sollicitations de routeur.
Type: ENTIER
Défaut: 4
Nombre de secondes d'attente entre les émissions de sollicitations de routeur.
Type: ENTIER
Défaut: 3
Nombre de sollicitation(s) de routeur à émettre avant de considérer qu'aucun routeur n'est présent.
Changer les réglages par défaut pour la détection de voisinage et certaines valeurs d'intervalle global et de déclenchement (threshold):
Type: ENTIER
Défaut: 1024
Paramètre de réglage de la taille de la table du voisinage.
Augmenter cette valeur si vous avez de nombreuses interfaces et un problème avec des routes qui commencent à mystérieusement s'activer et échouer. Ou si un démon de routage Zebra en cours d'activité rapporte cette erreur:
ZEBRA: netlink-listen error: No buffer space available, type=RTM_NEWROUTE(24), seq=426, pid=0 |
Changez ces réglages spécifiques à chaque interface pour la détection de voisinage.
Pour le moment (et cela sera valable jusqu'à ce qu'IPv4 soit complètement converti en un module indépendant du noyau), certains commutateurs IPv4 sont aussi utilisés par IPv6.
Ces réglages ne sont pas utilisés par IPv6. Pour réaliser une limitation du trafic ICMPv6 (ce qui est très recommandé compte tenu de possibles engorgements ICMPv6), des règles netfilter-v6 doivent être utilisées.
Dans /proc/net il y a plusieurs entrées disponibles en lecture seule. Vous ne pouvez pas utiliser ici “sysctl” afin de récupérer des informations, utiliser “cat”.
Type: Une ligne par adresse comporte plusieurs valeurs
Ici toutes les adresses IPv6 configurées sont montrées sous un format particulier. L'exemple affiche seulement l'interface loopback. Sa signification est détaillée ci-dessous (voir “net/ipv6/addrconf.c” pour en savoir plus).
# cat /proc/net/if_inet6 -00000000000000000000000000000001 01 80 10 80 lo -+------------------------------+ ++ ++ ++ ++ ++ -| | | | | | -1 2 3 4 5 6 |
L'adresse IPv6 affichée grâce à 32 caractères hexadécimaux sans le séparateur ":"
Numéro de périphérique Netlink (index d'interface) in hexadécimal (voir aussi “ip addr”)
La longueur du préfixe en hexadécimal
La valeur de la portée (voir les sources du noyau "include/net/ipv6.h" et "net/ipv6/addrconf.c" pour plus de détails)
Les drapeaux de l'interface (voir “include/linux/rtnetlink.h” et “net/ipv6/addrconf.c” pour en savoir plus)
Le nom du périphérique
Type: Une ligne par route comporte plusieurs valeurs
Ici toutes les routes IPv6 configurées sont montrées dans un format particulier. L'exemple affiche seulement l'interface loopback. Sa signification est détaillée ci-dessous (voir “net/ipv6/route.c” pour en savoir plus).
# cat /proc/net/ipv6_route -00000000000000000000000000000000 00 00000000000000000000000000000000 00 -+------------------------------+ ++ +------------------------------+ ++ -| | | | -1 2 3 4 - -¬ 00000000000000000000000000000000 ffffffff 00000001 00000001 00200200 lo -¬ +------------------------------+ +------+ +------+ +------+ +------+ ++ -¬ | | | | | | -¬ 5 6 7 8 9 10 |
Le réseau de destination IPv6 affiché grâce à 32 caractères hexadécimaux sans le séparateur ":"
La longueur du préfixe de destination IPv6 en hexadécimal
Le réseau source IPv6 affiché grâce à 32 caractères hexadécimaux sans le séparateur ":"
La longueur du préfixe de la source IPv6 en hexadécimal
Le prochain saut IPv6 affiché grâce à 32 caractères hexadécimaux sans le séparateur ":"
La distance en hexadécimal
Compteur de référence
Compteur d'utilisation
Les drapeaux
Nom du périphérique
Type: Une ligne par protocole avec description et valeur
Statistiques à propos de l'utilisation des sockets IPv6. Exemple:
# cat /proc/net/sockstat6 -TCP6: inuse 7 -UDP6: inuse 2 -RAW6: inuse 1 -FRAG6: inuse 0 memory 0 |
Type: Une ligne par description et valeur SNMP
Statistiques SNMP, peuvent être récupérées par un serveur SNMP et mis en rapport à une tableau MIB grâce à un logiciel d'administration réseau.
C'est toujours intéressant de savoir quelles sockets de serveur sont actives à un moment donné sur un noeud. Utiliser “netstat” est le moyen le plus court pour obtenir une telle information:
options employées: -nlptu
Exemple:
# netstat -nlptu -Active Internet connections (only servers) -Proto Recv-Q Send-Q Local Address Foreign Address State -¬ PID/Program name -tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN -¬ 1258/rpc.statd -tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN -¬ 1502/rpc.mountd -tcp 0 0 0.0.0.0:515 0.0.0.0:* LISTEN -¬ 22433/lpd Waiting -tcp 0 0 1.2.3.1:139 0.0.0.0:* LISTEN -¬ 1746/smbd -tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -¬ 1230/portmap -tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN -¬ 3551/X -tcp 0 0 1.2.3.1:8081 0.0.0.0:* LISTEN -¬ 18735/junkbuster -tcp 0 0 1.2.3.1:3128 0.0.0.0:* LISTEN -¬ 18822/(squid) -tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN -¬ 30734/named -tcp 0 0 ::ffff:1.2.3.1:993 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 :::13 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 ::ffff:1.2.3.1:143 :::* LISTEN -¬ 6742/xinetd-ipv6 -tcp 0 0 :::53 :::* LISTEN -¬ 30734/named -tcp 0 0 :::22 :::* LISTEN -¬ 1410/sshd -tcp 0 0 :::6010 :::* LISTEN -¬ 13237/sshd -udp 0 0 0.0.0.0:32768 0.0.0.0:* -¬ 1258/rpc.statd -udp 0 0 0.0.0.0:2049 0.0.0.0:* -¬ - -udp 0 0 0.0.0.0:32770 0.0.0.0:* -¬ 1502/rpc.mountd -udp 0 0 0.0.0.0:32771 0.0.0.0:* -¬ - -udp 0 0 1.2.3.1:137 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:137 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 1.2.3.1:138 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:138 0.0.0.0:* -¬ 1751/nmbd -udp 0 0 0.0.0.0:33044 0.0.0.0:* -¬ 30734/named -udp 0 0 1.2.3.1:53 0.0.0.0:* -¬ 30734/named -udp 0 0 127.0.0.1:53 0.0.0.0:* -¬ 30734/named -udp 0 0 0.0.0.0:67 0.0.0.0:* -¬ 1530/dhcpd -udp 0 0 0.0.0.0:67 0.0.0.0:* -¬ 1530/dhcpd -udp 0 0 0.0.0.0:32858 0.0.0.0:* -¬ 18822/(squid) -udp 0 0 0.0.0.0:4827 0.0.0.0:* -¬ 18822/(squid) -udp 0 0 0.0.0.0:111 0.0.0.0:* -¬ 1230/portmap -udp 0 0 :::53 :::* -¬ 30734/named |
Suivent quelques exemples de paquets capturés, cela sera peut-être utile pour vos propres déboguages...
...plus d'info à venir...
15:43:49.484751 fe80::212:34ff:fe12:3450 > ff02::1: icmp6: router -¬ advertisement(chlim=64, router_ltime=30, reachable_time=0, -¬ retrans_time=0)(prefix info: AR valid_ltime=30, preffered_ltime=20, -¬ prefix=2002:0102:0304:1::/64)(prefix info: LAR valid_ltime=2592000, -¬ preffered_ltime=604800, prefix=3ffe:ffff:0:1::/64)(src lladdr: -¬ 0:12:34:12:34:50) (len 88, hlim 255) |
Un routeur, avec pour adresse lien-local “fe80::212:34ff:fe12:3450”, émet une annonce à l'adresse multicast tous-les-noeuds-du-lien (all-node-on-link) “ff02::1”, contenant deux préfixes, “2002:0102:0304:1::/64” (d'une durée de vie de 30 s) et “3ffe:ffff:0:1::/64” (d'une durée de vie de 2592000 s), incluant sa propre adresse MAC de couche 2, “0:12:34:12:34:50”.
15:44:21.152646 fe80::212:34ff:fe12:3456 > ff02::2: icmp6: router solicitation -¬ (src lladdr: 0:12:34:12:34:56) (len 16, hlim 255) |
Un noeud, avec pour adresse lien-local “fe80::212:34ff:fe12:3456” et comme adresse de couche 2 “0:12:34:12:34:56”, est en quête d'un routeur présent sur le lien, en conséquence il émet cette sollicitation à l'adresse multicast tous-routeurs-présents-sur-le-lien (all-router-on-link) “ff02::2”.
Les paquets suivants sont émis par un noeud sur la couche 2, adresse MAC “0:12:34:12:34:56”, pendant l'auto-configuration, afin de vérifier si une adresse potentielle est déjà employée ou non par un autre noeud sur le lien permettant d'émettre ces paquets, via l'adresse multicast lien-local du noeud sollicité.
Le noeud veut configurer son lien-local avec l'adresse “fe80::212:34ff:fe12:3456”, il est en train de vérifier s'il y a duplication
15:44:17.712338 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ fe80::212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim 255) |
Le noeud veut configurer son adresse globale “2002:0102:0304:1:212:34ff:fe12:3456” (après avoir reçu l'annonce montrée plus haut), il est en train de vérifier s'il y a ou non duplication
15:44:21.905596 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ 2002:0102:0304:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, -¬ hlim 255) |
Le noeud veut configurer son adresse globale “3ffe:ffff:0:1:212:34ff:fe12:3456” (après avoir reçu l'annonce montrée plus haut), il est en train de vérifier s'il y a ou non duplication
15:44:22.304028 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has -¬ 3ffe:ffff:0:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim -¬ 255) |
Un noeud veut émettre des paquets à “3ffe:ffff:0:1::10” mais il n'a aucune adresse MAC de la couche 2 vers laquelle il pourrait émettre, il émet alors maintenant une sollicitation
13:07:47.664538 2002:0102:0304:1:2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6: -¬ neighbor sol: who has 3ffe:ffff:0:1::10(src lladdr: 0:e0:18:90:92:5) (len 32, -¬ hlim 255) |
Ce noeud recherche maintenant “fe80::10”
13:11:20.870070 fe80::2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6: neighbor -¬ sol: who has fe80::10(src lladdr: 0:e0:18:90:92:5) (len 32, hlim 255) |
Certaines distributions Linux contiennent déjà un support à la configuration persistante IPv6 utilisant une configuration nouvelle ou préexistante, des fichiers de script, et des accroches dans les fichiers de script IPv4.
Depuis que j'ai commencé à écrire l'Howto -IPv6 & Linux , il était dans mon intention de rendre disponible une configuration convenant aux cas les plus fréquents tels que hôte simple, routeur simple, hôte à double résidence, routeur avec un second tronçon réseau, tunnel typique, tunnel 6to4, etc. De nos jours, il existe des fichiers de configuration et des scripts qui font très bien ce travail (je n'ai jamais entendu parler de vrais problèmes, mais je ne sais pas s'ils sont beaucoup utilisés). Parce que cette configuration et ces scripts augmentent régulièrement en volume, ils ont leur propre page HOWTO: initscripts-ipv6 (miroir). Parce que j'ai commencé mon expérience IPv6 sur un clone de la Linux Red Hat 5.0, mes développements concernant IPv6 sont encore essentiellement basés sur Linux Red Hat, il est par conséquent un peu logique que ces scripts soient développés sur ce type de distribution (on appelle ça une raison historique). Il est ainsi très facile d'étendre certains de ces fichiers de configuration, d'en créer de nouveaux et de créer de simples accroches d'appel à l'installation d'IPv6 à partir de l'installation d'IPV4.
Depuis la Red Hat 7.1, une archive de mes scripts y est incluse. Cela est dû, et cela sera encore vrai à l'avenir, à l'assistance de Pekka Savola.
La Mandrake, depuis la version 8.0, inclut aussi un paquetage initscript prêt pour IPv6, cependant un bogue mineur retient de l'employer (il manque 'inet6” à “ifconfig” avant “add”).
Vous pouvez tester si votre distribution Linux contient le support pour la configuration persistante IPv6 utilisant mon jeu d'outils. Le script de la bibliothèque devrait exister:
/etc/sysconfig/network-scripts/network-functions-ipv6 |
Un test magique:
# test -f /etc/sysconfig/network-scripts/network-functions-ipv6 && echo "Main -¬ IPv6 script library exists" |
La version de la bibliothèque est importante s'il vous manque certaines fonctionnalités. Vous pouvez l'obtenir en exécutant ce qui suit (ou d'une façon encore plus aisée en regardant le haut du fichier):
# source /etc/sysconfig/network-scripts/network-functions-ipv6 && -¬ getversion_ipv6_functions -20011124 |
Dans l'exemple montré, la version utilisée est la 20011124. Vérifiez cela par rapport à l'information la plus à jour sur la page initscripts-ipv6 (miroir) afin de voir ce qui a changé. Vous y trouverez aussi un journal des modifications.
Vérifiez si votre système a déjà le module IPv6 chargé
# modprobe -c | grep net-pf-10 -alias net-pf-10 off |
Si le résultat est “off”, alors rendez disponible la mise en réseau IPv6 en éditant /etc/sysconfig/network, ajoutez la nouvelle ligne
NETWORKING_IPV6=yes |
Redémarrez la machine, ou simplement le réseau par
# service network restart |
Maintenant le module IPv6 devrait être chargé
# modprobe -c | grep ipv6 -alias net-pf-10 ipv6 |
Si votre système est sur un lien fournissant l'annonce de routeur, la configuration sera réalisée automatiquement. Pour plus d'information sur les réglages supportées, voir /usr/share/doc/initscripts-$version/sysconfig.txt.
Dans les nouvelles versions, il n'y a véritablement qu'un support rudimentaire disponible, voir /etc/rc.config pour les détails.
A cause de sa configuration très différente et de la structure de ses scripts, il est difficile (voire impossible) d'utiliser le jeu d'outils de Linux Red Hat et de ses clones avec cette distribution. -Dans les versions 8.x, SuSE va complétement modifier l'installation de sa configuration.
Editez le fichier /etc/sysconfig/network/ifcfg-<nom-de-l'interface> et fixez la valeur suivante
IP6ADDR="<Adresse-ipv6>/<préfixe>" |
Editez le fichier /etc/sysconfig/network/ifcfg-<nom-de-l'interface> et fixez la valeur suivante
IPADDR="<Adresse-ipv6>/<préfixe>" |
Les informations qui suivent sont une contribution de Stéphane Bortzmeyer <bortzmeyer chez nic point fr>
Assurez-vous qu'IPv6 soit chargé; soit il est compilé dans le noyau, soit il est chargé comme module. Dans ce dernier cas, trois solutions, l'ajouter à /etc/modules, utiliser la configuration ci-dessous, ou utiliser kmod (non détaillé ici).
Configurez votre interface. Par exemple, ici, nous considérons la prise en compte de eth0, avec pour adresse “3ffe:ffff:1234:5::1:1”. Editez /etc/network/interfaces :
iface eth0 inet6 static - pre-up modprobe ipv6 - address 3ffe:ffff:1234:5::1:1 - # Pour rendre complètement indisponible l'auto-configuration: - # up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf - netmask 64 - # Le routeur est auto-configuré, et n'a pas d'adresse fixe. - # Il est déterminé comme par magie - # (/proc/sys/net/ipv6/conf/all/accept_ra). Sinon: - # gateway 3ffe:ffff:1234:5::1 |
Puis vous rebootez, ou alors vous faites juste
# ifup --force eth0 |
Et vous avez votre adresse statique.
IPv6 sur Linux Debian par Craig Small
HowTo pour Freenet6 & les utilisateurs Debian de Jean-Marc Liotier (annoncé le 24.12.2002 sur la liste de diffusion users@ipv6.org )
Est supportée et observée sur l'adresse lien-local assignée après le montage d'une interface sur laquelle IPv6 est disponible.
Exemple:
# ip -6 addr show dev eth0 scope link - 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qlen1000 - inet6 fe80::211:d8ff:fe6b:f0f5/64 scope link - valid_lft forever preferred_lft forever |
A compléter. Voir plus bas l'auto-configuration par le démon radvd (Router Advertisement Daemon).
Après de longues discussions concernant les difficultés, le RFC 3315 / Dynamic Host Configuration Protocol for IPv6 (DHCPv6) a finalement vu le jour. Au moment de la mise à jour de ce passage (10/2005), il existe deux implémentations:
Dibbler par Tomasz Mrugalski <thomson chez klub point com point pl>
A compléter.
Pour le moment, voir la page d'accueil sur la mobilité IPv6 sur Linux (MIPL) pour plus de détails. Plus d'information peut être trouvée ici (merci de signaler les liens brisés):
draft-oneill-mipv6-cao-??.txt / MIPv6 Care of Address Option
draft-mccann-mobileip-80211fh-??.txt / Mobile IPv6 Fast Handovers for 802.11 Networks
draft-haberman-ipv6-anycast-rr-??.txt / IPv6 Anycast Binding using Return Routability
draft-mun-aaa-localkm-mobileipv6-??.txt / Localized Key Management for AAA in MobileIPv6
draft-thubert-nemo-ro-taxonomy-??.txt / Taxonomy of Route Optimization Models in the NEMO Context
draft-le-aaa-diameter-mobileipv6-??.txt / Diameter Mobile IPv6 Application
draft-wakikawa-manet-globalv6-??.txt / Global Connectivity for IPv6 Mobile Ad Hoc Networks
draft-ietf-mobileip-fast-mipv6-??.txt / Fast Handovers for Mobile IPv6
draft-ohnishi-mobileip-v6vpngateway-??.txt / Mobile IPv6 VPN using Gateway Home Agent
draft-ietf-mobileip-hmipv6-??.txt / Hierarchical MIPv6 mobility management (HMIPv6)
draft-mkhalil-ipv6-fastra-??.txt / IPv6 Fast Router Advertisement
draft-okazaki-mobileip-abk-??.txt / Securing MIPv6 Binding Updates Using Address Based Keys (ABKs)
draft-vriz-mobileip-hbhlmap-??.txt / Hop-by-Hop Local Mobility Agents Probing for Mobile IPv6
draft-suh-rmm-??.txt / Regional Mobile IPv6 mobility management
draft-mccann-mobileip-ipv6mipv4-??.txt / IPv6 over Mobile IPv4
draft-kempf-mobileip-fmipv6-sem-??.txt / Improving the Architectural Alignment for FMIPv6
Mettre en place un pare-feu IPv6 est très important, tout spécialement si IPv6 est utilisé sur un intranet avec des adresses IPv6 globales. Car, à la différence des réseaux IPv4 où les hôtes internes courants sont protégés par l'usage d'adresses IPv4 privées comme défini par le RFC 1918 / Address Allocation for Private Internets ou l'adressage IP privée automatique (Automatic Private IP Addressing, ou APIPA) recherche Google "Microsoft + APIPA", en IPv6, les adresses globales sont normalement utilisées, et quelqu'un possédant une connectivité IPv6 peut atteindre tous les noeuds propres à un intranet disposant d'IPv6.
La mise en place d'un pare-feu IPv6 est nativement supportée par les noyaux dont la version est supérieure à 2.4. Avec les anciennes versions inférieures à 2.2, vous pouvez seulement filtrer IPv6-in-IPv4 par le protocole 41.
Attention: il n'y a aucune garantie que les règles décrites ou les exemples fournis puissent protéger votre système!
Faites un audit de votre jeu de règles après son installation, voir l'audit de sécurité sur IPv6 pour en savoir plus.
Notez aussi que le projet USAGI finalise actuellement son travail sur la traque de connexion pour IPv6! Cela rendra la création de jeu de règles plus simple et plus sûre à l'avenir!
Récupérez les dernières sources du noyau: http://www.kernel.org/
Récupérez le dernier paquetage d'iptables:
Les sources en archive tar (pour patcher le noyau): http://www.netfilter.org/
Les sources en RPM pour reconstruire les binaires (pour les systèmes RedHat): ftp://ftp.redhat.com/redhat/linux/rawhide/SRPMS/SRPMS/ ou peut-être encore dans http://www.netcore.fi/pekkas/linux/ipv6/
Déplacez-vous dans le répertoire des sources:
# cd /chemin/vers/les/sources |
Décompactez et renommez les sources du noyau
# tar z|jxf kernel-version.tar.gz|bz2 -# mv linux linux-version-iptables-version+IPv6 |
Décompactez les sources d'iptables
# tar z|jxf iptables-version.tar.gz|bz2 |
Déplacez-vous dans le répertoire iptables
# cd iptables-version |
Appliquez les patchs en attente
# make pending-patches KERNEL_DIR=/chemin/vers/les/sources/linux-version-iptables-version+IPv6/ |
Appliquez les patchs additionnels relatifs à IPv6 (pas encore inclus dans le noyau vanille)
# make patch-o-matic KERNEL_DIR=/path/to/src/linux-version-iptables-version/ |
Répondez par l'affirmative aux options suivantes (iptables-1.2.2)
ah-esp.patch
masq-dynaddr.patch (nécessaire seulement sur les systèmes ayant une adresse IP dynamique à la connexion au WAN, comme pour PPP ou PPPoE)
ipv6-agr.patch.ipv6
ipv6-ports.patch.ipv6
LOG.patch.ipv6
REJECT.patch.ipv6
Vérifier la présence des extensions IPv6
# make print-extensions -Extensions found: IPv6:owner IPv6:limit IPv6:mac IPv6:multiport |
Déplacez-vous dans les sources du noyau
# cd /chemin/vers/les/sources/linux-version-iptables-version/ |
Editez Makefile
- EXTRAVERSION = -+ EXTRAVERSION = -iptables-version+IPv6-try |
Lancez configure, avec IPv6 de disponible
Code maturity level options - Prompt for development and/or incomplete code/drivers : yes - Networking options - Network packet filtering: yes - The IPv6 protocol: module - IPv6: Netfilter Configuration - IP6 tables support: module - All new options like following: - limit match support: module - MAC address match support: module - Multiple port match support: module - Owner match support: module - netfilter MARK match support: module - Aggregated address check: module - Packet filtering: module - REJECT target support: module - LOG target support: module - Packet mangling: module - MARK target support: module |
Configurez aussi tout ce qui concerne votre système
Compilez et installez: voir ici même la section noyau et autres HOWTO
Assurez-vous que l'arborescence des sources du noyau existe aussi dans /usr/src/linux/
Renommez l'ancien répertoire
# mv /usr/src/linux /usr/src/linux.old |
Créez un nouveau lien symbolique
# ln -s /chemin/vers/src/linux-version-iptables-version /usr/src/linux |
Reconstruisez le SRPM
# rpm --rebuild /chemin/vers/SRPM/iptables-version-release.src.rpm |
Installez les nouveaux paquetages iptables (iptables + iptables-ipv6)
Sur les systèmes RH 7.1, normalement, une ancienne version est installée, en conséquence utiliser "freshen"
# rpm -Fhv /chemin/vers/RPMS/cpu/iptables*-version-release.cpu.rpm |
Si elle n'était pas installée, utiliser "install"
# rpm -ihv /chemin/vers/RPMS/cpu/iptables*-version-release.cpu.rpm |
Sur les systèmes RH 6.2, normalement, aucun noyau 2.4.x n'est installé, conséquemment les pré-requis ne correspondent pas. Utiliser "--nodeps" pour l'installer
# rpm -ihv --nodeps /chemin/vers/RPMS/cpu/iptables*-version-release.cpu.rpm |
Il sera peut-être nécessaire de créer un lien symbolique vers le lieu où les bibliothèques iptables sont
# ln -s /lib/iptables/ /usr/lib/iptables |
Chargez le module, s'il est compilé
# modprobe ip6_tables |
Vérifiez si le noyau courant prend en charge iptables
# [ ! -f /proc/net/ip6_tables_names ] && echo "Current kernel doesn't support -¬ 'ip6tables' firewalling (IPv6)!" |
de façon abrégée
# ip6tables -L |
de façon détaillée
# ip6tables -n -v --line-numbers -L |
# ip6tables --table filter --append INPUT -j LOG --log-prefix "INPUT:" -¬ --log-level 7 |
# ip6tables --table filter --append INPUT -j DROP |
Avec les plus anciens noyaux (noyau non patché 2.4.5 et iptables-1.2.2), aucun type ne peut être spécifié
Accepter le trafic ICMPv6 entrant dans les tunnels
# ip6tables -A INPUT -i sit+ -p icmpv6 -j ACCEPT |
Autoriser le trafic ICMPv6 sortant des tunnels
# ip6tables -A OUTPUT -o sit+ -p icmpv6 -j ACCEPT |
Les nouveaux noyaux permettent de spécifier les types ICMPv6:
# ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT |
Il peut arriver (l'auteur l'a déjà vu) qu'un engorgement ICMPv6 se produise, c'est pourquoi vous devriez utiliser la limitation de débit, puisqu'elle est disponible, et ce, au moins pour le jeu de règles ICMPv6. De plus, des règles de journalisation devraient aussi être mises en place pour garder trace d'attaques DoS, grâce à syslog et au stockage des fichiers de log. Un exemple de limitation du débit ICMPv6 ressemble à ceci:
# ip6tables -A INPUT --protocol icmpv6 --icmpv6-type echo-request -¬ -j ACCEPT --match limit --limit 30/minute |
Ici l'exemple montré est un jeu de règles permettant les connexions entrantes SSH par une adresse IPv6 donnée
Autoriser le trafic entrant SSH provenant de 3ffe:ffff:100::1/128
# ip6tables -A INPUT -i sit+ -p tcp -s 3ffe:ffff:100::1/128 --sport 512:65535 -¬ --dport 22 -j ACCEPT |
Autoriser les paquets réponse (pour le moment, la traque du trafic IPv6 n'est pas au coeur de l'implémentation de netfilter)
# ip6tables -A OUTPUT -o sit+ -p tcp -d 3ffe:ffff:100::1/128 --dport 512:65535 -¬ --sport 22 ! --syn j ACCEPT |
Pour accepter les paquets tunnelés IPv6-in-IPv4, vous devez insérer des règles dans votre installation de pare-feu IPv4 relatives à de tels paquets, pour exemple
Accepter le trafic entrant IPv6-in-IPv4 sur l'interface ppp0
# iptables -A INPUT -i ppp0 -p ipv6 -j ACCEPT |
Permettre au trafic IPv6-in-IPv4 de sortir par l'interface ppp0
# iptables -A OUTPUT -o ppp0 -p ipv6 -j ACCEPT |
Si vous avez seulement un tunnel statique, vous pouvez aussi spécifier l'adresse IPv4, comme ici
Accepter le trafic entrant IPv6-in-IPv4 sur l'interface ppp0 et provenant de l'extrémité du tunnel 1.2.3.4
# iptables -A INPUT -i ppp0 -p ipv6 -s 1.2.3.4 -j ACCEPT |
Autoriser le trafic sortant IPv6-in-IPv4 vers l'interface ppp0 pour l'extrémité du tunnel 1.2.3.4
# iptables -A OUTPUT -o ppp0 -p ipv6 -d 1.2.3.4 -j ACCEPT |
TRÈS RECOMMANDÉ! Pour des questions de sécurité, vous devriez vraiment insérer une règle qui bloque les requêtes de connexion TCP entrante. Ajouter l'option "-i", si d'autres noms d'interface sont utilisés!
Bloquer les requêtes de connexion entrante TCP vers cet hôte
# ip6tables -I INPUT -i sit+ -p tcp --syn -j DROP |
Bloquer les requêtes de connexion entrante TCP allant vers les hôtes placés derrière ce routeur
# ip6tables -I FORWARD -i sit+ -p tcp --syn -j DROP |
Peut-être ces règles doivent-elles être placées sous d'autres, mais ça, c'est votre travail. La meilleure façon de faire est de créer un script et d'exécuter les règles d'une manière spécifique.
TRÈS RECOMMANDÉ AUSSI! Comme il a été dit dans la section concernant la mise en place d'un pare-feu, il est possible de contrôler les ports des sessions sortantes UDP/TCP. Si tous vos systèmes IPv6 locaux utilisent les ports locaux, par exemple de 32768 à 60999, vous êtes aussi capables de filtrer les connexions UDP (jusqu'à ce que la traque des connexions fonctionnent) comme suit:
Bloquer les paquets entrants UDP qui ne peuvent être des réponses de requêtes sortantes de cet hôte
# ip6tables -I INPUT -i sit+ -p udp ! --dport 32768:60999 -j DROP |
Bloquer les paquets entrants UDP qui ne peuvent être des réponses de requêtes d'hôtes placés derrière ce routeur, et transitant à travers lui
# ip6tables -I FORWARD -i sit+ -p udp ! --dport 32768:60999 -j DROP |
Les lignes qui suivent montrent en exemple une installation plus sophistiquée. Bonne création de jeux de règles netfilter6...
# ip6tables -n -v -L -Chain INPUT (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination - 0 0 extIN all sit+ * ::/0 ::/0 - 4 384 intIN all eth0 * ::/0 ::/0 - 0 0 ACCEPT all * * ::1/128 ::1/128 - 0 0 ACCEPT all lo * ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `INPUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain FORWARD (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination -¬ - 0 0 int2ext all eth0 sit+ ::/0 ::/0 - 0 0 ext2int all sit+ eth0 ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `FORWARD-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain OUTPUT (policy DROP 0 packets, 0 bytes) - pkts bytes target prot opt in out source destination -¬ - 0 0 extOUT all * sit+ ::/0 ::/0 - 4 384 intOUT all * eth0 ::/0 ::/0 - 0 0 ACCEPT all * * ::1/128 ::1/128 - 0 0 ACCEPT all * lo ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `OUTPUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain ext2int (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `ext2int-default:' - 0 0 DROP tcp * * ::/0 ::/0 - 0 0 DROP udp * * ::/0 ::/0 - 0 0 DROP all * * ::/0 ::/0 - -Chain extIN (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT tcp * * 3ffe:400:100::1/128 ::/0 -¬ tcp spts:512:65535 dpt:22 - 0 0 ACCEPT tcp * * 3ffe:400:100::2/128 ::/0 -¬ tcp spts:512:65535 dpt:22 - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02 - 0 0 ACCEPT udp * * ::/0 ::/0 -¬ udp spts:1:65535 dpts:1024:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `extIN-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain extOUT (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT tcp * * ::/0 -¬ 3ffe:ffff:100::1/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02 - 0 0 ACCEPT tcp * * ::/0 -¬ 3ffe:ffff:100::2/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02 - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1024:65535 dpts:1:65535 - 0 0 ACCEPT udp * * ::/0 ::/0 -¬ udp spts:1024:65535 dpts:1:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `extOUT-default:' - 0 0 DROP all * * ::/0 ::/0 - -Chain int2ext (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT icmpv6 * * ::/0 ::/0 - 0 0 ACCEPT tcp * * ::/0 ::/0 -¬ tcp spts:1024:65535 dpts:1:65535 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `int2ext:' - 0 0 DROP all * * ::/0 ::/0 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `int2ext-default:' - 0 0 DROP tcp * * ::/0 ::/0 - 0 0 DROP udp * * ::/0 ::/0 - 0 0 DROP all * * ::/0 ::/0 - -Chain intIN (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT all * * ::/0 -¬ fe80::/ffc0:: - 4 384 ACCEPT all * * ::/0 ff02::/16 - -Chain intOUT (1 references) - pkts bytes target prot opt in out source destination -¬ - 0 0 ACCEPT all * * ::/0 -¬ fe80::/ffc0:: - 4 384 ACCEPT all * * ::/0 ff02::/16 - 0 0 LOG all * * ::/0 ::/0 -¬ LOG flags 0 level 7 prefix `intOUT-default:' - 0 0 DROP all * * ::/0 ::/0 |
Il est très recommandé d'appliquer tous les patchs disponibles, de rendre indisponibles tous les services inutiles, d'associer les services nécessaires aux adresses IPv4/IPv6 et d'installer un pare-feu local.
A remplir plus avant...
De nombreux services utilisent la bibliothèque tcp_wrapper pour contrôler l'accès. Plus bas est décrite l'utilisation de tcp_wrapper.
A remplir plus avant...
Actuellement, il n'existe pas d'outil véritablement adéquate aux questions de sécurité IPv6 et capable de vérifier un système monté sur le réseau. Ni Nessus ni aucun autre scanner de sécurité provenant du commerce n'est capable, autant que je sache, de scanner les adresses IPv6.
ATTENTION: Prenez bien garde d'uniquement scanner vos propres systèmes, ou alors seulement après avoir reçu une autorisation écrite, sinon des problèmes d'ordre juridique risquent de vous arriver. -VERIFIER A DEUX FOIS les adresses IPv6 avant de lancer un scan.
Avec netcat disposant d'IPv6 (voir IPv6+Linux-status-apps/security-auditing pour en savoir plus), vous pouvez lancer un scan de ports via un script qui balaiera un intervalle de ports, captera des bannières, etc. Un exemple d'utilisation:
# nc6 ::1 daytime -13 JUL 2002 11:22:22 CEST |
NMap, l'un des meilleurs scanners de ports à travers le monde, supporte IPv6 depuis la version 3.10ALPHA1. Un exemple d'utilisation:
# nmap -6 -sT ::1 -Starting nmap V. 3.10ALPHA3 ( www.insecure.org/nmap/ ) -Interesting ports on localhost6 (::1): -(The 1600 ports scanned but not shown below are in state: closed) -Port State Service -22/tcp open ssh -53/tcp open domain -515/tcp open printer -2401/tcp open cvspserver -Nmap run completed -- 1 IP address (1 host up) scanned in 0.525 seconds |
Strobe est (comparé à NMap) un scanner de ports pour les petits budgets, mais il y a un patch disponible pour le rendre prêt pour IPv6 (voir IPv6+Linux-status-apps/security-auditing pour plus d'information). Un exemple d'utilisation:
# ./strobe ::1 strobe 1.05 (c) 1995-1999 Julian Assange <proff@iq.org>. -::1 2401 unassigned unknown -::1 22 ssh Secure Shell - RSA encrypted rsh -::1 515 printer spooler (lpd) -::1 6010 unassigned unknown -::1 53 domain Domain Name Server |
Note: strobe n'est plus véritablement en développement, le numéro de version montré n'est pas le bon.
Si le résultat de l'audit ne correspond pas à votre politique de sécurité IPv6, mettez en place le pare-feu IPv6 pour combler les trous de sécurité, par exemple en utilisant netfilter6 (voir Mettre en place un pare-feu grâce à Netfilter6 pour plus de détails).
Info: une information plus détaillée concernant la sécurité IPv6 peut être trouvée ici:
A la différence d'IPv4, l'encryptage et l'authentification sont des fonctionnalités que ne fournit pas IPv6 lui-même. Elles sont normalement implémentées par l'utilisation d'IPsec (qui peut également être employé par IPv4).
Deux modes d'encryptage et d'authentification sont possibles:
Le mode transport est un mode de connexion réellement de bout-en-bout. Ici, seule la charge utile (généralement ICMP, TCP ou UDP) est encryptée avec son en-tête particulier, tandis que l'en-tête IP n'est pas encrypté (mais couramment inclus dans l'authentification).
Utilisant AES-128 pour l'encryptage et SHA1 pour l'authentification, ce mode diminue la MTU de 42 octets.
Le mode tunnel peut être utilisé soit dans un mode de connexion de bout-en-bout soit dans un mode de connexion de passerelle-à-passerelle. Ici, le paquet IP complet est encrypté et prend un nouvel en-tête IP, le tout constituant un nouveau paquet (ce mécanisme étant connu sous le nom d'encapsulation).
Cependant, à cause de l'indépendance de l'encryptage et de l'authentification à l'égard du protocole d'échange de clés, il existe actuellement des problèmes d'interopérabilité. Ce mode diminue actuellement de 40 octets par rapport au mode transport. Utiliser AES-128 pour l'encryptage et SHA1 pour l'authentification diminue donc au total de 82 octets la MTU courante.
Manquant à ce jour jusqu'au noyau 2.4.28 vanille, le problème était de garder les sources du noyau Linux éloignées des questions de contrôles légaux d'import/export concernant le code d'encryptage en général. C'est une des raisons pour lesquelles le projet FreeS/WAN (IPsec pour IPv4 seulement) n'était pas compris dans les sources vanille. Un rétro-portage à partir de 2.6.x sera peut-être réalisé un jour.
Les versions actuelles (2.6.9 et supérieures, au moment de la rédaction) supportent nativement IPsec pour IPv4 et IPv6.
Le projet USAGI a aidé à l'implémentation.
IPsec requière un échange de clés afin de partager un secret. Ceci est essentiellement réalisé de façon automatisée par les démons IKE. Ils prennent également en charge l'authentification des entités en présence, soit par un secret commun (nommé “secret pré-partagé”), soit par clés RSA (qui peuvent provenir de certificats X.509).
Actuellement, deux démons IKE sont disponibles pour Linux, lesquels différent totalement par la configuration et l'emploi.
Je préfère “pluto” à l'implémentation *S/WAN à cause de son installation plus simple et à son unique fichier de configuration.
Le démon IKE “racoon” provient du projet KAME et a été porté sur Linux. Les distributions contemporaines de Linux comportent ce démon dans le paquetage “ipsec-tools”. Deux exécutables sont requis pour bien installer IPsec. Jetez aussi un oeil à Linux Advanced Routing & Traffic Control HOWTO / IPSEC.
Le rôle important de “setkey” est de définir la politique de sécurité (SP, security policy) pour le noyau.
Fichier: /etc/racoon/setkey.sh
Exemple d'une connexion encryptée de boute-en-bout en mode transport
#!/sbin/setkey -f -flush; -spdflush; -spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec esp/transport//require; -spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec esp/transport//require; |
Exemple d'une connexion encryptée de boute-en-bout en mode tunnel
#!/sbin/setkey -f -flush; -spdflush; -spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec -¬ esp/tunnel/2001:db8:1:1::1-2001:db8:2:2::2/require; -spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec -¬ esp/tunnel/2001:db8:2:2::2-2001:db8:1:1::1/require; |
Pour l'autre machine, vous avez juste à échanger “in” et “out”.
Pour sa bonne exécution, “racoon” requière d'être configuré. Ceci inclus les réglages relatifs à la politique de sécurité, qui doit être précédemment mise en place grâce à “setkey”.
Fichier: /etc/racoon/racoon.conf
# Fichier de configuration du démon IKE racoon. -# Voir 'man racoon.conf' pour une description du format et des entrées. -path include "/etc/racoon"; -path pre_shared_key "/etc/racoon/psk.txt"; - -listen - { - isakmp 2001:db8:1:1::1; - } - -remote 2001:db8:2:2::2 -{ - exchange_mode main; - lifetime time 24 hour; - proposal - { - encryption_algorithm 3des; - hash_algorithm md5; - authentication_method pre_shared_key; - dh_group 2; - } -} - -# De passerelle-à-passerelle -sainfo address 2001:db8:1:1::1 any address 2001:db8:2:2::2 any -{ - lifetime time 1 hour; - encryption_algorithm 3des; - authentication_algorithm hmac_md5; - compression_algorithm deflate; -} - -sainfo address 2001:db8:2:2::2 any address 2001:db8:1:1::1 any -{ - lifetime time 1 hour; - encryption_algorithm 3des; - authentication_algorithm hmac_md5; - compression_algorithm deflate; -} |
Fixez aussi un secret pré-partagé:
Fichier: /etc/racoon/psk.txt
# Fichier des clés pré-partagées utilisées pour l'authentification IKE -# Le format est: 'identificateur' 'clé' - -2001:db8:2:2::2 absolumentsecret |
Il faut pour le moins que le démon soit démarré. Au premier démarrage, utiliser les modes déboguage et premier plan (debug and foreground). L'exemple suivant montre une négociation IKE réussie dans ses phases 1 (ISAKMP-SA, Internet Security Association Key Management Security Association) and 2 (IPsec-SA, IPsec Security Association):
# racoon -F -v -f /etc/racoon/racoon.conf -Foreground mode. -2005-01-01 20:30:15: INFO: @(#)ipsec-tools 0.3.3 (http://ipsec-tools.sourceforge.net) -2005-01-01 20:30:15: INFO: @(#)This product linked -¬ OpenSSL 0.9.7a Feb 19 2003 (http://www.openssl.org/) -2005-01-01 20:30:15: INFO: 2001:db8:1:1::1[500] used as isakmp port (fd=7) -2005-01-01 20:31:06: INFO: IPsec-SA request for 2001:db8:2:2::2 -¬ queued due to no phase1 found. -2005-01-01 20:31:06: INFO: initiate new phase 1 negotiation: -¬ 2001:db8:1:1::1[500]<=>2001:db8:2:2::2[500] -2005-01-01 20:31:06: INFO: begin Identity Protection mode. -2005-01-01 20:31:09: INFO: ISAKMP-SA established -¬ 2001:db8:1:1::1[500]-2001:db8:2:2::2[500] spi:da3d3693289c9698:ac039a402b2db401 -2005-01-01 20:31:09: INFO: initiate new phase 2 negotiation: -¬ 2001:6f8:900:94::2[0]<=>2001:db8:2:2::2[0] -2005-01-01 20:31:10: INFO: IPsec-SA established: -¬ ESP/Tunnel 2001:db8:2:2::2->2001:db8:1:1::1 spi=253935531(0xf22bfab) -2005-01-01 20:31:10: INFO: IPsec-SA established: -¬ ESP/Tunnel 2001:db8:1:1::1->2001:db8:2:2::2 spi=175002564(0xa6e53c4) |
Chaque direction a sa propre IPsec-SA (comme définie dans le standard IPsec). Avec “tcpdump” à l'écoute de la bonne interface, vous devriez voir comme résultat d'un ping IPv6:
20:35:55.305707 2001:db8:1:1::1 > 2001:db8:2:2::2: ESP(spi=0x0a6e53c4,seq=0x3) -20:35:55.537522 2001:db8:2:2::2 > 2001:db8:1:1::1: ESP(spi=0x0f22bfab,seq=0x3) |
Comme prévu, les SPI (Security Parameter Index) négociés sont utilisés ici.
Et en utilisant “setkey”, les paramètres actifs courants:
# setkey -D -2001:db8:1:1::1 2001:db8:2:2::2 - esp mode=tunnel spi=175002564(0x0a6e53c4) reqid=0(0x00000000) - E: 3des-cbc bd26bc45 aea0d249 ef9c6b89 7056080f 5d9fa49c 924e2edd - A: hmac-md5 60c2c505 517dd8b7 c9609128 a5efc2db - seq=0x00000000 replay=4 flags=0x00000000 state=mature - created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005 - diff: 577(s) hard: 3600(s) soft: 2880(s) - last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s) - current: 540(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 3 hard: 0 soft: 0 - sadb_seq=1 pid=22358 refcnt=0 -2001:db8:2:2::2 2001:db8:1:1::1 - esp mode=tunnel spi=253935531(0x0f22bfab) reqid=0(0x00000000) - E: 3des-cbc c1ddba65 83debd62 3f6683c1 20e747ac 933d203f 4777a7ce - A: hmac-md5 3f957db9 9adddc8c 44e5739d 3f53ca0e - seq=0x00000000 replay=4 flags=0x00000000 state=mature - created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005 - diff: 577(s) hard: 3600(s) soft: 2880(s) - last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s) - current: 312(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 3 hard: 0 soft: 0 - sadb_seq=0 pid=22358 refcnt=0 |
Le démon IKE “pluto” est inclus dans les distributions des projets *S/WAN, qui ont pour origine FreeS/WAN. Le développement du projet FreeS/WAN a malheureusement été stoppé en 2004. A cause de la lenteur du développement dans le passé, deux projets en découlèrent: strongSwan et Openswan. Aujourd'hui, des paquetages d'installation sont disponibles, au moins pour Openswan (inclus dans Fedora Core 3).
Une différence importante par rapport à “racoon”, un seul et unique fichier de configuration est requis. Il y a bien sûr un script d'initialisation qui automatise le lancement au démarrage de la machine.
La configuration est très similaire à celle nécessaire pour IPv4, à part une importante et nécessaire option.
Fichier: /etc/ipsec.conf
# /etc/ipsec.conf - Fichier de configuration d'IPsec Openswan -# -# Manuel: ipsec.conf.5 -version 2.0 # conforme à la seconde version de la spécification d'ipsec.conf - -# configuration de base -config setup - # Contrôles du déboguage / journalisation : "none" pour (presque) rien, "all" pour beaucoup. - # klipsdebug=none - # plutodebug="control parsing" - -#Rendre indisponible l'encryptage opportuniste -include /etc/ipsec.d/examples/no_oe.conf - -conn ipv6-p1-p2 - connaddrfamily=ipv6 # Important pour IPv6! - left=2001:db8:1:1::1 - right=2001:db8:2:2::2 - authby=secret - esp=aes128-sha1 - ike=aes128-sha-modp1024 - type=transport - #type=tunnel - compress=no - #compress=yes - auto=add - #auto=start |
N'oubliez pas ici également de définir un secret pré-partagé.
Fichier: /etc/ipsec.secrets
2001:db8:1:1::1 2001:db8:2:2::2 : PSK "absolumentsecret" |
Si l'installation d'Openswan s'est achevée avec succès, un script d'initialisation doit exister permettant le démarrage d'IPsec, lancez simplement (sur chaque machine) par:
# /etc/rc.d/init.d/ipsec start |
Ensuite, démarrez une connexion sur l'une des machines. Si vous pouvez voir la ligne “IPsec SA established”, c'est que tout fonctionne parfaitement.
# ipsec auto --up ipv6-peer1-peer2 -104 "ipv6-p1-p2" #1: STATE_MAIN_I1: initiate -106 "ipv6-p1-p2" #1: STATE_MAIN_I2: sent MI2, expecting MR2 -108 "ipv6-p1-p2" #1: STATE_MAIN_I3: sent MI3, expecting MR3 -004 "ipv6-p1-p2" #1: STATE_MAIN_I4: ISAKMP SA established -112 "ipv6-p1-p2" #2: STATE_QUICK_I1: initiate -004 "ipv6-p1-p2" #2: STATE_QUICK_I2: sent QI2, -¬ IPsec SA established {ESP=>0xa98b7710 <0xa51e1f22} |
Parce que *S/WAN et setkey/racoon sont basés sur la même implémentation d'IPsec dans les noyaux 2.6.x,“setkey” peut être utilisé pour afficher les paramètres actifs courants:
# setkey -D -2001:db8:1:1::1 2001:db8:2:2::2 - esp mode=transport spi=2844489488(0xa98b7710) reqid=16385(0x00004001) - E: aes-cbc 082ee274 2744bae5 7451da37 1162b483 - A: hmac-sha1 b7803753 757417da 477b1c1a 64070455 ab79082c - seq=0x00000000 replay=64 flags=0x00000000 state=mature - created: Jan 1 21:16:32 2005 current: Jan 1 21:22:20 2005 - diff: 348(s) hard: 0(s) soft: 0(s) - last: hard: 0(s) soft: 0(s) - current: 0(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 0 hard: 0 soft: 0 - sadb_seq=1 pid=23825 refcnt=0 -2001:db8:2:2::2 2001:db8:1:1::1 - esp mode=transport spi=2770214690(0xa51e1f22) reqid=16385(0x00004001) - E: aes-cbc 6f59cc30 8d856056 65e07b76 552cac18 - A: hmac-sha1 c7c7d82b abfca8b1 5440021f e0c3b335 975b508b - seq=0x00000000 replay=64 flags=0x00000000 state=mature - created: Jan 1 21:16:31 2005 current: Jan 1 21:22:20 2005 - diff: 349(s) hard: 0(s) soft: 0(s) - last: hard: 0(s) soft: 0(s) - current: 0(bytes) hard: 0(bytes) soft: 0(bytes) - allocated: 0 hard: 0 soft: 0 - sadb_seq=0 pid=23825 refcnt=0 |
Pour les noyaux Linux 2.6.x, vous pouvez également obtenir la politique et l'état d'IPsec en utilisant “ip”:
# ip xfrm policy -... - -# ip xfrm state -... |
IPv6 supporte QoS par l'utilisation des labels de flux et des classes de trafic. Ceci peut être contrôlé en utilisant “tc” (compris dans le paquetage “iproute”).
Information complémentaire:
A remplir plus avant...
Ici quelques éléments d'installation des démons prêts pour IPv6 sont exposés.
IPv6 est supporté depuis la version 9. Utilisez toujours la dernière version disponible. Il faut au moins utiliser la version 9, les versions plus anciennes peuvent contenir des trous de sécurité exploitables à distance.
Note: à la différence d'IPv4, les versions actuelles ne permettent pas d'associer une socket de serveur à des adresses IPv6 données, par conséquent, seule l'alternative toutes ou aucune adresse(s) IPv6 est valide. Parce que cela peut poser un problème de sécurité, consultez aussi plus bas la section concernant la liste de contrôle d'accès (ACL)!
Pour rendre disponible à named l'écoute IPv6, les options suivantes demandent à être modifiées
options { - # certainement que d'autres options sont aussi ici - listen-on-v6 { any; }; -}; |
Il doit en résulter après redémarrage
# netstat -lnptu |grep "named\W*$" -tcp 0 0 :::53 :::* LISTEN 1234/named -¬ # incoming TCP requests -udp 0 0 1.2.3.4:53 0.0.0.0:* 1234/named -¬ # incoming UDP requests to IPv4 1.2.3.4 -udp 0 0 127.0.0.1:53 0.0.0.0:* 1234/named -¬ # incoming UDP requests to IPv4 localhost -udp 0 0 0.0.0.0:32868 0.0.0.0:* 1234/named -¬ # dynamic chosen port for outgoing queries -udp 0 0 :::53 :::* 1234/named -¬ # incoming UDP request to any IPv6 |
Un test simple ressemble à
# dig localhost @::1 |
et doit vous afficher un résultat.
Pour rendre indisponible l'écoute IPv6, l'option suivante demande à être modifiée
options { - # certainement que d'autres options sont aussi ici - listen-on-v6 { none; }; -}; |
Les ACL IPv6 sont disponibles et devraient être utilisées dès que possible. Un exemple ressemble à ce qui suit:
acl internal-net { - 127.0.0.1; - 1.2.3.0/24; - 3ffe:ffff:100::/56; - ::1/128; - ::ffff:1.2.3.4/128; -}; -acl ns-internal-net { - 1.2.3.4; - 1.2.3.5; - 3ffe:ffff:100::4/128; - 3ffe:ffff:100::5/128; -}; |
Ces ACL peuvent être utilisées par exemple pour les requêtes des clients ou pour le transfert de zones aux serveurs de noms de domaine secondaires. Ceci prévient aussi contre l'utilisation de votre serveur cache de noms de domaine à partir de l'extérieur grâce à IPv6.
options { - # certainement que d'autres options sont aussi ici - listen-on-v6 { none; }; - allow-query { internal-net; }; - allow-transfer { ns-internal-net; }; -}; |
Il est aussi possible de positionner les options allow-query et allow-transfer pour la plupart des définitions par fichier de zone.
Cette option n'est pas requise, mais peut être nécessaire:
query-source-v6 address <adresseipv6|*> port <port|*>; |
Il est aussi possible de définir des adresses IPv6 par zone.
L'adresse de la source de transfert est utilisée pour aller chercher les zones transférées:
transfer-source-v6 <adresseipv6|*> [port port]; |
L'adresse de la source à notifier est utilisée pour les messages de notification:
notify-source-v6 <adresseipv6|*> [port port]; |
Des informations peuvent être aussi trouvées dans cet article concernant l'information d'installation d'un DNS IPv6. Le constructeur de zone inverse IPv6 pour BIND 8/9 (outil web) peut aussi être d'une aide précieuse.
Pour IPv6, de nouveaux types et la zone racine nécessaire à la recherche inversée sont définis:
AAAA et IP6.INT inversée: specifiés dans le RFC 1886 / DNS Extensions to support IP version 6, utilisés depuis BIND version 4.9.6
A6, DNAME (DORÉNAVANT DÉPRECIÉ!) et IP6.ARPA inversé: spécifiés dans leRFC 2874 / DNS Extensions to Support IPv6 Address Aggregation and Renumbering, utilisable depuis BIND 9, mais vous pouvez trouver de l'information sur l'état actuel dans draft-ietf-dnsext-ipv6-addresses-00.txt
Peut-être complété plus tard, pour le moment, jetez un coup d'oeil aux RFC fournis et
AAAA et IP6.INT inversé: l'installation d'un DNS IPv6
A6, DNAME (DORÉNAVANT DÉPRECIÉ!) et IP6.ARPA inversé: jetez un coup d'oeil aux chapitres 4 et 6 du manuel de référence de l'administrateur BIND 9 (ARM), distributé avec le paquetage bind, ou bien récupérez-le : BIND version 9 ARM (PDF)
Parce que IP6.INT est déprécié (mais encore en usage), un serveur DNS qui supportera l'information IPv6 aura à servir tous les types de zones inversées.
Parce qu'il y a encore quelques problèmes qui existent lorsque les nouveaux formats sont utilisés, la meilleure pratique courante est:
Support de recherche:
AAAA
La recherche inversée supporte:
Le format réduit inversé (reverse nibble format) pour la zone ip6.int (POUR LA COMPATIBILITÉ ASCENDANTE)
Le format réduit inversé (reverse nibble format) pour la zone ip6.arpa (RECOMMANDÉ)
Pour vérifier si BIND est à l'écoute sur une socket IPv6 et sert des données, voir les exemples suivants.
En spécifiant un serveur pour les requêtes, une connexion IPv6 peut être forcée:
$ host -t aaaa www.6bone.net 3ffe:ffff:200:f101::1 -Using domain server: -Name: 3ffe:ffff:200:f101::1 -Address: 3ffe:ffff:200:f101::1#53 -Aliases: - -Host www.6bone.net. not found: 5(REFUSED) |
L'entrée relative dans le journal ressemble à ce qui suit:
Jan 3 12:43:32 gate named[12347]: client -¬ 3ffe:ffff:200:f101:212:34ff:fe12:3456#32770: - query denied |
Si vous observez de telles entrées dans le journal, vérifiez si les requêtes provenant de ce client doivent être autorisées, pour revoir, si nécessaire, votre configuration ACL.
Une connexion IPv6 réussie ressemble à ce qui suit:
$ host -t aaaa www.6bone.net 3ffe:ffff:200:f101::1 -Using domain server: -Name: 3ffe:ffff:200:f101::1 -Address: 3ffe:ffff:200:f101::1#53 -Aliases: - -www.6bone.net. is an alias for 6bone.net. -6bone.net. has AAAA address 3ffe:b00:c18:1::10 |
IPv6 est supporté, approximativement, depuis la version 1.8.9 de xinetd. Utilisez toujours la version disponible la plus récente. Seules les versions antérieures à la version 2.3.3 doivent être utilisées, les versions plus anciennes peuvent contenir des trous de sécurité exploitables à distance.
Certaines distributions Linux contiennent un paquetage supplémentaire pour xinetd prêt pour IPv6, d'autres démarrent xinetd prêt pour IPv6 si la variable suivante est positionnée: NETWORKING_IPV6="yes", chose normalement réalisée par /etc/sysconfig/network (valide uniquement pour la distribution Red Hat et ses dérivées). Dans les nouvelles livraisons des distributions, un binaire supporte à la fois IPv4 et IPv6.
Si vous rendez disponible un service fourni avec xinetd, comme par exemple daytime, en modifiant la configuration dans le fichier /etc/xinetd.d/daytime comme suit
# diff -u /etc/xinetd.d/daytime.orig /etc/xinetd.d/daytime ---- /etc/xinetd.d/daytime.orig Sun Dec 16 19:00:14 2001 -+++ /etc/xinetd.d/daytime Sun Dec 16 19:00:22 2001 -@@ -10,5 +10,5 @@ - protocol = tcp - user = root - wait = no -- disable = yes -+ disable = no - } |
vous devriez recevoir, après le redémarrage de xinetd, une réponse positive telle que:
# netstat -lnptu -A inet6 |grep "xinetd*" -tcp 0 0 ::ffff:192.168.1.1:993 :::* LISTEN 12345/xinetd-ipv6 -tcp 0 0 :::13 :::* LISTEN 12345/xinetd-ipv6 <- service -¬ daytime/tcp -tcp 0 0 ::ffff:192.168.1.1:143 :::* LISTEN 12345/xinetd-ipv6 |
L'exemple montre aussi que xinetd écoute pour IMAP et IMAP-SSL sur IPv4 seulement.
Note: un serveur xinetd uniquement IPv4 ne démarrera pas sur un noeud disposant d'IPv6 et inversement, un serveur xinetd IPv6 ne démarrera pas sur un noeud uniquement IPv4. Ce problème est réputé réglé dans les versions postérieures, au moins à partir de la version 2.3.11.
Le serveur web Apache supporte nativement IPv6 depuis la version 2.0.14. Des patchs disponibles pour l'ancienne série 1.3.x ne sont pas courants et ne devraient pas être employés dans un contexte public, mais ils sont disponibles sur ce serveur ftp, KAME / Misc.
Note: Les hôtes virtuels sur adresses IPv6 ne fonctionnent pas pour les versions inférieures à la 2.0.28 (un patch est disponible pour la 2.0.28). Mais en tout premier lieu, récupérez toujours la dernière version disponible, parce que les premières versions ont des problèmes de sécurité.
Listen [3ffe:ffff:100::1]:80 -<VirtualHost [3ffe:ffff:100::1]:80> - ServerName ipv6seul.votredomaine.votretld - # certainement des lignes de configuration en plus... -</VirtualHost> |
Listen [3ffe:ffff:100::2]:80 -Listen 1.2.3.4:80 -<VirtualHost [3ffe:ffff:100::2]:80 1.2.3.4:80> - ServerName ipv6etipv4.votredomaine.votretld - # certainement des lignes de configuration en plus... -</VirtualHost> |
Il devrait en résulter après redémarrage
# netstat -lnptu | grep "httpd2\W*$" -tcp 0 0 1.2.3.4:80 0.0.0.0:* LISTEN 12345/httpd2 -tcp 0 0 3ffe:ffff:100::1:80 :::* LISTEN 12345/httpd2 -tcp 0 0 3ffe:ffff:100::2:80 :::* LISTEN 12345/httpd2 |
Pour de simples tests, utiliser l'exemple telnet déjà montré.
D'une part, Apache2 supporte une méthode appelée “sendfile”, accélérant la fourniture des données. D'autre part, certains pilotes de NIC supportent la vérification différée des sommes de contrôle (offline checksumming). Dans certains cas, cela peut conduire à des problèmes de connexion et invalider les sommes de contrôle TCP. Il faut alors rendre indisponible “sendfile”, ou bien en recompilant par l'utilisation de l'option de configure “--without-sendfile”, ou bien en utilisant la directive du fichier de configuration "EnableSendfile off".
Le Démon d'Annonce de Routeur est très utile sur un LAN, à partir du moment où les clients doivent être auto-configurés. Le démon lui-même doit tourner sur la passerelle par défaut IPv6 Linux (il n'est pas requis qu'elle soit aussi la passerelle IPv4, aussi prenez garde à qui émet des annonces de routeur sur votre LAN).
Vous avez à spécifier certaines informations et drapeaux qui doivent être compris dans l'annonce. Les plus employés sont
Le préfixe (nécessaire)
La durée de vie du préfixe
La fréquence des envois d'annonce (optionnelle)
Après une configuration convenable, le démon émet des annonces au travers des interfaces spécifiées, dans l'espoir que les clients les reçoivent et auto-configurent comme par magie leurs adresses avec le préfixe reçu et le routeur par défaut.
Le fichier de configuration de radvd est généralement /etc/radvd.conf. Un exemple simple ressemble à ce qui suit:
interface eth0 { - AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; - prefix 3ffe:ffff:0100:f101::/64 { - AdvOnLink on; - AdvAutonomous on; - AdvRouterAddr on; - }; -}; |
Ce qui a pour résultat côté client
# /sbin/ip -6 addr show eth0 -3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 - inet6 3ffe:ffff:100:f101:2e0:12ff:fe34:1234/64 scope global dynamic - valid_lft 2591992sec preferred_lft 604792sec - inet6 fe80::2e0:12ff:fe34:1234/10 scope link |
Parce qu'aucune limite de vie n'a été définie, une très grande valeur est utilisée.
Les versions à partir de la 0.6.2pl3 supportent la (ré)génération des préfixes dépendant d'une adresse IPv4 propre à une interface spécifique. Ceci peut être utilisé afin de distribuer les annonces dans un LAN après que le tunnelage 6to4 ait changé. Surtout employé derrière un routeur de connexion dynamique à la demande (dial-on-demand). Avec l'assurance d'un temps de vie très bref pour un tel préfixe (après chaque reconnexion, dial-up, un autre préfixe est valide), la durée de vie est configurée aux valeurs minimales:
interface eth0 { - AdvSendAdvert on; - MinRtrAdvInterval 3; - MaxRtrAdvInterval 10; - prefix 0:0:0:f101::/64 { - AdvOnLink off; - AdvAutonomous on; - AdvRouterAddr on; - Base6to4Interface ppp0; - AdvPreferredLifetime 20; - AdvValidLifetime 30; - }; -}; |
Il en résulte pour le client situé à l'intérieur (en considérant que ppp0 a actuellement 1.2.3.4 comme adresse IPv4 locale):
# /sbin/ip -6 addr show eth0 -3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 - inet6 2002:0102:0304:f101:2e0:12ff:fe34:1234/64 scope global dynamic - valid_lft 22sec preferred_lft 12sec - inet6 fe80::2e0:12ff:fe34:1234/10 scope link |
Parce qu'un bref temps de vie a été défini, un tel préfixe sera rapidement jeté si aucune annonce s'y rapportant n'est reçue.
Note additionnelle: si vous n'utilisez pas de support spécifique 6to4 dans les scripts d'initialisation, vous avez à mettre en place une route spécifique sur l'interface interne du routeur, sinon vous aurez des problèmes de routage retour. En ce qui concerne l'exemple ci-après:
# /sbin/ip -6 route add 2002:0102:0304:f101::/64 dev eth0 metric 1 |
Cette route a besoin d'être remplacée chaque fois que le préfixe change, ce qui est le cas à chaque fois qu'une nouvelle adresse IPv4 est assignée à une interface numérotée automatiquement (dial-up interface).
Un programme appelé “radvdump” peut vous aider à observer les annonces émises ou reçues. Simple à utiliser:
# radvdump -Router advertisement from fe80::280:c8ff:feb9:cef9 (hoplimit 255) - AdvCurHopLimit: 64 - AdvManagedFlag: off - AdvOtherConfigFlag: off - AdvHomeAgentFlag: off - AdvReachableTime: 0 - AdvRetransTimer: 0 - Prefix 2002:0102:0304:f101::/64 - AdvValidLifetime: 30 - AdvPreferredLifetime: 20 - AdvOnLink: off - AdvAutonomous: on - AdvRouterAddr: on - Prefix 3ffe:ffff:100:f101::/64 - AdvValidLifetime: 2592000 - AdvPreferredLifetime: 604800 - AdvOnLink: on - AdvAutonomous: on - AdvRouterAddr: on - AdvSourceLLAddress: 00 80 12 34 56 78 |
Cette sortie vous montre que chaque paquetage d'annonce se présente dans un format lisible. Vous devriez voir à nouveau ici vos valeurs configurées, sinon, ce n'est peut-être pas votre radvd qui émet l'annonce... vérifiez s'il n'y a pas un autre routeur sur le lien (pour traquer ce routeur, prenez l'adresse LL, AdvSourceLLAddress, qui est son adresse MAC).
DHCPv6 peut être utilisé pour réaliser des configurations avec état. Le démon par lui-même n'a pas nécessairement à tourner sur la passerelle routeur Linux par défaut.
Vous pouvez spécifier plus d'information qu'avec radvd. Il est plus similaire à un serveur DHCP IPv4.
Après une configuration correcte, le démon réagit lors de la réception de paquets multicast envoyés par un client à l'adresse ff02::16.
Le fichier de configuration de dhcp6s est normalement /etc/dhcp6s.conf. Un exemple simple ressemble à ce qui suit:
interface eth0 { - server-preference 255; - renew-time 60; - rebind-time 90; - prefer-life-time 130; - valid-life-time 200; - allow rapid-commit; - option dns_servers 2001:db8:0:f101::1 sub.domain.example; - link AAA { - range 2001:db8:0:f101::1000 to 2001:db8:0:f101::ffff/64; - prefix 2001:db8:0:f101::/64; - }; -}; |
Le fichier de configuration de dhcp6c est normalement /etc/dhcp6c.conf. Un exemple simple ressemble à ce qui suit:
interface eth0 { - send rapid-commit; - request domain-name-servers; -}; |
Le serveur a un drapeau pour passer en premier plan et deux pour le déboguage (tout deux devraient être utilisés pour le déboguage). Voici un exemple:
# dhcp6c -d -D -f eth0 |
Le client a un drapeau pour passer en premier plan et deux pour le déboguage. Voici un exemple:
# dhcp6c -d -f eth0 - Oct/03/2005 17:18:16 dhcpv6 doesn't support hardware type 776 - Oct/03/2005 17:18:16 doesn't support sit0 address family 0 - Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error - Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error - Oct/03/2005 17:18:17 status code for this address is: success - Oct/03/2005 17:18:17 status code: success - Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error - Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error - Oct/03/2005 17:18:17 assigned address 2001:db8:0:f101::1002 prefix len isnot in any RAs prefix length using 64 bit instead - Oct/03/2005 17:18:17 renew time 60, rebind time 9 |
Notez que les messages d'erreur n'ont aucun impact.
tcp_wrapper est une bibliothèque qui peut vous aider à protéger vos services contre les usages abusifs.
Vous pouvez utiliser tcp_wrapper pour
Le filtrage à partir des adresses source (IPv4 ou IPv6)
Le filtrage des utilisateurs (réclame un démon ident en état de fonctionnement sur le client)
Les suivants sont connus:
Chaque service appelé par xinetd (si xinetd est compilé en utilisant la bibliothèque tcp_wrapper)
sshd (si compilé en utilisant tcp_wrapper)
tcp_wrapper est contrôlé par deux fichiers nommés /etc/hosts.allow et /etc/hosts.deny. Pour plus d'information voir
$ man hosts.allow |
Dans ce fichier, chaque service qui doit être positivement filtré (i.e., dont les connexions doivent être acceptées) a besoin d'une ligne.
sshd: 1.2.3. [3ffe:ffff:100:200::]/64 -daytime-stream: 1.2.3. [3ffe:ffff:100:200::]/64 |
Note: ils existent des implémentations cassées qui utilisent la mauvaise description réseau IPv6 suivante: [3ffe:ffff:100:200::/64].
Heureusement, de telles versions seront rapidement corrigées.
Ce fichier contient toutes les entrées de filtre négative et devrait dénier l'accès à tout le reste en utilisant
ALL: ALL |
Si ce noeud est très sensible, vous pouvez remplacer la ligne stantard ci-dessus par celle-ci, mais cela peut être cause d'attaque DoS (charge de serveur de courrier et répertoire spool), si trop de connexions sont réalisées en un temps très bref. Peut-être un observateur de journaux (a logwatch) serait-il meilleur dans de tels cas.
ALL: ALL: spawn (echo "Attempt from %h %a to %d at `date`" - | tee -a /var/log/tcp.deny.log | mail root@localhost) |
Selon l'entrée du fichier de configuration du démon syslog /etc/syslog.conf, la journalisation de tcp_wrapper se fait normalement dans /var/log/secure.
Une connexion refusée via IPv4 au service daytime, couvert par xinetd, produit des lignes telles que celles de l'exemple suivant
Jan 2 20:40:44 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap -¬ from=::ffff:1.2.3.4 -Jan 2 20:32:06 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap - from=3ffe:ffff:100:200::212:34ff:fe12:3456 |
Une connexion refusée via IPv4 à sshd en double écoute produit des lignes telles que celles de l'exemple suivant
Jan 2 20:24:17 gate sshd[12345]: refused connect from ::ffff:1.2.3.4 -¬ (::ffff:1.2.3.4) -Jan 2 20:39:33 gate sshd[12345]: refused connect - from 3ffe:ffff:100:200::212:34ff:fe12:3456 -¬ (3ffe:ffff:100:200::212:34ff:fe12:3456) |
Une connexion autorisée via IPv4 vers le service daytime, couvert par xinetd, produit des lignes telles que celles de l'exemple suivant
Jan 2 20:37:50 gate xinetd-ipv6[12346]: START: daytime-stream pid=0 -¬ from=::ffff:1.2.3.4 -Jan 2 20:37:56 gate xinetd-ipv6[12346]: START: daytime-stream pid=0 - from=3ffe:ffff:100:200::212:34ff:fe12:3456 |
Une connexion autorisée via IPv4 vers sshd en double écoute produit des lignes telles que celles de l'exemple suivant
Jan 2 20:43:10 gate sshd[21975]: Accepted password for user from ::ffff:1.2.3.4 -¬ port 33381 ssh2 -Jan 2 20:42:19 gate sshd[12345]: Accepted password for user - from 3ffe:ffff:100:200::212:34ff:fe12:3456 port 33380 ssh2 |
Editer le fichier de configuration, couramment /etc/vsftpd/vsftpd.conf, et ajuster l'option “listen”
listen_ipv6=yes |
C'est tout.
Editer le fichier de configuration, couramment /etc/proftpd.conf, mais prenez garde, tout n'est pas tout à fait logique dans la mise en place des hôtes virtuels
<VirtualHost 192.0.2.1> - ... - Bind 2001:0DB8::1 - ... -</VirtualHost> |
C'est tout.
De nos jours c'est généralement simple, cherchez une ligne de commande d'option ou bien une valeur de configuration pour rendre disponible l'écoute IPv6. Cherchez dans la page du manuel du démon ou dans les FAQ concernées. Il peut arriver que vous ne puissiez lier le démon qu'à une adresse IPv6 “any” (::) et pas à une adresse IPv6 précise, par manque de support (ça dépend de la façon dont le développeur à implémenter...).
Je n'ai aucune expérience de la programmation IPv6, peut-être que ce chapitre sera rempli par d'autres, ou déplacé vers un autre HOWTO
Plus d'information peut être trouvée ici:
Porting applications to IPv6 HowTo by Eva M. Castro
Il y a à travers le monde quelques projets qui vérifient l'interopérabilité des différents systèmes d'exploitation vis-à-vis de l'implémentation des fonctionnalités d'IPv6: Voici un URL:
D'autres arriveront prochainement...
Cisco Self-Study: Implementing IPv6 Networks (IPV6), par Regis Desmeules. Cisco Press; ISBN 1587050862; 500 pages; 1ère édition (11 avril 11 2003). -Note: cet ouvrage sera publié le 11 avril 2003.
Configuring IPv6 with Cisco IOS, par Sam Brown, Sam Browne, Neal Chen, Robbie Harrell, Edgar, Jr. Parenti (Editeur), Eric Knipp (Editeur), Paul Fong (Editeur) 362 pages; Syngress Media Inc; ISBN 1928994849; (12 juillet 2002).
IPv6 Essentials par Silvia Hagen, juillet 2002, O'Reilly, référence pour la commande: 1258, ISBN 0-5960-0125-8, 352 pages. -Table des matières, index, exemple de chapitre, etc.; Les derniers livres sortis chez O'Reilly
IPv6: The New Internet Protocol. Par Christian Huitema; Publié chez Prentice-Hall; ISBN 0138505055. -Description: Ce livre, écrit par Christian Huitema - membre du Comité Architecture Internet (Internet Architecture Board, ou IAB), offre une excellente description d'IPv6, de ses différences d'avec IPv4, du comment et du pourquoi de son développement. -Source: http://www.cs.uu.nl/wais/html/na-dir/internet/tcp-ip/resource-list.html
IPv6 Networks par Niles, Kitty; (ISBN 0070248079); 550 pages; Date de publication 05/01/1998.
Implementing IPV6. Supporting the Next Generation Internet Protocols par P. E. Miller, Mark A. Miller; éd. John Wiley & Sons; ISBN 0764545892; 2ème édition (15 mars 2000); 402 pages.
Big Book of Ipv6 Addressing Rfcs par Peter H. Salus (compilateur), Morgan Kaufmann Publishers, avril 2000, 450 pages, ISBN 0126167702.
Understanding IPV6 par Davies, Joseph; ISBN 0735612455; Date de publication 01/05/2001; 350 pages. -Understanding IPV6 par Davies, Joseph; ISBN 0735612455; Date de publication 11/13/2002; 544 pages.
Migrating to IPv6 - IPv6 in Practice. par Marc Blanchet; éd. John Wiley & Sons; ISBN 0471498920; 1ère édition (novembre 2002); 368 pages.
Ipv6 Network Programming par Jun-ichiro Hagino; ISBN 1555583180
Wireless boosting IPv6 par Carolyn Duffy Marsan, 23/10/2000.
la recherche avec le mot clé IPv6 sur O'reilly réseau donne 29 résultats (au 28 Janvier 2002).
Technik der IP-Netze (TCP/IP incl. IPv6) bei Amazon.de -Anatol Badach, Erwin Hoffmann -Carl Hanser Verlag München, Wien, 2001 ISBN 3-446-21501-8 -Kap. 6: Protokoll IPv6 S.205-242 -Kap. 7: Plug&Play-Unterstützung bei IPv6 S.243-276 -Kap. 8: Migration zum IPv6-Einsatz S.277-294 -Kap. 9.3.4: RIP für das Protokoll IPv6 (RIPng) S.349-351 -Kap. 9.4.6: OSPF für IPv6 S.384-385 -Kommentar: tw. nicht ganz up-to-date bzw. nicht ganz fehlerfreie Abbildungen -Homepage des Buches und Tabelle mit Fixes
Internet-Sicherheit (Browser, Firewalls und Verschlüsselung) bei Amazon.de -Kai Fuhrberg -2. akt. Auflage 2000 Carl Hanser Verlag München, Wien, ISBN 3-446-21333-3 -Kap.2.3.1.4. IPv6 S.18-22 -Kurz angerissen werden: RFC 1825 - Security Association Konzept RFC1826 - IP authentication Header RFC 1827 - IP Encapsulation Security Payload
IPv6. Das neue Internet- Protokoll. Technik, Anwendung, Migration bei Amazon -Hans Peter Dittler -2. akt. und erweiterte Auflage 2002 dpunkt.verlag, ISBN 3-89864-149-X
Das neue Internetprotokoll IPv6 bei Amazon -Herbert Wiese -2002 Carl Hanser Verlag, ISBN 3446216855
Getting Connected with 6to4 par Huber Feyrer, 01/06/2001
Transient Addressing for Related Processes: Improved Firewalling by Using IPv6 and Multiple Addresses per Host; écrit par Peter M. Gleiz, Steven M. Bellovin (version PDF pour PC; version PDF pour Palm; version PDB)
IPv6, théorie et pratique (en français) 3ème édition, mars 2002, O'Reilly, ISBN 2-84177-139-3
IPSec (en langue française)
Internetworking IPv6 with Cisco Routers par Silvano Gai, McGrawHill Italia, 1997. Le chapitre 13 et les appendices A-D sont téléchargables au format PDF.
Secure and Dynamic Tunnel Broker par Vegar Skaerven Wang, thèse de maîtrise en sciences informatiques, 2 Juin 2000, Faculté des Sciences, Département des sciences informatiques, Université de Tromso, Norvège.
Aufbruch in die neue Welt - IPv6 in IPv4 Netzen par Dipl.Ing. Ralf Döring, TU Illmenau, 1999
Migration and Co-existence of IPv4 and IPv6 in Residential Networks par Pekka Savola, CSC/FUNET, 2002
A simulation study on the performance of Mobile IPv6 in a WLAN-based cellular network, par Perez Costa X.; Hartenstein H. -- Computer Networks, Septembre 2002, vol. 40, no. 1, pp. 191-204(14) -- Elsevier Science.
Tests IPv6 sur le réseau universitaire britannique: Projet Bermudes 2 Août 2002: Participants - Se connecter - Project deliverables - Network topology - adresse assignments - Wireless IPv6 access - IPv6 migration - Project presentations - Internet 2 - Other IPv6 projects - IPv6 fora and standards Bermuda 2...
A scalable parallel internet router that enables the QoS through merging ATM with IPv6. par Song S. -- Computer Communications, 1 mai 2002, vol. 25, no. 7, pp. 647-651(5) -- Elsevier Science.
Linux IPv6: Which One to Deploy? journal Linux, Vol. 96, p. 86, 88-90, April 2002. (pour plus d'information, voir aussiliinwww.ira.uka.de/ipv6 )
An overview and analysis of mobile Internet protocols in cellular environments. Chao H-C. -- Internet Research: Electronic Networking Applications and Policy, 24 Octobre 2001, vol. 11, no. 5, pp. 435-450(16) -- MCB University Press
IPv6 for Future Wireless networksToftegaard Nielsen T. -- Wireless Personal Communications, Juin 2001, vol. 17, no. 2/3, pp. 237-247(11) -- éd. Kluwer Academic, Dordrecht, Les Pays-Bas
Seamless Support for Mobile Internet Protocol Based Cellular EnvironmentsChao H-C.; Chu Y-M. -- International Journal of Wireless Information Networks, Juillet 2001, vol. 8, no. 3, pp. 133-153(21) -- éd. Kluwer Academic/Plenum, New York, U.S.A.
IPv6: The Solution for Future Universal Networks. Lecture Notes in Computer Science, Vol. 1818, p. 82-??, 2000.
Modeling and performance analysis for IPv6 traffic with multiple QoS classes. Zhang L.; Zheng L. -- Computer Communications, 1 octobre 2001, vol. 24, no. 15, pp. 1626-1636(11) -- Elsevier Science.
Threshold-Based Registration (TBR) in Mobile IPv6. Lecture Notes in Computer Science, Vol. 1818, p. 150-??, 2000.
IPv6 Performance Analysis on FreeBSD Workstation Using Simple Applications. Lecture Notes in Computer Science, Vol. 1961, p. 33-??, 2000.
Microsoft Research IPv6 Implementation (MSRIPv6): MSRIPv6 Configuring 6to4 - Connectivity with MSR IPv6 - Our 6Bone Node...
New frontiers in cybersegmentation: marketing success in cyberspace depends on IP address. Louvieris P.; Driver J. --Qualitative Market Research: An International Journal, 27 juin 2001, vol. 4, no. 3, pp. 169-181(13) -- MCB University Press.
QoS-Conditionalized Handoff for Mobile IPv6. Notes de conférence en sciences informatiques, Vol. 2345, p. 721-??, 2002.
Quelque chose manque? Les suggestions sont les bienvenues!
A remplir plus avant et plus tard... Les suggestions sont les bienvenues!
Backbone de test IPv6: 6bone, Comment rejoindre 6bone, -Teilnahme am 6bone (en langue allemande), -La participation au 6bone (en langue anglaise)
Amérique: ARIN, ARIN / page d'enregistement, ARIN / IPv6 guidelines
EMEA: Ripe NCC, Ripe NCC / page d'enregistrement, Ripe NCC / IPv6 registration
Asie/Pacifique: APNIC, APNIC / guide de ressources IPv6
Amérique latine et les Caraïbes: LACNIC, Service d'enregistrement IPv6, Politique d'allocation IPv6
Afrique: AfriNIC
Il existe aussi une liste des principales allocations (préfixe de 32 bits) par bureau d'enregistrement régional ici: Ripe NCC / allocations IPv6.
Note: une liste de fournisseurs de tunnel peut être trouvée plus bas dans l'information concernant les fournisseurs de tunnel.
Code source utilisé dans une thèse de maîtrise dans le cadre du projet Vermicelli au sujet des fournisseurs de tunnels, Université de Tromso.
Fondation IPng. Fournisseurs de tunnel et ressources IPv6, dorénavant migré au système SixXs.
La page de Eckes Linux-avec-IPv6.
tunnelc - client de tunnelage basé sur perl: -freshmeat.net: détails sur ce client de tunnelage -SourceForge: Projet Info - tunnelc (aussi ici)
L'HOWTO Routage avancée Linux & contrôle du trafic, Chapitre 6: Le tunnelage IPv6 avec Cisco et/ou 6bone.
Voir aussi ici pour plus d'information et d'URL: ipv6-net.org.
A remplir plus avant et plus tard... Les suggestions sont les bienvenues!
ipv6-net.org, est aussi la page d'accueil du canal #IPv6 sur EFnet
Nombreux URLs vers d'autres documents par Anil Edathara
La publication de la liste des RFC relatifs à IPv6 outrepasse la portée de ce document, mais les URL fournis vous guiderons vers de telles listes:
Listes classées par Etat de la standardisation IPng ou Spécifications actuelles d'IPng par Robert Hinden
Spécifications relatives à IPv6 on IPv6.org
Les brouillons actuels concernant (aussi) IPv6 peuvent être trouvés ici:
Obtenir toute l'information à propos d'IPv6, depuis des vues d'ensemble, en passant par les brouillons et les RFC, jusqu'aux implémentations (comprenant la disponibilité de la pile sur différentes plates-formes & le code source de la pile IPv6)
Network Sorcery / IPv6, Protocole Internet IP version 6, l'en-tête du protocole IPv6
Guide / Références IPv6 SWITCH, importante liste de références IPv6, maintenue par Simon Leinen
A remplir plus avant et plus tard... les suggestions sont les bienvenues!
DeepSpace6 / plus de liens intéressants
DeepSpace6 / Portail Linux IPv6 (pas uniquement) - Italie (miroir)
IPv6-HowTo pour Linux par Peter Bieringer - Allemagne et son archive logiciel - Bieringer / IPv6
L'état de Linux+IPv6 par Peter Bieringer - Allemagne (en cours d'obsolescence)
DeepSpace6 / La page concernant l'état IPv6 - Italie (mirroir) (remplacera la page ci-dessus)
Projet USAGI - Japon, et son archive logiciel - projet USAGI
HOWTO IPv6 Protocole de routage à état de lien optimisé (OLSR)
PLD Linux Distribution (“leader du marché” quant aux paquetages disposant d'IPv6)
Linux Red Hat, les paquetages IPv6 de Pekka Savola (historic)
Linux Debian, Etat et information IPv6 par Craig Small,HOWTO Connectivité globale d'un LAN IPv6
Pour en savoir plus voir la page état des distributions Linux+IPv6.
Centre de ressources britanique IPv6 - Royaume-Uni
Projet WIDE - Japon
SWITCH IPv6 Pilot - Suisse
Le coin IPv6 de Hubert Feyrer - Allemagne
Projet Vermicelli - Norvège
IPv6 Forum - un consortium mondial d'importants fournisseurs Internet, Research & Education Networks...
Playground.sun.com / Page d'info IPv6 - maintenu par Robert Hinden, Nokia. Obtenir toute information au sujet d'IPv6, depuis de simples vues d'ensemble, en passant par les RFC et brouillons, jusqu'aux implémentations (incluant la disponibilité des piles sur différentes plates-formes & le code source des piles IPv6).
6INIT - Initiative Internet IPv6 - le 5ème programme-cadre européenne R&D de l'IST.
IPv6 Task Force (Union Européenne) (NdT: IPv6 Task Force France)
Projet de Documentation IPv6 (langue japonaise)
6init - IniTiative INternet IPv6
IPv6: La nouvelle version du protocole Internet, par Steve Deering.
IPv6: Le protocole Internet Nouvelle Génération, par Gary C. Kessler.
internet || site et Groupe de travail internet2 - Presentation (HTML + PPT) de l'atelier IPv6: (auto-configuration sans état, adressage IPv6, USAGI, fournisseur d'adressage IPv6 indépendant et autres thèmes).
NetworkWorldFusion: rechercher IPv6 (102 documents trouvés au 22.12.2002)
The Register (la recherche pour IPv6 donne 30 documents, 22.12.2002)
Les outils IPv6 Klingon, les outils IPv6 Klingon (accessible seulement en IPv6 natif): exemples de pare-feu IPv6, test de bande passante et scanner de ports
Quelque chose manque? Les suggestions sont les bienvenues!
A Tale of Two Wireless Technology Trends: Processor Development Outsourcing and IPv6Groupe Yankee - 1/4/2002 - 12 Pages - ID: YANL768881
The World Atlas of the Internet: Americas; IDATE - 2/1/2002 - 242 Pages - ID: IDT803907. Les pays couverts: Amérique Centrale, Amérique du Nord, Amérique du Sud; Liste: Prix: $ 3,500.00; à l'exception: Panorama du marché des accès à l'Internet à travers le monde. Estimation du marché et prévions jusqu'en 2006 pour 34 pays: structure du marché: les principaux ISP et le partage du marché; nombre de souscripteurs, d'ISP.
Earlier Interest Rising for IPv6 par IDC (Auteur); prix: $1,500.00; support: e-book (Acrobat Reader); éd. IDC; ISBN B000065T8E; ( 1 mars 2002)
Base de données des brevets canadiens: Accueil, Recherche (Recherche simple, entrez juste “IPv6” dans le champs recherche ;-); 84 documents trouvés au 22.12.2002)
Espacenet - information sur les brevets européens: -Offices nationaux, membres d'Espacenet(IPv6: 84 documents, au 22.12.2002)
Delphion: Recherche de brevets. Un simple enregistrement (gratuit) est nécessaire. Exemples trouvés au 21.12.2002 par une recherche sur l'expression IPv6: -Méthode de communication entre terminal IPv4 et terminal IPv6, mécanisme de conversion IPv4-IPv6 -Traducteur pour réseaux IP, système réseau utilisant le traducteur, mais aussi une méthode de couplage de réseaux IP
www.ist-ipv6.org: IST IPv6 Cluster, recherche européenne IPv6 et développement de projets
Euro6IX: Backbone européenne d'interconnexion Internet IPv6
IPv6@IKNnet et le groupe de recherche MIPv6: Vienne , Autriche (IPv6: projets, publications, diplômes / thèses de doctorat, actes de conférence, etc.)é
ETRI: Institut de Recherche en Electronique et Télécommunications
Forum IPv6 koréen: Projet de déploiement coréen d'IPv6
Mexique IPv6 (versions espagnole et anglaise): Accueil du projet IPv6 de l'Université nationale autonome du Mexique (UNAM)
SURFnet: Backbone IPv6 SURFnet
STACK, STACK (IPv6): Association d'étudiants en informatique de l' Université de Technologie, Pays-Bas
IPng.nl: collaboration entre WiseGuys et Intouch
La page d'accueil de British Telecom IPv6: essai de BT en tant que fournisseur de service IPv6, premier point d'interconnexion Internet au Royaume-Uni, ...
Le projet KAME (*BSD)
BUGAT - Groupe d'utilisateurs Australiens BSD - www.bugat.at: Tunnel IPv6 FreeBSD (langue allemande)
IPv6 pour IOS de Cisco, Fichier 2 sur 3: août 2002 -- Table des Matières: IPv6 pour IOS de Cisco; documentation des caractéristiques de configuration; Rendre disponible et configurer le routage IPv6; l'adressage IPv6; Rendre globalement le fonctionnement IPv6 disponible.
Manuel de la mise en réseau Internet Cisco, chapitre IPv6
Maintenant c'est IBM qui annonce la disponibilité de z/OS V1.4, Quoi de neuf dans cette version? Cette question a été posée le 15 août 2002
MSRIPv6 - Accueil IPv6 des recherches réseau de Microsoft
Débuter avec la technologie IPv6 Microsoft prévue pour Windows 2000
Le pare-feu servant à la connexion Internet ne bloque pas le trafic IPv6 (au 6.11.2001)
Internet Protocol Numbers (au 8.10.2002)
IPv6 Technology Preview Refresh (au 16.10.2002)
Comment: installer et configurer IP version 6 pour Windows .NET Enterprise Server (au 26.10.2002)
Le service de routage 6to4 du serveur Windows .NET quitte lorsque vous publiez une adresse 2002 sur une interface publique (au 28.10.2002)
msdn - recherche pour IPv6 (100 résultats, au 22.12.2002)
Internet Security Systems: Centre Sécurité, recherche dans la base de donnée X-Force (21.12.2002 - 6 thèmes relatifs à IPv6)
Projet IPsec NIST ( Institut National des Standards et Technologie, NIST)
NewOrder.box.sk (recherche pour IPv6) (Articles, exploits, files database, etc.)
Freshmeat / recherche IPv6, actuellement (au 14 décembre 2002), 62 projets
Forum IPv6 : IPv6 Router List
Ethereal - Ethereal est un analyseur libre de protocoles réseaux pour Unix et Windows
Radcom RC100-WL - Téléchargez l'analyseur de protocoles RC100-WL Radcom version 3.20
6wind - solutions pour routeur IPv4/IPv6, QoS, Multicast, Mobilité, Sécurité/VPN/Pare-feu.
Fefe's patches for IPv6 with djbdnsAoût 2002 -- Qu'est-ce que djbdns et a-t-il besoin d'IPv6? djbdns est un serveur DNS complet qui outrepasse les performances de BIND.
Histoire de la table de routage IPv6 créée par Gert Döring, Space.Net
IPv6 Allocation Data & Survey Results, IPv6 WG, Ripe 42, Ripe NCC
Une autre liste de points d'interconnexion IPv6 peut être trouvée ici: Site web des points d'interconnexion IPv6 ou Statut IPv6 des IXP en Europe
Point d'interconnexion Internet IPv6 français (actif depuis le 1.11.2002). -FNIX6 fournit une interconnexion haut débit FastEthernet gratuite et fiable entre ISP situés chez TeleCity, Paris.
Voir aussi: http://www.deepspace6.net/docs/tunnelbrokers.html
Freenet6 - délégation /48, Canada -Accéder à IPv6 en utilisant Freenet6 sur Debian -Création Freenet6
Centro Studi e Laboratory Telecomunicazioni (page de téléchargement TunnelBroker Version 2.1.) -Fournisseur de tunnel IPv6: instructions d'installation
Bersafe (langue italienne)
Telecom Italia LAB (page de téléchargement du logiciel Tunnelbroker)
Initiative Internet au Japon (en langue japonaise) - avec fourniture de lignes IPv6 natives et tunnelage IPv6
XS26 - "Accès à Six" - avec des POP (Points De Présence) en République slovaque, en République Tchèque, aux Pays-Bas, en Allemagne et en Hongrie.
IPng Pays-Bas - Intouch, SurfNet, AMS-IX, UUNet, Cistron, RIPE NCC et AT&T sont connectés au AMS-IX. Il est possible (sous certaines conditions) d'obtenir un tunnel statique.
UNINETT, Guide concernant le service IPv6 (pour les clients): fournisseur de tunnel et allocation d'adresse -Uninett-Autoupdate-HOWTO
Fournisseur de tunnel AS8758, Dolphins Network Systems (en ligne depuis le 20.12.2002)
NTT Europe, NTT, Royaume-Uni - essai IPv6. Tunnel IPv4 et IPv6 natif and native IPv6 leased Line connexions. Les POP sont situés à Londres au Royaume Uni, Düssenldorf en Allemagne, New Jersey aux USA (Côte Est), Cupertino aux USA (Côte Ouest), Tokyo au Japon
Interface d'administration du fourniseur de tunnel IPv6 BtexacT
ESnet, USA - Réseau des Sciences de l'Energie: Tunnel Registry & adresse Delegation for directly connected ESnet sites and ESnet collaborators.
6REN, USA - l'initiative 6ren est coordonnée par Réseau des Sciences de l'Energie (ESnet), the network for the Energy Research program of the US Dept. of Energy, located at the University of California's Lawrence Berkeley National Laboratory.
XS26 Distributed Tunnel Broker, USA & Europe
Hurricane Electric, backbone US; -Fournisseur de tunnel Hurrican Electric (aussi disponible ici) -Press Version: Hurricane Electric devient fournisseur de tunnel IPv6 (communiqué de presse) -Mise à jour d'extrémité de tunnel, pour fournisseur de tunnel, script Perl
Note: Ces services sont uniquement disponibles grâce à une connexion IPv6 valide!
Flux IPv6 expérimental en direct!, Université de Leipzig, Allemagne
Des listes de listes de diffusion sont disponibles:
Les listes de diffusion essentielles sont listées dans le tableau suivant:
Centre d'intérêt | Adresse mél de la requête d'inscription | A quoi souscrire | Adresse mél de la liste de diffusion | Langue | accès par WWW |
L'activité réseau du noyau Linux incluant IPv6 | majordomo (chez) oss.sgi.com | netdev | netdev (chez) oss.sgi.com | Anglaise | Archive |
Linux et IPv6 en général (1) | majordomo (chez) list.f00f.org | linux-ipv6 | linux-ipv6 (chez) list.f00f.org (modérée) | Anglaise | |
L'implémentation Linux du protocole IPv6 | interface web, voir l'URL | project6 (chez) ferrara.linux.it | Anglaise | Info, Subscription | |
La mobilité IP(v6) sur Linux | majordomo (chez) list.mipl.mediapoli.com | mipl | mipl (chez) list.mipl.mediapoli.com | Anglaise | Info, Archive |
Utilisateurs Linux IPv6 avec l'extension USAGI | usagi-users-ctl (chez) linux-ipv6.org | usagi-users (chez) linux-ipv6.org | Anglaise | Info / Recherche, Archive | |
IPv6 sur Debian Linux | interface web, voir l'URL | debian-ipv6 (chez) lists.debian.org | Anglaise | Info/Souscription/Archive | |
IPv6/6bone en Allemagne | majordomo (chez) atlan.uni-muenster.de | ipv6 | ipv6 (chez) uni-muenster.de | German/English | Info, Archive |
6bone | majordomo (chez) isi.edu | 6bone | 6bone (chez) isi.edu | Anglaise | Info, Archive |
Discussions IPv6 | majordomo (chez) sunroof.eng.sun.com | ipng | ipng (chez) sunroof.eng.sun.com | Anglaise | Info, Archive, Mirroir des archives |
Les utilisateurs d'IPv6 en général | majordomo (chez) ipv6.org | users | users (chez) ipv6.org | Anglaise | Info, Archive |
Recherche des bogues des applications Internet (2) | bugtraq-subscribe (chez) securityfocus.com | bugtraq (chez) securityfocus.com (moderated) | Anglaise | Info, Archive | |
IPv6 en général | interface web, voir l'URL | ipv6 (chez) ipng.nl | Anglaise | Info/Subscription, Archive | |
majordomo (chez) mfa.eti.br | majordomo (chez) mfa.eti.br | ipv6 | ipv6 (chez) mfa.eti.br | Portugaise | Info |
(1) recommandé pour les questions d'ordre général Linux & IPv6.
(2) très recommandé si vous êtes fournisseur d'applications serveur.
Quelque chose manque? Les suggestions sont les bienvenues!
Les listes de diffusion et newsgroups suivants sont disponibles via le web:
ipv6 (France) -Description: Cette liste IPv6 permet de discuter d'IPv6 en langue française. Elle s'adresse aux personnes désirant démarrer dès aujourd'hui des tests IPv6. Ce n'est en aucun cas un substitut aux listes de l'IETF. Pour de plus amples informations: http://www.urec.fr/IPng
ipv6 (Hongrie) -Description: ipv6 Az IPv6 protokoll listaja Konfiguracios es adminisztracios kerdesek az IPv6-al kapcsolatban. (Archivum)
student-ipv6 (Inde) -Description: groupe d'étudiants intéressé par IPv6
IPV6-CNR@LISTSERV.CNR.IT (Italie) -Description: Groupe IPv6 au CNR
sun-ipv6-users -Description: Merci de rapporter les problèmes/suggestions concernant l'implémentation IPng SUN Microsystems
IPv6-BITS -Description: Cette liste coordonnera le travail du Verebrae.
IPv6 -Description: Cette liste de diffusion consiste en discussions techniques au sujet des possibilités d'IPv6/IPsec WRT OpenBSD.
linux-bangalore-ipv6 -Description: La liste concernant le déploiement d'IPv6 du groupe d'utilisateurs Linux Bangalore
gab -Description: L'intention est de discuter du plan géographique d'adressage IPv6.
ipv6-bsd-user -Description: Cette liste de diffusion concerne l”implémentation INéRIA/IMAG d'IPv6. Elle est bilingue, Francais/Anglais. Si vous souhaitez contacter les implémenteurs, essayez ipv6-bsd-core@imag.fr
La commutation de paquets -Description: cette liste de diffusion fournit un forum de discussion au sujet de l'implémentation, de la technologie et de la théorie de la commutation de paquets et l'application à tout domaine, LAPB, X.25, SDLC, P802.1d, LLC, IP, IPv6, IPX, DECNET, APPLETALK, FR, PPP, téléphonie IP, les systèmes PBX LAN, les protocoles d'administration comme SNMP, e-mail, système de fenêtre transparent au réseau, implémentation de protocoles, vérification de protocoles, tests de conformité et outils utilisés dans la maintenance ou dans le développement des systèmes de commutation de paquets.
mumbaiinternetgroup -Description: Ce forum discutera des problèmes et des développements actuels concernant Internet dans la région de l'Asie pacifique. Cela couvrira IPv4, IPv6, le DNS multilingue, les numéros de systèmes autonomes, la gouvernance Internet et bien plus...
de.comm.protocols.tcp-ip -Description: Umstellung auf IPv6 -Source: Chartas der Newsgruppen in de.*
Groupe Google: comp.protocols.tcp-ip
Groupe Google: linux.debian.maint.ipv6
Groupe Google: microsoft.public.platformsdk.networking.ipv6
Groupe Google: fa.openbsd.ipv6
finger, nslookup, ping, traceroute, whois: Centre de ressources IPv6 britanique / la page de test
ping, traceroute, tracepath, whois 6bone, DNS: JOIN / outils de test (en langue allemande seulement, mais en l'occurrence cela ne devrait pas être un problème pour les non germanistes)
traceroute6, whois: IPng.nl
Vérificateur de résolution AAAA http://www.cnri.dit.ie/cgi-bin/check_aaaa.pl
Outils divers : IPv6tools
Outil d'analyse d'adresse IPv6 (assez similaire à l'option d'information d'ipv6calc)
formation et atelier IPv6, AERAsec, Allemagne (en langue allemande pour l'instant)
Migrer vers IPv6, Learning Tree International
Formation professionnelle CIW la maintenance Internet CBT CD
Pages concernant la formation, Royaume-Uni - recherche à partir du mot clé “IPv6” (13 cours, au 22.12.2002)
Quelque chose manque? Les suggestions sont les bienvenues!
IPv6: Addressing The Needs Of the Future [DOWNLOAD: PDF] -par le groupe Yankee (Auteur) -Prix: $595.00 -Edition: e-book (Acrobat Reader) -Pages: 3 (trois) -Editeur: MarketResearch.com; ISBN B00006334Y; (1 novembre 2001)
;-) Le nombre de copies serait intéressant à connaître...
Un historique des modifications de la version anglo-saxonne originale peut être trouvé ici: TLDP / Linux+IPv6-HOWTO / Revision History.
2007-10-06/PB: fix broken URLs to TLDP-CVS, minor fixes for proper SGML validation.
2006-02-26/MB: Mise à jour au profit de la révision 0.49.
2005-01-20/MB: Mise à jour au profit de la révision 0.48.1.
2004-09-05/MB: Mise à jour au profit de la révision 0.47.
2004-03-14/MB: Mise à jour au profit de la révision 0.45.1. Corrections et améliorations diverses.
2003-09-05/MB: Mise à jour au profit de la révision 0.44. A cette occasion, une révision non systématique est réalisée.
2003-07-17/MB: Correction de quelques coquilles, amélioration de la traduction de quelques passages.
2003-06-20/MB: Mise à jour au profit de la révision 0.43.2. A cette occasion, une révision non systématique est réalisée.
2003-06-06/MB: Première révision générale; à savoir, correction de coquilles, bogues, fautes d'orthographe, etc.
2003-05-09/MB: Cette version est la première. Son contenu, rédigé sur LyX version 1.3.2, est basé sur celui de la version anglo-saxonne 0.41.1. Cependant un certain nombre de mes suggestions (Michel Boucey) ayant été prises en compte par Peter Bieringer lors du travail de traduction, il existe d'ores et déjà, ça et là, des modifications mineures qui seront présentes dans les futures versions du document original. Le suffixe .fr.x indique le numéro de révision de la traduction francophone.
Le moyen le plus rapide d'être ajouté à cette sympathique liste est de m'envoyer des corrections (de bogue), et/ou mises à jour ;-).
Si vous voulez réaliser un réexamen important, vous pouvez utiliser le fichier natif LyX (voir le document original) et envoyez les diffs s'y rapportant, car les diffs en rapport au code SGML ne sont pas d'une grande utilité (NdT: merci d'envoyer les diffs à l'adresse <mboucey chez free point fr>).
David Ranch <dranch chez trinnet point net>: pour m'avoir encouragé à écrire cet HOWTO, pour ses commentaires sur quelques premières des révisions, et ses contributions à de différents résultats de test IPv6 sur mon site web IPv6. Mais aussi pour ses relectures et suggestions.
Pekka Savola <pekkas chez netcore point fi>: pour ses relectures essentielles, apports et suggestions.
Martin F. Krafft <madduck chez madduck point net>: pour la vérification orthographique et sa relecture générale du document.
John Ronan <j0n chez tssg point wit point ie>: pour la vérification orthographique.
Georg Käfer <gkaefer chez gmx point at>: pour la détection de la création défectueuse au format PDF (problème réglé maintenant par Greg Ferguson, travaillant au LDP), les références de livres en langue allemande, une grande liste d'URL, leurs vérifications, une grande quantité de suggestions, de corrections, de contributions, et pour sa traduction en langue allemande.
Michel Boucey <mboucey chez free point fr>: pour la correction orthographique, la découverte de liens brisés, sa contribution grâce à ses suggestions, ses apports de nouveaux liens, et pour sa traduction en langue française.
Michele Ferritto <m dot ferritto at virgilio dot it>: pour avoir découvert des bogues, et pour sa traduction en langue italienne.
Daniel Roesen <dr at cluenet dot de>: pour ses vérifications orthographiques.
Ecrire, en étant débutant, un HOWTO LDP (dans LyX et en exportant le travail vers DocBook pour se conformer au SGML) n'est pas si facile que certains pourraient le dire. Il y a d'étranges pièges... malgré tout, merci:
Aux auteurs du Guide de l'auteur LDP
A B. Guillon: pour l'HOWTO DocBook avec LyX
Les crédits concernant les corrections/suggestions apportées à la version francophone viendront ici (peut-être un jour...). Merci par avance pour vos contributions.
Merci de m'avoir lu. Dans l'espoir que cela puisse aider!
Si vous avez des questions, souscrivez à la bonne liste de diffusion et décrivez votre problème en fournissant autant d'information que possible.
] ]
-\end_layout
-
-\begin_layout Standard
-\align left
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route show dev eth0
-\end_layout
-
-\begin_layout Code
-
-3ffe:ffff:0:f101::/64 proto kernel metric 256 mtu 1500 advmss 1440
-\end_layout
-
-\begin_layout Code
-
-fe80::/10 proto kernel metric 256 mtu 1500 advmss 1440
-\end_layout
-
-\begin_layout Code
-
-ff00::/8 proto kernel metric 256 mtu 1500 advmss 1440
-\end_layout
-
-\begin_layout Code
-
-default proto kernel metric 256 mtu 1500 advmss 1440
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6
-\end_layout
-
-\begin_layout Standard
-\align left
-Exemple (la sortie est filtrée sur l'interface eth0).
- Ici vous pouvez voir différentes routes IPv6 pour différentes adresses
- sur une même interface.
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 |grep -w "eth0"
-\end_layout
-
-\begin_layout Code
-
-3ffe:ffff:0:f101 ::/64 :: UA 256 0 0 eth0 <- Route de l'interface de portée
- globale
-\end_layout
-
-\begin_layout Code
-
-¬ address
-\end_layout
-
-\begin_layout Code
-
-fe80::/10 :: UA 256 0 0 eth0 <- Route de l'interface de portée
- lien-local
-\end_layout
-
-\begin_layout Code
-
-¬ address
-\end_layout
-
-\begin_layout Code
-
-ff00::/8 :: UA 256 0 0 eth0 <- Route de l'interface destiné
- à tout le trafic multicast
-\end_layout
-
-\begin_layout Code
-
-¬ addresses
-\end_layout
-
-\begin_layout Code
-
-::/0 :: UDA 256 0 0 eth0 <- Route automatique par défaut
-\end_layout
-
-\begin_layout Section
-Ajouter une route IPv6 traversant une passerelle
-\end_layout
-
-\begin_layout Standard
-\align left
-Nécessaire la plupart du temps pour atteindre l'extérieur grâce à IPv6 en
- utilisant un routeur IPv6 sur votre lien.
-\end_layout
-
-\begin_layout Subsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route add ]
-\end_layout
-
-\begin_layout Code
-
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route add 2000::/3 via 3ffe:ffff:0:f101::1
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 add ]
-\end_layout
-
-\begin_layout Standard
-\align left
-Un périphérique peut être nécessaire également, si l'adresse IPv6 de la
- passerelle est un lien-local.
-\end_layout
-
-\begin_layout Standard
-Suivre l'exemple montré ajoute une route à toutes les adresses globales
- actuelles (2000::/3) à travers la passerelle
-\family typewriter
-\lang afrikaans
-3ffe:ffff:0:f101::1
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 add 2000::/3 gw 3ffe:ffff:0:f101::1
-\end_layout
-
-\begin_layout Section
-Ôter une route IPv6 traversant une passerelle
-\end_layout
-
-\begin_layout Standard
-\align left
-Rarement nécessaire manuellement, la plupart du temps effectué par les scripts
- configurant le réseau à l'extinction (totale ou par interface)
-\end_layout
-
-\begin_layout Subsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route del ]
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route del 2000::/3 via 3ffe:ffff:0:f101::1
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 del ]
-\end_layout
-
-\begin_layout Standard
-Exemple pour de nouveau ôter la route précédemment ajoutée:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 del 2000::/3 gw 3ffe:ffff:0:f101::1
-\end_layout
-
-\begin_layout Section
-Ajouter une route IPv6 traversant une interface
-\end_layout
-
-\begin_layout Standard
-Pas si fréquent, parfois en cas de création de lien point-à-point.
-\end_layout
-
-\begin_layout Subsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route add
-\end_layout
-
-\begin_layout Code
-
-¬ metric 1
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route add 2000::/3 dev eth0 metric 1
-\end_layout
-
-\begin_layout Standard
-La distance (
-\emph on
-metric
-\emph default
-)
-\begin_inset Quotes sld
-\end_inset
-
-1
-\begin_inset Quotes srd
-\end_inset
-
- est utilisée ici par soucis de compatibilité avec la distance utilisée
- par route, car la distance par défaut fixée par
-\begin_inset Quotes sld
-\end_inset
-
-ip
-\begin_inset Quotes srd
-\end_inset
-
- est
-\begin_inset Quotes sld
-\end_inset
-
-1024
-\begin_inset Quotes srd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 add
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 add 2000::/3 dev eth0
-\end_layout
-
-\begin_layout Section
-Ôter une route IPv6 traversant une interface
-\end_layout
-
-\begin_layout Standard
-Rarement utiliser manuellement, les scripts de configuration font cela à
- l'extinction.
-\end_layout
-
-\begin_layout Subsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route del
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route del 2000::/3 dev eth0
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-\align left
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 del
-\end_layout
-
-\begin_layout Standard
-\align left
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 del 2000::/3 dev eth0
-\end_layout
-
-\begin_layout Section
-FAQ concernant les routes IPv6
-\end_layout
-
-\begin_layout Subsection
-Support d'une route par défaut IPv6
-\end_layout
-
-\begin_layout Standard
-Une idée d'IPv6 était le routage hiérarchique, avec pour conséquence une
- quantité moindre d'entrées dans les tables de routage nécessaires aux routeurs.
-\end_layout
-
-\begin_layout Standard
-Il y a certains problèmes dans les noyaux Linux actuels:
-\end_layout
-
-\begin_layout Subsubsection
-Les clients (ne routent aucun paquet!)
-\end_layout
-
-\begin_layout Standard
-Les clients peuvent installer une route par défaut avec pour préfixe
-\begin_inset Quotes sld
-\end_inset
-
-::/0
-\begin_inset Quotes srd
-\end_inset
-
-, ils peuvent aussi apprendre une telle route par auto-configuration, en
- utilisant par exemple radvd s'il est présent sur le lien, comme le montre
- ce qui suit:
-\end_layout
-
-\begin_layout Code
-
-# ip -6 route show | grep ^default
-\end_layout
-
-\begin_layout Code
-
-default via fe80::212:34ff:fe12:3450 dev eth0 proto kernel metric 1024 expires
-\end_layout
-
-\begin_layout Code
-
-¬ 29sec mtu 1500 advmss 1440
-\end_layout
-
-\begin_layout Subsubsection
-Les routeurs en cas de renvoi de paquets
-\end_layout
-
-\begin_layout Standard
-Dans ses grandes lignes, l'actuel noyau Linux (au moins <= 2.4.17) ne supporte
- pas les routes par défaut.
- Vous pouvez les installées, mais la recherche échouera quand un paquet
- devra être renvoyé (une intention normale pour un routeur).
-\end_layout
-
-\begin_layout Standard
-Pour l'heure, le
-\begin_inset Quotes sld
-\end_inset
-
-routage par défaut
-\begin_inset Quotes srd
-\end_inset
-
- peut être installé en utilisant l'actuel et unique préfixe d'adresse globale
-
-\begin_inset Quotes sld
-\end_inset
-
-2000::/3
-\begin_inset Quotes srd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-Le projet USAGI supporte déjà cela dans leurs extensions grâce à une astuce
- de programmation (
-\emph on
-NdT
-\emph default
-:
-\emph on
-a hack
-\emph default
-,
-\emph on
-i.e.
-
-\emph default
- littéralement, une
-\begin_inset Quotes srd
-\end_inset
-
-bidouille
-\begin_inset Quotes srd
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Standard
-Note: prenez garde au routage par défaut sans filtrage d'adresse sur les
- routeurs de bordure, sinon du trafic multicast ou site-local quittera l'environ
-nement.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset CommandInset label
-LatexCommand label
-name "chapter-Neighbor-Discovery"
-
-\end_inset
-
-La découverte de voisinage
-\end_layout
-
-\begin_layout Standard
-La découverte de voisinage est le successeur IPv6 de ARP (
-\emph on
-Address Resolution Protocol
-\emph default
-, protocole de résolution d'adresse) pour IPv4.
- Vous pouvez récupérer l'information concernant le voisinage actuel, de
- plus, vous pouvez fixer ou détruire des entrées.
- Le noyau garde la trace de la détection d'un voisin (comme ARP pour IPv4).
- Vous pouvez faire des recherches dans la table apprise, en utilisant
-\begin_inset Quotes sld
-\end_inset
-
-ip
-\begin_inset Quotes srd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Section
-Afficher le voisinage en utilisant "ip"
-\end_layout
-
-\begin_layout Standard
-Avec la commande qui suit vous pouvez afficher les voisins IPv6 appris ou
- configurés
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh show [dev ]
-\end_layout
-
-\begin_layout Standard
-L'exemple suivant montre un voisin, qui est un routeur pouvant être atteint
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh show
-\end_layout
-
-\begin_layout Code
-
-fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable
-\end_layout
-
-\begin_layout Section
-Manipuler la table de voisinage en utilisant "ip"
-\end_layout
-
-\begin_layout Subsection
-Ajouter manuellement une entrée
-\end_layout
-
-\begin_layout Standard
-La commande suivante vous permet d'ajouter manuellement une entrée
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh add
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0
-\end_layout
-
-\begin_layout Subsection
-Détruire manuellement une entrée
-\end_layout
-
-\begin_layout Standard
-De même qu'une entrée peut être ajoutée, une entrée peut être détruite:
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh del
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0
-\end_layout
-
-\begin_layout Subsection
-Pour plus de réglages avancés
-\end_layout
-
-\begin_layout Standard
-L'outil
-\begin_inset Quotes sld
-\end_inset
-
-ip
-\begin_inset Quotes srd
-\end_inset
-
- est sous-documenté, mais il est très puissant.
- Voir l'aide en ligne pour en savoir plus
-\end_layout
-
-\begin_layout Code
-
-# ip -6 neigh help
-\end_layout
-
-\begin_layout Code
-
-Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR
- ]
-\end_layout
-
-\begin_layout Code
-
- [ nud { permanent | noarp | stale | reachable } ]
-\end_layout
-
-\begin_layout Code
-
- | proxy ADDR } [ dev DEV ]
-\end_layout
-
-\begin_layout Code
-
- ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ]
-\end_layout
-
-\begin_layout Standard
-Il semble que certaines options soient uniquement pour IPv4...
- si vous pouvez contribuer à en dire plus sur les drapeaux et l'emploi avancé,
- merci d'envoyer vos informations.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset CommandInset label
-LatexCommand label
-name "chapter-configuring-ipv6-in-ipv4-tunnels"
-
-\end_inset
-
-Configurer les tunnels IPv6-in-IPv4
-\end_layout
-
-\begin_layout Standard
-\align left
-Si vous souhaitez quitter votre lien incapable d'accéder à IPv6 à partir
- de votre réseau local, vous avez besoin d'un tunnelage IPv6-in-IPv4 afin
- de rejoindre l'Internet mondial IPv6.
-\end_layout
-
-\begin_layout Standard
-\align left
-Il y a différents mécanismes de tunnelage, et conséquemment, différentes
- façons d'installer des tunnels.
-\end_layout
-
-\begin_layout Section
-Les types de tunnel
-\end_layout
-
-\begin_layout Standard
-Il y a plus d'une façon de tunneler des paquets IPv6 sur des liens uniquement
- IPv4.
-\end_layout
-
-\begin_layout Subsection
-Tunnelage statique point-à-point: 6bone
-\end_layout
-
-\begin_layout Standard
-\align left
-Un tunnel point-à-point est un tunnel dédié à un point de connexion terminal,
- qui connaît votre réseau IPv6 (pour le routage en retour) et l'adresse
- IPv4 de votre point de connexion (terminale), comme défini dans la
-\begin_inset CommandInset href
-LatexCommand href
-name "RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers"
-target "http://www.faqs.org/rfcs/rfc2893.html"
-
-\end_inset
-
-.
- Pré-requis:
-\end_layout
-
-\begin_layout Itemize
-\align left
-L'adresse IPv4 de votre point de connexion terminal doit être globalement
- unique, statique, et accessible à partir de l'autre point de connexion
- terminal distant
-\end_layout
-
-\begin_layout Itemize
-\align left
-Un préfixe IPv6 vous est assigné (voir le bureau d'enregistrement 6bone)
-\end_layout
-
-\begin_layout Itemize
-\align left
-Une extrémité distante du tunnel capable de router votre préfixe IPv6 jusqu'à
- votre extrémité locale du tunnel (la plupart du temps, une configuration
- manuelle distante est requise)
-\end_layout
-
-\begin_layout Subsection
-Le tunnelage automatique
-\end_layout
-
-\begin_layout Standard
-Le cas du tunnelage automatique se présente quand un noeud se connecte directeme
-nt à un autre noeud en ayant obtenu au préalable l'adresse IPv4 de l'autre
- noeud.
-\end_layout
-
-\begin_layout Subsection
-\begin_inset CommandInset label
-LatexCommand label
-name "tunneling-6to4"
-
-\end_inset
-
-Le tunnelage 6to4
-\end_layout
-
-\begin_layout Standard
-Le tunnelage 6to4 (
-\begin_inset CommandInset href
-LatexCommand href
-name "RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds"
-target "http://www.faqs.org/rfcs/rfc3056.html"
-
-\end_inset
-
-) utilise un mécanisme simple pour créer des tunnels automatiques.
- Tout noeud ayant une adresse unique globale IPv4 est capable d'être le
- point de connexion terminal d'un tunnel 6to4 (si aucun pare-feu IPv4 ne
- prohibe ce trafic).
- Foncièrement, le tunnelage 6to4 n'est pas un tunnel en binôme (
-\emph on
-one-to-one tunnel
-\emph default
-).
- Ce tunnelage se subdivise en un tunnelage d'un flux montant et d'un flux
- descendant.
- Une adresse IPv6 spéciale indique que ce noeud utilisera un tunnelage 6to4
- pour se connnecter au réseau mondial IPv6.
-\end_layout
-
-\begin_layout Subsubsection
-La génération d'un préfixe 6to4
-\end_layout
-
-\begin_layout Standard
-Une adresse 6to4 est définie comme suit (le schéma provient du
-\begin_inset CommandInset href
-LatexCommand href
-name "RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds"
-target "http://www.faqs.org/rfcs/rfc3056.html"
-
-\end_inset
-
-):
-\end_layout
-
-\begin_layout Code
-
-| 3+13 | 32 | 16 | 64 bits |
-\end_layout
-
-\begin_layout Code
-
-+---+------+-----------+--------+--------------------------------+
-\end_layout
-
-\begin_layout Code
-
-| FP+TLA | V4ADDR | SLA ID | Interface ID |
-\end_layout
-
-\begin_layout Code
-
-| 0x2002 | | | |
-\end_layout
-
-\begin_layout Code
-
-+---+------+-----------+--------+--------------------------------+
-\end_layout
-
-\begin_layout Standard
-FP et TLA ensemble (16 bits) ont la valeur 0x2002.
- V4ADDR est l'adresse IPv4 globale et unique du noeud (en notation hexadécimale).
- SLA est l'identifiant de sous-réseau (65536 sous-réseaux locaux possibles).
- Ils sont utilisés pour représenter la structure locale de votre réseau.
-\end_layout
-
-\begin_layout Standard
-Pour les passerelles, un tel préfixe est généré en utilisant normalement
- pour SLA
-\begin_inset Quotes sld
-\end_inset
-
-0000
-\begin_inset Quotes srd
-\end_inset
-
-, et pour suffixe
-\begin_inset Quotes sld
-\end_inset
-
-::1
-\begin_inset Quotes srd
-\end_inset
-
- (ce n'est pas une nécessité, il peut être déterminé arbitrairement, mais
- d'une portée locale) et assigné à l'interface de tunnelage 6to4.
- Notez que Windows Microsoft utilise aussi V4ADDR comme préfixe.
-\end_layout
-
-\begin_layout Subsubsection
-Le flux de tunnelage ascendant 6to4
-\end_layout
-
-\begin_layout Standard
-Le noeud doit savoir à quel point de connexion terminal étranger ses paquets
- IPv6 dans IPv4 doivent être envoyés.
- Aux tout premiers jours du tunnelage 6to4, des routeurs dédiés au tunnelage
- de flux ascendant avaient été définis.
- Voir
-\begin_inset CommandInset href
-LatexCommand href
-name "l'information 6to4 de NSayer"
-target "http://www.kfu.com/~nsayer/6to4/"
-
-\end_inset
-
- pour une liste de ses routeurs.
-\end_layout
-
-\begin_layout Standard
-De nos jours, les routeurs de flux ascendant 6to4 peuvent être découverts
- comme par magie par l'emploi de l'adresse anycast 192.88.99.1.
- Les protocoles de routage s'occupent de cela en arrière-plan, voir le
-\begin_inset CommandInset href
-LatexCommand href
-name "RFC 3068 / An Anycast Prefix for 6to4 Relay Routers"
-target "http://www.faqs.org/rfcs/rfc3068.html"
-
-\end_inset
-
- pour les détails.
-
-\end_layout
-
-\begin_layout Subsubsection
-Le flux de tunnelage descendant 6to4
-\end_layout
-
-\begin_layout Standard
-La méthode servant au flux descendant (du 6bone vers votre noeud disposant
- de 6to4) n'est pas vraiment bien fixée et peut varier selon l'hôte étranger
- vers qui sont envoyés les paquets originaux.
- Il existe deux possibilités:
-\end_layout
-
-\begin_layout Itemize
-l'hôte étranger utilise 6to4 et émet directement en retour les paquets à
- votre noeud (voir plus bas)
-\end_layout
-
-\begin_layout Itemize
-l'hôte étranger émet les paquets en retour vers le réseau mondial IPv6 et
- selon le routage dynamique qui a lieu alors, un routeur relais créera un
- tunnel automatique de retour vers votre noeud.
-\end_layout
-
-\begin_layout Subsubsection
-Le trafic possible avec 6to4
-\end_layout
-
-\begin_layout Itemize
-de 6to4 vers 6to4: est normalement tunnelé directement entre chacun des
- hôtes disposant de 6to4
-\end_layout
-
-\begin_layout Itemize
-de 6to4 vers un trafic non 6to4: est émis
-\emph on
-via
-\emph default
- le flux ascendant du tunnelage
-\end_layout
-
-\begin_layout Itemize
-un trafic non 6to4 vers 6to4: est émis
-\emph on
-via
-\emph default
- le flux descendant du tunnelage
-\end_layout
-
-\begin_layout Section
-Afficher les tunnels existants
-\end_layout
-
-\begin_layout Subsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 tunnel show [ ]
-\end_layout
-
-\begin_layout Standard
-Exemple:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 tunnel show
-\end_layout
-
-\begin_layout Code
-
-sit0: ipv6/ip remote any local any ttl 64 nopmtudisc
-\end_layout
-
-\begin_layout Code
-
-sit1: ipv6/ip remote 195.226.187.50 local any ttl 64
-\end_layout
-
-\begin_layout Subsection
-Utiliser "route"
-\end_layout
-
-\begin_layout Standard
-Usage:
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6
-\end_layout
-
-\begin_layout Standard
-Exemple (la sortie est filtrée afin de ne laisser apparaître que les tunnels
- empreintant l'interface sit0):
-\end_layout
-
-\begin_layout Code
-
-# /sbin/route -A inet6 | grep "
-\backslash
-Wsit0
-\backslash
-W*$"
-\end_layout
-
-\begin_layout Code
-
-::/96 :: U 256 2 0 sit0
-\end_layout
-
-\begin_layout Code
-
-2002::/16 :: UA 256 0 0 sit0
-\end_layout
-
-\begin_layout Code
-
-2000::/3 ::193.113.58.75 UG 1 0 0 sit0
-\end_layout
-
-\begin_layout Code
-
-fe80::/10 :: UA 256 0 0 sit0
-\end_layout
-
-\begin_layout Code
-
-ff00::/8 :: UA 256 0 0 sit0
-\end_layout
-
-\begin_layout Section
-\begin_inset CommandInset label
-LatexCommand label
-name "conf-ipv6-in-ipv4-point-to-point-tunnels"
-
-\end_inset
-
-Montage d'un tunnel point-à-point
-\end_layout
-
-\begin_layout Standard
-\align left
-Il y a 3 possibilités pour ajouter ou ôter un tunnel point-à-point.
-\end_layout
-
-\begin_layout Standard
-Une bonne source d'information additionnelle à propos de l'installation
- de tunnel grâce à
-\begin_inset Quotes sld
-\end_inset
-
-ip
-\begin_inset Quotes srd
-\end_inset
-
- est
-\begin_inset CommandInset href
-LatexCommand href
-name "configurer les tunnels avec iproute2 (article)"
-target "http://www.deepspace6.net/docs/iproute2tunnel-en.html"
-
-\end_inset
-
- (
-\begin_inset CommandInset href
-LatexCommand href
-name "miroir"
-target "http://mirrors.bieringer.de/www.deepspace6.net/docs/iproute2tunnel-en.html"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Subsection
-Ajouter un tunnel point-à-point
-\end_layout
-
-\begin_layout Subsubsection
-Utiliser "ip"
-\end_layout
-
-\begin_layout Standard
-\align left
-La méthode la plus commune actuellement pour une petite quantité de tunnels.
-\end_layout
-
-\begin_layout Standard
-Usage en vue de créer un périphérique de tunnelage (mais il n'est pas monté
- pour autant, une TTL doit également être spécifiée, car la valeur par défaut
- est 0)
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip tunnel add mode sit ttl
-\end_layout
-
-\begin_layout Standard
-Usage (exemple générique pour trois tunnels):
-\end_layout
-
-\begin_layout Code
-
-# /sbin/ip -6 route del ] ]
-
-]]> ]
-]]> ]
-]]> ]
-]]>
-¬ metric 1
-]]>
-]]>
-]]>
-]]>
-]]>
-]]> pb at bieringer dot de The goal of the Linux IPv6 HOWTO is to answer both basic and advanced questions about IPv6 on the Linux operating system. This HOWTO will provide the reader with enough information to install, configure, and use IPv6 applications on Linux machines. Intermediate releases of this HOWTO are available at mirrors.bieringer.de or mirrors.deepspace6.net. See also revision history for changes. Information about available translations you will find in section Translations. Written and Copyright (C) 2001-2014 by Peter Bieringer This Linux IPv6 HOWTO is published under GNU GPL version 2: The Linux IPv6 HOWTO, a guide how to configure and use IPv6 on Linux systems. Copyright © 2001-2014 Peter Bieringer This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA. 1993: I got in contact with the Internet using console based e-mail and news client (e.g. look for “e91abier” on groups.google.com, that's me). 1996: I got a request for designing a course on IPv6, including a workshop with the Linux operating system. 1997: Started writing a guide on how to install, configure and use IPv6 on Linux systems, called IPv6 & Linux - HowTo (see IPv6 & Linux - HowTo/History for more information). 2001: Started writing this new Linux IPv6 HOWTO. The author can be contacted via e-mail at <pb at bieringer dot de> and also via his homepage. He's currently living in Munich / Bavaria / Germany / Europe / Earth. The current version is shown at the beginning of the document. For other available versions/translations see also http://www.bieringer.de/linux/IPv6/. 2001-11-30: Starting to design new HOWTO. 2002-01-02: A lot of content completed, first public release of chapter 1 (version 0.10). 2002-01-14: More completed, some reviews, public release of the whole document (version 0.14). 2002-08-16: Polish translation is in progress 2002-10-31: Chinese translation is available (see Translations for more) 2002-11-10: German translation is in progress 2003-02-10: German translation is available 2003-04-09: French translation is in progress 2003-05-09: French translation is available 2003-10-16: Italian translation is in progress 2004-03-12: Italian translation is available 2004-06-18: Greek translation is in progress 2005-07-25: Turkish translation is availble 2007-03-28: Portuguese-Brazil translation is in progress 2008-07-30: Spanish translation is available (but still in progress) 2011-05-09: Portuguese-Brazil translation is again in progress Translations always have to contain the URL, version number and copyright of the original document (but yours, too). Pls. don't translate the original changelog, this is not very useful - also do not translate the full section about available translations, can be run out-of-date, add an URL to this section here in the English howto. Looks like the document's change frequency is mostly less than once per month. Since version 0.27 it looks like that most of the content contributed by me has been written. Translations always have to use the English version as source. Note: an overview with URLs can be found at http://www.bieringer.de/linux/IPv6/. A Chinese translation by Burma Chen <expns at yahoo dot com> (announced to me at 2002-10-31) can be found on the TLDP: http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/zh/Linux-IPv6-HOWTO.txt.gz (g'zipped txt). It's a snapshot translation, don't know whether kept up-to-date. Since 2002-08-16 a Polish translation was started and is still in progress by Lukasz Jokiel <Lukasz dot Jokiel at klonex dot com dot pl>. Taken source: CVS-version 1.29 of LyX file, which was source for howto version 0.27. Status is still work-in-progress (2004-08-30). With 2002-11-10 a German translation was started by Georg Käfer <gkaefer at gmx dot at> and the first public version was published 2003-02-10. It's originally available on Deep Space 6 at http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-de/ (mirrored e.g. on http://mirrors.bieringer.de/Linux+IPv6-HOWTO-de/). This version will stay up-to-date as much as possible. With 2003-04-09 a French translation was started by Michel Boucey <mboucey at free dot fr> and the first public version was published 2003-05-09. It's originally available on Deep Space 6 at http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-fr/ (mirrored e.g. on http://mirrors.bieringer.de/Linux+IPv6-HOWTO-fr/). A member of the MontevideoLibre, a project in Uruguay (South America) started the translation into Spanish in wiki format some time ago, but the URL is no longer available. With 2003-10-16 a Italian translation was started by Michele Ferritto <m dot ferritto at virgilio dot it> for the ILDP (Italian Linux Documentation Project) and the first public version was published 2004-03-12. It's originally available on the ILDP at http://it.tldp.org/HOWTO/Linux+IPv6-HOWTO/. On 2003-05-14 Shino Taketani <shino_1305 at hotmail dot com> send me a note that he planned to translate the HowTo into Japanese. On 2004-06-18 Nikolaos Tsarmpopoulos <ntsarb at uth dot gr> send me a note that he planned to translate the HowTo into Greek. On 2005-07-18 Necdet Yucel <nyucel at comu dot edu dot tr> send me a note that a Turkish translation is available. It's a snapshot translation (currently of 0.61) and can be found at http://docs.comu.edu.tr/howto/ipv6-howto.html. On 2011-05-06 Gustavo Mendes de Carvalho <gmcarvalho at gmail dot com> start to translate the HowTo in Portuguese-Brazil. The first try in 2007 by Claudemir da Luz <claudemir dot daluz at virtuallink dot com dot br> was never finished. This HOWTO is currently written with LyX version 1.6.1 on a Fedora 10 Linux system with template SGML/XML (DocBook book). It's available on github / tLDP / LDP / users / Peter-Bieringer for contribution. Code line wrapping is done using selfmade utility “lyxcodelinewrapper.pl”, you can get it from CVS for your own usage: TLDP-CVS / users / Peter-Bieringer Generally, a reference to the master index page is recommended. Because the HTML pages are generated out of the SGML file, the HTML filenames turn out to be quite random. However, some pages are tagged in LyX, resulting in static names. These tags are useful for references and shouldn't be changed in the future. If you think that I have forgotten a tag, please let me know, and I will add it. Some things first: Including this, there are three (3) HOWTO documents available. Apologies, if that is too many ;-) The first IPv6 related document was written by Eric Osborne and called Linux IPv6 FAQ/HOWTO (please use it only for historical issues). Latest version was 3.2.1 released July, 14 1997. Please help: if someone knows the date of birth of this HOWTO, please send me an e-mail (information will be needed in “history”). There exists a second version called IPv6 & Linux - HowTo written by me (Peter Bieringer) in pure HTML. It was born April 1997 and the first English version was published in June 1997. I will continue to maintain it, but it will slowly fade (but not full) in favour of the Linux IPv6 HOWTO you are currently reading. Because the IPv6 & Linux - HowTo is written in pure HTML it's not really compatible with the The Linux Documentation Project (TLDP). I (Peter Bieringer) got a request in late November 2001 to rewrite the IPv6 & Linux - HowTo in SGML. However, because of the discontinuation of that HOWTO (Future of IPv6 & Linux - HowTo), and as IPv6 is becoming more and more standard, I decided to write a new document covering basic and advanced issues which will remain important over the next few years. More dynamic and some advanced content will be still found further on in the second HOWTO (IPv6 & Linux - HowTo). Well known decimal number system, represent any value with digit 0-9. Usually used in lower and higher programming languages, known also as hexadecimal number system, represent any value with digit 0-9 and char A-F (case insensitive). Representation of a value with 85 different digits/chars, this can lead to shorter strings but never seen in the wild. Smallest storage unit, on/true (1) or off/false (0) Mostly a collection of 8 (but not really a must - see older computer systems) bits Here, hardware of network connection, see also NIC A dual homed host is a node with two network (physical or virtual) interfaces on two different links, but does not forward any packets between the interfaces. Generally a single homed host on a link. Normally it has only one active network interface, e.g. Ethernet or (not and) PPP. Mostly same as “device”, see also NIC Header of an IP packet (each network packet has a header, kind of is depending on network layer) A link is a layer 2 network packet transport medium, examples are Ethernet, Token Ring, PPP, SLIP, ATM, ISDN, Frame Relay,... A node is a host or a router. A collection of 8 real bits, today also similar to “byte”. Information for the TCP/UDP dispatcher (layer 4) to transport information to upper layers Each network layer contains mostly a protocol field to make life easier on dispatching transported information to upper layer, seen in layer 2 (MAC) and 3 (IP) A router is a node with two or more network (physical or virtual) interfaces, capable of forwarding packets between the interfaces. An IP socket is defined by source and destination IP addresses and Ports and (binding) Network related a collection of layers IP networks uses bit masks to separate local networks from remote ones A tunnel is typically a point-to-point connection over which packets are exchanged which carry the data of another protocol, e.g. an IPv6-in-IPv4 tunnel. Access Control List Application Programming Interface Application Specified Integrated Circuit Berkeley Software Distribution Controller Area Network Bus (physical bus system) Internet Service Provider Project - a joint effort of six companies in Japan to provide a free IPv6 and IPsec (for both IPv4 and IPv6) stack for BSD variants to the world www.kame.net Local Internet Registry Network Interface Card Request For Comments - set of technical and organizational notes about the Internet UniverSAl playGround for Ipv6 Project - works to deliver the production quality IPv6 protocol stack for the Linux system. The special character “¬” is used for signaling that this code line is wrapped for better viewing in PDF and PS files. In generic examples you will sometimes find the following: For real use on your system command line or in scripts this has to be replaced with relevant content (removing the < and > of course), the result would be e.g. Commands executable as non-root user begin with $, e.g. Commands executable as root user begin with #, e.g. You should be familiar with the major Unix tools e.g. grep, awk, find, ... , and know about their most commonly used command-line options. You should know about layers, protocols, addresses, cables, plugs, etc. If you are new to this field, here is one good starting point for you: http://www.rigacci.org/docs/biblio/online/intro_to_networking/book1.htm You should definitely have some experience in IPv4 configuration, otherwise it will be hard for you to understand what is really going on. Also you should understand what the Domain Name System (DNS) is, what it provides and how to use it. You should at least understand how to use tcpdump and what it can show you. Otherwise, network debugging will very difficult for you. Surely you wish to experiment with real hardware, and not only read this HOWTO to fall asleep here and there. ;-7) IPv6 is a new layer 3 protocol which will supersede IPv4 (also known as IP). IPv4 was designed a long time ago (RFC 760 / Internet Protocol from January 1980) and since its inception, there have been many requests for more addresses and enhanced capabilities. Latest RFC is RFC 2460 / Internet Protocol Version 6 Specification. Major changes in IPv6 are the redesign of the header, including the increase of address size from 32 bits to 128 bits. Because layer 3 is responsible for end-to-end packet transport using packet routing based on addresses, it must include the new IPv6 addresses (source and destination), like IPv4. For more information about the IPv6 history take a look at older IPv6 related RFCs listed e.g. at SWITCH IPv6 Pilot / References. The years 1992, 1993 and 1994 of the IPv6 History (in general) are covered by the following document: IPv6 or IPng (IP next generation). To-do: better time-line, more content... The first IPv6 related network code was added to the Linux kernel 2.1.8 in November 1996 by Pedro Roque. It was based on the BSD API: The shown lines were copied from patch-2.1.8 (e-mail address was blanked on copy&paste). Because of lack of manpower, the IPv6 implementation in the kernel was unable to follow the discussed drafts or newly released RFCs. In October 2000, a project was started in Japan, called USAGI, whose aim was to implement all missing, or outdated IPv6 support in Linux. It tracks the current IPv6 implementation in FreeBSD made by the KAME project. From time to time they create snapshots against current vanilla Linux kernel sources. Until kernel development series 2.5.x was started, the USAGI patch was so big, that Linux networking maintainers were unable to include it completly in the production source of the Linux kernel 2.4.x series. During kernel development series 2.5.x, USAGI tried to insert all of their current extensions into this. Many of the long-term developed IPv6 related patches by USAGI and others are integrated into vanilla kernel series 2.6.x. USAGI and others are still working on implementation of newer features like mobililty and others. From time to time, new extension patches are released and also integration into vanilla kernel series is made. As previously mentioned, IPv6 addresses are 128 bits long. This number of bits generates very high decimal numbers with up to 39 digits: Such numbers are not really addresses that can be memorized. Also the IPv6 address schema is bitwise oriented (just like IPv4, but that's not often recognized). Therefore a better notation of such big numbers is hexadecimal. In hexadecimal, 4 bits (also known as “nibble”) are represented by a digit or character from 0-9 and a-f (10-15). This format reduces the length of the IPv6 address to 32 characters. This representation is still not very convenient (possible mix-up or loss of single hexadecimal digits), so the designers of IPv6 chose a hexadecimal format with a colon as separator after each block of 16 bits. In addition, the leading "0x" (a signifier for hexadecimal values used in programming languages) is removed: A usable address (see address types later) is e.g.: For simplifications, leading zeros of each 16 bit block can be omitted: One sequence of 16 bit blocks containing only zeroes can be replaced with “::“. But not more than one at a time, otherwise it is no longer a unique representation. The biggest reduction is seen by the IPv6 localhost address: There is also a so-called compact (base85 coded) representation defined in RFC 1924 / A Compact Representation of IPv6 Addresses (published on 1. April 1996), never seen in the wild, probably an April fool's joke, but here is an example: Info: ipv6calc is an IPv6 address format calculator and converter program and can be found here: ipv6calc homepage (Mirror) On any IP header, the first 4 bits are reserved for protocol version. So theoretically a protocol number between 0 and 15 is possible: 4: is already used for IPv4 5: is reserved for the Stream Protocol (STP, RFC 1819 / Internet Stream Protocol Version 2) (which never really made it to the public) The next free number was 6. Hence IPv6 was born! During the design of IPv4, people thought that 32 bits were enough for the world. Looking back into the past, 32 bits were enough until now and will perhaps be enough for another few years. However, 32 bits are not enough to provide each network device with a global address in the future. Think about mobile phones, cars (including electronic devices on its CAN-bus), toasters, refrigerators, light switches, and so on... So designers have chosen 128 bits, 4 times more in length than in IPv4 today. The usable size is smaller than it may appear however. This is because in the currently defined address schema, 64 bits are used for interface identifiers. The other 64 bits are used for routing. Assuming the current strict levels of aggregation (/48, /32, ...), it is still possible to “run out” of space, but hopefully not in the near future. See also for more information RFC 1715 / The H Ratio for Address Assignment Efficiency and RFC 3194 / The Host-Density Ratio for Address Assignment Efficiency. While, there are (possibly) some people (only know about Jim Fleming...) on the Internet who are thinking about IPv8 and IPv16, their design is far away from acceptance and implementation. In the meantime 128 bits was the best choice regarding header overhead and data transport. Consider the minimum Maximum Transfer Unit (MTU) in IPv4 (576 octets) and in IPv6 (1280 octets), the header length in IPv4 is 20 octets (minimum, can increase to 60 octets with IPv4 options) and in IPv6 is 40 octets (fixed). This is 3.4 % of minimum MTU in IPv4 and 3.1 % of minimum MTU in IPv6. This means the header overhead is almost equal. More bits for addresses would require bigger headers and therefore more overhead. Also, consider the maximum MTU on normal links (like Ethernet today): it's 1500 octets (in special cases: 9k octets using Jumbo frames). Ultimately, it wouldn't be a proper design if 10 % or 20 % of transported data in a Layer-3 packet were used for addresses and not for payload. Like IPv4, IPv6 addresses can be split into network and host parts using subnet masks. IPv4 has shown that sometimes it would be nice, if more than one IP address can be assigned to an interface, each for a different purpose (aliases, multi-cast). To remain extensible in the future, IPv6 is going further and allows more than one IPv6 address to be assigned to an interface. There is currently no limit defined by an RFC, only in the implementation of the IPv6 stack (to prevent DoS attacks). Using this large number of bits for addresses, IPv6 defines address types based on some leading bits, which are hopefully never going to be broken in the future (unlike IPv4 today and the history of class A, B, and C). Also the number of bits are separated into a network part (upper 64 bits) and a host part (lower 64 bits), to facilitate auto-configuration. This is a special address for the loopback interface, similiar to IPv4 with its “127.0.0.1”. With IPv6, the localhost address is: or compressed: Packets with this address as source or destination should never leave the sending host. This is a special address like “any” or “0.0.0.0” in IPv4 . For IPv6 it's: or: These addresses are mostly used/seen in socket binding (to any IPv6 address) or routing tables. Note: the unspecified address cannot be used as destination address. There are two addresses which contain an IPv4 address. IPv4-only IPv6-compatible addresses are sometimes used/shown for sockets created by an IPv6-enabled daemon, but only binding to an IPv4 address. These addresses are defined with a special prefix of length 96 (a.b.c.d is the IPv4 address): or in compressed format For example, the IPv4 address 1.2.3.4 looks like this: IPv4-compatible IPv6 addresses are used for automatic tunneling (RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers), which is being replaced by 6to4 tunneling. or in compressed format Designers defined some address types and left a lot of scope for future definitions as currently unknown requirements arise. RFC 4291 / IP Version 6 Addressing Architecture defines the current addressing scheme. Now lets take a look at the different types of prefixes (and therefore address types): These are special addresses which will only be valid on a link of an interface. Using this address as destination the packet would never pass through a router. It's used for link communications such as: anyone else here on this link? anyone here with a special address (e.g. looking for a router)? They begin with ( where “x” is any hex character, normally “0”) An address with this prefix is found on each IPv6-enabled interface after stateless auto-configuration (which is normally always the case). These are addresses similar to the RFC 1918 / Address Allocation for Private Internets in IPv4 today, with the added advantage that everyone who use this address type has the capability to use the given 16 bits for a maximum number of 65536 subnets. Comparable with the 10.0.0.0/8 in IPv4 today. Another advantage: because it's possible to assign more than one address to an interface with IPv6, you can also assign such a site local address in addition to a global one. It begins with: (where “x” is any hex character, normally “0”) This address type is now deprecated RFC 3879 / Deprecating Site Local Addresses, but for a test in a lab, such addresses are still a good choice in my humble opinion. Because the original defined site local addresses are not unique, this can lead to major problems, if two former independend networks would be connected later (overlapping of subnets). This and other issues lead to a new address type named RFC 4193 / Unique Local IPv6 Unicast Addresses. It begins with: A part of the prefix (40 bits) are generated using a pseudo-random algorithm and it's improbable, that two generated ones are equal. Example for a prefix (generated using a web-based tool: Goebel Consult / createLULA): Today, there is one global address type defined (the first design, called "provider based," was thrown away some years ago RFC 1884 / IP Version 6 Addressing Architecture [obsolete], you will find some remains in older Linux kernel sources). It begins with (x are hex characters) Note: the prefix “aggregatable” is thrown away in current drafts.
-There are some further subtypes defined, see below: These were the first global addresses which were defined and in use. They all start with Example: A special 6bone test address which will never be globally unique begins with and is mostly shown in older examples. The reason for this is, if real addresses are are shown, it's possible for someone to do a copy & paste to their configuration files, thus inadvertently causing duplicates on a globally unique address. This would cause serious problems for the original host (e.g. getting answer packets for request that were never sent).
-Because IPv6 is now in production, this prefix is no longer be delegated and is removed from routing after 6.6.2006 (see RFC 3701 / 6bone Phaseout for more). These addresses, designed for a special tunneling mechanism [RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds and RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers], encode a given IPv4 address and a possible subnet and begin with For example, representing 192.168.1.1/5: A small shell command line can help you generating such address out of a given IPv4 one: See also tunneling using 6to4 and information about 6to4 relay routers. These addresses are delegated to Internet service providers (ISP) and begin currently with Prefixes to major (backbone owning) ISPs (also known as LIRs) are delegated by local registries and currently have a prefix with length 32 assigned. Any ISP customer can get a prefix with length 48. Currently, two address ranges are reserved for examples and documentation RFC 3849 / IPv6 Address Prefix Reserved for Documentation: These address ranges should be filtered based on source addresses and should NOT be routed on border routers to the internet, if possible. Multicast addresses are used for related services. They alway start with (xx is the scope value) They are split into scopes and types: Multicast scope is a parameter to specify the maximum distance a multicast packet can travel from the sending entity. Currently, the following regions (scopes) are defined: ffx1: node-local, packets never leave the node. ffx2: link-local, packets are never forwarded by routers, so they never leave the specified link. ffx5: site-local, packets never leave the site. ffx8: organization-local, packets never leave the organization (not so easy to implement, must be covered by routing protocol). ffxe: global scope. others are reserved There are many types already defined/reserved (see RFC 4291 / IP Version 6 Addressing Architecture for details). Some examples are: All Nodes Address: ID = 1h, addresses all hosts on the local node (ff01:0:0:0:0:0:0:1) or the connected link (ff02:0:0:0:0:0:0:1). All Routers Address: ID = 2h, addresses all routers on the local node (ff01:0:0:0:0:0:0:2), on the connected link (ff02:0:0:0:0:0:0:2), or on the local site (ff05:0:0:0:0:0:0:2) Special multicast address used as destination address in neighborhood discovery, because unlike in IPv4, ARP no longer exists in IPv6. An example of this address looks like Used prefix shows that this is a link-local multicast address. The suffix is generated from the destination address. In this example, a packet should be sent to address “fe80::1234”, but the network stack doesn't know the current layer 2 MAC address. It replaces the upper 104 bits with “ff02:0:0:0:0:1:ff00::/104” and leaves the lower 24 bits untouched. This address is now used `on-link' to find the corresponding node which has to send a reply containing its layer 2 MAC address. Anycast addresses are special addresses and are used to cover things like nearest DNS server, nearest DHCP server, or similar dynamic groups. Addresses are taken out of the unicast address space (aggregatable global or site-local at the moment). The anycast mechanism (client view) will be handled by dynamic routing protocols. Note: Anycast addresses cannot be used as source addresses, they are only used as destination addresses. A simple example for an anycast address is the subnet-router anycast address. Assuming that a node has the following global assigned IPv6 address: The subnet-router anycast address will be created blanking the suffix (least significant 64 bits) completely: For auto-configuration and mobility issues, it was decided to use the lower 64 bits as the host part of the address in most of the current address types. Therefore each single subnet can hold a large amount of addresses. This host part can be inspected differently: With auto-configuration, the host part of the address is computed by converting the MAC address of an interface (if available), with the EUI-64 method, to a unique IPv6 address. If no MAC address is available for this device (happens e.g. on virtual devices), something else (like the IPv4 address or the MAC address of a physical interface) is used instead. E.g. a NIC has following MAC address (48 bit): This would be expanded according to theIEEE-Tutorial EUI-64 design for EUI-48 identifiers to the 64 bit interface identifier: With a given prefix, the result is the IPv6 address shown in example above: Because the "automatically computed" host part is globally unique (except when a vendor of a NIC uses the same MAC address on more than one NIC), client tracking is possible on the host when not using a proxy of any kind. This is a known problem, and a solution was defined: privacy extension, defined in RFC 3041 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6 (there is also already a newer draft available: draft-ietf-ipv6-privacy-addrs-v2-*). Using a random and a static value a new suffix is generated from time to time. Note: this is only reasonable for outgoing client connections and isn't really useful for well-known servers. For servers, it's probably easier to remember simpler addresses, this can also be accommodated. It is possible to assign an additional IPv6 address to an interface, e.g. For manual suffixes like “::1” shown in the above example, it's required that the 7th most significant bit is set to 0 (the universal/local bit of the automatically generated identifier). Also some other (otherwise unchosen ) bit combinations are reserved for anycast addresses, too. In the early design phase it was planned to use a fully hierarchical routing approach to reduce the size of the routing tables maximally. The reasons behind this approach were the number of current IPv4 routing entries in core routers (> 400 thousand in 2013), reducing the need of memory in hardware routers (ASIC “Application Specified Integrated Circuit” driven) to hold the routing table and increase speed (fewer entries hopefully result in faster lookups). Todays view is that routing will be mostly hierarchically designed for networks with only one service provider. With more than one ISP connections, this is not possible, and subject to an issue named multi-homing (infos on multi-homing: drafts-ietf-multi6-*,IPv6 Multihoming Solutions). Similar to IPv4, the routable network path for routing to take place. Because standard netmask notation for 128 bits doesn't look nice, designers employed the IPv4 Classless Inter Domain Routing (CIDR, RFC 1519 / Classless Inter-Domain Routing) scheme, which specifies the number of bits of the IP address to be used for routing. It is also called the "slash" notation. An example: This notation will be expanded: Network: Netmask: Under normal circumstances (no QoS), a lookup in a routing table results in the route with the most significant number of address bits being selected. In other words, the route with the biggest prefix length matches first. For example if a routing table shows following entries (list is not complete): Shown destination addresses of IPv6 packets will be routed through shown device Before you can start using IPv6 on a Linux host, you have to test, whether your system is IPv6-ready. You may have to do some work to enable it first. Modern Linux distributions already contain IPv6-ready kernels, the IPv6 capability is generally compiled as a module, but it's possible that this module is not loaded automatically on startup. Note: you shouldn't anymore use kernel series 2.2.x, because it's not IPv6-up-to-date anymore. Also the IPv6 support in series 2.4.x is no longer improved according to definitions in latest RFCs. It's recommend to use series 2.6.x now. To check, whether your current running kernel supports IPv6, take a look into your /proc-file-system. Following entry must exists: A short automatical test looks like: If this fails, it is quite likely, that the IPv6 module is not loaded. You can try to load the IPv6 module executing If this is successful, this module should be listed, testable with following auto-magically line: And the check shown above should now run successfully. Note: unloading the module is currently not supported and can result, under some circumstances, in a kernel crash. Its possible to automatically load the IPv6 module on demand. You only have to add following line in the configuration file of the kernel module loader (normally /etc/modules.conf or /etc/conf.modules): It's also possible to disable automatically loading of the IPv6 module using following line Additional note: in kernels series 2.6.x, the module loader mechanism was changed. The new configuration file has to be named /etc/modprobe.conf instead of /etc/modules.conf. If both above shown results were negative and your kernel has no IP6 support, than you have the following options: Update your distribution to a current one which supports IPv6 out-of-the-box (recommended for newbies) Compile a new vanilla kernel (easy, if you know which options you needed) Recompile kernel sources given by your Linux distribution (sometimes not so easy) Compile a kernel with USAGI extensions If you decide to compile a kernel, you should have previous experience in kernel compiling and read the Linux Kernel HOWTO. A comparison between vanilla and USAGI extended kernels is available on IPv6+Linux-Status-Kernel. More detailed hints about compiling an IPv6-enabled kernel can be found e.g. on IPv6-HOWTO-2#kernel. Note: you should use whenever possible kernel series 2.6.x or above, because the IPv6 support in series 2.4.x only will no longer get backported features from 2.6.x and IPv6 support in series 2.2.x is hopeless outdated. Same as for vanilla kernel, only recommend for advanced users, which are already familiar with IPv6 and kernel compilation. See also USAGI project / FAQ and Obtaining the best IPv6 support with Linux (Article) (Mirror). Not all existing network devices have already (or ever) the capability to transport IPv6 packets. A current status can be found at IPv6+Linux-status-kernel.html#transport. A major issue is that because of the network layer structure of kernel implementation an IPv6 packet isn't really recognized by it's IP header number (6 instead of 4). It's recognized by the protocol number of the Layer 2 transport protocol. Therefore any transport protocol which doesn't use such protocol number cannot dispatch IPv6 packets. Note: the packet is still transported over the link, but on receivers side, the dispatching won't work (you can see this e.g. using tcpdump). Serial Line IP (SLIP, RFC 1055 / SLIP), should be better called now to SLIPv4, device named: slX Parallel Line IP (PLIP), same like SLIP, device names: plipX ISDN with encapsulation rawip, device names: isdnX ISDN with encapsulation syncppp, device names: ipppX (design issue of the ipppd, will be merged into more general PPP layer in kernel series 2.5.x) You wont get very far, if you are running an IPv6-ready kernel, but have no tools to configure IPv6. There are several packages in existence which can configure IPv6. The net-tool package includes some tools like ifconfig and route, which helps you to configure IPv6 on an interface. Look at the output of ifconfig -? or route -?, if something is shown like IPv6 or inet6, then the tool is IPv6-ready. Auto-magically check: Same check can be done for route: Alexey N. Kuznetsov (current a maintainer of the Linux networking code) created a tool-set which configures networks through the netlink device. Using this tool-set you have more functionality than net-tools provides, but its not very well documented and isn't for the faint of heart. If the program /sbin/ip isn't found, then I strongly recommend you install the iproute package. You can get it from your Linux distribution (if contained) You're able to look for a proper RPM package at RPMfind/iproute (sometimes rebuilding of a SRPMS package is recommended) After you have prepared your system for IPv6, you now want to use IPv6 for network communications. First you should learn how to examine IPv6 packets with a sniffer program. This is strongly recommended because for debugging/troubleshooting issues this can aide in providing a diagnosis very quickly. This program is normally included in package iputils. It is designed for simple transport tests sending ICMPv6 echo-request packets and wait for ICMPv6 echo-reply packets. Usage Some implementation also support %<device> suffix instead of using -I <device>, e.g. Example Hint: ping6 needs raw access to socket and therefore root permissions. So if non-root users cannot use ping6 then there are two possible problems: ping6 is not in users path (probably, because ping6 is generally stored in /usr/sbin -> add path (not really recommended) ping6 doesn't execute properly, generally because of missing root permissions -> chmod u+s /usr/sbin/ping6 Using link-local addresses for an IPv6 ping, the kernel does not know through which (physically or virtual) device it must send the packet - each device has a link-local address. A try will result in following error message: In this case you have to specify the interface additionally like shown here: Example for %<device> notation: An interesting mechanism to detect IPv6-active hosts on a link is to ping6 to the link-local all-node multicast address: Example for %<device> notation: Unlike in IPv4, where replies to a ping on the broadcast address can be disabled, in IPv6 currently this behavior cannot be disable except by local IPv6 firewalling. This program is normally included in package iputils. It's a program similar to IPv4 traceroute. Below you will see an example: Note: unlike some modern versions of IPv4 traceroute, which can use ICMPv4 echo-request packets as well as UDP packets (default), current IPv6-traceroute is only able to send UDP packets. As you perhaps already know, ICMP echo-request packets are more accepted by firewalls or ACLs on routers inbetween than UDP packets. If a dedicated interface must be specified, this can be done by -i <device> or using <address>%<device>. This program is normally included in package iputils. It's a program like traceroute6 and traces the path to a given destination discovering the MTU along this path. Below you will see an example: On Linux, tcpdump is the major tool for packet capturing. Below you find some examples. IPv6 support is normally built-in in current releases of version 3.6. tcpdump uses expressions for filtering packets to minimize the noise: icmp6: filters native ICMPv6 traffic ip6: filters native IPv6 traffic (including ICMPv6) proto ipv6: filters tunneled IPv6-in-IPv4 traffic not port ssh: to suppress displaying SSH packets for running tcpdump in a remote SSH session Also some command line options are very useful to catch and print more information in a packet, mostly interesting for digging into ICMPv6 packets: “-s 512”: increase the snap length during capturing of a packet to 512 bytes “-vv”: really verbose output “-n”: don't resolve addresses to names, useful if reverse DNS resolving isn't working proper 1.2.3.4 and 5.6.7.8 are tunnel endpoints (all addresses are examples) Current distributions already contain the most needed IPv6 enabled client and servers. See first on IPv6+Linux-Status-Distribution. If still not included, you can check Current Status of IPv6 Support for Networking Applications whether the program is already ported to IPv6 and usable with Linux. For common used programs there are some hints available here later in this document. To run the following shown tests, it's required that your system is IPv6 enabled, and some examples show addresses which only can be reached if a connection to the global IPv6 network is available. Note: if using names instead of dedicated IPv4/IPv6 addresses which resolves to IPv4 and IPv6 addresses, some command line clients support explicitly use of specified protocol. Usually such clients have option “-4” for IPv4 and “-6” for IPv6. Because of security updates in the last years every Domain Name System (DNS) server should run newer software which already understands the (intermediate) IPv6 address-type AAAA (the newer one named A6 isn't still common at the moment because only supported using BIND9 and newer and also the non-existent support of root domain IP6.ARPA). A simple test whether the used system can resolve IPv6 addresses is and should show something like following: IPv6-ready telnet clients are available. A simple test can be done with If the telnet client don't understand the IPv6 address and says something like “cannot resolve hostname”, then it's not IPv6-enabled. Current versions of openssh are IPv6-ready. Depending on configuring before compiling it has two behavior. --without-ipv4-default: the client tries an IPv6 connect first automatically and fall back to IPv4 if not working --with-ipv4-default: default connection is IPv4, IPv6 connection must be force like following example shows If your ssh client doesn't understand the option “-6” then it's not IPv6-enabled, like most ssh version 1 packages. SSH.com's SSH client and server is also IPv6 aware now and is free for all Linux and FreeBSD machine regardless if used for personal or commercial use. A current status of IPv6 enabled web browsers is available at Current Status of IPv6 Support for Networking Applications - HTTP. Most of them have unresolved problems at the moment If using an IPv4 only proxy in the settings, IPv6 requests will be sent to the proxy, but the proxy will fail to understand the request and the request fails. Solution: update proxy software (see later). Automatic proxy settings (*.pac) cannot be extended to handle IPv6 requests differently (e.g. don't use proxy) because of their nature (written in Java-script and well hard coded in source like to be seen in Mozilla source code). Also older versions don't understand an URL with IPv6 encoded addresses like http://[2001:4dd0:f838:a006::6]/, IPv6 address of http://www.ipv6.bieringer.de/ (this given URLs only works with an IPv6-enabled browser!). A short test is to try shown URL with a given browser and using no proxy. A good starting point for browsing using IPv6 is http://www.kame.net/. If the turtle on this page is animated, the connection is via IPv6, otherwise the turtle is static. Other test servers are e.g. In this part of this HOWTO, more client specific issues are mentioned. Therefore hints for IPv6-ready servers like sshd, httpd, telnetd, etc. are shown below in Hints for IPv6-enabled daemons. Error message: "connect: Invalid argument" Kernel doesn't know, which physical or virtual link you want to use to send such ICMPv6 packets. Therefore it displays this error message. Solution: Specify interface like: “ping6 -I eth0 fe80::2e0:18ff:fe90:9205”, see also program ping6 usage. Error message: “icmp socket: Operation not permitted” These utilities create special ICMPv6 packets and send them out. This is done by using raw sockets in the kernel. But raw sockets can only be used by the “root” user. Therefore normal users get such error message. Solution: If it's really needed that all users should be able to use these utilities, you can add the “suid” bit using ”chmod u+s /path/to/program”, see also program ping6 usage. If not all users should be able to, you can change the group of the program to e.g. “wheel”, add these power users to this group and remove the execution bit for other users using “chmod o-rwx /path/to/program”. Or configure “sudo” to enable your security policy. On a node, there exist different network devices. They can be collected in classes Physically bounded, like eth0, tr0 Virtually existing, like ppp0, tun0, tap0, sit0, isdn0, ippp0 Physically bounded interfaces like Ethernet or Token-Ring are normal ones and need no special treatment. Virtually bounded interfaces always need special support These interfaces are normally named sitx. The name sit is a shortcut for Simple Internet Transition. This device has the capability to encapsulate IPv6 packets into IPv4 ones and tunnel them to a foreign endpoint. sit0 has a special meaning and cannot be used for dedicated tunnels. IPv6 capability for HDLC with encapsulation ip is already built-in in the kernel ISDN PPP interfaces (ippp) aren't IPv6 enabled by kernel. Also there are also no plans to do that because in kernel 2.5.+ they will be replaced by a more generic ppp interface layer. Like mentioned earlier, this interfaces don't support IPv6 transport (sending is OK, but dispatching on receiving don't work). Ether-tap devices are IPv6-enabled and also stateless configured. For use, the module “ethertap” has to be loaded before. Two methods can be used to bring interfaces up or down. Usage: Example: Usage: Example: There are different ways to configure an IPv6 address on an interface. You can use use "ifconfig" or "ip". First you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during stateless auto-configuration). Just note that addresses beginning with “fec0” are deprecated, but shown here for completness! Usage: Example for a static configured host: Example for a host which is auto-configured Here you see some auto-magically configured IPv6 addresses and their lifetime. Usage: Example (output filtered with grep to display only IPv6 addresses). Here you see different IPv6 addresses with different scopes. Adding an IPv6 address is similar to the mechanism of "IP ALIAS" addresses in Linux IPv4 addressed interfaces. Usage: Example: Usage: Example: Not so often needed, be carefully with removing non existent IPv6 address, sometimes using older kernels it results in a crash. Usage: Example: Usage: Example: In case, a Router Advertisement is received by a client, and IPv6 autoconfiguration is enabled (default on non-router), the client configures itself an IPv6 address according to the prefix contained in the advertisement (see also Section 22.4). Privacy Extension as described in RFC 4941 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6 (obsoleted RFC 3041) is replacing the static interface ID (mostly based on word-wide unique MAC address) used during autoconfiguration by a pseudo-random one and generating from time to time a new one deprecating the old one. Enable privacy extension for e.g. interface “eth0” and prefer the generated address: Afterwards, restart of the interface is necessary Once a router advertisement is received, the result should look like following For permanent activation, either a special initscript value per interface will enable privacy or an entry in the /etc/sysctl.conf file like Note: interface must already exists with proper name when sysctl.conf is applied. If this is not the case (e.g. after reboot) one has to configure privacy for all interfaces by default: Changed/added values in /etc/sysctl.conf can be activated during runtime, but at least an interface down/up or a reboot is recommended. Modern (client) systems are using NetworkManager for configuring interfaces. A command line tool is built-in which can be used to change settings which are not available via GUI. Examples based on version 0.9.9.1-5.git20140319.fc21 Check existing interfaces with: Current amount of IPv6 privacy extension addresses can be checked with Current IPv6 privacy extension settings can be checked with Enable IPv6 privacy extension and restart interface New IPv6 privacy extension settings can be checked with Now IPv6 privacy extension addresses are configured on the interface Whether the IPv6 address with an Interface ID generated by Privacy Extension is really used for outgoing connections, one can browse to http://ip.bieringer.de/, in case EUI64_SCOPE shows “iid-privacy”, then everything is working fine. If you want to leave your link and want to send packets in the world wide IPv6-Internet, you need routing. If there is already an IPv6 enabled router on your link, it's possible enough to add IPv6 routes. Just note that addresses beginning with “fec0” are deprecated, but shown here for completness! First you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during auto-configuration). Usage: Example: Usage: Example (output is filtered for interface eth0). Here you see different IPv6 routes for different addresses on a single interface. Mostly needed to reach the outside with IPv6 using an IPv6-enabled router on your link. Usage: Example: Usage: A device can be needed, too, if the IPv6 address of the gateway is a link local one. Following shown example adds a default route through gateway 2001:0db8:0:f101::1 Not so often needed manually, mostly done by network configure scripts on shutdown (full or per interface) Usage: Example: Usage: Example for removing upper added route again: Not often needed, sometimes in cases of dedicated point-to-point links. Usage: Example: Metric “1” is used here to be compatible with the metric used by route, because the default metric on using “ip” is “1024”. Usage: Example: Not so often needed to use by hand, configuration scripts will use such on shutdown. Usage: Example: Usage: Example: One idea of IPv6 was a hierachical routing, therefore only less routing entries are needed in routers. There are some issues in current Linux kernels: Client can setup a default route like prefix “::/0”, they also learn such route on autoconfiguration e.g. using radvd on the link like following example shows: Older Linux kernel (at least <= 2.4.17) don't support default routes. You can set them up, but the route lookup fails when a packet should be forwarded (normal intention of a router). If you're still using such older kernel, “default routing” can be setup using the currently used global address prefix “2000::/3”. Note: take care about default routing without address filtering on edge routers. Otherwise unwanted multicast or site-local traffic can leave the edge. Neighbor discovery was the IPv6 successor for the ARP (Address Resolution Protocol) in IPv4. You can retrieve information about the current neighbors, in addition you can set and delete entries. The kernel keeps tracking of successful neighbor detection (like ARP in IPv4). You can dig into the learnt table using “ip”. With following command you can display the learnt or configured IPv6 neighbors The following example shows one neighbor, which is a reachable router With following command you are able to manually add an entry Example: Like adding also an entry can be deleted: Example: The tool “ip” is less documentated, but very strong. See online “help” for more: Looks like some options are only for IPv4...if you can contribute information about flags and advanced usage, pls. send. If you want to leave your link and you have no IPv6 capable network around you, you need IPv6-in-IPv4 tunneling to reach the world wide IPv6-Internet. There are some kind of tunnel mechanism and also some possibilities to setup tunnels. There are more than one possibility to tunnel IPv6 packets over IPv4-only links. A point-to-point tunnel is a dedicated tunnel to an endpoint, which knows about your IPv6 network (for backward routing) and the IPv4 address of your tunnel endpoint and defined in RFC 4213 / Basic Transition Mechanisms for IPv6 Hosts and Routers. Requirements: IPv4 address of your local tunnel endpoint must be static, global unique and reachable from the foreign tunnel endpoint If no static IPv4 address is available, the tunnel provider must support authentication of the dynamic IPv4 address, like SixXS / AICCU (3740/udp) or gogo6 (3653/udp). A global IPv6 prefix assigned to you It is also possible that additional IPv6 networks are routed through this tunnel. A foreign tunnel endpoint which is capable to route your IPv6 prefix to your local tunnel endpoint (mostly remote manual configuration required) Tunnel provider for static point-to-point tunneling: Automatic tunneling occurs, when a node directly connects another node gotten the IPv4 address of the other node before. 6to4 tunneling (RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds) uses a simple mechanism to create automatic tunnels. Each node with a global unique IPv4 address is able to be a 6to4 tunnel endpoint (if no IPv4 firewall prohibits traffic). 6to4 tunneling is mostly not a one-to-one tunnel. This case of tunneling can be divided into upstream and downstream tunneling. Also, a special IPv6 address indicates that this node will use 6to4 tunneling for connecting the world-wide IPv6 network The 6to4 address is defined like following (schema is taken from RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds): FP and TLA together (16 bits) have the value 0x2002. V4ADDR is the node's global unique IPv4 address (in hexadecimal notation). SLA is the subnet identifier (65536 local subnets possible) and are usable to represent your local network structure. For gateways, such prefix is generated by normally using SLA “0000” and suffix “::1” (not a must, can be an arbitrary one with local-scope) and assigned to the 6to4 tunnel interface. Note that Microsoft Windows uses V4ADDR also for suffix. The node has to know to which foreign tunnel endpoint its in IPv4 packed IPv6 packets should be send to. In “early” days of 6to4 tunneling, dedicated upstream accepting routers were defined. See NSayer's 6to4 information for a list of routers. Nowadays, 6to4 upstream routers can be found auto-magically using the anycast address 192.88.99.1. In the background routing protocols handle this, see RFC 3068 / An Anycast Prefix for 6to4 Relay Routers for details. The downstream (IPv6 backbone -> your 6to4 enabled node) is not really fix and can vary from foreign host which originated packets were send to. There exist two possibilities: Foreign host uses 6to4 and sends packet direct back to your node (see below) Foreign host sends packets back to the world-wide IPv6 network and depending on the dynamic routing a relay router of an ISP which announces 2002::/16 via BGP will create a automatic tunnel back to your node. from 6to4 to 6to4: is normally directly tunneled between the both 6to4 enabled hosts from 6to4 to non-6to4: is sent via upstream tunneling non-6to4 to 6to4: is sent via downstream tunneling Note, that because of possible asymmetric routing problems with a broken 6to4 relay can be hard to troubleshoot. UDP encapsulated IPv6 tunneling is usally used if no global IPv4 address is available on the internal endpoint, but using Network Adress Translation (NAT) it can still reach related endpoints using UDP ports described below. RFC 4380 / Teredo: Tunneling IPv6 over UDP through Network Address Translationsdescribes tunneling of IPv6 packets via IPv4 UDP bubbles, see also Wikipedia / Teredo. It uses usually 3544/udp. Linux client is named miredo and usable out-of-the-box. This tunnel method can only connect a single client to the global IPv6 network.. Tunnel provider SixXS has also IPv6-in-UDP-in-IPv4 (5072/udp) capability, for using it, the AYIYA mode must be enabled. Tunnel provider gogo6 has also IPv6-in-UDP-in-IPv4 (3653/udp) capability, for using it, the v6udpv4 mode must be enabled. Usage: Example: Usage: Example (output is filtered to display only tunnels through virtual interface sit0): There are 3 possibilities to add or remove point-to-point tunnels. A good additional information about tunnel setup using “ip” is Configuring tunnels with iproute2 (article) (Mirror). Common method at the moment for a small amount of tunnels. Usage for creating a tunnel device (but it's not up afterward, also a TTL must be specified because the default value is 0). Usage (generic example for three tunnels): This not very recommended way to add a tunnel because it's a little bit strange. No problem if adding only one, but if you setup more than one, you cannot easy shutdown the first ones and leave the others running. Usage (generic example for three tunnels): Important: DON'T USE THIS, because this setup implicit enable "automatic tunneling" from anywhere in the Internet, this is a risk, and it should not be advocated. It's also possible to setup tunnels in Non Broadcast Multiple Access (NBMA) style, it's a easy way to add many tunnels at once. But none of the tunnel can be numbered (which is a not required feature). Usage (generic example for three tunnels): Important: DON'T USE THIS, because this setup implicit enable "automatic tunneling" from anywhere in the Internet, this is a risk, and it should not be advocated. Manually not so often needed, but used by scripts for clean shutdown or restart of IPv6 configuration. Usage for removing a tunnel device: Usage (generic example for three tunnels): Not only the creation is strange, the shutdown also...you have to remove the tunnels in backorder, means the latest created must be removed first. Usage (generic example for three tunnels): This is like removing normal IPv6 routes. Usage (generic example for three tunnels): Sometimes it's needed to configure a point-to-point tunnel with IPv6 addresses like in IPv4 today. This is only possible with the first (ifconfig+route - deprecated) and third (ip+route) tunnel setup. In such cases, you can add the IPv6 address to the tunnel interface like shown on interface configuration. Pay attention that the support of 6to4 tunnels currently lacks on vanilla kernel series 2.2.x (see systemcheck/kernel for more information). Also note that that the prefix length for a 6to4 address is 16 because of from network point of view, all other 6to4 enabled hosts are on the same layer 2. First, you have to calculate your 6to4 prefix using your local assigned global routable IPv4 address (if your host has no global routable IPv4 address, in special cases NAT on border gateways is possible): Assuming your IPv4 address is the generated 6to4 prefix will be Local 6to4 gateways should (but it's not a must, you can choose an arbitrary suffix with local-scope, if you feel better) always assigned the suffix “::1”, therefore your local 6to4 address will be Use e.g. following for automatic generation: There are two ways possible to setup 6to4 tunneling now. This is now the recommended way (a TTL must be specified because the default value is 0). Create a new tunnel device Bring interface up Add local 6to4 address to interface (note: prefix length 16 is important!) Add (default) route to the global IPv6 network using the all-6to4-routers IPv4 anycast address It was reported that some versions of “ip” (e.g. SuSE Linux 9.0) don't support IPv4-compatible IPv6 addresses for gateways, in this case the related IPv6 address has to be used: This is now deprecated because using the generic tunnel device sit0 doesn't let specify filtering per device. Bring generic tunnel interface sit0 up Add local 6to4 address to interface Add (default) route to the global IPv6 network using the all-6to4-relays IPv4 anycast address Remove all routes through this dedicated tunnel device Shut down interface Remove created tunnel device Remove (default) route through the 6to4 tunnel interface Remove local 6to4 address to interface Shut down generic tunnel device (take care about this, perhaps it's still in use...) RFC 2473 / Generic Packet Tunneling in IPv6 Specification specifies mechanisms to tunnel several different packet types over IPv6 including IPv4. NOTE: Support for IPv4-in-IPv6 tunnel is available only since kernel version 2.6.22. Usage: Example: NOTE: If you don't include "mode any", only IPv6-in-IPv6 tunnels are displayed. Usage for creating a 4over6 tunnel device (but it's not up afterward) Usage (generic example for three tunnels): Usage for removing a tunnel device: Usage (generic example for three tunnels): Note: the source of this section is mostly the file “ip-sysctl.txt” which is included in current kernel sources in directory “Documentation/networking”. Credits to Pekka Savola for maintaining the IPv6-related part in this file. Also some text is more or less copied & pasted into this document. Using “cat” and “echo” is the simplest way to access the /proc filesystem, but some requirements are needed for that The /proc-filesystem had to be enabled in kernel, means on compiling following switch has to be set The /proc-filesystem was mounted before, which can be tested using You need read and sometimes also write access (normally root only) to the /proc-filesystem Normally, only entries in /proc/sys/* are writable, the others are readonly and for information retrieving only. The value of an entry can be retrieved using “cat”: A new value can be set (if entry is writable) using “echo”: Using the “sysctl” program to access the kernel switches is a modern method today. You can use it also, if the /proc-filesystem isn't mounted. But you have only access to /proc/sys/*! The program “sysctl” is included in package “procps” (on Red Hat Linux systems). The sysctl-interface had to be enabled in kernel, means on compiling following switch has to be set The value of an entry can be retrieved now: A new value can be set (if entry is writable): Note: Don't use spaces around the “=” on setting values. Also on multiple values per line, quote them like e.g. Note: There are sysctl versions in the wild which displaying “/” instead of the “.” For more details take a look into sysctl's manpage. Hint: for digging fast into the settings, use the option “-a” (display all entries) in conjunction with “grep”. There are several formats seen in /proc-filesystem: BOOLEAN: simple a “0” (false) or a “1” (true) INTEGER: an integer value, can be unsigned, too more sophisticated lines with several values: sometimes a header line is displayed also, if not, have a look into the kernel source to retrieve information about the meaning of each value... Change the interface-specific default settings. Change all the interface-specific settings. Exception: “conf/all/forwarding” has a different meaning here Type: BOOLEAN This enables global IPv6 forwarding between all interfaces. In IPv6 you can't control forwarding per device, forwarding control has to be done using IPv6-netfilter (controlled with ip6tables) rulesets and specify input and output devices (see Firewalling/Netfilter6 for more). This is different to IPv4, where you are able to control forwarding per device (decision is made on interface where packet came in). This also sets all interfaces' Host/Router setting 'forwarding' to the specified value. See below for details. This referred to as global forwarding. If this value is 0, no IPv6 forwarding is enabled, packets never leave another interface, neither physical nor logical like e.g. tunnels. Change special settings per interface. The functional behaviour for certain settings is different depending on whether local forwarding is enabled or not. Type: BOOLEAN Functional default: enabled if local forwarding is disabled. disabled if local forwarding is enabled. Accept Router Advertisements, and autoconfigure this interface with received data. Type: BOOLEAN Functional default: enabled if local forwarding is disabled. disabled if local forwarding is enabled. Accept Redirects sent by an IPv6 router. Type: BOOLEAN Functional default: enabled if accept_ra_pinfo is enabled. disabled if accept_ra_pinfo is disabled. Autoconfigure addresses using prefix information from router advertisements. Type: INTEGER Default: 1 The amount of Duplicate Address Detection probes to send. Type: BOOLEAN Default: FALSE if global forwarding is disabled (default), otherwise TRUE Configure interface-specific Host/Router behaviour. Note: It is recommended to have the same setting on all interfaces; mixed router/host scenarios are rather uncommon. Value FALSE: By default, Host behaviour is assumed. This means: IsRouter flag is not set in Neighbour Advertisements. Router Solicitations are being sent when necessary. If accept_ra is TRUE (default), accept Router Advertisements (and do autoconfiguration). If accept_redirects is TRUE (default), accept Redirects. Value TRUE: If local forwarding is enabled, Router behaviour is assumed. This means exactly the reverse from the above: IsRouter flag is set in Neighbour Advertisements. Router Solicitations are not sent. Router Advertisements are ignored. Redirects are ignored. Type: INTEGER Default: 1 Number of seconds to wait after interface is brought up before sending Router Solicitations. Type: INTEGER Default: 4 Number of seconds to wait between Router Solicitations. Type: INTEGER Default: 3 Number of Router Solicitations to send until assuming no routers are present. Change default settings for neighbor detection and some special global interval and threshold values: Type: INTEGER Default: 1024 Tuning parameter for neighbour table size. Increase this value if you have a lot of interfaces and problem with routes start to act mysteriously and fail. Or if a running Zebra (routing daemon) reports: At the moment (and this will be until IPv4 is completly converted to an independend kernel module) some switches are also used here for IPv6. This control settings are not used by IPv6. To enable ICMPv6 rate limiting (which is very recommended because of the capability of ICMPv6 storms) netfilter-v6 rules must be used. In /proc/net there are several read-only entries available. You cannot retrieve information using “sysctl” here, so use e.g. “cat”. Type: One line per addresss containing multiple values Here all configured IPv6 addresses are shown in a special format. The example displays for loopback interface only. The meaning is shown below (see “net/ipv6/addrconf.c” for more). IPv6 address displayed in 32 hexadecimal chars without colons as separator Netlink device number (interface index) in hexadecimal (see “ip addr” , too) Prefix length in hexadecimal Scope value (see kernel source “ include/net/ipv6.h” and “net/ipv6/addrconf.c” for more) Interface flags (see “include/linux/rtnetlink.h” and “net/ipv6/addrconf.c” for more) Device name Type: One line per route containing multiple values Here all configured IPv6 routes are shown in a special format. The example displays for loopback interface only. The meaning is shown below (see “net/ipv6/route.c” for more). IPv6 destination network displayed in 32 hexadecimal chars without colons as separator IPv6 destination prefix length in hexadecimal IPv6 source network displayed in 32 hexadecimal chars without colons as separator IPv6 source prefix length in hexadecimal IPv6 next hop displayed in 32 hexadecimal chars without colons as separator Metric in hexadecimal Reference counter Use counter Flags Device name Type: One line per protocol with description and value Statistics about used IPv6 sockets. Example: Type: One line per SNMP description and value SNMP statistics, can be retrieved via SNMP server and related MIB table by network management software. Additional info can be found at Karl Auer's Blog: Controlling IPv6 source address selection , IPv6 Source Address Selection - what, why, how Name to IPv4 or IPv6 address resolving is usually done using a libc resolver library. Usually the function getaddrinfo is used for that. In case of more than one IPv6 address is returned, according to RFC 3484 / Default Address Selection for Internet Protocol version 6 a sorting should be applied, which can be optionally configured. The “magic” is controlled by a file named /etc/gai.conf (it can be that it is empty or missing by default). Default is usually somewhere stored in documentation, see “man gai.conf” or e.g. /usr/share/doc/glibc-common/gai.conf. For controlling sort order by configuration following are needed for testing: A host in DNS returning more than one IPv6 address, e.g. Lookup via DNS (/etc/hosts won't work) /etc/gai.conf with proper config, e.g. For tests use e.g. telnet client If precedence is changed in configuration The order is changed accordingly Source address selection in Linux is done automatically by kernel and usually only using information from routing tables and try to match the same scope of address. With extension of internal “ip addrlabel” a source address can be bound to a destination address (e.g. selected via mechanisms above). Binding means here: “same label” (label is a number). Default of “ip addrlabel” (here on CentOS 6): System is multihomed (here on one interface), router provides 2 prefixes via radvd: Connect now to server (shown above) Related tcpdump with filter “tcp and dst port 23” shows only the use of the upper local source IPv6 address Binding now source and destination with “ip addrlabel” Resulting “ip addrlabel” Connect now to server again Related tcpdump with filter “tcp and dst port 23” shows now the use of both local source IPv6 addresses according to the configured pairs A and B Setup of persistent “ip addrtable” is probably currently not supported by Linux distributions, so extension of network init scripts or rc.local must be used for that. A script which uses information from /etc/gai.conf and configure “ip addrtable” accordingly can be found here: /etc/gai.conf - it ain't what you think it is It's always interesting which server sockets are currently active on a node. Using “netstat” is a short way to get such information: Used options: -nlptu Example: Here some examples of captured packets are shown, perhaps useful for your own debugging... ...more coming next... Router with link-local address “fe80::212:34ff:fe12:3450” send an advertisement to the all-node-on-link multicast address “ff02::1” containing two prefixes “2002:0102:0304:1::/64” (lifetime 30 s) and “2001:0db8:0:1::/64” (lifetime 2592000 s) including its own layer 2 MAC address “0:12:34:12:34:50”. Node with link-local address “fe80::212:34ff:fe12:3456” and layer 2 MAC address “0:12:34:12:34:56” is looking for a router on-link, therefore sending this solicitation to the all-router-on-link multicast address “ff02::2”. Following packets are sent by a node with layer 2 MAC address “0:12:34:12:34:56” during autoconfiguration to check whether a potential address is already used by another node on the link sending this to the solicited-node link-local multicast address. Node wants to configure its link-local address “fe80::212:34ff:fe12:3456”, checks for duplicate now Node wants to configure its global address “2002:0102:0304:1:212:34ff:fe12:3456” (after receiving advertisement shown above), checks for duplicate now Node wants to configure its global address “2001:0db8:0:1:212:34ff:fe12:3456” (after receiving advertisement shown above), checks for duplicate now Node wants to send packages to “2001:0db8:0:1::10” but has no layer 2 MAC address to send packet, so send solicitation now Node looks for “fe80::10” now Some Linux distribution contain already support of a persistent IPv6 configuration using existing or new configuration and script files and some hook in the IPv4 script files. Since starting writing the IPv6 & Linux - HowTo it was my intention to enable a persistent IPv6 configuration which catch most of the wished cases like host-only, router-only, dual-homed-host, router with second stub network, normal tunnels, 6to4 tunnels, and so on. Nowadays there exists a set of configuration and script files which do the job very well (never heard about real problems, but I don't know how many use the set). Because this configuration and script files are extended from time to time, they got their own homepage: initscripts-ipv6 homepage (Mirror). Because I began my IPv6 experience using a Red Hat Linux 5.0 clone, my IPv6 development systems are mostly Red Hat Linux based now, it's kind a logic that the scripts are developed for this kind of distribution (so called historic issue). Also it was very easy to extend some configuration files, create new ones and create some simple hook for calling IPv6 setup during IPv4 setup. Fortunately, in Red Hat Linux since 7.1 a snapshot of my IPv6 scripts is included, this was and is still further on assisted by Pekka Savola. Mandrake since version 8.0 also includes an IPv6-enabled initscript package, but a minor bug still prevents usage (“ifconfig” misses “inet6” before “add”). You can test, whether your Linux distribution contain support for persistent IPv6 configuration using my set. Following script library should exist: Auto-magically test: The version of the library is important if you miss some features. You can get it executing following (or easier look at the top of the file): In shown example, the used version is 20011124. Check this against latest information on initscripts-ipv6 homepage (Mirror) to see what has been changed. You will find there also a change-log. Check whether running system has already IPv6 module loaded If result is “off”, then enable IPv6 networking by editing /etc/sysconfig/network, add following new line Reboot or restart networking using Now IPv6 module should be loaded If your system is on a link which provides router advertisement, autoconfiguration will be done automatically. For more information which settings are supported see /usr/share/doc/initscripts-$version/sysconfig.txt. In newer 7.x versions there is a really rudimentary support available, see /etc/rc.config for details. Because of the really different configuration and script file structure it is hard (or impossible) to use the set for Red Hat Linux and clones with this distribution.
-In versions 8.x they completly change their configuration setup. Edit file /etc/sysconfig/network/ifcfg-<Interface-Name> and setup following value Edit file /etc/sysconfig/network/ifcfg-<Interface-Name> and setup following value Following information was contributed by Stephane Bortzmeyer <bortzmeyer at nic dot fr> Be sure that IPv6 is loaded, either because it is compiled into the kernel or because the module is loaded. For the latest, three solutions, adding it to /etc/modules, using the pre-up trick shown later or using kmod (not detailed here). Configure your interface. Here we assume eth0 and address (2001:0db8:1234:5::1:1). Edit /etc/network/interfaces: And you reboot or you just and you have your static address. Jean-Marc V. Liotier's HOWTO for Freenet6 & Debian Users (announced 24.12.2002 on mailinglist users@ipv6.org ) Is supported and seen on the assigned link-local address after an IPv6-enabled interface is up. Example: to be filled. See radvd daemon autoconfiguration below. After a long time discussing issues, finally RFC 3315 / Dynamic Host Configuration Protocol for IPv6 (DHCPv6) was finished. At time updating this part (10/2005) currently two implementations are available: Dibbler by Tomasz Mrugalski <thomson at klub dot com dot pl> (Hints for configuration) Support for IPv6 mobility can be enabled in Linux by installing the MIPL2 implementation found at: http://www.mobile-ipv6.org/ This implementation is compliant with RFC 3775. It is composed of a kernel patch and a mobility daemon called mip6d. Version 2.0.1 applies on Linux kernel 2.6.15. Installation and setup are described in the Linux Mobile IPv6 HOWTO. There also exists an implementation of network mobility for Linux, it is called NEPL and is based on MIPL. It can also be downloaded from: http://www.mobile-ipv6.org/. The HOWTO document describing setup and configuration is available at: http://www.nautilus6.org/doc/nepl-howto/. Mobile IPv6 for Linux (MIPL) project: http://www.mobile-ipv6.org/ Nautilus6 working group: http://nautilus6.org/ Fast Handovers for Mobile IPv6 for Linux project: http://www.fmipv6.org/ USAGI-patched Mobile IPv6 for Linux (UMIP):http://umip.linux-ipv6.org/ Deploying IPsec/IKE-protected MIPv6 under Linux:http://natisbad.org/MIPv6/ RFC 3776 / Using IPsec to Protect Mobile IPv6 Signaling Between Mobile Nodes and Home Agents HIP implementations: http://infrahip.hiit.fi/, http://hip4inter.net/, http://www.openhip.org/ IPv6 firewalling is important, especially if using IPv6 on internal networks with global IPv6 addresses. Because unlike at IPv4 networks where in common internal hosts are protected automatically using private IPv4 addresses like RFC 1918 / Address Allocation for Private Internets or Automatic Private IP Addressing (APIPA)Google search for Microsoft + APIPA, in IPv6 normally global addresses are used and someone with IPv6 connectivity can reach all internal IPv6 enabled nodes. Native IPv6 firewalling is only supported in kernel versions 2.4+. In older 2.2- you can only filter IPv6-in-IPv4 by protocol 41. Attention: no warranty that described rules or examples can really protect your system! Audit your ruleset after installation, see Section 19.3 for more. Since kernel version 2.6.20 (February 2007) IPv6 connection tracking is fully working (and does not break IPv4 NAT anymore like versions before) Since kernel version 3.9.0 (April 2013) NAT for IPv6 is supported with ip6tables >= 1.4.18 Since kernel version 3.13 (April 2014) new framework introduced named: nftables This step is only needed if distributed kernel and netfilter doesn't fit your requirements and new features are available but still not built-in. Get the latest kernel source: http://www.kernel.org/ Get the latest iptables package: Source tarball (for kernel patches): http://www.netfilter.org/ Change to source directory: Unpack and rename kernel sources Unpack iptables sources Change to iptables directory Apply pending patches Apply additional IPv6 related patches (still not in the vanilla kernel included) Say yes at following options (iptables-1.2.2) ah-esp.patch masq-dynaddr.patch (only needed for systems with dynamic IP assigned WAN connections like PPP or PPPoE) ipv6-agr.patch.ipv6 ipv6-ports.patch.ipv6 LOG.patch.ipv6 REJECT.patch.ipv6 Check IPv6 extensions Change to kernel sources Edit Makefile Run configure, enable IPv6 related Configure other related to your system, too Compilation and installing: see the kernel section here and other HOWTOs Make sure, that upper kernel source tree is also available at /usr/src/linux/ Rename older directory Create a new softlink Rebuild SRPMS Install new iptables packages (iptables + iptables-ipv6) On RH 7.1 systems, normally, already an older version is installed, therefore use "freshen" If not already installed, use "install" On RH 6.2 systems, normally, no kernel 2.4.x is installed, therefore the requirements don't fit. Use "--nodeps" to install it Perhaps it's necessary to create a softlink for iptables libraries where iptables looks for them Load module, if so compiled Check for capability Short Extended Since kernel version 2.6.20 IPv6 connection tracking is well supported and should be used instead of using stateless filter rules. Using older kernels (unpatched kernel 2.4.5 and iptables-1.2.2) no type can be specified Accept incoming ICMPv6 through tunnels Allow outgoing ICMPv6 through tunnels Newer kernels allow specifying of ICMPv6 types: Because it can happen (author already saw it to times) that an ICMPv6 storm will raise up, you should use available rate limiting for at least ICMPv6 ruleset. In addition logging rules should also get rate limiting to prevent DoS attacks against syslog and storage of log file partition. An example for a rate limited ICMPv6 looks like: Here an example is shown for a ruleset which allows incoming SSH connection from a specified IPv6 address Allow incoming SSH from 2001:0db8:100::1/128 Allow response packets (no longer needed if connection tracking is used!) To accept tunneled IPv6-in-IPv4 packets, you have to insert rules in your IPv4 firewall setup relating to such packets, for example Accept incoming IPv6-in-IPv4 on interface ppp0 Allow outgoing IPv6-in-IPv4 to interface ppp0 If you have only a static tunnel, you can specify the IPv4 addresses, too, like Accept incoming IPv6-in-IPv4 on interface ppp0 from tunnel endpoint 192.0.2.2 Allow outgoing IPv6-in-IPv4 to interface ppp0 to tunnel endpoint 192.0.2.2 VERY RECOMMENDED! For security issues you should really insert a rule which blocks incoming TCP connection requests. Adapt "-i" option, if other interface names are in use! Block incoming TCP connection requests to this host Block incoming TCP connection requests to hosts behind this router Perhaps the rules have to be placed below others, but that is work you have to think about it. Best way is to create a script and execute rules in a specified way. ALSO RECOMMENDED! Like mentioned on my firewall information it's possible to control the ports on outgoing UDP/TCP sessions. So if all of your local IPv6 systems are using local ports e.g. from 32768 to 60999 you are able to filter UDP connections also (until connection tracking works) like: Block incoming UDP packets which cannot be responses of outgoing requests of this host Block incoming UDP packets which cannot be responses of forwarded requests of hosts behind this router Following lines show a simple firewall configuration for Fedora 6 (since kernel version 2.6.20). It was modfied from the default one (generated by system-config-firewall) for supporting connection tracking and return the proper ICMPv6 code for rejects. Incoming SSH (port 22) connections are allowed. For completeness also the IPv4 configuration is shown here: Usage: Create/modify the configuration files Activate IPv4 & IPv6 firewalling Enable automatic start after reboot Following lines show a more sophisticated but still stateless filter setup as an example. Happy netfilter6 ruleset creation.... Since at least Linux kernel version 3.9.0 and using ip6tables since 1.4.18 also Network Address Translation (NAT) is usable. Like in IPv4 clients behind a router can be hided by using IPv6 masquerading (hide/overlap NAT), e.g. A dedicated public IPv6 address can be forwarded to an internal IPv6 address, e.g. A dedicated specified port can be forwarded to an internal system, e.g. nftables adds in addition to protocol specific tables “ip” (IPv4) and “ip6” (IPv6) support for a IPv4/IPv6 aware table named “inet”. Using this table it's possible to add only one rule and match both protocols (in case of UDP and TCP). Take care if rules are contained in more than one table, because the tables are checked in sequence: If table “ip6” accepts the packet, also table “inet” must accept the packet, otherwise it can be dropped by a later drop rule. Install a Linux distribution which has nftables support already included. At time of writing (May 2014) at least Fedora Rawhide (upcoming version 21) has support in conjunction with nftables version 0.2.0. Load kernel modules: Flush iptables and ip6tables to avoid interferences: Create filter table: Create input chain: Allow packets which are related to existing connection tracking entries Allow IPv4 and IPv6 ICMP echo-request (aka ping) Allow some important IPv6 ICMP traffic, without counter, but checking hop-limit for security Allow incoming SSH for IPv4 and IPv6 Reject/drop others Table for IP version aware filter To enable logging, an additonal kernel module must be loaded BUT TAKE CARE, IT LOOKS LIKE THAT NO LOG LEVEL CAN BE SPEFICIED CURRENTLY IN nftables, resulting that events are logged with kern.emerg - POSSIBILITY OF FLODDING THE CONSOLE WITH LOG ENTRIES! Fir initial test with logging it can be useful to disable kernel console logging in e.g. /etc/rsyslog.conf by putting a “#” in front of the related entry and restart logging daemon Rule from above accepting SSH on port 22, but now with logging: As written above, if rules should be stored in related tables, it must be assured that earlier accepts are not discarded in the further table. This can be done using “meta mark set xxxx” on every accept rule and generic rules which accepts packets with “mark xxxx”. A resulting filter set would look like the following: It's very recommended to apply all available patches and disable all not necessary services. Also bind services to the needed IPv4/IPv6 addresses only and install local firewalling. More to be filled... Many services uses the tcp_wrapper library for access control. Below is described the use of tcp_wrapper. More to be filled... Currently there are no comfortable tools out which are able to check a system over network for IPv6 security issues. Neither Nessus nor any commercial security scanner is as far as I know able to scan IPv6 addresses. ATTENTION: always take care that you only scan your own systems or after receiving a written order, otherwise legal issues are able to come up to you.
-CHECK destination IPv6 addresses TWICE before starting a scan. With the IPv6-enabled netcat (see IPv6+Linux-status-apps/security-auditing for more) you can run a portscan by wrapping a script around which run through a port range, grab banners and so on. Usage example: NMap, one of the best portscaner around the world, supports IPv6 since version 3.10ALPHA1. Usage example: Strobe is a (compared to NMap) more a low budget portscanner, but there is an IPv6-enabling patch available (see IPv6+Linux-status-apps/security-auditing for more). Usage example: Note: strobe isn't really developed further on, the shown version number isn't the right one. There are some IPv6 enabled online tools available which can support in testing inbound firewall configuration: If the result of an audit mismatch your IPv6 security policy, use IPv6 firewalling to close the holes, e.g. using netfilter6 (see Firewalling/Netfilter6 for more). Info: More detailed information concerning IPv6 Security can be found here: Unlike in IPv4, encryption and authentication is a mandatory feature of IPv6. Those features are normally implemented using IPsec (which can be also used by IPv4). Two modes of encryption and authentication of a connection are possible: Transport mode is a real end-to-end connection mode. Here, only the payload (usually ICMP, TCP or UDP) is encrypted with their particular header, while the IP header is not encrypted (but usually included in authentication). Using AES-128 for encryption and SHA1 for authentication, this mode decreases the MTU by 42 octets. Tunnel mode can be used either for end-to-end or for gateway-to-gateway connection modes. Here, the complete IP packet is being encrypted and gets a new IP header prepended, all together constituing a new IP packet (this mechanism is also known as "encapsulation") This mode usually decreases the MTU by 40 octets from the MTU of transport mode. I.e. using AES-128 for encryption and SHA1 for authentication 82 octets less than the normal MTU. At the time of writing missing in vanilla up to 2.4.28. There was an issue about keeping the Linux kernel source free of export/import-control-laws regarding encryption code. This is also one case why FreeS/WAN project wasn't included in vanilla source. Perhaps a backport from 2.6.x will be done in the future. Current versions (as time of writing 2.6.9 and upper) support native IPsec for IPv4 and IPv6. Implementation was helped by the USAGI project. IPsec requires a key exchange of a secret. This is mostly done automatically by so called IKE daemons. They also handle the authentication of the peers, either by a common known secret (so called “pre-shared secret”) or by RSA keys (which can also be used from X.509 certificates). Currently, two different IKE daemons are available for Linux, which totally differ in configuration and usage. I prefer “pluto” from the *S/WAN implementation because of the easier and one-config-only setup. The IKE daemon “racoon” is taken from the KAME project and ported to Linux. Modern Linux distributions contain this daemon in the package “ipsec-tools”. Two executables are required for a proper IPsec setup. Take a look on Linux Advanced Routing & Traffic Control HOWTO / IPSEC, too. “setkey” is important to define the security policy (SP) for the kernel. File: /etc/racoon/setkey.sh Example for an end-to-end encrypted connection in transport mode Example for a end-to-end encrypted connection in tunnel mode For the other peer, you have to replace “in” with “out”. “racoon” requires a configuration file for proper execution. It includes the related settings to the security policy, which should be set up previously using “setkey”. File: /etc/racoon/racoon.conf Also set up the pre-shared secret: File: /etc/racoon/psk.txt At least the daemon needs to be started. For the first time, use debug and foreground mode. The following example shows a successful IKE phase 1 (ISAKMP-SA) and 2 (IPsec-SA) negotiation: Each direction got its own IPsec-SA (like defined in the IPsec standard). With “tcpdump” on the related interface, you will see as result of an IPv6 ping: As expected, the negotiated SPIs are being used here. And using “setkey”, current active parameters are shown: The IKE daemon “pluto” is included in distributions of the *S/WAN projects. *S/WAN project starts at the beginning as FreeS/WAN. Unfortunately, the FreeS/WAN project stopped further development in 2004. Because of the slow pace of development in the past, two spin-offs started: strongSwan and Openswan. Today, readily installable packages are available for at least Openswan (included in Fedora Core 3). A major difference to “racoon”, only one configuration file is required. Also, an initscript exists for automatic setup after booting. The configuration is very similar to the IPv4 one, only one important option is necessary. File: /etc/ipsec.conf Don't forget to define the pre-shared secret here also. File: /etc/ipsec.secrets If installation of Openswan was successfully, an initscript should exist for starting IPsec, simply run (on each peer): Afterwards, start this connection on one peer. If you saw the line “IPsec SA established”, all worked fine. Because *S/WAN and setkey/racoon do use the same IPsec implementation in Linux 2.6.x kernel, “setkey” can be used here too to show current active parameters: On Linux Kernel 2.6.x you can get the policy and status of IPsec also using “ip”: IPv6 supports QoS with use of Flow Labels and Traffic Classes. Additional infos: Proper working QoS is only possible on the outgoing interface of a router or host, where the bottleneck begins. Everything else is a hickup and not subject to work as expected or has a successful result. Linux is using “tc” from the “iproute2” package to configure traffic shaping, generally described in the Linux Advanced Routing & Traffic Control HOWTO. With the “cbq” scheduler, pipes with constant bit rates can be defined. Define root qdisc with a bandwidth of 1000 MBit/s on eth1 Define a class 1:1 with 1 MBit/s Define a class 1:2 with 50 MBit/s Define a class 1:3 with 10 MBit/s Define a class 1:4 with 200 kBit/s Define a filter for IPv4 (protocol ip), TCP (match ip protocol 6 0xff) destination port 5001 (match ip dport 5001 0xffff) using class 1:2 from above Define a filter for IPv6 (protocol ip), TCP (match ip6 protocol 6 0xff) destination port 5001 using class 1:2 from above Define a filter for IPv6 for packets having flow label 12345 (match ip6 flowlabel 12345 0x3ffff) using class 1:3 from above Define a filter for IPv6 for packets having Linux iptables mark 32 (handle 32 fw) specified using class 1:4 from above The last filter definition requires an entry in the ip6tables to mark a packet Start on server side each one one separate console: Start on client side and compare results: The rate result should be as defined in the classes (see above), the results on port 5002 should be very similar independend from used IP version. Here some hints are shown for IPv6-enabled daemons. IPv6 is supported since version 9. Always use newest available version. At least version 9.1.3 must be used, older versions can contain remote exploitable security holes. Note: unlike in IPv4 current versions doesn't allow to bind a server socket to dedicated IPv6 addresses, so only any or none are valid. Because this can be a security issue, check the Access Control List (ACL) section below, too! To enable IPv6 for listening, following options are requested to change This should result after restart in e.g. And a simple test looks like and should show you a result. To disable IPv6 for listening, following options are requested to change IPv6 enabled ACLs are possible and should be used whenever it's possible. An example looks like following: This ACLs can be used e.g. for queries of clients and transfer zones to secondary name-servers. This prevents also your caching name-server to be used from outside using IPv6. It's also possible to set the allow-query and allow-transfer option for most of single zone definitions, too. This option is not required, but perhaps needed: It's also possible to define per zone some IPv6 addresses. Transfer source address is used for outgoing zone transfers: Notify source address is used for outgoing notify messages: Some information can be also found at IPv6 DNS Setup Information (article). Perhaps also helpful is the IPv6 Reverse DNS zone builder for BIND 8/9 (webtool). For IPv6 new types and root zones for reverse lookups are defined: AAAA and reverse IP6.INT: specified in RFC 1886 / DNS Extensions to support IP version 6, usable since BIND version 4.9.6 A6, DNAME (DEPRECATED NOW!) and reverse IP6.ARPA: specified in RFC 2874 / DNS Extensions to Support IPv6 Address Aggregation and Renumbering, usable since BIND 9, but see also an information about the current state at Domain Name System Extension (dnsext) Perhaps filled later more content, for the meantime take a look at given RFCs and AAAA and reverse IP6.INT: IPv6 DNS Setup Information A6, DNAME (DEPRECATED NOW!) and reverse IP6.ARPA: take a look into chapter 4 and 6 of the BIND 9 Administrator Reference Manual (ARM) distributed with the bind-package or get this here: BIND manual version 9.3 Because IP6.INT is deprecated (but still in use), a DNS server which will support IPv6 information has to serve both reverse zones. Because there are some troubles around using the new formats, current best practice is: Forward lookup support: AAAA Reverse lookup support: Reverse nibble format for zone ip6.int (FOR BACKWARD COMPATIBILITY) Reverse nibble format for zone ip6.arpa (RECOMMENDED) To check, whether BIND named is listening on an IPv6 socket and serving data see following examples. Specifying a dedicated server for the query, an IPv6 connect can be forced: Related log entry looks like following: If you see such entries in the log, check whether requests from this client should be allowed and perhaps review your ACL configuration. A successful IPv6 connect looks like following: IPv6 is supported since xinetd version around 1.8.9. Always use newest available version. At least version 2.3.3 must be used, older versions can contain remote exploitable security holes. Some Linux distribution contain an extra package for the IPv6 enabled xinetd, some others start the IPv6-enabled xinetd if following variable is set: NETWORKING_IPV6="yes", mostly done by /etc/sysconfig/network (only valid for Red Hat like distributions). In newer releases, one binary supports IPv4 and IPv6. If you enable a built-in service like e.g. daytime by modifying the configuration file in /etc/xinetd.d/daytime like After restarting the xinetd you should get a positive result like: Shown example also displays an IMAP and IMAP-SSL IPv4-only listening xinetd. Note: earlier versions had a problem that an IPv4-only xinetd won't start on an IPv6-enabled node and also the IPv6-enabled xinetd won't start on an IPv4-only node. This is known to be fixed in later versions, at least version 2.3.11. Apache web server supports IPv6 native by maintainers since 2.0.14. Available patches for the older 1.3.x series are not current and shouldn't be used in public environment, but available at KAME / Misc. Note: virtual hosts on IPv6 addresses are broken in versions until 2.0.28 (a patch is available for 2.0.28). But always try latest available version first because earlier versions had some security issues. This should result after restart in e.g. For simple tests use the telnet example already shown. Apache2 supports a method called “sendfile” to speedup serving data. Some NIC drivers also support offline checksumming. In some cases, this can lead to connection problems and invalid TCP checksums. In this cases, disable “sendfile” either by recompiling using configure option “--without-sendfile” or by using the "EnableSendfile off" directive in configuration file. The router advertisement daemon is very useful on a LAN, if clients should be auto-configured. The daemon itself should run on the Linux default IPv6 gateway router (it's not required that this is also the default IPv4 gateway, so pay attention who on your LAN is sending router advertisements). You can specify some information and flags which should be contained in the advertisement. Common used are Prefix (needed) Lifetime of the prefix Frequency of sending advertisements (optional) After a proper configuration, the daemon sends advertisements through specified interfaces and clients are hopefully receive them and auto-magically configure addresses with received prefix and the default route. Radvd's config file is normally /etc/radvd.conf. An simple example looks like following: This results on client side in Because no lifetime was defined, a very high value was used. Version since 0.6.2pl3 support the automatic (re)-generation of the prefix depending on an IPv4 address of a specified interface. This can be used to distribute advertisements in a LAN after the 6to4 tunneling has changed. Mostly used behind a dynamic dial-on-demand Linux router. Because of the sure shorter lifetime of such prefix (after each dial-up, another prefix is valid), the lifetime configured to minimal values: This results on client side in (assuming, ppp0 has currently 1.2.3.4 as local IPv4 address): Because a small lifetime was defined, such prefix will be thrown away quickly, if no related advertisement was received. Additional note: if you do not used special 6to4 support in initscripts, you have to setup a special route on the internal interface on the router, otherwise you will get some backrouting problems. for the example showh here: This route needs to be replaced every time the prefix changes, which is the case after a new IPv4 address was assigned to the dial-up interface. A program called “radvdump” can help you looking into sent or received advertisements. Simple to use: Output shows you each advertisement package in readable format. You should see your configured values here again, if not, perhaps it's not your radvd which sends the advertisement...look for another router on the link (and take the LLAddress, which is the MAC address for tracing). DHCPv6 can be used for stateful configurations. The daemon itself need not necessary run on the Linux default IPv6 gateway router. You can specify more information than by using radvd. The are most similar to IPv4 DHCP server. After a proper configuration, the daemon reacts on received ICMPv6 multicast packets sent by a client to address ff02::1:2 dhcp6s's config file is normally /etc/dhcp6s.conf. An simple example looks like following: dhcp6c's config file is normally /etc/dhcp6c.conf. An simple example looks like following: The server has one foreground and two debug toggles (both should be used for debugging), here is an example: As general debugging for test whether the IPv6 DHCP server is reable on the link use an IPv6 ping to the DHCP multicast address: The client has one foreground and two debug toggles, here is an example: Note that the netlink error messages have no impact. ISC DHCP supports IPv6 since version 4.x. Note that currently, the ISC DHCP server can only serve IPv4 or IPv6, means you have to start the daemon twice (for IPv6 with option “-6”) to support both protocols. Create a dedicated configuration file /etc/dhcp/dhcpd6.conf for the IPv6 part of the dhcpd. Note, that the router requires to have a interface configured with an IPv6 address out of the defined subnet. Note that the “dhcp.client-id” no longer belongs to a MAC address, an unique ID is used instead! “dhcp6c” (see above) uses the file /var/lib/dhcpv6/dhcp6c_duid (would be created during first start, if not existing) as unique identity. It's a 14 byte long identifier, starting with a 2 byte length information (usually “0x000e”): Start server in foreground: Dibbler is also a DHCP server Create a dedicated configuration file /etc/dibbler/server.conf . Note, that the router requires to have a interface configured with an IPv6 address out of the defined subnet. Start server in foreground: tcp_wrapper is a library which can help you to protect service against misuse. You can use tcp_wrapper for Filtering against source addresses (IPv4 or IPv6) Filtering against users (requires a running ident daemon on the client) Following are known: Each service which is called by xinetd (if xinetd is compiled using tcp_wrapper library) sshd (if compiled using tcp_wrapper) tcp_wrapper is controlled by two files name /etc/hosts.allow and /etc/hosts.deny. For more information see In this file, each service which should be positive filtered (means connects are accepted) need a line. Note: there are broken implementations around, which uses following broken IPv6 network description: [2001:0db8:100:200::/64]. Hopefully, such versions will be fixed soon. This file contains all negative filter entries and should normally deny the rest using If this node is a more sensible one you can replace the standard line above with this one, but this can cause a DoS attack (load of mailer and spool directory), if too many connects were made in short time. Perhaps a logwatch is better for such issues. Depending on the entry in the syslog daemon configuration file /etc/syslog.conf the tcp_wrapper logs normally into /var/log/secure. A refused connection via IPv4 to an xinetd covered daytime service produces a line like following example A refused connection via IPv4 to an dual-listen sshd produces a line like following example A permitted connection via IPv4 to an xinetd covered daytime service produces a line like following example A permitted connection via IPv4 to an dual-listen sshd produces a line like following example Edit the configuration file, ususally /etc/vsftpd/vsftpd.conf, and adjust the listen option like That's all. Edit the configuration file, ususally /etc/proftpd.conf, but take care, not 100% logical in virtual host setup That's all. Nowadays it's mostly simple, look for either a command line option or a configuration value to enable IPv6 listening. See manual page of the daemon or check related FAQs. It can happen that you can bind a daemon only to the IPv6-“any”-address (::) and not to bind to a dedicated IPv6 address, because the lack of support (depends on that what the programmer has implemented so far...). Related RFCs: Following contents of this section is contributed by John Wenker, Sr. Software Engineer Performance Technologies San Diego, CA USA http://www.pt.com/. This section describes how to write IPv6 client-server applications under the Linux operating system. First thing's first, and credit must be given where it is due. The information contained in this section is derived from Chapters 2 through 4 of IPv6 Network Programming by Jun-ichiro itojun Hagino (ISBN 1-55558-318-0). The reader is encouraged to consult that book for more detailed information. It describes how to convert IPv4 applications to be IPv6 compatible in a protocol-independent way, and describes some of the common problems encountered during the conversion along with suggested solutions. At the time of this writing, this is the only book of which the author is aware that specifically addresses how to program IPv6 applications [since writing this section, the author has also become aware of the Porting applications to IPv6 HowTo by Eva M. Castro at http://jungla.dit.upm.es/~ecastro/IPv6-web/ipv6.html]. Unfortunately, of the almost 360 pages in the book, maybe 60 are actually useful (the chapters mentioned). Nevertheless, without the guidance of that book, the author would have been unable to perform his job duties or compose this HowTo. While most (but certainly not all) of the information in the Hagino book is available via the Linux 'man' pages, application programmers will save a significant amount of time and frustration by reading the indicated chapters of the book rather than searching through the 'man' pages and online documentation. Other than the Hagino book, any other information presented in this HowTo was obtained through trial and error. Some items or explanations may not be entirely “correct” in the grand IPv6 scheme, but seem to work in practical application. The discussion that follows assumes the reader is already experienced with the traditional TCP/IP socket API. For more information on traditional socket programming, the Internetworking with TCP/IP series of textbooks by Comer & Stevens is hard to beat, specifically Volume III: Client-Server Programming and Applications, Linux/POSIX Sockets Version (ISBN 0-13-032071-4). This HowTo also assumes that the reader has had at least a bare basic introduction to IPv6 and in particular the addressing scheme for network addresses (see Section 2.3). This section provides a brief overview of the structures provided in the socket API to represent network addresses (or more specifically transport endpoints) when using the Internet protocols in a client-server application. In IPv4, network addresses are 32 bits long and define a network node. Addresses are written in dotted decimal notation, such as 192.0.2.1, where each number represents eight bits of the address. Such an IPv4 address is represented by the struct sockaddr_in data type, which is defined in <netinet/in.h>. The sin_family component indicates the address family. For IPv4 addresses, this is always set to AF_INET. The sin_addr field contains the 32-bit network address (in network byte order). Finally, the sin_port component represents the transport layer port number (in network byte order). Readers should already be familiar with this structure, as this is the standard IPv4 address structure. The biggest feature of IPv6 is its increased address space. Instead of 32-bit network addresses, IPv6 allots 128 bits to an address. Addresses are written in colon-hex notation of the form fe80::2c0:8cff:fe01:2345, where each hex number separated by colons represents 16 bits of the address. Two consecutive colons indicate a string of consecutive zeros for brevity, and at most only one double-colon may appear in the address. IPv6 addresses are represented by the struct sockaddr_in6 data type, also defined in <netinet/in.h>. The sin6_family, sin6_port, and sin6_addr components of the structure have the same meaning as the corresponding fields in the sockaddr_in structure. However, the sin6_family member is set to AF_INET6 for IPv6 addresses, and the sin6_addr field holds a 128-bit address instead of only 32 bits. The sin6_flowinfo field is used for flow control, but is not yet standardized and can be ignored. The sin6_scope_id field has an odd use, and it seems (at least to this naïve author) that the IPv6 designers took a huge step backwards when devising this. Apparently, 128-bit IPv6 network addresses are not unique. For example, it is possible to have two hosts, on separate networks, with the same link-local address (see Figure 1). In order to pass information to a specific host, more than just the network address is required; the scope identifier must also be specified. In Linux, the network interface name is used for the scope identifier (e.g. “eth0”) [be warned that the scope identifier is implementation dependent!]. Use the ifconfig(1M) command to display a list of active network interfaces. A colon-hex network address can be augmented with the scope identifier to produce a "scoped address”. The percent sign ('%') is used to delimit the network address from the scope identifier. For example, fe80::1%eth0 is a scoped IPv6 address where fe80::1 represents the 128-bit network address and eth0 is the network interface (i.e. the scope identifier). Thus, if a host resides on two networks, such as Host B in example below, the user now has to know which path to take in order to get to a particular host. In Figure 1, Host B addresses Host A using the scoped address fe80::1%eth0, while Host C is addressed with fe80::1%eth1. Getting back to the sockaddr_in6 structure, its sin6_scope_id field contains the index of the network interface on which a host may be found. Server applications will have this field set automatically by the socket API when they accept a connection or receive a datagram. For client applications, if a scoped address is passed as the node parameter to getaddrinfo(3) (described later in this HowTo), then the sin6_scope_id field will be filled in correctly by the system upon return from the function; if a scoped address is not supplied, then the sin6_scope_id field must be explicitly set by the client software prior to attempting to communicate with the remote server. The if_nametoindex(3) function is used to translate a network interface name into its corresponding index. It is declared in <net/if.h>. As any programmer familiar with the traditional TCP/IP socket API knows, several socket functions deal with "generic" pointers. For example, a pointer to a generic struct sockaddr data type is passed as a parameter to some socket functions (such as connect(2) or bind(2)) rather than a pointer to a specific address type. Be careful… the sockaddr_in6 structure is larger than the generic sockaddr structure! Thus, if your program receives a generic address whose actual type is unknown (e.g. it could be an IPv4 address structure or an IPv6 address structure), you must supply sufficient storage to hold the entire address. The struct sockaddr_storage data type is defined in <bits/socket.h> for this purpose [do not #include this file directly within an application; use <sys/socket.h> as usual, and <bits/socket.h> will be implicitly included]. For example, consider the recvfrom(2) system call, which is used to receive a message from a remote peer. Its function prototype is: The from parameter points to a generic sockaddr structure. If data can be received from an IPv6 peer on the socket referenced by s, then from should point to a data type of struct sockaddr_storage, as in the following dummy example: As seen in the above example, ss (a struct sockaddr_storage data object) is used to receive the peer address information, but it's address is typecast to a generic struct sockaddr* pointer in the call to recvfrom(2). Traditionally, hostname and service name resolution were performed by functions such as gethostbyname(3) and getservbyname(3). These traditional lookup functions are still available, but they are not forward compatible to IPv6. Instead, the IPv6 socket API provides new lookup functions that consolidate the functionality of several traditional functions. These new lookup functions are also backward compatible with IPv4, so a programmer can use the same translation algorithm in an application for both the IPv4 and IPv6 protocols. This is an important feature, because obviously a global IPv6 infrastructure isn't going to be put in place overnight. Thus, during the transition period from IPv4 to IPv6, client-server applications should be designed with the flexibility to handle both protocols simultaneously. The example programs at the end of this chapter do just that. The primary lookup function in the new socket API is getaddrinfo(3). Its prototype is as follows. The node parameter is a pointer to the hostname or IP address being translated. The referenced string can be a hostname, IPv4 dotted decimal address, or IPv6 colon-hex address (possibly scoped). The service parameter is a pointer to the transport layer's service name or port number. It can be specified as a name found in /etc/services or a decimal number. getaddrinfo(3) resolves the host/service combination and returns a list of address records; a pointer to the list is placed in the location pointed at by res. For example, suppose a host can be identified by both an IPv4 and IPv6 address, and that the indicated service has both a TCP entry and UDP entry in /etc/services. In such a scenario, it is not inconceivable that four address records are returned; one for TCP/IPv6, one for UDP/IPv6, one for TCP/IPv4, and one for UDP/IPv4. The definition for struct addrinfo is found in <netdb.h> (as is the declaration for getaddrinfo(3) and the other functions described in this section). The structure has the following format: Consult the 'man' page for getaddrinfo(3) for detailed information about the various fields; this HowTo only describes a subset of them, and only to the extent necessary for normal IPv6 programming. The ai_family, ai_socktype, and ai_protocol fields have the exact same meaning as the parameters to the socket(2) system call. The ai_family field indicates the protocol family (not the address family) associated with the record, and will be PF_INET6 for IPv6 or PF_INET for IPv4. The ai_socktype parameter indicates the type of socket to which the record corresponds; SOCK_STREAM for a reliable connection-oriented byte-stream or SOCK_DGRAM for connectionless communication. The ai_protocol field specifies the underlying transport protocol for the record. The ai_addr field points to a generic struct sockaddr object. Depending on the value in the ai_family field, it will point to either a struct sockaddr_in (PF_INET) or a struct sockaddr_in6 (PF_INET6). The ai_addrlen field contains the size of the object pointed at by the ai_addr field. As mentioned, getaddrinfo(3) returns a list of address records. The ai_next field points to the next record in the list. The hints parameter to getaddrinfo(3) is also of type struct addrinfo and acts as a filter for the address records returned in res. If hints is NULL, all matching records are returned; but if hints is non-NULL, the referenced structure gives "hints" to getaddrinfo(3) about which records to return. Only the ai_flags, ai_family, ai_socktype, and ai_protocol fields are significant in the hints structure, and all other fields should be set to zero. Programs can use hints->ai_family to specify the protocol family. For example, if it is set to PF_INET6, then only IPv6 address records are returned. Likewise, setting hints->ai_family to PF_INET results in only IPv4 address records being returned. If an application wants both IPv4 and IPv6 records, the field should be set to PF_UNSPEC. The hints->socktype field can be set to SOCK_STREAM to return only records that correspond to connection-oriented byte streams, SOCK_DGRAM to return only records corresponding to connectionless communication, or 0 to return both. For the Internet protocols, there is only one protocol associated with connection-oriented sockets (TCP) and one protocol associated with connectionless sockets (UDP), so setting hints->ai_socktype to SOCK_STREAM or SOCK_DGRAM is the same as saying, "Give me only TCP records," or "Give me only UDP records," respectively. With that in mind, the hints->ai_protocol field isn't really that important with the Internet protocols, and pretty much mirrors the hints->ai_socktype field. Nevertheless, hints->ai_protocol can be set to IPPROTO_TCP to return only TCP records, IPPROTO_UDP to return only UDP records, or 0 for both. The node or service parameter to gethostbyname(3) can be NULL, but not both. If node is NULL, then the ai_flags field of the hints parameter specifies how the network address in a returned record is set (i.e. the sin_addr or sin6_addr field of the object pointed at by the ai_addr component in a returned record). If the AI_PASSIVE flag is set in hints, then the returned network addresses are left unresolved (all zeros). This is how server applications would use getaddrinfo(3). If the flag is not set, then the address is set to the local loopback address (::1 for IPv6 or 127.0.0.1 for IPv4). This is one way a client application can specify that the target server is running on the same machine as the client. If the service parameter is NULL, the port number in the returned address records remains unresolved. The getaddrinfo(3) function returns zero on success, or an error code. In the case of an error, the gai_strerror(3) function is used to obtain a character pointer to an error message corresponding to the error code, just like strerror(3) does in the standard 'C' library. Once the address list is no longer needed, it must be freed by the application. This is done with the freeaddrinfo(3) function. The last function that will be mentioned in this section is getnameinfo(3). This function is the inverse of getaddrinfo(3); it is used to create a string representation of the hostname and service from a generic struct sockaddr data object. It has the following prototype. The sa parameter points to the address structure in question, and salen contains its size. The host parameter points to a buffer where the null-terminated hostname string is placed, and the hostlen parameter is the size of that buffer. If there is no hostname that corresponds to the address, then the network address (dotted decimal or colon-hex) is placed in host. Likewise, the serv parameter points to a buffer where the null-terminated service name string (or port number) is placed, and the servlen parameter is the size of that buffer. The flags parameter modifies the function's behavior; in particular, the NI_NUMERICHOST flag indicates that the converted hostname should always be formatted in numeric form (i.e. dotted decimal or colon-hex), and the NI_NUMERICSERV flag indicates that the converted service should always be in numeric form (i.e. the port number). The symbols NI_MAXHOST and NI_MAXSERV are available to applications and represent the maximum size of any converted hostname or service name, respectively. Use these when declaring output buffers for getnameinfo(3). Before jumping into the programming examples, there are several quirks in IPv6 of which the reader should be aware. The more significant ones (in addition to the non-uniqueness of IPv6 network addresses already discussed) are described in the paragraphs below. For security reasons that this author won't pretend to understand, "IPv4 mapped addresses" should not be allowed in IPv6-capable server applications. To put it in terms that everyone can understand, this simply means that a server should not accept IPv4 traffic on an IPv6 socket (an otherwise legal operation). An IPv4 mapped address is a mixed-format address of the form: where the first portion is in IPv6 colon-hex format and the last portion is in IPv4 dotted decimal notation. The dotted decimal IPv4 address is the actual network address, but it is being mapped into an IPv6 compatible format. To prevent IPv4 mapped addresses from being accepted on an IPv6 socket, server applications must explicitly set the IPV6_V6ONLY socket option on all IPv6 sockets created [the Hagino book implies that this is only a concern with server applications. However, it has been observed during testing that if a client application uses an IPv4 mapped address to specify the target server, and the target server has IPv4 mapped addresses disabled, the connection still completes regardless. On the server side, the connection endpoint is an IPv4 socket as desired; but on the client side, the connection endpoint is an IPv6 socket. Setting the IPV6_V6ONLY socket option on the client side as well as the server side prevents any connection from being established at all.]. There's only one problem. Apparently, IPV6_V6ONLY isn't defined on all systems [or at least it wasn't in 2005 when the Hagino book was written]. The server example at the end of this chapter provides a method for handling this problem. If IPv4 traffic cannot be handled on IPv6 sockets, then that implies that server applications must open both an IPv4 and IPv6 socket for a particular network service if it wants to handle requests from either protocol. This goes back to the flexibility issue mentioned earlier. If getaddrinfo(3) returns multiple address records, then server applications should traverse the list and open a passive socket for each address provided. It is possible to assign a hostname to an IPv6 network address in /etc/hosts. For example, the following is an excerpt from the /etc/hosts file on the author's development system. The "localhost" and "pt141" hostnames can be translated to either an IPv4 or IPv6 network address. So, for example, if "pt141" is passed as the node parameter to getaddrinfo(3), the function returns both an IPv4 and IPv6 address record for the host (assuming the behavior hasn't been modified by the hints parameter). Unfortunately, a scoped address cannot be used in /etc/hosts. Doing so results in getaddrinfo(3) returning only the IPv4 record. Suppose a machine has the IPv4 address 192.0.2.1. A client application running on that machine can connect to a server application on the same machine by using either the local loopback address (127.0.0.1) or the network address (192.0.2.1) as the target server. Much to this author's surprise (and dismay), it turns out that an IPv6 client application cannot connect to a server application on the same machine if it uses the network address of that machine as the target; it must use the local loopback address (::1). Now it's time to put everything discussed thus far together into a sample client-server application. The remainder of this section is devoted to a remote time-of-day application (the 'daytime' Internet service) [I noticed that Ms. Castro used a 'daytime' example in her Porting applications to IPv6 HowTo. For the record, the source code presented here is original, developed from scratch, and any similarity between it and any other publicly available 'daytime' example is purely coincidental.]. The source code presented in this section was developed and tested on a RedHat Linux release using the 2.6 kernel (2.6.9 to be specific). Readers may use the source code freely, so long as proper credit is attributed; but of course the standard disclaimer must be given first: Although the sample source code is believed to be free of errors, the author makes no guarantees as to its reliability, especially considering that some error paths were intentionally omitted for brevity. Use it at your own risk! When you get right down to it, there really aren't that many differences between IPv4 and IPv6 applications. The trick is to code IPv6 applications in a protocol-independent manner, such that they can handle both IPv4 and IPv6 simultaneously and transparently. This sample application does just that. The only protocol-dependent code in the example occurs when printing network addresses in verbose mode; but only after the ai_family field in the addrinfo structure has been checked, so the programs know exactly what type of address they're handling at the time. The server code is found in file tod6d.c (time-of-day IPv6 daemon). Once built, the server may be started using the following command syntax (assuming tod6d is the executable file): ARGUMENTS: The service (or well-known port) on which to listen. Default is "daytime". OPTIONS: Turn on verbose mode. The server handles both TCP and UDP requests on the network. The server source code contained in tod6d.c follows: The TCP client code is found in file tod6tc.c (time-of-day IPv6 TCP client). Once built, the TCP client may be started using the following command syntax (assuming tod6tc is the executable file): ARGUMENTS: The hostname or IP address (dotted decimal or colon-hex) of the remote host providing the service. Default is "localhost". The TCP service (or well-known port number) to which a connection attempt is made. Default is "daytime". OPTIONS: This option is only meaningful for IPv6 addresses, and is used to set the scope identifier (i.e. the network interface on which to establish the connection). Default is "eth0". If host is a scoped address, this option is ignored. Turn on verbose mode. The TCP client source code contained in tod6tc.c follows: The UDP client code is found in file tod6uc.c (time-of-day IPv6 UDP client). It is almost an exact duplicate of the TCP client (and in fact was derived from it), but is included in this HowTo for completeness. Once built, the UDP client may be started using the following command syntax (assuming tod6uc is the executable file): ARGUMENTS: The hostname or IP address (dotted decimal or colon-hex) of the remote host providing the service. Default is "localhost". The UDP service (or well-known port number) to which datagrams are sent. Default is "daytime". OPTIONS: This option is only meaningful for IPv6 addresses, and is used to set the scope identifier (i.e. the network interface on which to exchange datagrams). Default is "eth0". If host is a scoped address, this option is ignored. Turn on verbose mode. The UDP client source code contained in tod6uc.c follows: Sun Java versions since 1.4 are IPv6 enabled, see e.g. Inet6Address (1.5/5.0) class. Hints are available in the Networking IPv6 User Guide for JDK/JRE 1.4 and 1.5 (5.0). As of May 2007 it's not known that the Perl core itself already supports IPv6. It can be added by using following modules: Anyway, some other modules exist for/with IPv6 support (e.g. Net::IP), search for “IPv6” on http://search.cpan.org/. The TAHI Project checks the interoperability of different operating systems regarding the implementation of IPv6 features. Linux kernel already got the IPv6 Ready Logo Phase 1. Cisco Self-Study: Implementing IPv6 Networks (IPV6) by Regis Desmeules. Cisco Press; ISBN 1587050862; 500 pages; 1st edition (April 11, 2003).
-Note: This item will be published on April 11, 2003. Configuring IPv6 with Cisco IOS by Sam Brown, Sam Browne, Neal Chen, Robbie Harrell, Edgar, Jr. Parenti (Editor), Eric Knipp (Editor), Paul Fong (Editor)362 pages; Syngress Media Inc; ISBN 1928994849; (July 12, 2002). IPv6 in Practice: A Unixer's Guide to the Next Generation Internet von Benedikt Stockebrand, November 2006; ISBN 3-540-24524-3 IPv6 Essentials by Silvia Hagen, 2nd Edition, May 2006; ISBN 0-5961-0058-2
-ToC, Index, Sample Chapter etc.; O'Reilly Pressrelease IPv6: The New Internet Protocol. By Christian Huitema; Published by Prentice-Hall; ISBN 0138505055.
-Description: This book, written by Christian Huitema - a member of the InternetArchitecture Board, gives an excellent description of IPv6, how it differs from IPv4, and the hows and whys of it's development.
-Source: http://www.cs.uu.nl/wais/html/na-dir/internet/tcp-ip/resource-list.html IPv6 Networks by Niles, Kitty; (ISBN 0070248079); 550 pages; Date Published 05/01/1998. Implementing IPV6. Supporting the Next Generation Internet Protocols by P. E. Miller, Mark A. Miller; Publisher: John Wiley & Sons; ISBN 0764545892; 2nd edition (March 15, 2000); 402 pages. Big Book of Ipv6 Addressing Rfcs by Peter H. Salus (Compiler), Morgan Kaufmann Publishers, April 2000, 450 pages ISBN 0126167702. Understanding IPV6 by Davies, Joseph; ISBN 0735612455; Date Published 05/01/2001; Number of Pages: 350. Migrating to IPv6 - IPv6 in Practice by Marc Blanchet Publisher: John Wiley & Sons; ISBN 0471498920; 1st edition (November 2002); 368 pages. Ipv6 Network Programming by Jun-ichiro Hagino; ISBN 1555583180 Wireless boosting IPv6 by Carolyn Duffy Marsan, 10/23/2000. O'reilly Network search for keyword IPv6 results in 29 hits (28. January 2002) Getting Connected with 6to4 by Huber Feyrer, 06/01/2001 Transient Addressing for Related Processes: Improved Firewalling by Using IPv6 and Multiple Addresses per Host; written by Peter M. Gleiz, Steven M. Bellovin (PC-PDF-Version; Palm-PDF-Version; PDB-Version) Internetworking IPv6 with Cisco Routers by Silvano Gai, McGrawHill Italia, 1997. The 13 chapters and appendix A-D are downloadable as PDF-documents. Migration and Co-existence of IPv4 and IPv6 in Residential Networks by Pekka Savola, CSC/FUNET, 2002 See also: liinwww.ira.uka.de/ipv6 or Google / Scholar / IPv6 IPv6 Trials on UK Academic Networks: Bermuda Project Aug.2002: Participants - Getting connected - Project deliverables - Network topology - Address assignments - Wireless IPv6 access - IPv6 migration - Project presentations - Internet 2 - Other IPv6 projects - IPv6 fora and standards Bermuda 2... Microsoft Research IPv6 Implementation (MSRIPv6): MSRIPv6 Configuring 6to4 - Connectivity with MSR IPv6 - Our 6Bone Node... More to be filled later...suggestions are welcome! America: ARIN, ARIN / registration page, ARIN / IPv6 guidelines EMEA: Ripe NCC, Ripe NCC / registration page, Ripe NCC / IPv6 registration Asia/Pacific: APNIC, APNIC / IPv6 ressource guide Latin America and Caribbea: LACNIC, IPv6 Registration Services, IPv6 Allocation Policy Africa: AfriNIC Also a list of major (prefix length 32) allocations per local registry is available here: Ripe NCC / IPv6 allocations. Note: A list of available Tunnel broker can be found in the section Tunnel broker below. Former IPng. Tunnelbroker and IPv6 resources, now migrated to the SixXs System. Eckes' IPv6-with-Linux Page. tunnelc - a perl based tunnel client script:
-freshmeat.net: Project details for tunnel client
-SourceForge: Project Info - tunnelc (also here) Linux Advanced Routing & Traffic Control HOWTO, Chapter 6: IPv6 tunneling with Cisco and/or 6bone. Lot of URLs to others documents by Anil Edathara go6 - The IPv6 Portal: an IPv6 online portal with a wiki-based IPv6 knowledge center, an IPv6 discussion forum, an up-to-date collection of IPv6 Events and News, free IPv6 access and services, IPv6 software applications, and much more Publishing the list of IPv6-related RFCs is beyond the scope of this document, but given URLs will lead you to such lists: List sorted by IPng Standardization Status or IPng Current Specifications by Robert Hinden IPv6 Related Specifications on IPv6.org Current (also) IPv6-related drafts can be found here: Get any information about IPv6, from overviews, through RFCs & drafts, to implementations (including availability of stacks on various platforms & source code for IPv6 stacks) SWITCH IPv6 Pilot / References, big list of IPv6 references maintained by Simon Leinen DeepSpace6 / more interesting links IPv6-HowTo for Linux by Peter Bieringer - Germany, and his Bieringer / IPv6 - software archive Linux+IPv6 status by Peter Bieringer - Germany (going obsolete) DeepSpace6 / IPv6 Status Page - Italy (Mirror) (will superseed upper one) USAGI project - Japan, and their USAGI project - software archive Linux Optimized Link State Routing Protocol (OLSR) IPv6 HOWTO PLD Linux Distribution (“market leader” in containing IPv6 enabled packages) Red Hat Enterprise Linux, Pekka Savola's IPv6 packages (Historic) For more see the IPv6+Linux Status Distributions page. WIDE project - Japan SWITCH IPv6 Pilot - Switzerland IPv6 Corner of Hubert Feyrer - Germany IPv6 Forum - a world-wide consortium of leading Internet vendors, Research & Education Networks... Playground.sun.com / IPv6 Info Page - maintained by Robert Hinden, Nokia. Get any information about IPv6, from overviews, through RFCs & drafts, to implementations (including availability of stacks on various platforms & source code for IPv6 stacks). 6INIT - IPv6 Internet Initiative - an EU Fifth Framework Project under the IST Programme. 6init - IPv6 INternet IniTiative IPv6: The New Version of the Internet Protocol, by Steve Deering. IPv6: The Next Generation Internet Protocol, by Gary C. Kessler. NetworkWorldFusion: Search / Doc Finder: searched for IPv6 (102 documents found 22.12.2002) The Register (Search for IPv6 will result in 30 documents, 22.12.2002) Something missing? Suggestions are welcome! Delphion Research: Patent Search Page. Basic (free) registration needed. Examples found 21.12.2002 searching for IPv6:
-Communicating method between IPv4 terminal and IPv6 terminal and IPv4-IPv6 converting apparatus
-Translator for IP networks, network system using the translator, and IP network coupling method therefor www.ist-ipv6.org: IST IPv6 Cluster, European IPv6 Research and Development Projects Euro6IX: European IPv6 Internet Exchanges Backbone IPv6@IKNnet and MIPv6 Research Group: TU Vienna, Austria (IPv6: project, publications, diploma / doctor thesis, Conference Proceedings etc.) ETRI: Electronics and Telecommunications Research Institut IPv6 Forum Korea: Korean IPv6 Deployment Project IPv6 Mexico (spain & english version): IPv6 Project Hompeage of The National Autonomous University of Mexico (UNAM) SURFnet: SURFnet IPv6 Backbone STACK, STACK (IPv6): Students' computer association of the Eindhoven University of Technology, Netherland IPng.nl: collaboration between WiseGuys and Intouch British Telecom IPv6 Home: BT's ISP IPv6 Trial, UK's first IPv6 Internet Exchange etc. IPv6 for Cisco IOS Software, File 2 of 3: Aug 2002 -- Table of Contents: IPv6 for Cisco IOS Software; Configuring Documentation Specifics; Enabling IPv6 Routing and Configuring; IPv6 Addressing; Enabling IPv6 Processing Globally. Cisco Internet Networking Handbook, Chapter IPv6 Now that IBM's announced the availability of z/OS V1.4, what's new in this release? This question was posed on 15 August 2002 MSRIPv6 - Microsoft Research Network - IPv6 Homepage Internet Connection Firewall Does Not Block Internet Protocol Version 6 Traffic (6.11.2001) Internet Protocol Numbers (8.10.2002) IPv6 Technology Preview Refresh (16.10.2002) HOW TO: Install and Configure IP Version 6 in Windows .NET Enterprise Server (26.10.2002) Windows .NET Server 6to4 Router Service Quits When You Advertise a 2002 Address on the Public Interface (28.10.2002) Internet Security Systems: Security Center, X-Force Database Search (21.12.2002 - 6 topics found relating to IPv6) NIST IPsec Project ( National Institute of Standards and Technology, NIST) NewOrder.box.sk (search for IPv6) (Articles, exploits, files database etc.) Freshmeat / IPv6 search, currently (14 Dec 2002) 62 projects Wireshark (former known as Ethereal) is a free network protocol analyzer for Unix and Windows Radcom RC100-WL - Download Radcom RC100-WL protocol analyzer version 3.20 6wind - solutions for IPv4/IPv6 Router, QoS, Multicast, Mobility, Security/VPN/Firewall. Fefe's patches for IPv6 with djbdnsAug 2002 -- What is djbdns and why does it need IPv6? djbdns is a full blown DNS server which outperforms BIND in nearly all respects. IPv6 routing table history created by Gert Döring, Space.Net Another list of IPv6 Internet Exchanges can be found here: IPv6 status of IXPs in Europe French National Internet Exchange IPv6 (since 1.11.2002 active).
-FNIX6 provides a free and reliable high speed FastEthernet interconnection between ISP located in TeleCity Paris. See also: http://www.deepspace6.net/docs/tunnelbrokers.html Freenet6 - /48 Delegation, Canada
-Getting IPv6 Using Freenet6 on Debian
-Freenet6 creater IPng Netherland - Intouch, SurfNet, AMS-IX, UUNet, Cistron, RIPE NCC and AT&T are connected at the AMS-IX. It is possible (there are requirements...) to get an static tunnel. UNINETT - Pilot IPv6 Service (for Customers): tunnelbroker & address allocation
-Uninett-Autoupdate-HOWTO NTT, United Kingdom - IPv6 Trial. IPv4 Tunnel and native IPv6 leased Line connections. POPs are located in London, UK Dusseldorf, Germany New Jersey, USA (East Coast) Cupertino, USA (West Coast) Tokyo, Japan ESnet, USA - Energy Sciences Network: Tunnel Registry & Address Delegation for directly connected ESnet sites and ESnet collaborators. Hurricane Electric, US backbone;
-Hurrican Electric Tunnelbroker (also available under http://tunnelbroker.com/)
-Press Release: Hurricane Electric Upgrades IPv6 Tunnel Broker
-Tunnel Broker Endpoint Autoupdate, Perl Script Note: These services are mostly only available with a valid IPv6 connection! Lists of maillists are available at: Major Mailinglists are listed in following table: (1) very recommended if you provide server applications. (2) list is moderated. Something missing? Suggestions are welcome! Following other maillinglists & newsgroups are available via web: student-ipv6 (India)
-Description: This is the group for the Student Awareness group of IPv6 in India sun-ipv6-users
-Description: Please report problems/suggestions regarding SUN Microsystems IPng implementation IPv6-BITS
-Description: This List will co-ordinate the working of Project Vertebrae. linux-bangalore-ipv6
-Description: The IPv6 deployment list of the Bangalore Linux User Group packet-switching
-Description: This mailing list provides a forum for discussion of packet switching theory, technology, implementation and application in any relevant aspect including without limitation LAPB, X.25, SDLC, P802.1d, LLC, IP, IPv6, IPX, DECNET, APPLETALK, FR, PPP, IP Telephony, LAN PBX systems, management protocols like SNMP, e-mail, network transparent window systems, protocol implementation, protocol verification, conformance testing and tools used in maintaining or developing packet switching systems. de.comm.protocols.tcp-ip
-Description: Umstellung auf IPv6
-Source: Chartas der Newsgruppen in de.* Google Group: comp.protocols.tcp-ip Google Group: linux.debian.maint.ipv6 Google Group: microsoft.public.platformsdk.networking.ipv6 Google Group: fa.openbsd.ipv6 ping, traceroute, tracepath, 6bone registry, DNS: JOIN / Testtools (German language only, but should be no problem for non German speakers) traceroute6, whois: IPng.nl AAAA Lookup Checker http://www.cnri.dit.ie/cgi-bin/check_aaaa.pl Training Pages, U.K. - Search for IPv6 (13 Courses, 2006-08-21) Something missing? Suggestions are welcome! IPv6: Addressing The Needs Of the Future by Yankee Group (Author)
-List Price: $595.00
-Edition: e-book (Acrobat Reader)
-Pages: 3 (three)
-Publisher: MarketResearch.com; ISBN B00006334Y; (November 1, 2001) ;-) The number of copies would be interesting... Versions x.y are published on the Internet. Versions x.y.z are work-in-progress and published as LyX and SGML file on CVS. Because Deep Space 6 mirrors these SGML files and generate independend from TLDP public versions, this versions will show up there and also on its mirrors. 2015-08-18/PB: fix some broken URLs, 20151016/bie: remove broken URL to Spanish transation, 20161215/bie: update some URLs 2010-04-20/PB: extend QoS section with examples, 20130513/PB: add IPv6 NAT hints, 20130521/PB: review dhcpd, 20131019/bie: general review, 20140502/bie: add hints for nftables, 20140513/bie: extend section regarding address resolution and add source/destination address selection information, 20140515/bie: add hints for activation of privacy extension 2009-12-13/PB: minor fixes 2009-06-11/PB: extend DHCP server examples (ISC DHCP, Dibbler) 2009-02-14/PB: Fix FSF address, major update on 4in6 tunnels, add new section for address resolving, add some URLs, remove broken URLs 2008-11-09/PB: Adjust URL to Turkish howto, add some HIP related URLs, remove broken URLs 2007-11-11/PB: fix broken description of shortcut BIND 2007-10-06/PB: fix broken URLs to TLDP-CVS, minor URL update. 2007-10-03/PB: fix description of sysctl/autoconf (credits to Francois-Xavier Le Bail) 2007-06-16/PB: speling fixes (credits to Larry W. Burton) 2007-05-29/PB: import major contribution to Programming using C-API written by John Wenker, minor fixes 2007-05-23/PB: update firewalling chapter, improve document for proper SGML validation, minor bugfixes 2006-11-08/PB: remove broken URLs, add a new book (credits to Bryan Vukich) 2006-10-25/PB: fix typo in dhcp6 section (credits to Michele Ferritto) 2006-09-23/PB: add some URLs 2006-08-24/PB: check RFC URLs, fix URL to Chinese translation, finalize for publishing 2006-08-23/PB: fix/remove broken URLs 2006-08-21/PB: some review, update and enhancement of the content, replace old 6bone example addresses with the current defined ones. 2006-08-20/PB: fix bug in maillist entries, 'mobility' is now a separate chapter 2006-08-20/PB: update and cleanup of maillist entries 2006-06-13/PB: major update of mobility section (contributed by Benjamin Thery) 2005-10-03/PB: add configuration hints for DHCPv6, major broken URL cleanup (credits to Necdet Yucel) 2005-01-15/PB: minor fixes 2005-01-11/PB: grammar check and minor review of IPv6 IPsec section 2005-01-01/PB: add information and examples about IPv6 IPsec, add some URLs 2004-08-30/PB: add some notes about proftpd, vsftpd and other daemons, add some URLs, minor fixes, update status of Spanish translation 2004-07-19/PB: minor fixes 2004-06-23/PB: add note about started Greek translation, replace Taiwanese with Chinese for related translation 2004-05-22/PB: minor fixes 2004-04-18/PB: minor fixes 2004-03-04/PB: announce Italian translation, add information about DHCPv6, minor updates 2004-01-12/PB: add note about the official example address space 2004-01-11/PB: minor fixes, add/fix some URLs, some extensions 2003-10-30/PB: fix some copy&paste text bugs 2003-10-19/PB: add note about start of Italian translation 2003-08-15/PB: fix URLs, add hint on tcp_wrappers (about broken notation in some versions) and Apache2 2003-07-26/PB: fix URL, add archive URL for maillist users at ipv6.org, add some ds6 URLs 2003-06-19/PB: fix typos 2003-06-11/PB: fix URL 2003-06-07/PB: fix some URLs, fix credits, add some notes at IPsec 2003-06-05/PB: add some notes about configuration in SuSE Linux, add URL of French translation 2003-05-09/PB: minor fixes, announce French translation 2003-05-02/PB: Remove a broken URL, update some others. 2003-04-23/PB: Minor fixes, remove a broken URL, fix URL to Taiwanese translation 2003-04-13/PB: Fix some typos, add a note about a French translation is in progress 2003-03-31/PB: Remove a broken URL, fix another 2003-03-22/PB: Add URL of German translation 2003-02-27/PB: Fix a misaddressed URL 2003-02-12/PB: Add Debian-Linux-Configuration, add a minor note on translations 2003-02-10/PB: Announcing available German version 2003-02-10/GK: Minor syntax and spelling fixes 2003-01-09/PB: fix an URL (draft adopted to an RFC) 2003-01-13/PB: fix a bug (forgotten 'link” on “ip link set” (credits to Yaniv Kaul) 2003-01-09/PB: a minor fix 2003-01-06/PB: minor fixes 2003-01-05/PB: minor updates 2002-12-31/GK: 270 new links added (searched in 1232 SearchEngines) in existing and 53 new (sub)sections 2002-12-20/PB: Minor fixes 2002-12-16/PB: Check of and fix broken links (credits to Georg Käfer), some spelling fixes 2002-12-11/PB: Some fixes and extensions 2002-11-25/PB: Some fixes (e.g. broken linuxdoc URLs) 2002-11-19/PB: Add information about German translation (work in progress), some fixes, create a small shortcut explanation list, extend “used terms” and add two German books 2002-11-18/PB: Fix broken RFC-URLs, add parameter ttl on 6to4 tunnel setup example 2002-11-03/PB: Add information about Taiwanese translation 2002-10-06/PB: Add another maillist 2002-09-29/PB: Extend information in proc-filesystem entries 2002-09-27/PB: Add some maillists 2002-09-18/PB: Update statement about nmap (triggered by Fyodor) 2002-09-16/PB: Add note about ping6 to multicast addresses, add some labels 2002-08-17/PB: Fix broken LDP/CVS links, add info about Polish translation, add URL of the IPv6 Address Oracle 2002-08-10/PB: Some minor updates 2002-07-15/PB: Add information neighbor discovery, split of firewalling (got some updates) and security into extra chapters 2002-07-13/PB: Update nmap/IPv6 information 2002-07-13/PB: Fill /proc-filesystem chapter, update DNS information about depricated A6/DNAME, change P-t-P tunnel setup to use of “ip” only 2002-07-11/PB: Minor spelling fixes 2002-06-23/PB: Minor spelling and other fixes 2002-05-16/PB: Cosmetic fix for 2^128, thanks to José Abílio Oliveira Matos for help with LyX 2002-05-02/PB: Add entries in URL list, minor spelling fixes 2002-03-27/PB: Add entries in URL list and at maillists, add a label and minor information about IPv6 on RHL 2002-03-04/PB: Add info about 6to4 support in kernel series 2.2.x and add an entry in URL list and at maillists 2002-02-26/PB: Migrate next grammar checks submitted by John Ronan 2002-02-21/PB: Migrate more grammar checks submitted by John Ronan, add some additional hints at DNS section 2002-02-12/PB: Migrate a minor grammar check patch submitted by John Ronan 2002-02-05/PB: Add mipl to maillist table 2002-01-31/PB: Add a hint how to generate 6to4 addresses 2002-01-30/PB: Add a hint about default route problem, some minor updates 2002-01-29/PB: Add many new URLs 2002-01-27/PB: Add some forgotten URLs 2002-01-25/PB: Add two German books, fix quote entinities in exported SGML code 2002-01-23/PB: Add a FAQ on the program chapter 2002-01-23/PB: Move “the end” to the end, add USAGI to maillists 2002-01-22/PB: Fix bugs in explanation of multicast address types 2002-01-22/PB: Cosmetic fix double existing text in history (at 0.16), move all credits to the end of the document 2002-01-20/PB: Add a reference, fix URL text in online-test-tools 2002-01-19/PB: Add some forgotten information and URLs about global IPv6 addresses 2002-01-19/PB: Minor fixes, remove “bold” and “emphasize” formats on code lines, fix “too long unwrapped code lines” using selfmade utility, extend list of URLs. 2002-01-15/PB: Fix bug in addresstype/anycast, move content related credits to end of document 2002-01-14/PB: Minor review at all, new chapter “debugging”, review “addresses”, spell checking, grammar checking (from beginning to 3.4.1) by Martin Krafft, add tcpdump examples, copy firewalling/netfilter6 from IPv6+Linux-HowTo, minor enhancements 2002-01-05/PB: Add example BIND9/host, move revision history to end of document, minor extensions 2002-01-03/PB: Merge review of David Ranch 2002-01-02/PB: Spell checking and merge review of Pekka Savola 2002-01-02/PB: First public release of chapter 1 The quickest way to be added to this nice list is to send bug fixes, corrections, and/or updates to me ;-). If you want to do a major review, you can use the native LyX file (see original source) and send diffs against it, because diffs against SGML don't help too much. David Ranch <dranch at trinnet dot net>: For encouraging me to write this HOWTO, his editorial comments on the first few revisions, and his contributions to various IPv6 testing results on my IPv6 web site. Also for his major reviews and suggestions. Pekka Savola <pekkas at netcore dot fi>: For major reviews, input and suggestions. Martin F. Krafft <madduck at madduck dot net>: For grammar checks and general reviewing of the document. John Ronan <j0n at tssg dot wit dot ie>: For grammar checks. Georg Käfer <gkaefer at gmx dot at>: For detection of no proper PDF creation (fixed now by LDP maintainer Greg Ferguson), input for German books, big list of URLs, checking all URLs, many more suggestions, corrections and contributions, and the German translation Michel Boucey <mboucey at free dot fr>: Finding typos and some broken URLs, contribute some suggestions and URLs, and the French translation Michele Ferritto <m dot ferritto at virgilio dot it>: Finding bugs and the Italian translation Daniel Roesen <dr at cluenet dot de>: For grammar checks Benjamin Thery <benjamin dot thery at bull dot net>: For contribution of updated mobility section John Wenker <jjw at pt dot com>: major contribution to Programming using C-API Srivats P. <Srivats dot P at conexant dot com>: major contribution for 4in6 tunnels Writing a LDP HOWTO as a newbie (in LyX and exporting this to DocBook to conform to SGML) isn't as easy as some people say. There are some strange pitfalls... Nevertheless, thanks to: Authors of the LDP Author Guide B. Guillon: For his DocBook with LyX HOWTO Credits for fixes and hints are listed here, will grow sure in the future S .P. Meenakshi <meena at cs dot iitm dot ernet dot in>: For a hint using a “send mail” shell program on tcp_wrapper/hosts.deny Frank Dinies <FrankDinies at web dot de>: For a bugfix on IPv6 address explanation John Freed <jfreed at linux-mag dot com>: For finding a bug in IPv6 multicast address explanation Craig Rodrigues <crodrigu at bbn dot com>: For suggestion about RHL IPv6 setup Fyodor <fyodor at insecure dot org>: Note me about outdated nmap information Mauro Tortonesi <mauro at deepspace6 dot net>: For some suggestions Tom Goodale <goodale at aei-potsdam dot mpg dot de>: For some suggestions Martin Luemkemann <mluemkem at techfak dot uni-bielefeld dot de>: For a suggestion Jean-Marc V. Liotier <jim at jipo dot com>: Finding a bug Yaniv Kaul <ykaul at checkpoint dot com>: Finding a bug Arnout Engelen <arnouten at bzzt dot net>: For sending note about a draft was adopted to RFC now Stephane Bortzmeyer <bortzmeyer at nic dot fr>: Contributing persistent configuration on Debian lithis von saturnsys <lithis at saturnsys dot com>: Reporting a misaddressed URL Guy Hulbert <gwhulbert at rogers dot com>: Send a note that RFC1924 is probably an April fool's joke Tero Pelander <tpeland at tkukoulu dot fi>: Reporting a broken URL Walter Jontofsohn <wjontof at gmx dot de>: Hints for SuSE Linux 8.0/8.1 Benjamin Hofstetter <benjamin dot hofstetter at netlabs dot org>: Reporting a mispointing URL J.P. Larocque <piranha at ely dot ath dot cx>: Reporting archive URL for maillist users at ipv6 dot org Jorrit Kronjee <jorrit at wafel dot org>: Reporting broken URLs Colm MacCarthaigh <colm dot maccarthaigh at heanet dot ie>: Hint for sendfile issue on Apache2 Tiago Camilo <tandre at ipg dot pt>: Contribute some URLs about Mobile IPv6 Harald Geiger: Reporting a bug in how described the bit counting of the universal/global bit Bjoern Jacke <bjoern at j3e dot de>: Triggered me to fix some outdated information on xinetd Christoph Egger <cegger at chrrr dot com>: Sending note about “ip” has problems with IPv4-compatible addresses on SuSE Linux 9.0 and trigger to add a hint on 6to4-radvd example David Lee Haw Ling <hawling at singnet dot com dot sg>: Sending information about a tunnel broker Michael H. Warfield <mhw at iss dot net>: Sending note about suffix for 6to4 routers Tomasz Mrugalski <thomson at klub dot com dot pl>: Sending updates for DHCPv6 section Jan Minar <jjminar at fastmail dot fm>: Reporting minor bugs Kalin KOZHUHAROV <kalin at tar dot bz>: Fixing a not so well explanation Roel van Dijk <rdvdijk at planet dot nl>: Reporting broken URLs Catalin Muresan <catalin dot muresan at astral dot ro>: Reporting minor bugs Dennis van Dok <dvandok at quicknet dot nl>: Reporting minor bugs Necdet Yucel <nyucel at comu dot edu dot tr>: Reporting broken URLs Bryan Vukich: Reporting a broken URL Daniele Masini: reporting a broken iptables example Yao Zhao: reporting a bug in IPv6 route remove description Aaron Kunde: reporting a broken URL and a content related bug Larry W. Burton: speling fixes Justin Pryzby: reporting broken shortcut description of BIND Thanks for reading. Hope it helps! If you have any questions, subscribe to proper maillist and describe your problem providing as much as information as possible.
-
Linux IPv6 HOWTO (en)
Peter Bieringer
Revision History Revision 0.67wip 2016-12-15 Revised by: PB Revision 0.66 2014-05-15 Revised by: PB Revision 0.65 2009-12-13 Revised by: PB Revision 0.64 2009-06-11 Revised by: PB Revision 0.60 2007-05-31 Revised by: PB Revision 0.51 2006-11-08 Revised by: PB Chapter 1. General
1.1. Copyright, license and others
1.1.1. Copyright
1.1.2. License
1.1.3. About the author
1.1.3.1. Internet/IPv6 history of the author
1.1.3.2. Contact
1.3. Version, History and To-Do
1.3.1. Version
1.3.2. History
1.3.2.1. Major history
1.4. Translations
1.4.1. To language
1.4.1.1. Chinese
1.4.1.2. Polish
1.4.1.3. German
1.4.1.4. French
1.4.1.5. Spanish
1.4.1.6. Italian
1.4.1.7. Japanese
1.4.1.8. Greek
1.4.1.9. Turkish
1.4.1.10. Portuguese-Brazil
1.5. Technical
1.5.1. Original source of this HOWTO
1.5.1.1. Code line wrapping
1.5.2. On-line references to the HTML version of this HOWTO (linking/anchors)
1.5.2.1. Master index page
1.5.2.2. Dedicated pages
1.6. Preface
1.6.1. How many versions of a Linux & IPv6 related HOWTO are floating around?
1.6.1.1. Linux IPv6 FAQ/HOWTO (outdated)
1.6.1.2. IPv6 & Linux - HowTo (maintained)
1.6.1.3. Linux IPv6 HOWTO (this document)
1.7. Used terms, glossary and shortcuts
1.7.1. Network related
1.7.1.1. Shortcuts
1.7.2. Document related
1.7.2.1. Long code line wrapping signal char
1.7.2.2. Placeholders
<myipaddress>
1.2.3.4
1.7.2.3. Commands in the shell
$ whoami
# whoami
1.8. Requirements for using this HOWTO
1.8.1. Personal prerequisites
1.8.1.1. Experience with Unix tools
1.8.1.2. Experience with networking theory
1.8.1.3. Experience with IPv4 configuration
1.8.1.4. Experience with the Domain Name System (DNS)
1.8.1.5. Experience with network debugging strategies
1.8.2. Linux operating system compatible hardware
Chapter 2. Basics
2.1. What is IPv6?
2.2. History of IPv6 in Linux
2.2.1. Beginning
diff -u --recursive --new-file v2.1.7/linux/include/linux/in6.h
-¬ linux/include/linux/in6.h
---- v2.1.7/linux/include/linux/in6.h Thu Jan 1 02:00:00 1970
-+++ linux/include/linux/in6.h Sun Nov 3 11:04:42 1996
-@@ -0,0 +1,99 @@
-+/*
-+ * Types and definitions for AF_INET6
-+ * Linux INET6 implementation
-+ * + * Authors:
-+ * Pedro Roque <******>
-+ *
-+ * Source:
-+ * IPv6 Program Interfaces for BSD Systems
-+ * <draft-ietf-ipngwg-bsd-api-05.txt>
2.2.2. In between
2.2.3. Current
2.2.4. Future
2.3. What do IPv6 addresses look like?
2^128-1: 340282366920938463463374607431768211455
2^128-1: 0xffffffffffffffffffffffffffffffff
2^128-1: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
2001:0db8:0100:f101:0210:a4ff:fee3:9566
2001:0db8:0100:f101:0210:a4ff:fee3:9566 ->
-¬ 2001:db8:100:f101:210:a4ff:fee3:9566
2001:0db8:100:f101:0:0:0:1 -> 2001:db8:100:f101::1
0000:0000:0000:0000:0000:0000:0000:0001 -> ::1
# ipv6calc --addr_to_base85 2001:0db8:0100:f101:0210:a4ff:fee3:9566
-9R}vSQZ1W=9A_Q74Lz&R
2.4. FAQ (Basics)
2.4.1. Why is the name IPv6 and not IPv5 as successor for IPv4?
2.4.2. IPv6 addresses: why such a high number of bits?
2.4.3. IPv6 addresses: why so small a number of bits on a new design?
Chapter 3. Address types
3.1. Addresses without a special prefix
3.1.1. Localhost address
0000:0000:0000:0000:0000:0000:0000:0001
::1
3.1.2. Unspecified address
0000:0000:0000:0000:0000:0000:0000:0000
::
3.1.3. IPv6 address with embedded IPv4 address
3.1.3.1. IPv4-mapped IPv6 address
0:0:0:0:0:ffff:a.b.c.d/96
::ffff:a.b.c.d/96
::ffff:1.2.3.4
3.1.3.2. IPv4-compatible IPv6 address
0:0:0:0:0:0:a.b.c.d/96
::a.b.c.d/96
3.2. Network part, also known as prefix
3.2.1. Link local address type
fe8x: <- currently the only one in use
-fe9x:
-feax:
-febx:
3.2.2. Site local address type
fecx: <- most commonly used
-fedx:
-feex:
-fefx:
3.2.3. Unique Local IPv6 Unicast Addresses
fcxx:
-fdxx: <- currently the only one in use
fd0f:8b72:ac90::/48
3.2.4. Global address type "(Aggregatable) global unicast"
2xxx:
-3xxx:
3.2.4.1. 6bone test addresses
3ffe:
3ffe:ffff:100:f102::1
3ffe:ffff:
3.2.4.2. 6to4 addresses
2002:
2002:c0a8:0101:5::1
ipv4="1.2.3.4"; sla="5"; printf "2002:%02x%02x:%02x%02x:%04x::1" `echo $ipv4
-¬ | tr "." " "` $sla
3.2.4.3. Assigned by provider for hierarchical routing
2001:
3.2.4.4. Addresses reserved for examples and documentation
3fff:ffff::/32
-2001:0DB8::/32 EXAMPLENET-WF
3.2.5. Multicast addresses
ffxy:
3.2.5.1. Multicast scopes
3.2.5.2. Multicast types
3.2.5.3. Solicited node link-local multicast address
ff02::1:ff00:1234
3.2.6. Anycast addresses
3.2.6.1. Subnet-router anycast address
2001:db8:100:f101:210:a4ff:fee3:9566/64 <- Node's address
2001:db8:100:f101::/64 <- subnet-router anycast address
3.3. Address types (host part)
3.3.1. Automatically computed (also known as stateless)
00:10:a4:01:23:45
0210:a4ff:fe01:2345
2001:0db8:0100:f101:0210:a4ff:fe01:2345
3.3.1.1. Privacy problem with automatically computed addresses and a solution
3.3.2. Manually set
2001:0db8:100:f101::1
3.4. Prefix lengths for routing
3.4.1. Prefix lengths (also known as "netmasks")
2001:0db8:100:1:2:3:4:5/48
2001:0db8:0100:0000:0000:0000:0000:0000
ffff:ffff:ffff:0000:0000:0000:0000:0000
3.4.2. Matching a route
2001:0db8:100::/48 :: U 1 0 0 sit1
-2000::/3 ::192.88.99.1 UG 1 0 0 tun6to4
2001:0db8:100:1:2:3:4:5/48 -> routed through device sit1
-2001:0db8:200:1:2:3:4:5/48 -> routed through device tun6to4
Chapter 4. IPv6-ready system check
4.1. IPv6-ready kernel
4.1.1. Check for IPv6 support in the current running kernel
/proc/net/if_inet6
# test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready"
4.1.2. Try to load IPv6 module
# modprobe ipv6
# lsmod |grep -w 'ipv6' && echo "IPv6 module successfully loaded"
4.1.2.1. Automatically loading of module
alias net-pf-10 ipv6 # automatically load IPv6 module on demand
alias net-pf-10 off # disable automatically load of IPv6 module on demand
4.1.3. Compile kernel with IPv6 capabilities
4.1.3.1. Compiling a vanilla kernel
4.1.3.2. Compiling a kernel with USAGI extensions
4.1.4. IPv6-ready network devices
4.1.4.1. Currently known never “IPv6 capable links”
4.1.4.2. Currently known “not supported IPv6 capable links”
4.2. IPv6-ready network configuration tools
4.2.1. net-tools package
# /sbin/ifconfig -? 2>& 1|grep -qw 'inet6' && echo "utility 'ifconfig' is
-¬ IPv6-ready"
# /sbin/route -? 2>& 1|grep -qw 'inet6' && echo "utility 'route' is IPv6-ready"
4.2.2. iproute package
# /sbin/ip 2>&1 |grep -qw 'inet6' && echo "utility 'ip' is IPv6-ready"
4.3. IPv6-ready test/debug programs
4.3.1. IPv6 ping
# ping6 <hostwithipv6address>
-# ping6 <ipv6address>
-# ping6 [-I <device>] <link-local-ipv6address>
# ping6 <link-local-ipv6address>%<device>
# ping6 -c 1 ::1
-PING ::1(::1) from ::1 : 56 data bytes
-64 bytes from ::1: icmp_seq=0 hops=64 time=292 usec
-
---- ::1 ping statistics ---
-1 packets transmitted, 1 packets received, 0% packet loss
-round-trip min/avg/max/mdev = 0.292/0.292/0.292/0.000 ms
4.3.1.1. Specifying interface for IPv6 ping
# ping6 fe80::212:34ff:fe12:3456
-connect: Invalid argument
# ping6 -I eth0 -c 1 fe80::2e0:18ff:fe90:9205
-PING fe80::212:23ff:fe12:3456(fe80::212:23ff:fe12:3456) from
-¬ fe80::212:34ff:fe12:3478 eth0: 56 data bytes
-64 bytes from fe80::212:23ff:fe12:3456: icmp_seq=0 hops=64 time=445 usec
-
---- fe80::2e0:18ff:fe90:9205 ping statistics ---
-1 packets transmitted, 1 packets received, 0% packet loss round-trip
-¬ min/avg/max/mdev = 0.445/0.445/0.445/0.000 ms
# ping6 -c 1 fe80::2e0:18ff:fe90:9205%eth0
4.3.1.2. Ping6 to multicast addresses
# ping6 -I eth0 ff02::1
-PING ff02::1(ff02::1) from fe80:::2ab:cdff:feef:0123 eth0: 56 data bytes
-64 bytes from ::1: icmp_seq=1 ttl=64 time=0.104 ms
-64 bytes from fe80::212:34ff:fe12:3450: icmp_seq=1 ttl=64 time=0.549 ms (DUP!)
# ping6 ff02::1%eth0
4.3.2. IPv6 traceroute6
# traceroute6 www.6bone.net
-traceroute to 6bone.net (3ffe:b00:c18:1::10) from 2001:0db8:0000:f101::2, 30
-¬ hops max, 16 byte packets
- 1 localipv6gateway (2001:0db8:0000:f101::1) 1.354 ms 1.566 ms 0.407 ms
- 2 swi6T1-T0.ipv6.switch.ch (3ffe:2000:0:400::1) 90.431 ms 91.956 ms 92.377 ms
- 3 3ffe:2000:0:1::132 (3ffe:2000:0:1::132) 118.945 ms 107.982 ms 114.557 ms
- 4 3ffe:c00:8023:2b::2 (3ffe:c00:8023:2b::2) 968.468 ms 993.392 ms 973.441 ms
- 5 3ffe:2e00:e:c::3 (3ffe:2e00:e:c::3) 507.784 ms 505.549 ms 508.928 ms
- 6 www.6bone.net (3ffe:b00:c18:1::10) 1265.85 ms * 1304.74 ms
4.3.3. IPv6 tracepath6
# tracepath6 www.6bone.net
- 1?: [LOCALHOST] pmtu 1480
- 1: 3ffe:401::2c0:33ff:fe02:14 150.705ms
- 2: 3ffe:b00:c18::5 267.864ms
- 3: 3ffe:b00:c18::5 asymm 2 266.145ms pmtu 1280
- 3: 3ffe:3900:5::2 asymm 4 346.632ms
- 4: 3ffe:28ff:ffff:4::3 asymm 5 365.965ms
- 5: 3ffe:1cff:0:ee::2 asymm 4 534.704ms
- 6: 3ffe:3800::1:1 asymm 4 578.126ms !N
-Resume: pmtu 1280
4.3.4. IPv6 tcpdump
4.3.4.1. IPv6 ping to 2001:0db8:100:f101::1 native over a local link
# tcpdump -t -n -i eth0 -s 512 -vv ip6 or proto ipv6
-tcpdump: listening on eth0
-2001:0db8:100:f101:2e0:18ff:fe90:9205 > 2001:0db8:100:f101::1: icmp6: echo
-¬ request (len 64, hlim 64)
-2001:0db8:100:f101::1 > 2001:0db8:100:f101:2e0:18ff:fe90:9205: icmp6: echo
-¬ reply (len 64, hlim 64)
4.3.4.2. IPv6 ping to 2001:0db8:100::1 routed through an IPv6-in-IPv4-tunnel
# tcpdump -t -n -i ppp0 -s 512 -vv ip6 or proto ipv6
-tcpdump: listening on ppp0
-1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 2001:0db8:100::1: icmp6: echo request
-¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124)
-5.6.7.8 > 1.2.3.4: 2001:0db8:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len
-¬ 64, hlim 61) (ttl 23, id 29887, len 124)
-1.2.3.4 > 5.6.7.8: 2002:ffff:f5f8::1 > 2001:0db8:100::1: icmp6: echo request
-¬ (len 64, hlim 64) (DF) (ttl 64, id 0, len 124)
-5.6.7.8 > 1.2.3.4: 2001:0db8:100::1 > 2002:ffff:f5f8::1: icmp6: echo reply (len
-¬ 64, hlim 61) (ttl 23, id 29919, len 124)
4.4. IPv6-ready programs
4.5. IPv6-ready client programs (selection)
4.5.1. Checking DNS for resolving IPv6 addresses
# host -t AAAA www.join.uni-muenster.de
www.join.uni-muenster.de. is an alias for tolot.join.uni-muenster.de.
-tolot.join.uni-muenster.de. has AAAA address
-¬ 2001:638:500:101:2e0:81ff:fe24:37c6
4.5.2. IPv6-ready telnet clients
$ telnet 3ffe:400:100::1 80
-Trying 3ffe:400:100::1...
-Connected to 3ffe:400:100::1.
-Escape character is '^]'.
-HEAD / HTTP/1.0
-
-HTTP/1.1 200 OK
-Date: Sun, 16 Dec 2001 16:07:21
-GMT Server: Apache/2.0.28 (Unix)
-Last-Modified: Wed, 01 Aug 2001 21:34:42 GMT
-ETag: "3f02-a4d-b1b3e080"
-Accept-Ranges: bytes
-Content-Length: 2637
-Connection: close
-Content-Type: text/html; charset=ISO-8859-1
-
-Connection closed by foreign host.
4.5.3. IPv6-ready ssh clients
4.5.3.1. openssh
$ ssh -6 ::1
-user@::1's password: ******
-[user@ipv6host user]$
4.5.3.2. ssh.com
4.5.4. IPv6-ready web browsers
4.5.4.1. URLs for testing
4.6. IPv6-ready server programs
4.7. FAQ (IPv6-ready system check)
4.7.1. Using tools
4.7.1.1. Q: Cannot ping6 to link-local addresses
4.7.1.2. Q: Cannot ping6 or traceroute6 as normal user
Chapter 5. Configuring interfaces
5.1. Different network devices
5.1.1. Physically bounded
5.1.2. Virtually bounded
5.1.2.1. IPv6-in-IPv4 tunnel interfaces
5.1.2.3. ISDN HDLC interfaces
5.1.2.4. ISDN PPP interfaces
5.1.2.5. SLIP + PLIP
5.1.2.6. Ether-tap device
5.2. Bringing interfaces up/down
5.2.1. Using "ip"
# ip link set dev <interface> up
-# ip link set dev <interface> down
# ip link set dev eth0 up
-# ip link set dev eth0 down
5.2.2. Using "ifconfig"
# /sbin/ifconfig <interface> up
-# /sbin/ifconfig <interface> down
# /sbin/ifconfig eth0 up
-# /sbin/ifconfig eth0 down
Chapter 6. Configuring IPv6 addresses
6.1. Displaying existing IPv6 addresses
6.1.1. Using "ip"
# /sbin/ip -6 addr show dev <interface>
# /sbin/ip -6 addr show dev eth0
-2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_ fast qlen 100
-inet6 fe80::210:a4ff:fee3:9566/10 scope link
-inet6 2001:0db8:0:f101::1/64 scope global
-inet6 fec0:0:0:f101::1/64 scope site
# /sbin/ip -6 addr show dev eth0
-3: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen
-¬ 100
-inet6 2002:d950:f5f8:f101:2e0:18ff:fe90:9205/64 scope global dynamic
-valid_lft 16sec preferred_lft 6sec
-inet6 3ffe:400:100:f101:2e0:18ff:fe90:9205/64 scope global dynamic
-valid_lft 2591997sec preferred_lft 604797sec inet6 fe80::2e0:18ff:fe90:9205/10
-¬ scope link
6.1.2. Using "ifconfig"
# /sbin/ifconfig <interface>
# /sbin/ifconfig eth0 |grep "inet6 addr:"
-inet6 addr: fe80::210:a4ff:fee3:9566/10 Scope:Link
-inet6 addr: 2001:0db8:0:f101::1/64 Scope:Global
-inet6 addr: fec0:0:0:f101::1/64 Scope:Site
6.2. Add an IPv6 address
6.2.1. Using "ip"
# /sbin/ip -6 addr add <ipv6address>/<prefixlength> dev <interface>
# /sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0
6.2.2. Using "ifconfig"
# /sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
# /sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64
6.3. Removing an IPv6 address
6.3.1. Using "ip"
# /sbin/ip -6 addr del <ipv6address>/<prefixlength> dev <interface>
# /sbin/ip -6 addr del 2001:0db8:0:f101::1/64 dev eth0
6.3.2. Using "ifconfig"
# /sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
# /sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64
6.4. Automatic IPv6 Address Configuration
6.5. Enable Privacy Extension
6.5.1. Enable Privacy Extension using sysctl
Temporary activation
# sysctl -w net.ipv6.conf.eth0.use_tempaddr=2
# ip link set dev eth0 down
-# ip link set dev eth0 up
# ip -6 addr show dev eth0
-2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
- inet6 2001:db8:0:1:8992:3c03:d6e2:ed72/64 scope global secondary dynamic <- pseudo-random IID
- valid_lft 604711sec preferred_lft 86311sec
- inet6 2001:db8:0:1::224:21ff:fe01:2345/64 scope global <- IID based on MAC
- valid_lft 604711sec preferred_lft 86311sec
- ...
Permanent activation
net.ipv6.conf.eth0.use_tempaddr=2
net.ipv6.conf.all.use_tempaddr=2
-net.ipv6.conf.default.use_tempaddr=2
# sysctl -p
6.5.2. Enable Privacy Extension using NetworkManager
# nmcli connection
-NAME UUID TYPE DEVICE
-ens4v1 d0fc2b2e-5fa0-4675-96b5-b723ca5c46db 802-3-ethernet ens4v1
# ip -o addr show dev ens4v1 | grep temporary | wc -l
-0
# nmcli connection show ens4v1 |grep ip6-privacy
-ipv6.ip6-privacy: -1 (unknown)
# nmcli connection modify ens4v1 ipv6.ip6-privacy 2
-# nmcli connection down ens4v1; nmcli connection up ens4v1
# nmcli connection show ens4v1 |grep ip6-privacy
-ipv6.ip6-privacy: 2 (active, prefer temporary IP)
# ip -o addr show dev ens4v1 | grep temporary | wc -l
-2
6.5.3. Test real use of Privacy Extension IPv6 Addresses
Chapter 7. Configuring normal IPv6 routes
7.1. Displaying existing IPv6 routes
7.1.1. Using "ip"
# /sbin/ip -6 route show [dev <device>]
# /sbin/ip -6 route show dev eth0
-2001:0db8:0:f101::/64 proto kernel metric 256 mtu 1500 advmss 1440
-fe80::/10 proto kernel metric 256 mtu 1500 advmss 1440
-ff00::/8 proto kernel metric 256 mtu 1500 advmss 1440
-default proto kernel metric 256 mtu 1500 advmss 1440
7.1.2. Using "route"
# /sbin/route -A inet6
# /sbin/route -A inet6 |grep -w "eth0"
-2001:0db8:0:f101 ::/64 :: UA 256 0 0 eth0 <- Interface route for global
-¬ address
-fe80::/10 :: UA 256 0 0 eth0 <- Interface route for link-local
-¬ address
-ff00::/8 :: UA 256 0 0 eth0 <- Interface route for all multicast
-¬ addresses
-::/0 :: UDA 256 0 0 eth0 <- Automatic default route
7.2. Add an IPv6 route through a gateway
7.2.1. Using "ip"
# /sbin/ip -6 route add <ipv6network>/<prefixlength> via <ipv6address>
-¬ [dev <device>]
# /sbin/ip -6 route add default via 2001:0db8:0:f101::1
7.2.2. Using "route"
# /sbin/route -A inet6 add <ipv6network>/<prefixlength> gw
-¬ <ipv6address> [dev <device>]
# /sbin/route -A inet6 add default gw 2001:0db8:0:f101::1
7.3. Removing an IPv6 route through a gateway
7.3.1. Using "ip"
# /sbin/ip -6 route del <ipv6network>/<prefixlength> via <ipv6address>
-¬ [dev <device>]
# /sbin/ip -6 route del default via 2001:0db8:0:f101::1
7.3.2. Using "route"
# /sbin/route -A inet6 del <network>/<prefixlength> gw <ipv6address> [dev
-¬ <device>]
# /sbin/route -A inet6 del default gw 2001:0db8:0:f101::1
7.4. Add an IPv6 route through an interface
7.4.1. Using "ip"
# /sbin/ip -6 route add <ipv6network>/<prefixlength> dev <device>
-¬ metric 1
# /sbin/ip -6 route add default dev eth0 metric 1
7.4.2. Using "route"
# /sbin/route -A inet6 add <ipv6network>/<prefixlength> dev <device>
# /sbin/route -A inet6 add default dev eth0
7.5. Removing an IPv6 route through an interface
7.5.1. Using "ip"
# /sbin/ip -6 route del <ipv6network>/<prefixlength> dev <device>
# /sbin/ip -6 route del default dev eth0
7.5.2. Using "route"
# /sbin/route -A inet6 del <network>/<prefixlength> dev <device>
# /sbin/route -A inet6 del default dev eth0
7.6. FAQ for IPv6 routes
7.6.1. Support of an IPv6 default route
7.6.1.1. Clients (not routing any packet!)
# ip -6 route show | grep ^default
-default via fe80::212:34ff:fe12:3450 dev eth0 proto kernel metric 1024 expires
-¬ 29sec mtu 1500 advmss 1440
7.6.1.2. Routers in case of packet forwarding
Chapter 8. Neighbor Discovery
8.1. Displaying neighbors using “ip”
# ip -6 neigh show [dev <device>]
# ip -6 neigh show
-fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable
8.2. Manipulating neighbors table using “ip”
8.2.1. Manually add an entry
# ip -6 neigh add <IPv6 address> lladdr <link-layer address> dev <device>
# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0
8.2.2. Manually delete an entry
# ip -6 neigh del <IPv6 address> lladdr <link-layer address> dev <device>
# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0
8.2.3. More advanced settings
# ip -6 neigh help
-Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ]
- [ nud { permanent | noarp | stale | reachable } ]
- | proxy ADDR } [ dev DEV ]
- ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ]
Chapter 9. Configuring IPv6-in-IPv4 tunnels
9.1. Types of tunnels
9.1.1. Static point-to-point tunneling
9.1.2. Automatically tunneling
9.1.3. 6to4-Tunneling
9.1.3.1. Generation of 6to4 prefix
| 3+13 | 32 | 16 | 64 bits |
-+---+------+-----------+--------+--------------------------------+
-| FP+TLA | V4ADDR | SLA ID | Interface ID |
-| 0x2002 | | | |
-+---+------+-----------+--------+--------------------------------+
9.1.3.2. 6to4 upstream tunneling
9.1.3.3. 6to4 downstream tunneling
9.1.3.4. Possible 6to4 traffic
9.1.4. UDP encapsulated IPv6 tunneling
9.1.4.1. Teredo Tunnel
9.1.4.2. AYIYA Tunnel
9.1.4.3. gogo6 Tunnel
9.2. Displaying existing tunnels
9.2.1. Using "ip"
# /sbin/ip -6 tunnel show [<device>]
# /sbin/ip -6 tunnel show
-sit0: ipv6/ip remote any local any ttl 64 nopmtudisc
-sit1: ipv6/ip remote 195.226.187.50 local any ttl 64
9.2.2. Using "route"
# /sbin/route -A inet6
# /sbin/route -A inet6 | grep "\Wsit0\W*$"
-::/96 :: U 256 2 0 sit0
-2002::/16 :: UA 256 0 0 sit0
-2000::/3 ::193.113.58.75 UG 1 0 0 sit0
-fe80::/10 :: UA 256 0 0 sit0
-ff00::/8 :: UA 256 0 0 sit0
9.3. Setup of point-to-point tunnel
9.3.1. Add point-to-point tunnels
9.3.1.1. Using "ip"
# /sbin/ip tunnel add <device> mode sit ttl <ttldefault> remote
-¬ <ipv4addressofforeigntunnel> local <ipv4addresslocal>
# /sbin/ip tunnel add sit1 mode sit ttl <ttldefault> remote
-¬ <ipv4addressofforeigntunnel1> local <ipv4addresslocal>
-# /sbin/ip link set dev sit1 up
-# /sbin/ip -6 route add <prefixtoroute1> dev sit1 metric 1
-
-# /sbin/ip tunnel add sit2 mode sit ttl <ttldefault>
-¬ <ipv4addressofforeigntunnel2> local <ipv4addresslocal>
-# /sbin/ip link set dev sit2 up
-# /sbin/ip -6 route add <prefixtoroute2> dev sit2 metric 1
-
-# /sbin/ip tunnel add sit3 mode sit ttl <ttldefault>
-¬ <ipv4addressofforeigntunnel3> local <ipv4addresslocal>
-# /sbin/ip link set dev sit3 up
-# /sbin/ip -6 route add <prefixtoroute3> dev sit3 metric 1
9.3.1.2. Using "ifconfig" and "route" (deprecated)
# /sbin/ifconfig sit0 up
-
-# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel1>
-# /sbin/ifconfig sit1 up
-# /sbin/route -A inet6 add <prefixtoroute1> dev sit1
-
-# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel2>
-# /sbin/ifconfig sit2 up
-# /sbin/route -A inet6 add <prefixtoroute2> dev sit2
-
-# /sbin/ifconfig sit0 tunnel <ipv4addressofforeigntunnel3>
-# /sbin/ifconfig sit3 up
-# /sbin/route -A inet6 add <prefixtoroute3> dev sit3
9.3.1.3. Using "route" only
# /sbin/ifconfig sit0 up
-
-# /sbin/route -A inet6 add <prefixtoroute1> gw
-¬ ::<ipv4addressofforeigntunnel1> dev sit0
-# /sbin/route -A inet6 add <prefixtoroute2> gw
-¬ ::<ipv4addressofforeigntunnel2> dev sit0
-# /sbin/route -A inet6 add <prefixtoroute3> gw
-¬ ::<ipv4addressofforeigntunnel3> dev sit0
9.3.2. Removing point-to-point tunnels
9.3.2.1. Using "ip"
# /sbin/ip tunnel del <device>
# /sbin/ip -6 route del <prefixtoroute1> dev sit1
-# /sbin/ip link set sit1 down
-# /sbin/ip tunnel del sit1
-
-# /sbin/ip -6 route del <prefixtoroute2> dev sit2
-# /sbin/ip link set sit2 down
-# /sbin/ip tunnel del sit2
-
-# /sbin/ip -6 route del <prefixtoroute3> dev sit3
-# /sbin/ip link set sit3 down
-# /sbin/ip tunnel del sit3
9.3.2.2. Using "ifconfig" and "route" (deprecated because not very funny)
# /sbin/route -A inet6 del <prefixtoroute3> dev sit3
-# /sbin/ifconfig sit3 down
-
-# /sbin/route -A inet6 del <prefixtoroute2> dev sit2
-# /sbin/ifconfig sit2 down
-
-# /sbin/route -A inet6 add <prefixtoroute1> dev sit1
-# /sbin/ifconfig sit1 down
-
-# /sbin/ifconfig sit0 down
9.3.2.3. Using "route"
# /sbin/route -A inet6 del <prefixtoroute1> gw
-¬ ::<ipv4addressofforeigntunnel1> dev sit0
-# /sbin/route -A inet6 del <prefixtoroute2> gw
-¬ ::<ipv4addressofforeigntunnel2> dev sit0
-# /sbin/route -A inet6 del <prefixtoroute3> gw
-¬ ::<ipv4addressofforeigntunnel3> dev sit0
-
-# /sbin/ifconfig sit0 down
9.3.3. Numbered point-to-point tunnels
9.4. Setup of 6to4 tunnels
9.4.1. Add a 6to4 tunnel
1.2.3.4
2002:0102:0304::
2002:0102:0304::1
ipv4="1.2.3.4"; printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "`
9.4.1.1. Using "ip" and a dedicated tunnel device
# /sbin/ip tunnel add tun6to4 mode sit ttl <ttldefault> remote any local
-¬ <localipv4address>
# /sbin/ip link set dev tun6to4 up
# /sbin/ip -6 addr add <local6to4address>/16 dev tun6to4
# /sbin/ip -6 route add default via ::192.88.99.1 dev tun6to4 metric 1
# /sbin/ip -6 route add default via 2002:c058:6301::1 dev tun6to4 metric 1
9.4.1.2. Using "ifconfig" and "route" and generic tunnel device “sit0” (deprecated)
# /sbin/ifconfig sit0 up
# /sbin/ifconfig sit0 add <local6to4address>/16
# /sbin/route -A inet6 add default gw ::192.88.99.1 dev sit0
9.4.2. Remove a 6to4 tunnel
9.4.2.1. Using "ip" and a dedicated tunnel device
# /sbin/ip -6 route flush dev tun6to4
# /sbin/ip link set dev tun6to4 down
# /sbin/ip tunnel del tun6to4
9.4.2.2. Using “ifconfig” and “route” and generic tunnel device “sit0” (deprecated)
# /sbin/route -A inet6 del default gw ::192.88.99.1 dev sit0
# /sbin/ifconfig sit0 del <local6to4address>/16
# /sbin/ifconfig sit0 down
Chapter 10. Configuring IPv4-in-IPv6 tunnels
10.1. Displaying existing tunnels
# /sbin/ip -6 tunnel show [<device>]
# /sbin/ip -6 tunnel show mode any
-ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00
-¬ flowlabel 0x00000 (flowinfo 0x00000000)
-ip6tnl1: ip/ipv6 remote fd00:0:0:2::a local fd00:0:0:2::1 dev eth1 encaplimit 4
-¬ hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)
10.2. Setup of point-to-point tunnel
# /sbin/ip tunnel add <device> mode ip4ip6 remote <ipv6addressofforeigntunnel>
-¬ local <ipv6addresslocal>
# /sbin/ip -6 tunnel add ip6tnl1 mode ip4ip6 remote
-¬ <ipv6addressofforeigntunnel1> local <ipv6addresslocal>
-# /sbin/ip link set dev ip6tnl1 up
-# /sbin/ip -6 route add <prefixtoroute1> dev ip6tnl1 metric 1
-
-# /sbin/ip -6 tunnel add ip6tnl2 mode ip4ip6 remote
-¬ <ipv6addressofforeigntunnel2> local <ipv6addresslocal>
-# /sbin/ip link set dev ip6tnl2 up
-# /sbin/ip -6 route add <prefixtoroute2> dev ip6tnl2 metric 1
-
-# /sbin/ip -6 tunnel add ip6tnl3 mode ip4ip6 remote
-¬ <ipv6addressofforeigntunnel3> local <ipv6addresslocal>
-# /sbin/ip link set dev ip6tnl3 up
-# /sbin/ip -6 route add <prefixtoroute3> dev ip6tnl3 metric 1
10.3. Removing point-to-point tunnels
# /sbin/ip -6 tunnel del <device>
# /sbin/ip -6 route del <prefixtoroute1> dev ip6tnl1
-# /sbin/ip link set ip6tnl1 down
-# /sbin/ip -6 tunnel del ip6tnl1
-
-# /sbin/ip -6 route del <prefixtoroute2> dev ip6tnl2
-# /sbin/ip link set ip6tnl2 down
-# /sbin/ip -6 tunnel del ip6tnl2
-
-# /sbin/ip -6 route del <prefixtoroute3> dev ip6tnl3
-# /sbin/ip link set ip6tnl3 down
-# /sbin/ip -6 tunnel del ip6tnl3
Chapter 11. Kernel settings in /proc-filesystem
11.1. How to access the /proc-filesystem
11.1.1. Using “cat” and “echo”
CONFIG_PROC_FS=y
# mount | grep "type proc"
-none on /proc type proc (rw)
11.1.1.1. Retrieving a value
# cat /proc/sys/net/ipv6/conf/all/forwarding
-0
11.1.1.2. Setting a value
# echo "1" >/proc/sys/net/ipv6/conf/all/forwarding
11.1.2. Using “sysctl”
CONFIG_SYSCTL=y
11.1.2.1. Retrieving a value
# sysctl net.ipv6.conf.all.forwarding
-net.ipv6.conf.all.forwarding = 0
11.1.2.2. Setting a value
# sysctl -w net.ipv6.conf.all.forwarding=1
-net.ipv6.conf.all.forwarding = 1
# sysctl -w net.ipv4.ip_local_port_range="32768 61000"
-net.ipv4.ip_local_port_range = 32768 61000
11.1.2.3. Additionals
11.1.3. Values found in /proc-filesystems
11.2. Entries in /proc/sys/net/ipv6/
11.2.1. conf/default/*
11.2.2. conf/all/*
11.2.2.1. conf/all/forwarding
11.2.3. conf/interface/*
11.2.3.1. accept_ra
11.2.3.2. accept_redirects
11.2.3.3. autoconf
11.2.3.4. dad_transmits
11.2.3.5. forwarding
11.2.3.8. router_solicitation_delay
11.2.3.9. router_solicitation_interval
11.2.3.10. router_solicitations
11.2.4. neigh/default/*
11.2.4.3. gc_thresh3
ZEBRA: netlink-listen error: No buffer space available, type=RTM_NEWROUTE(24),
-¬ seq=426, pid=0
11.3. IPv6-related entries in /proc/sys/net/ipv4/
11.3.3. icmp_*
11.4. IPv6-related entries in /proc/net/
11.4.1. if_inet6
# cat /proc/net/if_inet6
-00000000000000000000000000000001 01 80 10 80 lo
-+------------------------------+ ++ ++ ++ ++ ++
-| | | | | |
-1 2 3 4 5 6
11.4.2. ipv6_route
# cat /proc/net/ipv6_route
-00000000000000000000000000000000 00 00000000000000000000000000000000 00
-+------------------------------+ ++ +------------------------------+ ++
-| | | |
-1 2 3 4
-
-¬ 00000000000000000000000000000000 ffffffff 00000001 00000001 00200200 lo
-¬ +------------------------------+ +------+ +------+ +------+ +------+ ++
-¬ | | | | | |
-¬ 5 6 7 8 9 10
11.4.3. sockstat6
# cat /proc/net/sockstat6
-TCP6: inuse 7
-UDP6: inuse 2
-RAW6: inuse 1
-FRAG6: inuse 0 memory 0
11.4.10. snmp6
Chapter 13. Address Resolver & Selection
Address Resolver & Destination Address Selection
$ dig +short aaaa st1.bieringer.de
-2001:4dd0:ff00:834::2
-2a01:238:423d:8800:85b3:9e6b:3019:8909
precedence ::1/128 50 # default
-precedence ::/0 40 # default
-precedence 2002::/16 30 # default
-precedence ::/96 20 # default
-precedence ::ffff:0:0/96 10 # default
-precedence 2001:4dd0:ff00:834::/64 80 # dst-A
-precedence 2a01:238:423d:8800::/64 90 # dst-B
$ telnet st1.bieringer.de
-Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B)
-...
-Trying 2001:4dd0:ff00:834::2... (dst-A)
-...
precedence 2001:4dd0:ff00:834::/64 90 # dst-A ex 80
-precedence 2a01:238:423d:8800::/64 80 # dst-B ex 90
$ telnet st1.bieringer.de
-Trying 2001:4dd0:ff00:834::2... (dst-A)
-...
-Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B)
-...
Source Address Selection
Source Address Selection with “ip addrlabel”
# ip addrlabel
-prefix ::1/128 label 0
-prefix ::/96 label 3
-prefix ::ffff:0.0.0.0/96 label 4
-prefix 2001::/32 label 6
-prefix 2001:10::/28 label 7
-prefix 2002::/16 label 2
-prefix fc00::/7 label 5
-prefix ::/0 label 1
# ip -6 addr show dev eth1 | grep -w inet6 |grep -w global
- inet6 2001:6f8:12d8:2:5054:ff:fefb:6582/64 scope global dynamic
- inet6 2001:6f8:900:8cbc:5054:ff:fefb:6582/64 scope global dynamic
$ telnet st1.bieringer.de
-Trying 2001:4dd0:ff00:834::2... (dst-A)
-...
-Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B)
-...
IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.37762 > 2001:4dd0:ff00:834::2.telnet: (src-A -> dst-A)
-IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.45754 > 2a01:238:423d:8800:85b3:9e6b:3019:8909.telnet: (src-A -> dst-B)
# ip addrlabel add prefix 2001:6f8:12d8:2::/64 label 200
-# ip addrlabel add prefix 2001:6f8:900:8cbc::/64 label 300
-# ip addrlabel add prefix 2001:4dd0:ff00:834::/64 label 200
-# ip addrlabel add prefix 2a01:238:423d:8800::/64 label 300
# ip addrlabel
-prefix ::1/128 label 0
-prefix ::/96 label 3
-prefix ::ffff:0.0.0.0/96 label 4
-prefix 2a01:238:423d:8800::/64 label 300 # dst-B
-prefix 2001:4dd0:ff00:834::/64 label 200 # dst-A
-prefix 2001:6f8:900:8cbc::/64 label 300 # src-B
-prefix 2001:6f8:12d8:2::/64 label 200 # src-A
-prefix 2001::/32 label 6
-prefix 2001:10::/28 label 7
-prefix 2002::/16 label 2
-prefix fc00::/7 label 5
-prefix ::/0 label 1
$ telnet st1.bieringer.de
-Trying 2001:4dd0:ff00:834::2... (dst-A)
-...
-Trying 2a01:238:423d:8800:85b3:9e6b:3019:8909... (dst-B)
-...
IP6 2001:6f8:12d8:2:5054:ff:fefb:6582.37765 > 2001:4dd0:ff00:834::2.telnet: (src-A -> dst-A)
-IP6 2001:6f8:900:8cbc:5054:ff:fefb:6582.39632 > 2a01:238:423d:8800:85b3:9e6b:3019:8909.telnet: (src-B -> dst-B)
Chapter 14. Network debugging
14.1. Server socket binding
14.1.1. Using “netstat” for server socket binding check
# netstat -nlptu
-Active Internet connections (only servers)
-Proto Recv-Q Send-Q Local Address Foreign Address State
-¬ PID/Program name
-tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN
-¬ 1258/rpc.statd
-tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN
-¬ 1502/rpc.mountd
-tcp 0 0 0.0.0.0:515 0.0.0.0:* LISTEN
-¬ 22433/lpd Waiting
-tcp 0 0 1.2.3.1:139 0.0.0.0:* LISTEN
-¬ 1746/smbd
-tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
-¬ 1230/portmap
-tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
-¬ 3551/X
-tcp 0 0 1.2.3.1:8081 0.0.0.0:* LISTEN
-¬ 18735/junkbuster
-tcp 0 0 1.2.3.1:3128 0.0.0.0:* LISTEN
-¬ 18822/(squid)
-tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
-¬ 30734/named
-tcp 0 0 ::ffff:1.2.3.1:993 :::* LISTEN
-¬ 6742/xinetd-ipv6
-tcp 0 0 :::13 :::* LISTEN
-¬ 6742/xinetd-ipv6
-tcp 0 0 ::ffff:1.2.3.1:143 :::* LISTEN
-¬ 6742/xinetd-ipv6
-tcp 0 0 :::53 :::* LISTEN
-¬ 30734/named
-tcp 0 0 :::22 :::* LISTEN
-¬ 1410/sshd
-tcp 0 0 :::6010 :::* LISTEN
-¬ 13237/sshd
-udp 0 0 0.0.0.0:32768 0.0.0.0:*
-¬ 1258/rpc.statd
-udp 0 0 0.0.0.0:2049 0.0.0.0:*
-¬ -
-udp 0 0 0.0.0.0:32770 0.0.0.0:*
-¬ 1502/rpc.mountd
-udp 0 0 0.0.0.0:32771 0.0.0.0:*
-¬ -
-udp 0 0 1.2.3.1:137 0.0.0.0:*
-¬ 1751/nmbd
-udp 0 0 0.0.0.0:137 0.0.0.0:*
-¬ 1751/nmbd
-udp 0 0 1.2.3.1:138 0.0.0.0:*
-¬ 1751/nmbd
-udp 0 0 0.0.0.0:138 0.0.0.0:*
-¬ 1751/nmbd
-udp 0 0 0.0.0.0:33044 0.0.0.0:*
-¬ 30734/named
-udp 0 0 1.2.3.1:53 0.0.0.0:*
-¬ 30734/named
-udp 0 0 127.0.0.1:53 0.0.0.0:*
-¬ 30734/named
-udp 0 0 0.0.0.0:67 0.0.0.0:*
-¬ 1530/dhcpd
-udp 0 0 0.0.0.0:67 0.0.0.0:*
-¬ 1530/dhcpd
-udp 0 0 0.0.0.0:32858 0.0.0.0:*
-¬ 18822/(squid)
-udp 0 0 0.0.0.0:4827 0.0.0.0:*
-¬ 18822/(squid)
-udp 0 0 0.0.0.0:111 0.0.0.0:*
-¬ 1230/portmap
-udp 0 0 :::53 :::*
-¬ 30734/named
14.2. Examples for tcpdump packet dumps
14.2.1. Router discovery
14.2.1.1. Router advertisement
15:43:49.484751 fe80::212:34ff:fe12:3450 > ff02::1: icmp6: router
-¬ advertisement(chlim=64, router_ltime=30, reachable_time=0,
-¬ retrans_time=0)(prefix info: AR valid_ltime=30, preffered_ltime=20,
-¬ prefix=2002:0102:0304:1::/64)(prefix info: LAR valid_ltime=2592000,
-¬ preffered_ltime=604800, prefix=2001:0db8:0:1::/64)(src lladdr:
-¬ 0:12:34:12:34:50) (len 88, hlim 255)
14.2.1.2. Router solicitation
15:44:21.152646 fe80::212:34ff:fe12:3456 > ff02::2: icmp6: router solicitation
-¬ (src lladdr: 0:12:34:12:34:56) (len 16, hlim 255)
14.2.2. Neighbor discovery
14.2.2.1. Neighbor discovery solicitation for duplicate address detection
15:44:17.712338 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has
-¬ fe80::212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim 255)
15:44:21.905596 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has
-¬ 2002:0102:0304:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32,
-¬ hlim 255)
15:44:22.304028 :: > ff02::1:ff12:3456: icmp6: neighbor sol: who has
-¬ 2001:0db8:0:1:212:34ff:fe12:3456(src lladdr: 0:12:34:12:34:56) (len 32, hlim
-¬ 255)
14.2.2.2. Neighbor discovery solicitation for looking for host or gateway
13:07:47.664538 2002:0102:0304:1:2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6:
-¬ neighbor sol: who has 2001:0db8:0:1::10(src lladdr: 0:e0:18:90:92:5) (len 32,
-¬ hlim 255)
13:11:20.870070 fe80::2e0:18ff:fe90:9205 > ff02::1:ff00:10: icmp6: neighbor
-¬ sol: who has fe80::10(src lladdr: 0:e0:18:90:92:5) (len 32, hlim 255)
Chapter 15. Support for persistent IPv6 configuration in Linux distributions
15.1. Red Hat Linux and “clones”
15.1.1. Test for IPv6 support of network configuration scripts
/etc/sysconfig/network-scripts/network-functions-ipv6
# test -f /etc/sysconfig/network-scripts/network-functions-ipv6 && echo "Main
-¬ IPv6 script library exists"
# source /etc/sysconfig/network-scripts/network-functions-ipv6 &&
-¬ getversion_ipv6_functions
-20011124
15.1.2. Short hint for enabling IPv6 on current RHL 7.1, 7.2, 7.3, ...
# modprobe -c | grep net-pf-10
-alias net-pf-10 off
NETWORKING_IPV6=yes
# service network restart
# modprobe -c | grep ipv6
-alias net-pf-10 ipv6
15.2. SuSE Linux
15.2.2. SuSE Linux 8.0
15.2.2.1. IPv6 address configuration
IP6ADDR="<ipv6-address>/<prefix>"
15.2.3. SuSE Linux 8.1
15.2.3.1. IPv6 address configuration
IPADDR="<ipv6-address>/<prefix>"
15.3. Debian Linux
iface eth0 inet6 static
- pre-up modprobe ipv6
- address 2001:0db8:1234:5::1:1
- # To suppress completely autoconfiguration:
- # up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
- netmask 64
- # The router is autoconfigured and has no fixed address.
- # It is magically
- # found. (/proc/sys/net/ipv6/conf/all/accept_ra). Otherwise:
- #gateway 2001:0db8:1234:5::1
# ifup --force eth0
15.3.1. Further information
Chapter 16. Auto-configuration
16.1. Stateless auto-configuration out-of-the-box
# ip -6 addr show dev eth0 scope link
-2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qlen1000
- inet6 fe80::211:d8ff:fe6b:f0f5/64 scope link
- valid_lft forever preferred_lft forever
16.2. Stateless auto-configuration using Router Advertisement Daemon (radvd)
16.3. Dynamic Host Configuration Protocol v6 (DHCPv6)
Chapter 17. Mobility
17.1. Common information
17.1.1. Node Mobility
17.1.2. Network Mobility
17.1.3. Links
Chapter 18. Firewalling
18.1. Firewalling using netfilter6
18.2. Preparation
18.2.1. Get sources
18.2.2. Extract sources
# cd /path/to/src
# tar z|jxf kernel-version.tar.gz|bz2
-# mv linux linux-version-iptables-version+IPv6
# tar z|jxf iptables-version.tar.gz|bz2
18.2.3. Apply latest iptables/IPv6-related patches to kernel source
# cd iptables-version
# make pending-patches KERNEL_DIR=/path/to/src/linux-version-iptables-version/
# make patch-o-matic KERNEL_DIR=/path/to/src/linux-version-iptables-version/
# make print-extensions
-Extensions found: IPv6:owner IPv6:limit IPv6:mac IPv6:multiport
18.2.4. Configure, build and install new kernel
# cd /path/to/src/linux-version-iptables-version/
- EXTRAVERSION =
-+ EXTRAVERSION = -iptables-version+IPv6-try
Code maturity level options
- Prompt for development and/or incomplete code/drivers : yes
- Networking options
- Network packet filtering: yes
- The IPv6 protocol: module
- IPv6: Netfilter Configuration
- IP6 tables support: module
- All new options like following:
- limit match support: module
- MAC address match support: module
- Multiple port match support: module
- Owner match support: module
- netfilter MARK match support: module
- Aggregated address check: module
- Packet filtering: module
- REJECT target support: module
- LOG target support: module
- Packet mangling: module
- MARK target support: module
18.2.5. Rebuild and install binaries of iptables
# mv /usr/src/linux /usr/src/linux.old
# ln -s /path/to/src/linux-version-iptables-version /usr/src/linux
# rpm --rebuild /path/to/SRPMS/iptables-version-release.src.rpm
# rpm -Fhv /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm
# rpm -ihv /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm
# rpm -ihv --nodeps /path/to/RPMS/cpu/iptables*-version-release.cpu.rpm
# ln -s /lib/iptables/ /usr/lib/iptables
18.3. Usage of ip6tables
18.3.1. Check for support
# modprobe ip6_tables
# [ ! -f /proc/net/ip6_tables_names ] && echo "Current kernel doesn't support
-¬ 'ip6tables' firewalling (IPv6)!"
18.3.2. Learn how to use ip6tables
18.3.2.1. List all IPv6 netfilter entries
# ip6tables -L
# ip6tables -n -v --line-numbers -L
18.3.2.3. Insert a log rule at the input filter with options
# ip6tables --table filter --append INPUT -j LOG --log-prefix "INPUT:"
-¬ --log-level 7
18.3.2.6. Enable connection tracking
# ip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
18.3.2.7. Allow ICMPv6
# ip6tables -A INPUT -i sit+ -p icmpv6 -j ACCEPT
# ip6tables -A OUTPUT -o sit+ -p icmpv6 -j ACCEPT
# ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT
18.3.2.8. Rate-limiting
# ip6tables -A INPUT --protocol icmpv6 --icmpv6-type echo-request
-¬ -j ACCEPT --match limit --limit 30/minute
18.3.2.9. Allow incoming SSH
# ip6tables -A INPUT -i sit+ -p tcp -s 2001:0db8:100::1/128 --sport 512:65535
-¬ --dport 22 -j ACCEPT
# ip6tables -A OUTPUT -o sit+ -p tcp -d 2001:0db8:100::1/128 --dport 512:65535
-¬ --sport 22 ! --syn -j ACCEPT
18.3.2.10. Enable tunneled IPv6-in-IPv4
# iptables -A INPUT -i ppp0 -p ipv6 -j ACCEPT
# iptables -A OUTPUT -o ppp0 -p ipv6 -j ACCEPT
# iptables -A INPUT -i ppp0 -p ipv6 -s 192.0.2.2 -j ACCEPT
# iptables -A OUTPUT -o ppp0 -p ipv6 -d 192.0.2.2 -j ACCEPT
18.3.2.11. Protection against incoming TCP connection requests
# ip6tables -I INPUT -i sit+ -p tcp --syn -j DROP
# ip6tables -I FORWARD -i sit+ -p tcp --syn -j DROP
18.3.2.12. Protection against incoming UDP connection requests
# ip6tables -I INPUT -i sit+ -p udp ! --dport 32768:60999 -j DROP
# ip6tables -I FORWARD -i sit+ -p udp ! --dport 32768:60999 -j DROP
18.3.3. Examples
18.3.3.1. Simple example for Fedora
File: /etc/sysconfig/ip6tables
-
-*filter :INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
-:RH-Firewall-1-INPUT - [0:0]
--A INPUT -j RH-Firewall-1-INPUT
--A FORWARD -j RH-Firewall-1-INPUT
--A RH-Firewall-1-INPUT -i lo -j ACCEPT
--A RH-Firewall-1-INPUT -p icmpv6 -j ACCEPT
--A RH-Firewall-1-INPUT -p 50 -j ACCEPT
--A RH-Firewall-1-INPUT -p 51 -j ACCEPT
--A RH-Firewall-1-INPUT -p udp --dport 5353 -d ff02::fb -j ACCEPT
--A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
--A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-adm-prohibited
-COMMIT
File: /etc/sysconfig/iptables
-
-*filter :INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
-:RH-Firewall-1-INPUT - [0:0]
--A INPUT -j RH-Firewall-1-INPUT
--A FORWARD -j RH-Firewall-1-INPUT
--A RH-Firewall-1-INPUT -i lo -j ACCEPT
--A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
--A RH-Firewall-1-INPUT -p 50 -j ACCEPT
--A RH-Firewall-1-INPUT -p 51 -j ACCEPT
--A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
--A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
--A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
-COMMIT
# service iptables start
-# service ip6tables start
# chkconfig iptables on
-# chkconfig ip6tables on
18.3.3.2. Sophisticated example
# ip6tables -n -v -L
-Chain INPUT (policy DROP 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
- 0 0 extIN all sit+ * ::/0 ::/0
- 4 384 intIN all eth0 * ::/0 ::/0
- 0 0 ACCEPT all * * ::1/128 ::1/128
- 0 0 ACCEPT all lo * ::/0 ::/0
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `INPUT-default:'
- 0 0 DROP all * * ::/0 ::/0
-
-Chain FORWARD (policy DROP 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 int2ext all eth0 sit+ ::/0 ::/0
- 0 0 ext2int all sit+ eth0 ::/0 ::/0
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `FORWARD-default:'
- 0 0 DROP all * * ::/0 ::/0
-
-Chain OUTPUT (policy DROP 0 packets, 0 bytes)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 extOUT all * sit+ ::/0 ::/0
- 4 384 intOUT all * eth0 ::/0 ::/0
- 0 0 ACCEPT all * * ::1/128 ::1/128
- 0 0 ACCEPT all * lo ::/0 ::/0
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `OUTPUT-default:'
- 0 0 DROP all * * ::/0 ::/0
-
-Chain ext2int (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT icmpv6 * * ::/0 ::/0
- 0 0 ACCEPT tcp * * ::/0 ::/0
-¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `ext2int-default:'
- 0 0 DROP tcp * * ::/0 ::/0
- 0 0 DROP udp * * ::/0 ::/0
- 0 0 DROP all * * ::/0 ::/0
-
-Chain extIN (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT tcp * * 3ffe:400:100::1/128 ::/0
-¬ tcp spts:512:65535 dpt:22
- 0 0 ACCEPT tcp * * 3ffe:400:100::2/128 ::/0
-¬ tcp spts:512:65535 dpt:22
- 0 0 ACCEPT icmpv6 * * ::/0 ::/0
- 0 0 ACCEPT tcp * * ::/0 ::/0
-¬ tcp spts:1:65535 dpts:1024:65535 flags:!0x16/0x02
- 0 0 ACCEPT udp * * ::/0 ::/0
-¬ udp spts:1:65535 dpts:1024:65535
- 0 0 LOG all * * ::/0 ::/0
-¬ limit: avg 5/min burst 5 LOG flags 0 level 7 prefix `extIN-default:'
- 0 0 DROP all * * ::/0 ::/0
-
-Chain extOUT (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT tcp * * ::/0
-¬ 2001:0db8:100::1/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02
- 0 0 ACCEPT tcp * * ::/0
-¬ 2001:0db8:100::2/128tcp spt:22 dpts:512:65535 flags:!0x16/0x02
- 0 0 ACCEPT icmpv6 * * ::/0 ::/0
- 0 0 ACCEPT tcp * * ::/0 ::/0
-¬ tcp spts:1024:65535 dpts:1:65535
- 0 0 ACCEPT udp * * ::/0 ::/0
-¬ udp spts:1024:65535 dpts:1:65535
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `extOUT-default:'
- 0 0 DROP all * * ::/0 ::/0
-
-Chain int2ext (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT icmpv6 * * ::/0 ::/0
- 0 0 ACCEPT tcp * * ::/0 ::/0
-¬ tcp spts:1024:65535 dpts:1:65535
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `int2ext:'
- 0 0 DROP all * * ::/0 ::/0
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `int2ext-default:'
- 0 0 DROP tcp * * ::/0 ::/0
- 0 0 DROP udp * * ::/0 ::/0
- 0 0 DROP all * * ::/0 ::/0
-
-Chain intIN (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT all * * ::/0
-¬ fe80::/ffc0::
- 4 384 ACCEPT all * * ::/0 ff02::/16
-
-Chain intOUT (1 references)
- pkts bytes target prot opt in out source destination
-¬
- 0 0 ACCEPT all * * ::/0
-¬ fe80::/ffc0::
- 4 384 ACCEPT all * * ::/0 ff02::/16
- 0 0 LOG all * * ::/0 ::/0
-¬ LOG flags 0 level 7 prefix `intOUT-default:'
- 0 0 DROP all * * ::/0 ::/0
18.4. Network Address Translation (NAT) using netfilter6
18.4.1. IPv6 Masquerading
# ip6tables -t nat -A POSTROUTING -o sixxs -s fec0::/64 -j MASQUERADE
18.4.2. IPv6 Destination NAT
# ip6tables -t nat -A PREROUTING -d 2001:db8:0:1:5054:ff:fe01:2345 -i sixxs -j DNAT --to-destination fec0::5054:ff:fe01:2345
18.4.3. IPv6 Port Forwarding
# ip6tables -t nat -A PREROUTING -i sixxs -p tcp --dport 8080 -j DNAT --to-destination [fec0::1234]:80
18.5. Firewalling using nftables
IPv4-Packet --> table "ip" --> table "inet" --> further checks
-IPv6-Packet --> table "ip6" --> table "inet" --> further checks
18.5.1. Preparation for nftables usage
18.5.2. Basic nftables configuration
# modprobe nf_tables
-# modprobe nf_tables_ipv4
-# modprobe nf_tables_ipv6
-# modprobe nf_tables_inet
# iptables -F
-# ip6tables -F
# nft add table inet filter
# nft add chain inet filter input { type filter hook input priority 0 \; }
18.5.3. Simple filter policy with nftables using only table “inet”
18.5.3.1. Configuration
# nft add rule inet filter input ct state established,related counter accept
# nft add rule inet filter input meta nfproto ipv4 icmp type { echo-request } counter accept
-# nft add rule inet filter input meta nfproto ipv6 icmpv6 type echo-request counter accept
# nft add rule inet filter input meta nfproto ipv6
-¬ icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} ip6 hoplimit 1 accept
-# nft add rule inet filter input meta nfproto ipv6
-¬ icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} ip6 hoplimit 255 counter accept
# nft add rule inet filter input tcp dport 22 ct state new tcp flags \& \(syn \| ack\) == syn counter accept
# nft add rule inet filter input tcp dport 0-65535 reject
-# nft add rule inet filter input udp dport 0-65535 counter drop
-# nft add rule inet filter input counter drop
18.5.3.2. Result
table inet filter {
- chain input {
- type filter hook input priority 0;
- ct state established,related counter packets 0 bytes 0 accept
- ip protocol icmp icmp type { echo-request} counter packets 0 bytes 0 accept
- ip6 nexthdr ipv6-icmp icmpv6 type echo-request counter packets 0 bytes 0 accept
- ip6 nexthdr ipv6-icmp ip6 hoplimit 1 icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} accept
- ip6 nexthdr ipv6-icmp ip6 hoplimit 255 icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} accept
- tcp dport ssh ct state new tcp flags & (syn | ack) == syn counter packets 0 bytes 0 accept
- tcp dport >= 0 tcp dport <= 65535 counter packets 0 bytes 0 reject
- udp dport >= 0 udp dport <= 65535 counter packets 0 bytes 0 drop
- log prefix counter packets 0 bytes 0 drop
- }
-}
18.5.3.3. Hints for logging
# modprobe xt_LOG
#*.emerg :omusrmsg:*
# nft add rule inet filter input tcp dport 22 ct state new tcp flags \& \(syn \| ack\) == syn log prefix \"inet/input/accept: \" counter accept
18.5.4. Filter policy with nftables using tables “ip”, “ip6” and “inet”
# for table in ip ip6 inet; do nft list table $table filter; done
-table ip filter {
- chain input {
- type filter hook input priority 0;
- ct state established,related counter packets 241 bytes 25193 accept
- counter packets 2 bytes 120 mark 0x00000100 accept
- icmp type { echo-request} counter packets 0 bytes 0 meta mark set 0x00000100 accept
- }
-}
-table ip6 filter {
- chain input {
- type filter hook input priority 0;
- ct state established,related counter packets 14 bytes 4077 accept
- counter packets 4 bytes 408 mark 0x00000100 accept
- icmpv6 type echo-request counter packets 1 bytes 104 meta mark set 0x00000100
- icmpv6 type { nd-neighbor-advert, nd-neighbor-solicit, nd-router-advert} counter packets 2 bytes 224 meta mark set 0x00000100 accept
- }
-}
-table inet filter {
- chain input {
- type filter hook input priority 0;
- ct state established,related counter packets 307 bytes 31974 accept
- counter packets 6 bytes 528 mark 0x00000100 accept
- tcp dport ssh ct state new tcp flags & (syn | ack) == syn log prefix "inet/input/accept: " meta mark set 0x00000100 counter packets 3 bytes 200 accept
- log prefix "inet/input/reject: " counter packets 0 bytes 0 reject
- }
-}
Chapter 19. Security
19.1. Node security
19.2. Access limitations
19.3. IPv6 security auditing
19.3.1. Legal issues
19.3.2. Security auditing using IPv6-enabled netcat
# nc6 ::1 daytime
-13 JUL 2002 11:22:22 CEST
19.3.3. Security auditing using IPv6-enabled nmap
# nmap -6 -sT ::1
-Starting nmap V. 3.10ALPHA3 ( www.insecure.org/nmap/ )
-Interesting ports on localhost6 (::1):
-(The 1600 ports scanned but not shown below are in state: closed)
-Port State Service
-22/tcp open ssh
-53/tcp open domain
-515/tcp open printer
-2401/tcp open cvspserver
-Nmap run completed -- 1 IP address (1 host up) scanned in 0.525 seconds
19.3.4. Security auditing using IPv6-enabled strobe
# ./strobe ::1 strobe 1.05 (c) 1995-1999 Julian Assange <proff@iq.org>.
-::1 2401 unassigned unknown
-::1 22 ssh Secure Shell - RSA encrypted rsh
-::1 515 printer spooler (lpd)
-::1 6010 unassigned unknown
-::1 53 domain Domain Name Server
19.3.5. Security auditing using online tools
19.3.6. Audit results
Chapter 20. Encryption and Authentication
20.1. Modes of using encryption and authentication
20.1.1. Transport mode
20.1.2. Tunnel mode
20.2. Support in kernel (ESP and AH)
20.2.1. Support in vanilla Linux kernel 2.4.x
20.2.2. Support in vanilla Linux kernel 2.6.x
20.3. Automatic key exchange (IKE)
20.3.1. IKE daemon “racoon”
20.3.1.1. Manipulation of the IPsec SA/SP database with the tool “setkey”
#!/sbin/setkey -f
-flush;
-spdflush;
-spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec esp/transport//require;
-spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec esp/transport//require;
#!/sbin/setkey -f
-flush;
-spdflush;
-spdadd 2001:db8:1:1::1 2001:db8:2:2::2 any -P out ipsec
-¬ esp/tunnel/2001:db8:1:1::1-2001:db8:2:2::2/require;
-spdadd 2001:db8:2:2::2 2001:db8:1:1::1 any -P in ipsec
-¬ esp/tunnel/2001:db8:2:2::2-2001:db8:1:1::1/require;
20.3.1.2. Configuration of the IKE daemon “racoon”
# Racoon IKE daemon configuration file.
-# See 'man racoon.conf' for a description of the format and entries.
-path include "/etc/racoon";
-path pre_shared_key "/etc/racoon/psk.txt";
-
-listen
-{
- isakmp 2001:db8:1:1::1;
-}
-
-remote 2001:db8:2:2::2
-{
- exchange_mode main;
- lifetime time 24 hour;
- proposal
- {
- encryption_algorithm 3des;
- hash_algorithm md5;
- authentication_method pre_shared_key;
- dh_group 2;
- }
-}
-
-# gateway-to-gateway
-sainfo address 2001:db8:1:1::1 any address 2001:db8:2:2::2 any
-{
- lifetime time 1 hour;
- encryption_algorithm 3des;
- authentication_algorithm hmac_md5;
- compression_algorithm deflate;
-}
-
-sainfo address 2001:db8:2:2::2 any address 2001:db8:1:1::1 any
-{
- lifetime time 1 hour;
- encryption_algorithm 3des;
- authentication_algorithm hmac_md5;
- compression_algorithm deflate;
-}
# file for pre-shared keys used for IKE authentication
-# format is: 'identifier' 'key'
-
-2001:db8:2:2::2 verysecret
20.3.1.3. Running IPsec with IKE daemon “racoon”
# racoon -F -v -f /etc/racoon/racoon.conf
-Foreground mode.
-2005-01-01 20:30:15: INFO: @(#)ipsec-tools 0.3.3
-¬ (http://ipsec-tools.sourceforge.net)
-2005-01-01 20:30:15: INFO: @(#)This product linked
-¬ OpenSSL 0.9.7a Feb 19 2003 (http://www.openssl.org/)
-2005-01-01 20:30:15: INFO: 2001:db8:1:1::1[500] used as isakmp port (fd=7)
-2005-01-01 20:31:06: INFO: IPsec-SA request for 2001:db8:2:2::2
-¬ queued due to no phase1 found.
-2005-01-01 20:31:06: INFO: initiate new phase 1 negotiation:
-¬ 2001:db8:1:1::1[500]<=>2001:db8:2:2::2[500]
-2005-01-01 20:31:06: INFO: begin Identity Protection mode.
-2005-01-01 20:31:09: INFO: ISAKMP-SA established
-¬ 2001:db8:1:1::1[500]-2001:db8:2:2::2[500] spi:da3d3693289c9698:ac039a402b2db401
-2005-01-01 20:31:09: INFO: initiate new phase 2 negotiation:
-¬ 2001:6f8:900:94::2[0]<=>2001:db8:2:2::2[0]
-2005-01-01 20:31:10: INFO: IPsec-SA established:
-¬ ESP/Tunnel 2001:db8:2:2::2->2001:db8:1:1::1 spi=253935531(0xf22bfab)
-2005-01-01 20:31:10: INFO: IPsec-SA established:
-¬ ESP/Tunnel 2001:db8:1:1::1->2001:db8:2:2::2 spi=175002564(0xa6e53c4)
20:35:55.305707 2001:db8:1:1::1 > 2001:db8:2:2::2: ESP(spi=0x0a6e53c4,seq=0x3)
-20:35:55.537522 2001:db8:2:2::2 > 2001:db8:1:1::1: ESP(spi=0x0f22bfab,seq=0x3)
# setkey -D
-2001:db8:1:1::1 2001:db8:2:2::2
- esp mode=tunnel spi=175002564(0x0a6e53c4) reqid=0(0x00000000)
- E: 3des-cbc bd26bc45 aea0d249 ef9c6b89 7056080f 5d9fa49c 924e2edd
- A: hmac-md5 60c2c505 517dd8b7 c9609128 a5efc2db
- seq=0x00000000 replay=4 flags=0x00000000 state=mature
- created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005
- diff: 577(s) hard: 3600(s) soft: 2880(s)
- last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s)
- current: 540(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 3 hard: 0 soft: 0
- sadb_seq=1 pid=22358 refcnt=0
-2001:db8:2:2::2 2001:db8:1:1::1
- esp mode=tunnel spi=253935531(0x0f22bfab) reqid=0(0x00000000)
- E: 3des-cbc c1ddba65 83debd62 3f6683c1 20e747ac 933d203f 4777a7ce
- A: hmac-md5 3f957db9 9adddc8c 44e5739d 3f53ca0e
- seq=0x00000000 replay=4 flags=0x00000000 state=mature
- created: Jan 1 20:31:10 2005 current: Jan 1 20:40:47 2005
- diff: 577(s) hard: 3600(s) soft: 2880(s)
- last: Jan 1 20:35:05 2005 hard: 0(s) soft: 0(s)
- current: 312(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 3 hard: 0 soft: 0
- sadb_seq=0 pid=22358 refcnt=0
20.3.2. IKE daemon “pluto”
20.3.2.1. Configuration of the IKE daemon “pluto”
# /etc/ipsec.conf - Openswan IPsec configuration file
-#
-# Manual: ipsec.conf.5
-version 2.0 # conforms to second version of ipsec.conf specification
-
-# basic configuration
-config setup
- # Debug-logging controls: "none" for (almost) none, "all" for lots.
- # klipsdebug=none
- # plutodebug="control parsing"
-
-#Disable Opportunistic Encryption
-include /etc/ipsec.d/examples/no_oe.conf
-
-conn ipv6-p1-p2
- connaddrfamily=ipv6 # Important for IPv6, but no longer needed since StrongSwan 4
- left=2001:db8:1:1::1
- right=2001:db8:2:2::2
- authby=secret
- esp=aes128-sha1
- ike=aes128-sha-modp1024
- type=transport
- #type=tunnel
- compress=no
- #compress=yes
- auto=add
- #auto=up
2001:db8:1:1::1 2001:db8:2:2::2 : PSK "verysecret"
20.3.2.2. Running IPsec with IKE daemon “pluto”
# /etc/rc.d/init.d/ipsec start
# ipsec auto --up ipv6-peer1-peer2
-104 "ipv6-p1-p2" #1: STATE_MAIN_I1: initiate
-106 "ipv6-p1-p2" #1: STATE_MAIN_I2: sent MI2, expecting MR2
-108 "ipv6-p1-p2" #1: STATE_MAIN_I3: sent MI3, expecting MR3
-004 "ipv6-p1-p2" #1: STATE_MAIN_I4: ISAKMP SA established
-112 "ipv6-p1-p2" #2: STATE_QUICK_I1: initiate
-004 "ipv6-p1-p2" #2: STATE_QUICK_I2: sent QI2,
-¬ IPsec SA established {ESP=>0xa98b7710 <0xa51e1f22}
# setkey -D
-2001:db8:1:1::1 2001:db8:2:2::2
- esp mode=transport spi=2844489488(0xa98b7710) reqid=16385(0x00004001)
- E: aes-cbc 082ee274 2744bae5 7451da37 1162b483
- A: hmac-sha1 b7803753 757417da 477b1c1a 64070455 ab79082c
- seq=0x00000000 replay=64 flags=0x00000000 state=mature
- created: Jan 1 21:16:32 2005 current: Jan 1 21:22:20 2005
- diff: 348(s) hard: 0(s) soft: 0(s)
- last: hard: 0(s) soft: 0(s)
- current: 0(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 0 hard: 0 soft: 0
- sadb_seq=1 pid=23825 refcnt=0
-2001:db8:2:2::2 2001:db8:1:1::1
- esp mode=transport spi=2770214690(0xa51e1f22) reqid=16385(0x00004001)
- E: aes-cbc 6f59cc30 8d856056 65e07b76 552cac18
- A: hmac-sha1 c7c7d82b abfca8b1 5440021f e0c3b335 975b508b
- seq=0x00000000 replay=64 flags=0x00000000 state=mature
- created: Jan 1 21:16:31 2005 current: Jan 1 21:22:20 2005
- diff: 349(s) hard: 0(s) soft: 0(s)
- last: hard: 0(s) soft: 0(s)
- current: 0(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 0 hard: 0 soft: 0
- sadb_seq=0 pid=23825 refcnt=0
20.4. Additional informations:
# ip xfrm policy
-...
-
-# ip xfrm state
-...
Chapter 21. Quality of Service (QoS)
21.1. General
-------------->-------
- Queue 1 \
- --->--- ---->--------->--------->---------------
-Big pipe Queue 2 Queue 1 / Queue 2 / Queue 3 Thin Pipe
- --->---- ---->--------->--------->---------------
- Queue 3 /
--------------->-------
21.2. Linux QoS using “tc”
21.2.1. Example for a constant bitrate queuing
21.2.1.1. Root qdisc definition
# tc qdisc add dev eth1 root handle 1: cbq avpkt 1000 bandwidth 1000Mbit
21.2.1.2. QoS class definition
# tc class add dev eth1 parent 1: classid 1:1 cbq rate 1Mbit allot 1500 bounded
# tc class add dev eth1 parent 1: classid 1:2 cbq rate 50Mbit allot 1500 bounded
# tc class add dev eth1 parent 1: classid 1:3 cbq rate 10Mbit allot 1500 bounded
# tc class add dev eth1 parent 1: classid 1:4 cbq rate 200kbit allot 1500 bounded
21.2.1.3. QoS filter definition
# tc filter add dev eth1 parent 1: protocol ip u32 match ip protocol 6 0xff match ip dport 5001 0xffff flowid 1:1
# tc filter add dev eth1 parent 1: protocol ipv6 u32 match ip6 protocol 6 0xff match ip6 dport 5001 0xffff flowid 1:2
# tc filter add dev eth1 parent 1: protocol ipv6 u32 match ip6 flowlabel 12345 0x3ffff flowid 1:3
# tc filter add dev eth1 parent 1: protocol ipv6 handle 32 fw flowid 1:4
# ip6tables -A POSTROUTING -t mangle -p tcp --dport 5003 -j MARK --set-mark 32
21.2.1.4. Testing filter definitions using iperf
# iperf -V -s -p 5001
-# iperf -V -s -p 5002
-# iperf -V -s -p 5003
# iperf -V -c SERVER-IPv4 -p 5001 (expected: 1 MBit/s)
-# iperf -V -c SERVER-IPv6 -p 5001 (expected: 50 MBit/s)
-# iperf -V -c SERVER-IPv4 -p 5002 (expected: >> 50 MBit/s && <= 1000 MBit/s)
-# iperf -V -c SERVER-IPv6 -p 5002 (expected: >> 50 MBit/s && <= 1000 MBit/s)
-# iperf -V -c SERVER-IPv4 -p 5003 (expected: >> 50 MBit/s && <= 1000 MBit/s)
-# iperf -V -c SERVER-IPv6 -p 5003 (expected: 200 kBit/s)
Chapter 22. Hints for IPv6-enabled daemons
22.1. Berkeley Internet Name Domain (BIND) daemon “named”
22.1.1. Listening on IPv6 addresses
22.1.1.1. Enable BIND named for listening on IPv6 address
options {
- # sure other options here, too
- listen-on-v6 { any; };
-};
# netstat -lnptu |grep "named\W*$"
-tcp 0 0 :::53 :::* LISTEN 1234/named
-¬ # incoming TCP requests
-udp 0 0 1.2.3.4:53 0.0.0.0:* 1234/named
-¬ # incoming UDP requests to IPv4 1.2.3.4
-udp 0 0 127.0.0.1:53 0.0.0.0:* 1234/named
-¬ # incoming UDP requests to IPv4 localhost
-udp 0 0 0.0.0.0:32868 0.0.0.0:* 1234/named
-¬ # dynamic chosen port for outgoing queries
-udp 0 0 :::53 :::* 1234/named
-¬ # incoming UDP request to any IPv6
# dig localhost @::1
22.1.1.2. Disable BIND named for listening on IPv6 address
options {
- # sure other options here, too
- listen-on-v6 { none; };
-};
22.1.2. IPv6 enabled Access Control Lists (ACL)
acl internal-net {
- 127.0.0.1;
- 1.2.3.0/24;
- 2001:0db8:100::/56;
- ::1/128;
- ::ffff:1.2.3.4/128;
-};
-acl ns-internal-net {
- 1.2.3.4;
- 1.2.3.5;
- 2001:0db8:100::4/128;
- 2001:0db8:100::5/128;
-};
options {
- # sure other options here, too
- listen-on-v6 { none; };
- allow-query { internal-net; };
- allow-transfer { ns-internal-net; };
-};
22.1.3. Sending queries with dedicated IPv6 address
query-source-v6 address <ipv6address|*> port <port|*>;
22.1.4. Per zone defined dedicated IPv6 addresses
22.1.4.1. Transfer source address
transfer-source-v6 <ipv6addr|*> [port port];
22.1.4.2. Notify source address
notify-source-v6 <ipv6addr|*> [port port];
22.1.5. IPv6 DNS zone files examples
22.1.6. Serving IPv6 related DNS data
22.1.6.1. Current best practice
22.1.7. Checking IPv6-enabled connect
22.1.7.1. IPv6 connect, but denied by ACL
$ host -t aaaa www.6bone.net 2001:0db8:200:f101::1
-Using domain server:
-Name: 2001:0db8:200:f101::1
-Address: 2001:0db8:200:f101::1#53
-Aliases:
-
-Host www.6bone.net. not found: 5(REFUSED)
Jan 3 12:43:32 gate named[12347]: client
-¬ 2001:0db8:200:f101:212:34ff:fe12:3456#32770:
- query denied
22.1.7.2. Successful IPv6 connect
$ host -t aaaa www.6bone.net 2001:0db8:200:f101::1
-Using domain server:
-Name: 2001:0db8:200:f101::1
-Address: 2001:0db8:200:f101::1#53
-Aliases:
-
-www.6bone.net. is an alias for 6bone.net.
-6bone.net. has AAAA address 3ffe:b00:c18:1::10
22.2. Internet super daemon (xinetd)
# diff -u /etc/xinetd.d/daytime.orig /etc/xinetd.d/daytime
---- /etc/xinetd.d/daytime.orig Sun Dec 16 19:00:14 2001
-+++ /etc/xinetd.d/daytime Sun Dec 16 19:00:22 2001
-@@ -10,5 +10,5 @@
- protocol = tcp
- user = root
- wait = no
-- disable = yes
-+ disable = no
- }
# netstat -lnptu -A inet6 |grep "xinetd*"
-tcp 0 0 ::ffff:192.168.1.1:993 :::* LISTEN 12345/xinetd-ipv6
-tcp 0 0 :::13 :::* LISTEN 12345/xinetd-ipv6 <- service
-¬ daytime/tcp
-tcp 0 0 ::ffff:192.168.1.1:143 :::* LISTEN 12345/xinetd-ipv6
22.3. Webserver Apache2 (httpd2)
22.3.1. Listening on IPv6 addresses
22.3.1.1. Virtual host listen on an IPv6 address only
Listen [2001:0db8:100::1]:80
-<VirtualHost [2001:0db8:100::1]:80>
- ServerName ipv6only.yourdomain.yourtopleveldomain
- # ...sure more config lines
-</VirtualHost>
22.3.1.2. Virtual host listen on an IPv6 and on an IPv4 address
Listen [2001:0db8:100::2]:80
-Listen 1.2.3.4:80
-<VirtualHost [2001:0db8:100::2]:80 1.2.3.4:80>
- ServerName ipv6andipv4.yourdomain.yourtopleveldomain
- # ...sure more config lines
-</VirtualHost>
# netstat -lnptu |grep "httpd2\W*$"
-tcp 0 0 1.2.3.4:80 0.0.0.0:* LISTEN 12345/httpd2
-tcp 0 0 2001:0db8:100::1:80 :::* LISTEN 12345/httpd2
-tcp 0 0 2001:0db8:100::2:80 :::* LISTEN 12345/httpd2
22.3.1.3. Additional notes
22.4. Router Advertisement Daemon (radvd)
22.4.1. Configuring radvd
22.4.1.1. Simple configuration
interface eth0 {
- AdvSendAdvert on;
- MinRtrAdvInterval 3;
- MaxRtrAdvInterval 10;
- prefix 2001:0db8:0100:f101::/64 {
- AdvOnLink on;
- AdvAutonomous on;
- AdvRouterAddr on;
- };
-};
# ip -6 addr show eth0
-3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
- inet6 2001:0db8:100:f101:2e0:12ff:fe34:1234/64 scope global dynamic
- valid_lft 2591992sec preferred_lft 604792sec
- inet6 fe80::2e0:12ff:fe34:1234/10 scope link
22.4.1.2. Special 6to4 configuration
interface eth0 {
- AdvSendAdvert on;
- MinRtrAdvInterval 3;
- MaxRtrAdvInterval 10;
- prefix 0:0:0:f101::/64 {
- AdvOnLink off;
- AdvAutonomous on;
- AdvRouterAddr on;
- Base6to4Interface ppp0;
- AdvPreferredLifetime 20;
- AdvValidLifetime 30;
- };
-};
# /sbin/ip -6 addr show eth0
-3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
- inet6 2002:0102:0304:f101:2e0:12ff:fe34:1234/64 scope global dynamic
- valid_lft 22sec preferred_lft 12sec
- inet6 fe80::2e0:12ff:fe34:1234/10 scope link
# /sbin/ip -6 route add 2002:0102:0304:f101::/64 dev eth0 metric 1
22.4.2. Debugging
# radvdump
-Router advertisement from fe80::280:c8ff:feb9:cef9 (hoplimit 255)
- AdvCurHopLimit: 64
- AdvManagedFlag: off
- AdvOtherConfigFlag: off
- AdvHomeAgentFlag: off
- AdvReachableTime: 0
- AdvRetransTimer: 0
- Prefix 2002:0102:0304:f101::/64
- AdvValidLifetime: 30
- AdvPreferredLifetime: 20
- AdvOnLink: off
- AdvAutonomous: on
- AdvRouterAddr: on
- Prefix 2001:0db8:100:f101::/64
- AdvValidLifetime: 2592000
- AdvPreferredLifetime: 604800
- AdvOnLink: on
- AdvAutonomous: on
- AdvRouterAddr: on
- AdvSourceLLAddress: 00 80 12 34 56 78
22.5. Dynamic Host Configuration v6 Server (dhcp6s)
22.5.1. Configuration of the DHCPv6 server (dhcp6s)
22.5.1.1. Simple configuration
interface eth0 {
- server-preference 255;
- renew-time 60;
- rebind-time 90;
- prefer-life-time 130;
- valid-life-time 200;
- allow rapid-commit;
- option dns_servers 2001:db8:0:f101::1 sub.domain.example;
- link AAA {
- range 2001:db8:0:f101::1000 to 2001:db8:0:f101::ffff/64;
- prefix 2001:db8:0:f101::/64;
- };
-};
22.5.2. Configuration of the DHCPv6 client (dhcp6c)
22.5.2.1. Simple configuration
interface eth0 {
- send rapid-commit;
- request domain-name-servers;
-};
22.5.4. Debugging
22.5.4.1. dhcpv6_server
# dhcp6s -d -D -f eth0
22.5.4.2. dhcpv6_client
# ping6 -I eth0 ff02::1:2
# dhcp6c -d -f eth0
-Oct/03/2005 17:18:16 dhcpv6 doesn't support hardware type 776
-Oct/03/2005 17:18:16 doesn't support sit0 address family 0
-Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error
-Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error
-Oct/03/2005 17:18:17 status code for this address is: success
-Oct/03/2005 17:18:17 status code: success
-Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error
-Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error
-Oct/03/2005 17:18:17 assigned address 2001:db8:0:f101::1002 prefix len is not
-¬ in any RAs prefix length using 64 bit instead
-Oct/03/2005 17:18:17 renew time 60, rebind time 9
22.6. ISC Dynamic Host Configuration Server (dhcpd)
22.6.1. Configuration of the ISC DHCP server for IPv6 (dhcpd)
22.6.1.1. Simple configuration
default-lease-time 600;
-max-lease-time 7200;
-log-facility local7;
-subnet6 2001:db8:0:1::/64 {
- # Range for clients
- range6 2001:db8:0:1::129 2001:db8:0:1::254;
-
- # Range for clients requesting a temporary address
- range6 2001:db8:0:1::/64 temporary;
-
- # Additional options
- option dhcp6.name-servers fec0:0:0:1::1;
- option dhcp6.domain-search "domain.example";
-
- # Prefix range for delegation to sub-routers
- prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56;
-
- # Example for a fixed host address
- host specialclient {
- host-identifier option dhcp6.client-id 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45;
- fixed-address6 2001:db8:0:1::127;
- }
-}
# hexdump -e '"%07.7_ax " 1/2 "%04x" " " 14/1 "%02x:" "\n"' /var/lib/dhcpv6/dhcp6c_duid 0000000 000e 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45:
22.6.2. Usage
22.6.2.1. dhcpd
# /usr/sbin/dhcpd -6 -d -cf /etc/dhcp/dhcpd6.conf eth1
-Internet Systems Consortium DHCP Server 4.1.0
-Copyright 2004-2008 Internet Systems Consortium.
-All rights reserved.
-For info, please visit http://www.isc.org/sw/dhcp/
-Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
-Wrote 0 leases to leases file.
-Bound to *:547
-Listening on Socket/5/eth1/2001:db8:0:1::/64
-Sending on Socket/5/eth1/2001:db8:0:1::/64
22.7. DHCP Server Dibbler
22.7.1. Configuration of the Dibbler DHCP server for IPv6
22.7.1.1. Simple configuration
log-level 8
-log-mode short
-preference 0
-iface "eth1" {
- // also ranges can be defines, instead of exact values t1 1800-2000 t2 2700-3000
- prefered-lifetime 3600
- valid-lifetime 7200
- class {
- pool 2001:6f8:12d8:1::/64
- }
- option dns-server fec0:0:0:1::1
- option domain domain.example
-}
22.7.2. Usage
22.7.2.1. dibbler-server
# dibbler-server run
-| Dibbler - a portable DHCPv6, version 0.7.3 (SERVER, Linux port)
-| Authors : Tomasz Mrugalski<thomson(at)klub.com.pl>,Marek Senderski<msend(at)o2.pl>
-| Licence : GNU GPL v2 only. Developed at Gdansk University of Technology.
-| Homepage: http://klub.com.pl/dhcpv6/
-2009.05.28 10:18:48 Server Notice My pid (1789) is stored in /var/lib/dibbler/server.pid
-2009.05.28 10:18:48 Server Notice Detected iface eth0/3, MAC=54:52:00:01:23:45.
-2009.05.28 10:18:48 Server Notice Detected iface eth1/2, MAC=54:52:00:67:89:ab.
-2009.05.28 10:18:48 Server Notice Detected iface lo/1, MAC=00:00:00:00:00:00.
-2009.05.28 10:18:48 Server Debug Skipping database loading.
-2009.05.28 10:18:48 Server Debug Cache:server-cache.xml file: parsing started, expecting 0 entries.
-2009.05.28 10:18:48 Server Notice Parsing /etc/dibbler/server.conf config file...
-18:48 Server Debug Setting 0 generic option(s).
-18:48 Server Debug 0 per-client configurations (exceptions) added.
-18:48 Server Debug Parsing /etc/dibbler/server.conf done.
-18:48 Server Info 0 client class(es) defined.
-18:48 Server Debug 1 interface(s) specified in /etc/dibbler/server.conf
-18:48 Server Info Mapping allow, deny list to class 0:0 allow/deny entries in total.
-18:48 Server Info Interface eth1/2 configuration has been loaded.
-18:48 Server Notice Running in stateful mode.
-18:48 Server Info My DUID is 00:01:00:01:11:aa:6d:a7:54:52:00:67:89:ab.
-18:48 Server Notice Creating multicast (ff02::1:2) socket on eth1/2 (eth1/2) interface.
-18:48 Server Debug Cache: size set to 1048576 bytes, 1 cache entry size is 87 bytes, so maximum 12052 address-client pair(s) may be cached.
-18:48 Server Notice Accepting connections. Next event in 4294967295 second(s).
22.8. tcp_wrapper
22.8.1. Filtering capabilities
22.8.2. Which program uses tcp_wrapper
22.8.3. Usage
$ man hosts.allow
22.8.3.1. Example for /etc/hosts.allow
sshd: 1.2.3. [2001:0db8:100:200::]/64
-daytime-stream: 1.2.3. [2001:0db8:100:200::]/64
22.8.3.2. Example for /etc/hosts.deny
ALL: ALL
ALL: ALL: spawn (echo "Attempt from %h %a to %d at `date`"
- | tee -a /var/log/tcp.deny.log | mail root@localhost)
22.8.4. Logging
22.8.4.1. Refused connection
Jan 2 20:40:44 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap
-¬ from=::ffff:1.2.3.4
-Jan 2 20:32:06 gate xinetd-ipv6[12346]: FAIL: daytime-stream libwrap
- from=2001:0db8:100:200::212:34ff:fe12:3456
Jan 2 20:24:17 gate sshd[12345]: refused connect from ::ffff:1.2.3.4
-¬ (::ffff:1.2.3.4)
-Jan 2 20:39:33 gate sshd[12345]: refused connect
- from 2001:0db8:100:200::212:34ff:fe12:3456
-¬ (2001:0db8:100:200::212:34ff:fe12:3456)
22.8.4.2. Permitted connection
Jan 2 20:37:50 gate xinetd-ipv6[12346]: START: daytime-stream pid=0
-¬ from=::ffff:1.2.3.4
-Jan 2 20:37:56 gate xinetd-ipv6[12346]: START: daytime-stream pid=0
- from=2001:0db8:100:200::212:34ff:fe12:3456
Jan 2 20:43:10 gate sshd[21975]: Accepted password for user from ::ffff:1.2.3.4
-¬ port 33381 ssh2
-Jan 2 20:42:19 gate sshd[12345]: Accepted password for user
- from 2001:0db8:100:200::212:34ff:fe12:3456 port 33380 ssh2
22.9. vsftpd
22.9.1. Listening on IPv6 addresses
listen_ipv6=yes
22.10. proftpd
22.10.1. Listening on IPv6 addresses
<VirtualHost 192.0.2.1>
- ...
- Bind 2001:0DB8::1
- ...
-</VirtualHost>
22.11. Other daemons
Chapter 23. Programming
23.1. Programming using C-API
23.1.1. Address Structures
23.1.1.1. IPv4 sockaddr_in
struct sockaddr_in
-{
- sa_family_t sin_family;
- in_port_t sin_port;
- struct in_addr sin_addr;
- /* Plus some padding for alignment */
-};
23.1.1.2. IPv6 sockaddr_in6
struct sockaddr_in6
-{
- sa_family_t sin6_family;
- in_port_t sin6_port;
- uint32_t sin6_flowinfo;
- struct in6_addr sin6_addr;
- uint32_t sin6_scope_id;
-};
Host A (fe80::1) ---- eth0 ---- Host B ---- eth1 ---- Host C (fe80::1)
23.1.1.3. Generic Addresses
ssize_t recvfrom( int s,
- void *buf,
- size_t len,
- int flags,
- struct sockaddr *from,
- socklen_t *fromlen );
/*
-** Read a message from a remote peer, and return a buffer pointer to
-** the caller.
-**
-** 's' is the file descriptor for the socket.
-*/
-char *rcvMsg( int s )
-{
- static char bfr[ 1025 ]; /* Where the msg is stored. */
- ssize_t count;
- struct sockaddr_storage ss; /* Where the peer adr goes. */
- socklen_t sslen;
- sslen = sizeof( ss );
- count = recvfrom( s,
- bfr,
- sizeof( bfr ) - 1,
- 0,
- (struct sockaddr*) &ss,
- &sslen );
- bfr[ count ] = '\0'; /* Null-terminates the message. */
- return bfr;
-} /* End rcvMsg() */
23.1.2. Lookup Functions
int getaddrinfo( const char *node,
- const char *service,
- const struct addrinfo *hints,
- struct addrinfo **res );
struct addrinfo
-{
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- socklen_t ai_addrlen;
- struct sockaddr *ai_addr;
- char *ai_canonname;
- struct addrinfo *ai_next;
-};
int getnameinfo( const struct sockaddr *sa,
- socklen_t salen,
- char *host,
- size_t hostlen,
- char *serv,
- size_t servlen,
- int flags );
23.1.3. Quirks Encountered
23.1.3.1. IPv4 Mapped Addresses
::ffff:192.0.2.1
23.1.3.2. Cannot Specify the Scope Identifier in /etc/hosts
::1 localhost
- 127.0.0.1 localhost
- fe80::2c0:8cff:fe01:2345 pt141
- 192.0.2.1 pt141
23.1.3.3. Client & Server Residing on the Same Machine
23.1.4. Putting It All Together (A Client-Server Programming Example)
23.1.4.1. 'Daytime' Server Code
tod6d [-v] [service]
/******************************************************************************
-* File: tod6d.c
-* Description: Contains source code for an IPv6-capable 'daytime' server.
-* Author: John Wenker, Sr. Software Engineer,
-* Performance Technologies, San Diego, USA
-******************************************************************************/
-/*
-** System header files.
-*/
-#include <errno.h> /* errno declaration & error codes. */
-#include <netdb.h> /* getaddrinfo(3) et al. */
-#include <netinet/in.h> /* sockaddr_in & sockaddr_in6 definition. */
-#include <stdio.h> /* printf(3) et al. */
-#include <stdlib.h> /* exit(2). */
-#include <string.h> /* String manipulation & memory functions. */
-#include <sys/poll.h> /* poll(2) and related definitions. */
-#include <sys/socket.h> /* Socket functions (socket(2), bind(2), etc). */
-#include <time.h> /* time(2) & ctime(3). */
-#include <unistd.h> /* getopt(3), read(2), etc. */
-/*
-** Constants.
-*/
-#define DFLT_SERVICE "daytime" /* Default service name. */
-#define INVALID_DESC -1 /* Invalid file descriptor. */
-#define MAXCONNQLEN 3 /* Max nbr of connection requests to queue. */
-#define MAXTCPSCKTS 2 /* One TCP socket for IPv4 & one for IPv6. */
-#define MAXUDPSCKTS 2 /* One UDP socket for IPv4 & one for IPv6. */
-#define VALIDOPTS "v" /* Valid command options. */
-/*
-** Simple boolean type definition.
-*/
-typedef enum { false = 0, true } boolean;
-/*
-** Prototypes for internal helper functions.
-*/
-static int openSckt( const char *service,
- const char *protocol,
- int desc[ ],
- size_t *descSize );
-static void tod( int tSckt[ ],
- size_t tScktSize,
- int uSckt[ ],
- size_t uScktSize );
-/*
-** Global (within this file only) data objects.
-*/
-static char hostBfr[ NI_MAXHOST ]; /* For use w/getnameinfo(3). */
-static const char *pgmName; /* Program name w/o dir prefix. */
-static char servBfr[ NI_MAXSERV ]; /* For use w/getnameinfo(3). */
-static boolean verbose = false; /* Verbose mode indication. */
-/*
-** Usage macro for command syntax violations.
-*/
-#define USAGE \
- { \
- fprintf( stderr, \
- "Usage: %s [-v] [service]\n", \
- pgmName ); \
- exit( 127 ); \
- } /* End USAGE macro. */
-/*
-** Macro to terminate the program if a system call error occurs. The system
-** call must be one of the usual type that returns -1 on error. This macro is
-** a modified version of a macro authored by Dr. V. Vinge, SDSU Dept. of
-** Computer Science (retired)... best professor I ever had. I hear he writes
-** great science fiction in addition to robust code, too.
-*/
-#define CHK(expr) \
- do \
- { \
- if ( (expr) == -1 ) \
- { \
- fprintf( stderr, \
- "%s (line %d): System call ERROR - %s.\n", \
- pgmName, \
- __LINE__, \
- strerror( errno ) ); \
- exit( 1 ); \
- } /* End IF system call failed. */ \
- } while ( false )
-/******************************************************************************
-* Function: main
-*
-* Description:
-* Set up a time-of-day server and handle network requests. This server
-* handles both TCP and UDP requests.
-*
-* Parameters:
-* The usual argc and argv parameters to a main() function.
-*
-* Return Value:
-* This is a daemon program and never returns. However, in the degenerate
-* case where no sockets are created, the function returns zero.
-******************************************************************************/
-int main( int argc,
- char *argv[ ] )
-{
- int opt;
- const char *service = DFLT_SERVICE;
- int tSckt[ MAXTCPSCKTS ]; /* Array of TCP socket descriptors. */
- size_t tScktSize = MAXTCPSCKTS; /* Size of uSckt (# of elements). */
- int uSckt[ MAXUDPSCKTS ]; /* Array of UDP socket descriptors. */
- size_t uScktSize = MAXUDPSCKTS; /* Size of uSckt (# of elements). */
- /*
- ** Set the program name (w/o directory prefix).
- */
- pgmName = strrchr( argv[ 0 ], '/' );
- pgmName = pgmName == NULL ? argv[ 0 ] : pgmName + 1;
- /*
- ** Process command options.
- */
- opterr = 0; /* Turns off "invalid option" error messages. */
- while ( ( opt = getopt( argc, argv, VALIDOPTS ) ) >= 0 )
- {
- switch ( opt )
- {
- case 'v': /* Verbose mode. */
- {
- verbose = true;
- break;
- }
- default:
- {
- USAGE;
- }
- } /* End SWITCH on command option. */
- } /* End WHILE processing options. */
- /*
- ** Process command line arguments.
- */
- switch ( argc - optind )
- {
- case 0: break;
- case 1: service = argv[ optind ]; break;
- default: USAGE;
- } /* End SWITCH on number of command line arguments. */
- /*
- ** Open both a TCP and UDP socket, for both IPv4 & IPv6, on which to receive
- ** service requests.
- */
- if ( ( openSckt( service, "tcp", tSckt, &tScktSize ) < 0 ) ||
- ( openSckt( service, "udp", uSckt, &uScktSize ) < 0 ) )
- {
- exit( 1 );
- }
- /*
- ** Run the time-of-day server.
- */
- if ( ( tScktSize > 0 ) || ( uScktSize > 0 ) )
- {
- tod( tSckt, /* tod() never returns. */
- tScktSize,
- uSckt,
- uScktSize );
- }
- /*
- ** Since tod() never returns, execution only gets here if no sockets were
- ** created.
- */
- if ( verbose )
- {
- fprintf( stderr,
- "%s: No sockets opened... terminating.\n",
- pgmName );
- }
- return 0;
-} /* End main() */
-/******************************************************************************
-* Function: openSckt
-*
-* Description:
-* Open passive (server) sockets for the indicated inet service & protocol.
-* Notice in the last sentence that "sockets" is plural. During the interim
-* transition period while everyone is switching over to IPv6, the server
-* application has to open two sockets on which to listen for connections...
-* one for IPv4 traffic and one for IPv6 traffic.
-*
-* Parameters:
-* service - Pointer to a character string representing the well-known port
-* on which to listen (can be a service name or a decimal number).
-* protocol - Pointer to a character string representing the transport layer
-* protocol (only "tcp" or "udp" are valid).
-* desc - Pointer to an array into which the socket descriptors are
-* placed when opened.
-* descSize - This is a value-result parameter. On input, it contains the
-* max number of descriptors that can be put into 'desc' (i.e. the
-* number of elements in the array). Upon return, it will contain
-* the number of descriptors actually opened. Any unused slots in
-* 'desc' are set to INVALID_DESC.
-*
-* Return Value:
-* 0 on success, -1 on error.
-******************************************************************************/
-static int openSckt( const char *service,
- const char *protocol,
- int desc[ ],
- size_t *descSize )
-{
- struct addrinfo *ai;
- int aiErr;
- struct addrinfo *aiHead;
- struct addrinfo hints = { .ai_flags = AI_PASSIVE, /* Server mode.
-¬ */
- .ai_family = PF_UNSPEC }; /* IPv4 or IPv6.
-¬ */
- size_t maxDescs = *descSize;
- /*
- ** Initialize output parameters. When the loop completes, *descSize is 0.
- */
- while ( *descSize > 0 )
- {
- desc[ --( *descSize ) ] = INVALID_DESC;
- }
- /*
- ** Check which protocol is selected (only TCP and UDP are valid).
- */
- if ( strcmp( protocol, "tcp" ) == 0 ) /* TCP protocol. */
- {
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_protocol = IPPROTO_TCP;
- }
- else if ( strcmp( protocol, "udp" ) == 0 ) /* UDP protocol. */
- {
- hints.ai_socktype = SOCK_DGRAM;
- hints.ai_protocol = IPPROTO_UDP;
- }
- else /* Invalid protocol. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown transport "
- "layer protocol \"%s\".\n",
- pgmName,
- __LINE__,
- protocol );
- return -1;
- }
- /*
- ** Look up the service's well-known port number. Notice that NULL is being
- ** passed for the 'node' parameter, and that the AI_PASSIVE flag is set in
- ** 'hints'. Thus, the program is requesting passive address information.
- ** The network address is initialized to :: (all zeros) for IPv6 records, or
- ** 0.0.0.0 for IPv4 records.
- */
- if ( ( aiErr = getaddrinfo( NULL,
- service,
- &hints,
- &aiHead ) ) != 0 )
- {
- fprintf( stderr,
- "%s (line %d): ERROR - %s.\n",
- pgmName,
- __LINE__,
- gai_strerror( aiErr ) );
- return -1;
- }
- /*
- ** For each of the address records returned, attempt to set up a passive
- ** socket.
- */
- for ( ai = aiHead;
- ( ai != NULL ) && ( *descSize < maxDescs );
- ai = ai->ai_next )
- {
- if ( verbose )
- {
- /*
- ** Display the current address info. Start with the protocol-
- ** independent fields first.
- */
- fprintf( stderr,
- "Setting up a passive socket based on the "
- "following address info:\n"
- " ai_flags = 0x%02X\n"
- " ai_family = %d (PF_INET = %d, PF_INET6 = %d)\n"
- " ai_socktype = %d (SOCK_STREAM = %d, SOCK_DGRAM = %d)\n"
- " ai_protocol = %d (IPPROTO_TCP = %d, IPPROTO_UDP = %d)\n"
- " ai_addrlen = %d (sockaddr_in = %d, "
- "sockaddr_in6 = %d)\n",
- ai->ai_flags,
- ai->ai_family,
- PF_INET,
- PF_INET6,
- ai->ai_socktype,
- SOCK_STREAM,
- SOCK_DGRAM,
- ai->ai_protocol,
- IPPROTO_TCP,
- IPPROTO_UDP,
- ai->ai_addrlen,
- sizeof( struct sockaddr_in ),
- sizeof( struct sockaddr_in6 ) );
- /*
- ** Now display the protocol-specific formatted socket address. Note
- ** that the program is requesting that getnameinfo(3) convert the
- ** host & service into numeric strings.
- */
- getnameinfo( ai->ai_addr,
- ai->ai_addrlen,
- hostBfr,
- sizeof( hostBfr ),
- servBfr,
- sizeof( servBfr ),
- NI_NUMERICHOST | NI_NUMERICSERV );
- switch ( ai->ai_family )
- {
- case PF_INET: /* IPv4 address record. */
- {
- struct sockaddr_in *p = (struct sockaddr_in*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin_addr: %s\n"
- " sin_port: %s\n",
- p->sin_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr );
- break;
- } /* End CASE of IPv4. */
- case PF_INET6: /* IPv6 address record. */
- {
- struct sockaddr_in6 *p = (struct sockaddr_in6*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin6_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin6_addr: %s\n"
- " sin6_port: %s\n"
- " sin6_flowinfo: %d\n"
- " sin6_scope_id: %d\n",
- p->sin6_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr,
- p->sin6_flowinfo,
- p->sin6_scope_id );
- break;
- } /* End CASE of IPv6. */
- default: /* Can never get here, but just for completeness. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown protocol family (%d).\n",
- pgmName,
- __LINE__,
- ai->ai_family );
- freeaddrinfo( aiHead );
- return -1;
- } /* End DEFAULT case (unknown protocol family). */
- } /* End SWITCH on protocol family. */
- } /* End IF verbose mode. */
- /*
- ** Create a socket using the info in the addrinfo structure.
- */
- CHK( desc[ *descSize ] = socket( ai->ai_family,
- ai->ai_socktype,
- ai->ai_protocol ) );
- /*
- ** Here is the code that prevents "IPv4 mapped addresses", as discussed
- ** in Section 22.1.3.1. If an IPv6 socket was just created, then set the
- ** IPV6_V6ONLY socket option.
- */
- if ( ai->ai_family == PF_INET6 )
- {
-#if defined( IPV6_V6ONLY )
- /*
- ** Disable IPv4 mapped addresses.
- */
- int v6Only = 1;
- CHK( setsockopt( desc[ *descSize ],
- IPPROTO_IPV6,
- IPV6_V6ONLY,
- &v6Only,
- sizeof( v6Only ) ) );
-#else
- /*
- ** IPV6_V6ONLY is not defined, so the socket option can't be set and
- ** thus IPv4 mapped addresses can't be disabled. Print a warning
- ** message and close the socket. Design note: If the
- ** #if...#else...#endif construct were removed, then this program
- ** would not compile (because IPV6_V6ONLY isn't defined). That's an
- ** acceptable approach; IPv4 mapped addresses are certainly disabled
- ** if the program can't build! However, since this program is also
- ** designed to work for IPv4 sockets as well as IPv6, I decided to
- ** allow the program to compile when IPV6_V6ONLY is not defined, and
- ** turn it into a run-time warning rather than a compile-time error.
- ** IPv4 mapped addresses are still disabled because _all_ IPv6 traffic
- ** is disabled (all IPv6 sockets are closed here), but at least this
- ** way the server can still service IPv4 network traffic.
- */
- fprintf( stderr,
- "%s (line %d): WARNING - Cannot set IPV6_V6ONLY socket "
- "option. Closing IPv6 %s socket.\n",
- pgmName,
- __LINE__,
- ai->ai_protocol == IPPROTO_TCP ? "TCP" : "UDP" );
- CHK( close( desc[ *descSize ] ) );
- continue; /* Go to top of FOR loop w/o updating *descSize! */
-#endif /* IPV6_V6ONLY */
- } /* End IF this is an IPv6 socket. */
- /*
- ** Bind the socket. Again, the info from the addrinfo structure is used.
- */
- CHK( bind( desc[ *descSize ],
- ai->ai_addr,
- ai->ai_addrlen ) );
- /*
- ** If this is a TCP socket, put the socket into passive listening mode
- ** (listen is only valid on connection-oriented sockets).
- */
- if ( ai->ai_socktype == SOCK_STREAM )
- {
- CHK( listen( desc[ *descSize ],
- MAXCONNQLEN ) );
- }
- /*
- ** Socket set up okay. Bump index to next descriptor array element.
- */
- *descSize += 1;
- } /* End FOR each address info structure returned. */
- /*
- ** Dummy check for unused address records.
- */
- if ( verbose && ( ai != NULL ) )
- {
- fprintf( stderr,
- "%s (line %d): WARNING - Some address records were "
- "not processed due to insufficient array space.\n",
- pgmName,
- __LINE__ );
- } /* End IF verbose and some address records remain unprocessed. */
- /*
- ** Clean up.
- */
- freeaddrinfo( aiHead );
- return 0;
-} /* End openSckt() */
-/******************************************************************************
-* Function: tod
-*
-* Description:
-* Listen on a set of sockets and send the current time-of-day to any
-* clients. This function never returns.
-*
-* Parameters:
-* tSckt - Array of TCP socket descriptors on which to listen.
-* tScktSize - Size of the tSckt array (nbr of elements).
-* uSckt - Array of UDP socket descriptors on which to listen.
-* uScktSize - Size of the uSckt array (nbr of elements).
-*
-* Return Value: None.
-******************************************************************************/
-static void tod( int tSckt[ ],
- size_t tScktSize,
- int uSckt[ ],
- size_t uScktSize )
-{
- char bfr[ 256 ];
- ssize_t count;
- struct pollfd *desc;
- size_t descSize = tScktSize + uScktSize;
- int idx;
- int newSckt;
- struct sockaddr *sadr;
- socklen_t sadrLen;
- struct sockaddr_storage sockStor;
- int status;
- size_t timeLen;
- char *timeStr;
- time_t timeVal;
- ssize_t wBytes;
- /*
- ** Allocate memory for the poll(2) array.
- */
- desc = malloc( descSize * sizeof( struct pollfd ) );
- if ( desc == NULL )
- {
- fprintf( stderr,
- "%s (line %d): ERROR - %s.\n",
- pgmName,
- __LINE__,
- strerror( ENOMEM ) );
- exit( 1 );
- }
- /*
- ** Initialize the poll(2) array.
- */
- for ( idx = 0; idx < descSize; idx++ )
- {
- desc[ idx ].fd = idx < tScktSize ? tSckt[ idx ]
- : uSckt[ idx - tScktSize ];
- desc[ idx ].events = POLLIN;
- desc[ idx ].revents = 0;
- }
- /*
- ** Main time-of-day server loop. Handles both TCP & UDP requests. This is
- ** an interative server, and all requests are handled directly within the
- ** main loop.
- */
- while ( true ) /* Do forever. */
- {
- /*
- ** Wait for activity on one of the sockets. The DO..WHILE construct is
- ** used to restart the system call in the event the process is
- ** interrupted by a signal.
- */
- do
- {
- status = poll( desc,
- descSize,
- -1 /* Wait indefinitely for input. */ );
- } while ( ( status < 0 ) && ( errno == EINTR ) );
- CHK( status ); /* Check for a bona fide system call error. */
- /*
- ** Get the current time.
- */
- timeVal = time( NULL );
- timeStr = ctime( &timeVal );
- timeLen = strlen( timeStr );
- /*
- ** Indicate that there is new network activity.
- */
- if ( verbose )
- {
- char *s = malloc( timeLen+1 );
- strcpy( s, timeStr );
- s[ timeLen-1 ] = '\0'; /* Overwrite '\n' in date string. */
- fprintf( stderr,
- "%s: New network activity on %s.\n",
- pgmName,
- s );
- free( s );
- } /* End IF verbose. */
- /*
- ** Process sockets with input available.
- */
- for ( idx = 0; idx < descSize; idx++ )
- {
- switch ( desc[ idx ].revents )
- {
- case 0: /* No activity on this socket; try the next. */
- continue;
- case POLLIN: /* Network activity. Go process it. */
- break;
- default: /* Invalid poll events. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Invalid poll event (0x%02X).\n",
- pgmName,
- __LINE__,
- desc[ idx ].revents );
- exit( 1 );
- }
- } /* End SWITCH on returned poll events. */
- /*
- ** Determine if this is a TCP request or UDP request.
- */
- if ( idx < tScktSize )
- {
- /*
- ** TCP connection requested. Accept it. Notice the use of
- ** the sockaddr_storage data type.
- */
- sadrLen = sizeof( sockStor );
- sadr = (struct sockaddr*) &sockStor;
- CHK( newSckt = accept( desc[ idx ].fd,
- sadr,
- &sadrLen ) );
- CHK( shutdown( newSckt, /* Server never recv's anything. */
- SHUT_RD ) );
- if ( verbose )
- {
- /*
- ** Display the socket address of the remote client. Begin with
- ** the address-independent fields.
- */
- fprintf( stderr,
- "Sockaddr info for new TCP client:\n"
- " sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
- " addr len = %d (sockaddr_in = %d, "
- "sockaddr_in6 = %d)\n",
- sadr->sa_family,
- AF_INET,
- AF_INET6,
- sadrLen,
- sizeof( struct sockaddr_in ),
- sizeof( struct sockaddr_in6 ) );
- /*
- ** Display the address-specific fields.
- */
- getnameinfo( sadr,
- sadrLen,
- hostBfr,
- sizeof( hostBfr ),
- servBfr,
- sizeof( servBfr ),
- NI_NUMERICHOST | NI_NUMERICSERV );
- /*
- ** Notice that we're switching on an address family now, not a
- ** protocol family.
- */
- switch ( sadr->sa_family )
- {
- case AF_INET: /* IPv4 address. */
- {
- struct sockaddr_in *p = (struct sockaddr_in*) sadr;
- fprintf( stderr,
- " sin_addr = sin_family: %d\n"
- " sin_addr: %s\n"
- " sin_port: %s\n",
- p->sin_family,
- hostBfr,
- servBfr );
- break;
- } /* End CASE of IPv4. */
- case AF_INET6: /* IPv6 address. */
- {
- struct sockaddr_in6 *p = (struct sockaddr_in6*) sadr;
- fprintf( stderr,
- " sin6_addr = sin6_family: %d\n"
- " sin6_addr: %s\n"
- " sin6_port: %s\n"
- " sin6_flowinfo: %d\n"
- " sin6_scope_id: %d\n",
- p->sin6_family,
- hostBfr,
- servBfr,
- p->sin6_flowinfo,
- p->sin6_scope_id );
- break;
- } /* End CASE of IPv6. */
- default: /* Can never get here, but for completeness. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown address "
- "family (%d).\n",
- pgmName,
- __LINE__,
- sadr->sa_family );
- break;
- } /* End DEFAULT case (unknown address family). */
- } /* End SWITCH on address family. */
- } /* End IF verbose mode. */
- /*
- ** Send the TOD to the client.
- */
- wBytes = timeLen;
- while ( wBytes > 0 )
- {
- do
- {
- count = write( newSckt,
- timeStr,
- wBytes );
- } while ( ( count < 0 ) && ( errno == EINTR ) );
- CHK( count ); /* Check for a bona fide error. */
- wBytes -= count;
- } /* End WHILE there is data to send. */
- CHK( close( newSckt ) );
- } /* End IF this was a TCP connection request. */
- else
- {
- /*
- ** This is a UDP socket, and a datagram is available. The funny
- ** thing about UDP requests is that this server doesn't require any
- ** client input; but it can't send the TOD unless it knows a client
- ** wants the data, and the only way that can occur with UDP is if
- ** the server receives a datagram from the client. Thus, the
- ** server must receive _something_, but the content of the datagram
- ** is irrelevant. Read in the datagram. Again note the use of
- ** sockaddr_storage to receive the address.
- */
- sadrLen = sizeof( sockStor );
- sadr = (struct sockaddr*) &sockStor;
- CHK( count = recvfrom( desc[ idx ].fd,
- bfr,
- sizeof( bfr ),
- 0,
- sadr,
- &sadrLen ) );
- /*
- ** Display whatever was received on stdout.
- */
- if ( verbose )
- {
- ssize_t rBytes = count;
- fprintf( stderr,
- "%s: UDP datagram received (%d bytes).\n",
- pgmName,
- count );
- while ( count > 0 )
- {
- fputc( bfr[ rBytes - count-- ],
- stdout );
- }
- if ( bfr[ rBytes-1 ] != '\n' )
- fputc( '\n', stdout ); /* Newline also flushes stdout. */
- /*
- ** Display the socket address of the remote client. Address-
- ** independent fields first.
- */
- fprintf( stderr,
- "Remote client's sockaddr info:\n"
- " sa_family = %d (AF_INET = %d, AF_INET6 = %d)\n"
- " addr len = %d (sockaddr_in = %d, "
- "sockaddr_in6 = %d)\n",
- sadr->sa_family,
- AF_INET,
- AF_INET6,
- sadrLen,
- sizeof( struct sockaddr_in ),
- sizeof( struct sockaddr_in6 ) );
- /*
- ** Display the address-specific information.
- */
- getnameinfo( sadr,
- sadrLen,
- hostBfr,
- sizeof( hostBfr ),
- servBfr,
- sizeof( servBfr ),
- NI_NUMERICHOST | NI_NUMERICSERV );
- switch ( sadr->sa_family )
- {
- case AF_INET: /* IPv4 address. */
- {
- struct sockaddr_in *p = (struct sockaddr_in*) sadr;
- fprintf( stderr,
- " sin_addr = sin_family: %d\n"
- " sin_addr: %s\n"
- " sin_port: %s\n",
- p->sin_family,
- hostBfr,
- servBfr );
- break;
- } /* End CASE of IPv4 address. */
- case AF_INET6: /* IPv6 address. */
- {
- struct sockaddr_in6 *p = (struct sockaddr_in6*) sadr;
- fprintf( stderr,
- " sin6_addr = sin6_family: %d\n"
- " sin6_addr: %s\n"
- " sin6_port: %s\n"
- " sin6_flowinfo: %d\n"
- " sin6_scope_id: %d\n",
- p->sin6_family,
- hostBfr,
- servBfr,
- p->sin6_flowinfo,
- p->sin6_scope_id );
- break;
- } /* End CASE of IPv6 address. */
- default: /* Can never get here, but for completeness. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown address "
- "family (%d).\n",
- pgmName,
- __LINE__,
- sadr->sa_family );
- break;
- } /* End DEFAULT case (unknown address family). */
- } /* End SWITCH on address family. */
- } /* End IF verbose mode. */
- /*
- ** Send the time-of-day to the client.
- */
- wBytes = timeLen;
- while ( wBytes > 0 )
- {
- do
- {
- count = sendto( desc[ idx ].fd,
- timeStr,
- wBytes,
- 0,
- sadr, /* Address & address length */
- sadrLen ); /* received in recvfrom(). */
- } while ( ( count < 0 ) && ( errno == EINTR ) );
- CHK( count ); /* Check for a bona fide error. */
- wBytes -= count;
- } /* End WHILE there is data to send. */
- } /* End ELSE a UDP datagram is available. */
- desc[ idx ].revents = 0; /* Clear the returned poll events. */
- } /* End FOR each socket descriptor. */
- } /* End WHILE forever. */
-} /* End tod() */
23.1.4.2. 'Daytime' TCP Client Code
tod6tc [-v] [-s scope_id] [host [service]]
/******************************************************************************
-* File: tod6tc.c
-* Description: Contains source code for an IPv6-capable 'daytime' TCP client.
-* Author: John Wenker, Sr. Software Engineer
-* Performance Technologies, San Diego, USA
-******************************************************************************/
-/*
-** System header files.
-*/
-#include <errno.h> /* errno declaration and error codes. */
-#include <net/if.h> /* if_nametoindex(3). */
-#include <netdb.h> /* getaddrinfo(3) and associated definitions. */
-#include <netinet/in.h> /* sockaddr_in and sockaddr_in6 definitions. */
-#include <stdio.h> /* printf(3) et al. */
-#include <stdlib.h> /* exit(2). */
-#include <string.h> /* String manipulation and memory functions. */
-#include <sys/socket.h> /* Socket functions (socket(2), connect(2), etc). */
-#include <unistd.h> /* getopt(3), read(2), etc. */
-/*
-** Constants & macros.
-*/
-#define DFLT_HOST "localhost" /* Default server name. */
-#define DFLT_SCOPE_ID "eth0" /* Default scope identifier. */
-#define DFLT_SERVICE "daytime" /* Default service name. */
-#define INVALID_DESC -1 /* Invalid file (socket) descriptor. */
-#define MAXBFRSIZE 256 /* Max bfr sz to read remote TOD. */
-#define VALIDOPTS "s:v" /* Valid command options. */
-/*
-** Type definitions (for convenience).
-*/
-typedef enum { false = 0, true } boolean;
-typedef struct sockaddr_in sockaddr_in_t;
-typedef struct sockaddr_in6 sockaddr_in6_t;
-/*
-** Prototypes for internal helper functions.
-*/
-static int openSckt( const char *host,
- const char *service,
- unsigned int scopeId );
-static void tod( int sckt );
-/*
-** Global (within this file only) data objects.
-*/
-static const char *pgmName; /* Program name (w/o directory). */
-static boolean verbose = false; /* Verbose mode. */
-/*
-** Usage macro.
-*/
-#define USAGE \
- { \
- fprintf( stderr, \
- "Usage: %s [-v] [-s scope_id] [host [service]]\n", \
- pgmName ); \
- exit( 127 ); \
- } /* End USAGE macro. */
-/*
-** This "macro" (even though it's really a function) is loosely based on the
-** CHK() macro by Dr. V. Vinge (see server code). The status parameter is
-** a boolean expression indicating the return code from one of the usual system
-** calls that returns -1 on error. If a system call error occurred, an alert
-** is written to stderr. It returns a boolean value indicating success/failure
-** of the system call.
-**
-** Example: if ( !SYSCALL( "write",
-** count = write( fd, bfr, size ) ) )
-** {
-** // Error processing... but SYSCALL() will have already taken
-** // care of dumping an error alert to stderr.
-** }
-*/
-static __inline boolean SYSCALL( const char *syscallName,
- int lineNbr,
- int status )
-{
- if ( ( status == -1 ) && verbose )
- {
- fprintf( stderr,
- "%s (line %d): System call failed ('%s') - %s.\n",
- pgmName,
- lineNbr,
- syscallName,
- strerror( errno ) );
- }
- return status != -1; /* True if the system call was successful. */
-} /* End SYSCALL() */
-/******************************************************************************
-* Function: main
-*
-* Description:
-* Connect to a remote time-of-day service and write the remote host's TOD to
-* stdout.
-*
-* Parameters:
-* The usual argc & argv parameters to a main() program.
-*
-* Return Value:
-* This function always returns zero.
-******************************************************************************/
-int main( int argc,
- char *argv[ ] )
-{
- const char *host = DFLT_HOST;
- int opt;
- int sckt;
- unsigned int scopeId = if_nametoindex( DFLT_SCOPE_ID );
- const char *service = DFLT_SERVICE;
- /*
- ** Determine the program name (w/o directory prefix).
- */
- pgmName = (const char*) strrchr( argv[ 0 ], '/' );
- pgmName = pgmName == NULL ? argv[ 0 ] : pgmName+1;
- /*
- ** Process command line options.
- */
- opterr = 0; /* Turns off "invalid option" error messages. */
- while ( ( opt = getopt( argc, argv, VALIDOPTS ) ) != -1 )
- {
- switch ( opt )
- {
- case 's': /* Scope identifier (IPv6 kluge). */
- {
- scopeId = if_nametoindex( optarg );
- if ( scopeId == 0 )
- {
- fprintf( stderr,
- "%s: Unknown network interface (%s).\n",
- pgmName,
- optarg );
- USAGE;
- }
- break;
- }
- case 'v': /* Verbose mode. */
- {
- verbose = true;
- break;
- }
- default:
- {
- USAGE;
- }
- } /* End SWITCH on command option. */
- } /* End WHILE processing command options. */
- /*
- ** Process command arguments. At the end of the above loop, optind is the
- ** index of the first NON-option argv element.
- */
- switch ( argc - optind )
- {
- case 2: /* Both host & service are specified on the command line. */
- {
- service = argv[ optind + 1 ];
- /***** Fall through *****/
- }
- case 1: /* Host is specified on the command line. */
- {
- host = argv[ optind ];
- /***** Fall through *****/
- }
- case 0: /* Use default host & service. */
- {
- break;
- }
- default:
- {
- USAGE;
- }
- } /* End SWITCH on number of command arguments. */
- /*
- ** Open a connection to the indicated host/service.
- **
- ** Note that if all three of the following conditions are met, then the
- ** scope identifier remains unresolved at this point.
- ** 1) The default network interface is unknown for some reason.
- ** 2) The -s option was not used on the command line.
- ** 3) An IPv6 "scoped address" was not specified for the hostname on the
- ** command line.
- ** If the above three conditions are met, then only an IPv4 socket can be
- ** opened (connect(2) fails without the scope ID properly set for IPv6
- ** sockets).
- */
- if ( ( sckt = openSckt( host,
- service,
- scopeId ) ) == INVALID_DESC )
- {
- fprintf( stderr,
- "%s: Sorry... a connection could not be established.\n",
- pgmName );
- exit( 1 );
- }
- /*
- ** Get the remote time-of-day.
- */
- tod( sckt );
- /*
- ** Close the connection and terminate.
- */
- (void) SYSCALL( "close",
- __LINE__,
- close( sckt ) );
- return 0;
-} /* End main() */
-/******************************************************************************
-* Function: openSckt
-*
-* Description:
-* Sets up a TCP connection to a remote server. Getaddrinfo(3) is used to
-* perform lookup functions and can return multiple address records (i.e. a
-* list of 'struct addrinfo' records). This function traverses the list and
-* tries to establish a connection to the remote server. The function ends
-* when either a connection has been established or all records in the list
-* have been processed.
-*
-* Parameters:
-* host - A pointer to a character string representing the hostname or IP
-* address (IPv4 or IPv6) of the remote server.
-* service - A pointer to a character string representing the service name or
-* well-known port number.
-* scopeId - For IPv6 sockets only. This is the index corresponding to the
-* network interface on which to set up the connection. This
-* parameter is ignored for IPv4 sockets or when an IPv6 "scoped
-* address" is specified in 'host' (i.e. where the colon-hex
-* network address is augmented with the scope ID).
-*
-* Return Value:
-* Returns the socket descriptor for the connection, or INVALID_DESC if all
-* address records have been processed and a connection could not be
-* established.
-******************************************************************************/
-static int openSckt( const char *host,
- const char *service,
- unsigned int scopeId )
-{
- struct addrinfo *ai;
- int aiErr;
- struct addrinfo *aiHead;
- struct addrinfo hints;
- sockaddr_in6_t *pSadrIn6;
- int sckt;
- /*
- ** Initialize the 'hints' structure for getaddrinfo(3).
- **
- ** Notice that the 'ai_family' field is set to PF_UNSPEC, indicating to
- ** return both IPv4 and IPv6 address records for the host/service. Most of
- ** the time, the user isn't going to care whether an IPv4 connection or an
- ** IPv6 connection is established; the user simply wants to exchange data
- ** with the remote host and doesn't care how it's done. Sometimes, however,
- ** the user might want to explicitly specify the type of underlying socket.
- ** It is left as an exercise for the motivated reader to add a command line
- ** option allowing the user to specify the IP protocol, and then process the
- ** list of addresses accordingly (it's not that difficult).
- */
- memset( &hints, 0, sizeof( hints ) );
- hints.ai_family = PF_UNSPEC; /* IPv4 or IPv6 records (don't care). */
- hints.ai_socktype = SOCK_STREAM; /* Connection-oriented byte stream. */
- hints.ai_protocol = IPPROTO_TCP; /* TCP transport layer protocol only. */
- /*
- ** Look up the host/service information.
- */
- if ( ( aiErr = getaddrinfo( host,
- service,
- &hints,
- &aiHead ) ) != 0 )
- {
- fprintf( stderr,
- "%s (line %d): ERROR - %s.\n",
- pgmName,
- __LINE__,
- gai_strerror( aiErr ) );
- return INVALID_DESC;
- }
- /*
- ** Go through the list and try to open a connection. Continue until either
- ** a connection is established or the entire list is exhausted.
- */
- for ( ai = aiHead, sckt = INVALID_DESC;
- ( ai != NULL ) && ( sckt == INVALID_DESC );
- ai = ai->ai_next )
- {
- /*
- ** IPv6 kluge. Make sure the scope ID is set.
- */
- if ( ai->ai_family == PF_INET6 )
- {
- pSadrIn6 = (sockaddr_in6_t*) ai->ai_addr;
- if ( pSadrIn6->sin6_scope_id == 0 )
- {
- pSadrIn6->sin6_scope_id = scopeId;
- } /* End IF the scope ID wasn't set. */
- } /* End IPv6 kluge. */
- /*
- ** Display the address info for the remote host.
- */
- if ( verbose )
- {
- /*
- ** Temporary character string buffers for host & service.
- */
- char hostBfr[ NI_MAXHOST ];
- char servBfr[ NI_MAXSERV ];
- /*
- ** Display the address information just fetched. Start with the
- ** common (protocol-independent) stuff first.
- */
- fprintf( stderr,
- "Address info:\n"
- " ai_flags = 0x%02X\n"
- " ai_family = %d (PF_INET = %d, PF_INET6 = %d)\n"
- " ai_socktype = %d (SOCK_STREAM = %d, SOCK_DGRAM = %d)\n"
- " ai_protocol = %d (IPPROTO_TCP = %d, IPPROTO_UDP = %d)\n"
- " ai_addrlen = %d (sockaddr_in = %d, "
- "sockaddr_in6 = %d)\n",
- ai->ai_flags,
- ai->ai_family,
- PF_INET,
- PF_INET6,
- ai->ai_socktype,
- SOCK_STREAM,
- SOCK_DGRAM,
- ai->ai_protocol,
- IPPROTO_TCP,
- IPPROTO_UDP,
- ai->ai_addrlen,
- sizeof( struct sockaddr_in ),
- sizeof( struct sockaddr_in6 ) );
- /*
- ** Display the protocol-specific formatted address.
- */
- getnameinfo( ai->ai_addr,
- ai->ai_addrlen,
- hostBfr,
- sizeof( hostBfr ),
- servBfr,
- sizeof( servBfr ),
- NI_NUMERICHOST | NI_NUMERICSERV );
- switch ( ai->ai_family )
- {
- case PF_INET: /* IPv4 address record. */
- {
- sockaddr_in_t *pSadrIn = (sockaddr_in_t*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin_addr: %s\n"
- " sin_port: %s\n",
- pSadrIn->sin_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr );
- break;
- } /* End CASE of IPv4 record. */
- case PF_INET6: /* IPv6 address record. */
- {
- pSadrIn6 = (sockaddr_in6_t*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin6_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin6_addr: %s\n"
- " sin6_port: %s\n"
- " sin6_flowinfo: %d\n"
- " sin6_scope_id: %d\n",
- pSadrIn6->sin6_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr,
- pSadrIn6->sin6_flowinfo,
- pSadrIn6->sin6_scope_id );
- break;
- } /* End CASE of IPv6 record. */
- default: /* Can never get here, but just for completeness. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown protocol family (%d).\n",
- pgmName,
- __LINE__,
- ai->ai_family );
- break;
- } /* End DEFAULT case (unknown protocol family). */
- } /* End SWITCH on protocol family. */
- } /* End IF verbose mode. */
- /*
- ** Create a socket.
- */
- if ( !SYSCALL( "socket",
- __LINE__,
- sckt = socket( ai->ai_family,
- ai->ai_socktype,
- ai->ai_protocol ) ) )
- {
- sckt = INVALID_DESC;
- continue; /* Try the next address record in the list. */
- }
- /*
- ** Connect to the remote host.
- */
- if ( !SYSCALL( "connect",
- __LINE__,
- connect( sckt,
- ai->ai_addr,
- ai->ai_addrlen ) ) )
- {
- (void) close( sckt ); /* Could use SYSCALL() again here, but why? */
- sckt = INVALID_DESC;
- continue; /* Try the next address record in the list. */
- }
- } /* End FOR each address record returned by getaddrinfo(3). */
- /*
- ** Clean up & return.
- */
- freeaddrinfo( aiHead );
- return sckt;
-} /* End openSckt() */
-/******************************************************************************
-* Function: tod
-*
-* Description:
-* Receive the time-of-day from the remote server and write it to stdout.
-*
-* Parameters:
-* sckt - The socket descriptor for the connection.
-*
-* Return Value: None.
-******************************************************************************/
-static void tod( int sckt )
-{
- char bfr[ MAXBFRSIZE+1 ];
- int inBytes;
- /*
- ** The client never sends anything, so shut down the write side of the
- ** connection.
- */
- if ( !SYSCALL( "shutdown",
- __LINE__,
- shutdown( sckt, SHUT_WR ) ) )
- {
- return;
- }
- /*
- ** Read the time-of-day from the remote host.
- */
- do
- {
- if ( !SYSCALL( "read",
- __LINE__,
- inBytes = read( sckt,
- bfr,
- MAXBFRSIZE ) ) )
- {
- return;
- }
- bfr[ inBytes ] = '\0'; /* Null-terminate the received string. */
- fputs( bfr, stdout ); /* Null string if EOF (inBytes == 0). */
- } while ( inBytes > 0 );
- fflush( stdout );
-} /* End tod() */
23.1.4.3. 'Daytime' UDP Client Code
tod6uc [-v] [-s scope_id] [host [service]]
/******************************************************************************
-* File: tod6uc.c
-* Description: Contains source code for an IPv6-capable 'daytime' UDP client.
-* Author: John Wenker, Sr. Software Engineer
-* Performance Technologies, San Diego, USA
-******************************************************************************/
-/*
-** System header files.
-*/
-#include <errno.h> /* errno declaration and error codes. */
-#include <net/if.h> /* if_nametoindex(3). */
-#include <netdb.h> /* getaddrinfo(3) and associated definitions. */
-#include <netinet/in.h> /* sockaddr_in and sockaddr_in6 definitions. */
-#include <stdio.h> /* printf(3) et al. */
-#include <stdlib.h> /* exit(2). */
-#include <string.h> /* String manipulation and memory functions. */
-#include <sys/socket.h> /* Socket functions (socket(2), connect(2), etc). */
-#include <unistd.h> /* getopt(3), recvfrom(2), sendto(2), etc. */
-/*
-** Constants & macros.
-*/
-#define DFLT_HOST "localhost" /* Default server name. */
-#define DFLT_SCOPE_ID "eth0" /* Default scope identifier. */
-#define DFLT_SERVICE "daytime" /* Default service name. */
-#define INVALID_DESC -1 /* Invalid file (socket) descriptor. */
-#define MAXBFRSIZE 256 /* Max bfr sz to read remote TOD. */
-#define VALIDOPTS "s:v" /* Valid command options. */
-/*
-** Type definitions (for convenience).
-*/
-typedef enum { false = 0, true } boolean;
-typedef struct sockaddr_in sockaddr_in_t;
-typedef struct sockaddr_in6 sockaddr_in6_t;
-/*
-** Prototypes for internal helper functions.
-*/
-static int openSckt( const char *host,
- const char *service,
- unsigned int scopeId );
-static void tod( int sckt );
-/*
-** Global (within this file only) data objects.
-*/
-static const char *pgmName; /* Program name (w/o directory). */
-static boolean verbose = false; /* Verbose mode. */
-/*
-** Usage macro.
-*/
-#define USAGE \
- { \
- fprintf( stderr, \
- "Usage: %s [-v] [-s scope_id] [host [service]]\n", \
- pgmName ); \
- exit( 127 ); \
- } /* End USAGE macro. */
-/*
-** This "macro" (even though it's really a function) is loosely based on the
-** CHK() macro by Dr. V. Vinge (see server code). The status parameter is
-** a boolean expression indicating the return code from one of the usual system
-** calls that returns -1 on error. If a system call error occurred, an alert
-** is written to stderr. It returns a boolean value indicating success/failure
-** of the system call.
-**
-** Example: if ( !SYSCALL( "write",
-** count = write( fd, bfr, size ) ) )
-** {
-** // Error processing... but SYSCALL() will have already taken
-** // care of dumping an error alert to stderr.
-** }
-*/
-static __inline boolean SYSCALL( const char *syscallName,
- int lineNbr,
- int status )
-{
- if ( ( status == -1 ) && verbose )
- {
- fprintf( stderr,
- "%s (line %d): System call failed ('%s') - %s.\n",
- pgmName,
- lineNbr,
- syscallName,
- strerror( errno ) );
- }
- return status != -1; /* True if the system call was successful. */
-} /* End SYSCALL() */
-/******************************************************************************
-* Function: main
-*
-* Description:
-* Connect to a remote time-of-day service and write the remote host's TOD to
-* stdout.
-*
-* Parameters:
-* The usual argc & argv parameters to a main() program.
-*
-* Return Value:
-* This function always returns zero.
-******************************************************************************/
-int main( int argc,
- char *argv[ ] )
-{
- const char *host = DFLT_HOST;
- int opt;
- int sckt;
- unsigned int scopeId = if_nametoindex( DFLT_SCOPE_ID );
- const char *service = DFLT_SERVICE;
- /*
- ** Determine the program name (w/o directory prefix).
- */
- pgmName = (const char*) strrchr( argv[ 0 ], '/' );
- pgmName = pgmName == NULL ? argv[ 0 ] : pgmName+1;
- /*
- ** Process command line options.
- */
- opterr = 0; /* Turns off "invalid option" error messages. */
- while ( ( opt = getopt( argc, argv, VALIDOPTS ) ) != -1 )
- {
- switch ( opt )
- {
- case 's': /* Scope identifier (IPv6 kluge). */
- {
- scopeId = if_nametoindex( optarg );
- if ( scopeId == 0 )
- {
- fprintf( stderr,
- "%s: Unknown network interface (%s).\n",
- pgmName,
- optarg );
- USAGE;
- }
- break;
- }
- case 'v': /* Verbose mode. */
- {
- verbose = true;
- break;
- }
- default:
- {
- USAGE;
- }
- } /* End SWITCH on command option. */
- } /* End WHILE processing command options. */
- /*
- ** Process command arguments. At the end of the above loop, optind is the
- ** index of the first NON-option argv element.
- */
- switch ( argc - optind )
- {
- case 2: /* Both host & service are specified on the command line. */
- {
- service = argv[ optind + 1 ];
- /***** Fall through *****/
- }
- case 1: /* Host is specified on the command line. */
- {
- host = argv[ optind ];
- /***** Fall through *****/
- }
- case 0: /* Use default host & service. */
- {
- break;
- }
- default:
- {
- USAGE;
- }
- } /* End SWITCH on number of command arguments. */
- /*
- ** Open a connection to the indicated host/service.
- **
- ** Note that if all three of the following conditions are met, then the
- ** scope identifier remains unresolved at this point.
- ** 1) The default network interface is unknown for some reason.
- ** 2) The -s option was not used on the command line.
- ** 3) An IPv6 "scoped address" was not specified for the hostname on the
- ** command line.
- ** If the above three conditions are met, then only an IPv4 socket can be
- ** opened (connect(2) fails without the scope ID properly set for IPv6
- ** sockets).
- */
- if ( ( sckt = openSckt( host,
- service,
- scopeId ) ) == INVALID_DESC )
- {
- fprintf( stderr,
- "%s: Sorry... a connectionless socket could "
- "not be set up.\n",
- pgmName );
- exit( 1 );
- }
- /*
- ** Get the remote time-of-day.
- */
- tod( sckt );
- /*
- ** Close the connection and terminate.
- */
- (void) SYSCALL( "close",
- __LINE__,
- close( sckt ) );
- return 0;
-} /* End main() */
-/******************************************************************************
-* Function: openSckt
-*
-* Description:
-* Sets up a UDP socket to a remote server. Getaddrinfo(3) is used to
-* perform lookup functions and can return multiple address records (i.e. a
-* list of 'struct addrinfo' records). This function traverses the list and
-* tries to establish a connection to the remote server. The function ends
-* when either a connection has been established or all records in the list
-* have been processed.
-*
-* Parameters:
-* host - A pointer to a character string representing the hostname or IP
-* address (IPv4 or IPv6) of the remote server.
-* service - A pointer to a character string representing the service name or
-* well-known port number.
-* scopeId - For IPv6 sockets only. This is the index corresponding to the
-* network interface on which to exchange datagrams. This
-* parameter is ignored for IPv4 sockets or when an IPv6 "scoped
-* address" is specified in 'host' (i.e. where the colon-hex
-* network address is augmented with the scope ID).
-*
-* Return Value:
-* Returns the socket descriptor for the connection, or INVALID_DESC if all
-* address records have been processed and a socket could not be initialized.
-******************************************************************************/
-static int openSckt( const char *host,
- const char *service,
- unsigned int scopeId )
-{
- struct addrinfo *ai;
- int aiErr;
- struct addrinfo *aiHead;
- struct addrinfo hints;
- sockaddr_in6_t *pSadrIn6;
- int sckt;
- /*
- ** Initialize the 'hints' structure for getaddrinfo(3).
- **
- ** Notice that the 'ai_family' field is set to PF_UNSPEC, indicating to
- ** return both IPv4 and IPv6 address records for the host/service. Most of
- ** the time, the user isn't going to care whether an IPv4 connection or an
- ** IPv6 connection is established; the user simply wants to exchange data
- ** with the remote host and doesn't care how it's done. Sometimes, however,
- ** the user might want to explicitly specify the type of underlying socket.
- ** It is left as an exercise for the motivated reader to add a command line
- ** option allowing the user to specify the IP protocol, and then process the
- ** list of addresses accordingly (it's not that difficult).
- */
- memset( &hints, 0, sizeof( hints ) );
- hints.ai_family = PF_UNSPEC; /* IPv4 or IPv6 records (don't care). */
- hints.ai_socktype = SOCK_DGRAM; /* Connectionless communication. */
- hints.ai_protocol = IPPROTO_UDP; /* UDP transport layer protocol only. */
- /*
- ** Look up the host/service information.
- */
- if ( ( aiErr = getaddrinfo( host,
- service,
- &hints,
- &aiHead ) ) != 0 )
- {
- fprintf( stderr,
- "%s (line %d): ERROR - %s.\n",
- pgmName,
- __LINE__,
- gai_strerror( aiErr ) );
- return INVALID_DESC;
- }
- /*
- ** Go through the list and try to open a connection. Continue until either
- ** a connection is established or the entire list is exhausted.
- */
- for ( ai = aiHead, sckt = INVALID_DESC;
- ( ai != NULL ) && ( sckt == INVALID_DESC );
- ai = ai->ai_next )
- {
- /*
- ** IPv6 kluge. Make sure the scope ID is set.
- */
- if ( ai->ai_family == PF_INET6 )
- {
- pSadrIn6 = (sockaddr_in6_t*) ai->ai_addr;
- if ( pSadrIn6->sin6_scope_id == 0 )
- {
- pSadrIn6->sin6_scope_id = scopeId;
- } /* End IF the scope ID wasn't set. */
- } /* End IPv6 kluge. */
- /*
- ** Display the address info for the remote host.
- */
- if ( verbose )
- {
- /*
- ** Temporary character string buffers for host & service.
- */
- char hostBfr[ NI_MAXHOST ];
- char servBfr[ NI_MAXSERV ];
- /*
- ** Display the address information just fetched. Start with the
- ** common (protocol-independent) stuff first.
- */
- fprintf( stderr,
- "Address info:\n"
- " ai_flags = 0x%02X\n"
- " ai_family = %d (PF_INET = %d, PF_INET6 = %d)\n"
- " ai_socktype = %d (SOCK_STREAM = %d, SOCK_DGRAM = %d)\n"
- " ai_protocol = %d (IPPROTO_TCP = %d, IPPROTO_UDP = %d)\n"
- " ai_addrlen = %d (sockaddr_in = %d, "
- "sockaddr_in6 = %d)\n",
- ai->ai_flags,
- ai->ai_family,
- PF_INET,
- PF_INET6,
- ai->ai_socktype,
- SOCK_STREAM,
- SOCK_DGRAM,
- ai->ai_protocol,
- IPPROTO_TCP,
- IPPROTO_UDP,
- ai->ai_addrlen,
- sizeof( struct sockaddr_in ),
- sizeof( struct sockaddr_in6 ) );
- /*
- ** Display the protocol-specific formatted address.
- */
- getnameinfo( ai->ai_addr,
- ai->ai_addrlen,
- hostBfr,
- sizeof( hostBfr ),
- servBfr,
- sizeof( servBfr ),
- NI_NUMERICHOST | NI_NUMERICSERV );
- switch ( ai->ai_family )
- {
- case PF_INET: /* IPv4 address record. */
- {
- sockaddr_in_t *pSadrIn = (sockaddr_in_t*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin_addr: %s\n"
- " sin_port: %s\n",
- pSadrIn->sin_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr );
- break;
- } /* End CASE of IPv4 record. */
- case PF_INET6: /* IPv6 address record. */
- {
- pSadrIn6 = (sockaddr_in6_t*) ai->ai_addr;
- fprintf( stderr,
- " ai_addr = sin6_family: %d (AF_INET = %d, "
- "AF_INET6 = %d)\n"
- " sin6_addr: %s\n"
- " sin6_port: %s\n"
- " sin6_flowinfo: %d\n"
- " sin6_scope_id: %d\n",
- pSadrIn6->sin6_family,
- AF_INET,
- AF_INET6,
- hostBfr,
- servBfr,
- pSadrIn6->sin6_flowinfo,
- pSadrIn6->sin6_scope_id );
- break;
- } /* End CASE of IPv6 record. */
- default: /* Can never get here, but just for completeness. */
- {
- fprintf( stderr,
- "%s (line %d): ERROR - Unknown protocol family (%d).\n",
- pgmName,
- __LINE__,
- ai->ai_family );
- break;
- } /* End DEFAULT case (unknown protocol family). */
- } /* End SWITCH on protocol family. */
- } /* End IF verbose mode. */
- /*
- ** Create a socket.
- */
- if ( !SYSCALL( "socket",
- __LINE__,
- sckt = socket( ai->ai_family,
- ai->ai_socktype,
- ai->ai_protocol ) ) )
- {
- sckt = INVALID_DESC;
- continue; /* Try the next address record in the list. */
- }
- /*
- ** Set the target destination for the remote host on this socket. That
- ** is, this socket only communicates with the specified host.
- */
- if ( !SYSCALL( "connect",
- __LINE__,
- connect( sckt,
- ai->ai_addr,
- ai->ai_addrlen ) ) )
- {
- (void) close( sckt ); /* Could use SYSCALL() again here, but why? */
- sckt = INVALID_DESC;
- continue; /* Try the next address record in the list. */
- }
- } /* End FOR each address record returned by getaddrinfo(3). */
- /*
- ** Clean up & return.
- */
- freeaddrinfo( aiHead );
- return sckt;
-} /* End openSckt() */
-/******************************************************************************
-* Function: tod
-*
-* Description:
-* Receive the time-of-day from the remote server and write it to stdout.
-*
-* Parameters:
-* sckt - The socket descriptor for the connection.
-*
-* Return Value: None.
-******************************************************************************/
-static void tod( int sckt )
-{
- char bfr[ MAXBFRSIZE+1 ];
- int inBytes;
- /*
- ** Send a datagram to the server to wake it up. The content isn't
- ** important, but something must be sent to let it know we want the TOD.
- */
- if ( !SYSCALL( "write",
- __LINE__,
- write( sckt, "Are you there?", 14 ) ) )
- {
- return;
- }
- /*
- ** Read the time-of-day from the remote host.
- */
- if ( !SYSCALL( "read",
- __LINE__,
- inBytes = read( sckt,
- bfr,
- MAXBFRSIZE ) ) )
- {
- return;
- }
- bfr[ inBytes ] = '\0'; /* Null-terminate the received string. */
- fputs( bfr, stdout ); /* Null string if EOF (inBytes == 0). */
- fflush( stdout );
-} /* End tod() */
23.2. Other programming languages
23.2.1. JAVA
23.2.2. Perl
Chapter 24. Interoperability
Chapter 25. Further information and URLs
25.1. Paper printed books, articles, online reviews (mixed)
25.1.1. Printed Books (English)
25.1.1.1. Cisco
25.1.1.2. General
25.1.2. Articles, eBooks, Online Reviews (mixed)
25.1.3. Science Publications (abstracts, bibliographies, online resources)
25.3. Online information
25.3.1. Join the IPv6 backbone
25.3.1.2. Major regional registries
25.3.1.3. Tunnel brokers
25.3.2. Latest news and URLs to other documents
25.3.3. Protocol references
25.3.3.1. IPv6-related Request For Comments (RFCs)
25.3.3.2. Current drafts of working groups
25.3.3.3. Others
25.3.4. More information
25.3.4.1. Linux related
25.3.4.2. Linux related per distribution
25.3.4.3. General
25.3.4.5. Patents
25.3.5. By countries
25.3.5.1. Europe
25.3.5.2. Austria
25.3.5.12. Korea
25.3.5.13. Mexico
25.3.5.14. Netherland
25.3.5.18. United Kingdom
25.3.6. By operating systems
25.3.6.2. Cisco IOS
25.3.6.4. IBM
25.3.6.5. Microsoft
25.3.7. IPv6 Security
25.3.8. Application lists
25.3.8.1. Analyzer tools
25.3.8.2. IPv6 Products
25.4. IPv6 Infrastructure
25.4.1. Statistics
25.4.2. Internet Exchanges
25.4.2.3. France
25.4.3. Tunnel broker
25.4.3.2. Canada
25.4.3.9. Netherlands
25.4.3.10. Norway
25.4.3.13. UK
25.4.3.14. USA
25.4.4. Native IPv6 Services
25.5. Maillists
Focus Request e-mail address What to subscribe Maillist e-mail address Language Access through WWW Linux kernel networking including IPv6 majordomo (at) vger.kernel.org netdev netdev (at) vger.kernel.org English Info, Archive Mobile IP(v6) for Linux Web-based, see URL mipl mipl (at) mobile-ipv6.org English Info, Archive Linux IPv6 users using USAGI extension usagi-users-ctl (at) linux-ipv6.org usagi-users (at) linux-ipv6.org English Info / Search, Archive IPv6 on Debian Linux debian-ipv6 (at) lists.debian.org English Info/Subscription/Archive 6bone majordomo (at) isi.edu 6bone 6bone (at) isi.edu English Info, Archive IPv6 users in general majordomo (at) ipv6.org users users (at) ipv6.org English Info, Archive Bugtracking of Internet applications (1) bugtraq-subscribe (at) securityfocus.com bugtraq (at) securityfocus.com (2) English Info, Archive 25.6. Online tools
25.6.1. Testing tools
25.7. Trainings, Seminars
25.8. 'The Online Discovery' ...
Chapter 26. Revision history / Credits / The End
26.1. Revision history
26.1.1. Releases 0.x
26.2. Credits
26.2.1. Major credits
26.2.2. Other credits
26.2.2.1. Document technique related
26.2.2.2. Content related credits
26.3. The End