-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLinux+IPv6-HOWTO.sgml
5322 lines (5271 loc) · 413 KB
/
Linux+IPv6-HOWTO.sgml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN"
[
<!ENTITY % output.print.png "IGNORE">
<!ENTITY % output.print.pdf "IGNORE">
<!ENTITY % output.print.eps "IGNORE">
<!ENTITY % output.print.bmp "IGNORE">
]>
<!-- SGML file was created by LyX 2.3.4.2
See http://www.lyx.org/ for more information -->
<book lang="en">
<bookinfo>
<title>Linux IPv6 HOWTO (en)</title>
<author><firstname>Peter</firstname><surname>Bieringer</surname><affiliation><address>pb at bieringer dot de</address></affiliation></author>
<revhistory>
<revision> <revnumber>0.67wip</revnumber> <date>2020-04-04</date> <authorinitials>PB</authorinitials></revision>
<revision> <revnumber>0.66</revnumber> <date>2014-05-15</date> <authorinitials>PB</authorinitials></revision>
<revision> <revnumber>0.65</revnumber> <date>2009-12-13</date> <authorinitials>PB</authorinitials></revision>
<revision> <revnumber>0.64</revnumber> <date>2009-06-11</date> <authorinitials>PB</authorinitials></revision>
<revision> <revnumber>0.60</revnumber> <date>2007-05-31</date> <authorinitials>PB</authorinitials></revision>
<revision> <revnumber>0.51</revnumber> <date>2006-11-08</date> <authorinitials>PB</authorinitials></revision>
</revhistory> <abstract>
<para>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 <ulink url="http://mirrors.bieringer.de/Linux+IPv6-HOWTO/">mirrors.bieringer.de</ulink> or <ulink url="http://mirrors.deepspace6.net/Linux+IPv6-HOWTO/">mirrors.deepspace6.net</ulink>. See also <link linkend="revision-history">revision history</link> for changes.</para>
</abstract></bookinfo><chapter id='chapter-general' >
<title><!-- anchor id="chapter-general" -->General</title>
<para>Information about available translations you will find in section <link linkend="general-translations">Translations</link>.</para><sect1 id='general-copright' >
<title><!-- anchor id="general-copright" -->Copyright, license and others</title>
<sect2>
<title>Copyright</title>
<para>Written and Copyright (C) 2001-2020 by Peter Bieringer</para></sect2><sect2>
<title>License</title>
<para>This Linux IPv6 HOWTO is published under GNU GPL version 2:
</para>
<para>The Linux IPv6 HOWTO, a guide how to configure and use IPv6 on Linux systems.
</para>
<para>Copyright © 2001-2020 Peter Bieringer
</para>
<para>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. </para>
<para>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. </para>
<para>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.</para></sect2><sect2>
<title>About the author</title>
<sect3>
<title>Internet/IPv6 history of the author</title>
<itemizedlist>
<listitem><para>1993: I got in contact with the Internet using console based e-mail and news client (e.g. look for ”e91abier” on <ulink url="http://groups.google.com/">groups.google.com</ulink>, that's me).</para></listitem><listitem><para>1996: I got a request for designing a course on IPv6, including a workshop with the Linux operating system.</para></listitem><listitem><para>1997: Started writing a guide on how to install, configure and use IPv6 on Linux systems, called <ulink url="http://www.bieringer.de/linux/IPv6/">IPv6 & Linux - HowTo</ulink> (see <ulink url="http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO-0.html#history">IPv6 & Linux - HowTo/History</ulink> for more information).</para></listitem><listitem><para>2001: Started writing this new Linux IPv6 HOWTO. </para></listitem></itemizedlist></sect3><sect3>
<title>Contact</title>
<para>The author can be contacted via e-mail at <pb at bieringer dot de> and also via his <ulink url="http://www.bieringer.de/pb/">homepage</ulink>.</para>
<para>He's currently living in Munich / Bavaria / Germany / Europe / Earth.</para></sect3></sect2></sect1><sect1 id='general-category' >
<title><!-- anchor id="general-category" -->Category</title>
<para>This HOWTO should be listed in category ”<emphasis>Networking</emphasis>/<emphasis>Protocols</emphasis>”.</para></sect1><sect1>
<title>Version, History and To-Do</title>
<sect2>
<title>Version</title>
<para>The current version is shown at the beginning of the document.</para>
<para>For other available versions/translations see also <ulink url="http://www.bieringer.de/linux/IPv6/">http://www.bieringer.de/linux/IPv6/</ulink>.</para></sect2><sect2>
<title>History</title>
<sect3>
<title>Major history</title>
<para>2001-11-30: Starting to design new HOWTO.</para>
<para>2002-01-02: A lot of content completed, first public release of chapter 1 (version 0.10).</para>
<para>2002-01-14: More completed, some reviews, public release of the whole document (version 0.14).</para>
<para>2002-08-16: Polish translation is in progress</para>
<para>2002-10-31: Chinese translation is available (see <link linkend="general-translations">Translations</link> for more)</para>
<para>2002-11-10: German translation is in progress</para>
<para>2003-02-10: German translation is available</para>
<para>2003-04-09: French translation is in progress</para>
<para>2003-05-09: French translation is available</para>
<para>2003-10-16: Italian translation is in progress</para>
<para>2004-03-12: Italian translation is available</para>
<para>2004-06-18: Greek translation is in progress</para>
<para>2005-07-25: Turkish translation is availble</para>
<para>2007-03-28: Portuguese-Brazil translation is in progress</para>
<para>2008-07-30: Spanish translation is available (lost, URL no longer valid)</para>
<para>2011-05-09: Portuguese-Brazil translation is again in progress</para></sect3><sect3>
<title>Full history</title>
<para>See <link linkend="revision-history">revision history</link> at the end of this document.</para></sect3></sect2><sect2>
<title>To-Do</title>
<itemizedlist>
<listitem><para>Fill in missing content</para></listitem><listitem><para>Finishing grammar checking</para></listitem></itemizedlist></sect2></sect1><sect1 id='general-translations' >
<title><!-- anchor id="general-translations" -->Translations</title>
<para>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.</para>
<para>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.</para><sect2>
<title>To language</title>
<para>Note: an overview with URLs can be found at <ulink url="http://www.bieringer.de/linux/IPv6/">http://www.bieringer.de/linux/IPv6/</ulink>.</para><sect3>
<title>Chinese</title>
<para>A Chinese translation by Burma Chen <expns at yahoo dot com> (announced to me at 2002-10-31) can be found on the TLDP: <ulink url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/zh/Linux-IPv6-HOWTO.txt.gz">http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/zh/Linux-IPv6-HOWTO.txt.gz (g'zipped txt)</ulink>. It's a snapshot translation, don't know whether kept up-to-date.</para></sect3><sect3>
<title>Polish</title>
<para>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).</para></sect3><sect3>
<title>German</title>
<para>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 <ulink url="http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-de/">http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-de/</ulink> (mirrored e.g. on <ulink url="http://mirrors.bieringer.de/Linux+IPv6-HOWTO-de/">http://mirrors.bieringer.de/Linux+IPv6-HOWTO-de/</ulink>). This version will stay up-to-date as much as possible.</para></sect3><sect3>
<title>French</title>
<para>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 <ulink url="http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-fr/">http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-fr/</ulink> (mirrored e.g. on <ulink url="http://mirrors.bieringer.de/Linux+IPv6-HOWTO-fr/">http://mirrors.bieringer.de/Linux+IPv6-HOWTO-fr/</ulink>).</para></sect3><sect3>
<title>Spanish</title>
<para>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.</para></sect3><sect3>
<title>Italian</title>
<para>With 2003-10-16 a Italian translation was started by Michele Ferritto <m dot ferritto at virgilio dot it> for the <ulink url="http://ildp.pluto.linux.it/">ILDP</ulink> (Italian Linux Documentation Project) and the first public version was published 2004-03-12. It's originally available on the ILDP at <ulink url="http://www.pluto.it/ildp/howto/ipv6.html">http://www.pluto.it/ildp/howto/ipv6.html</ulink>.</para></sect3><sect3>
<title>Japanese</title>
<para>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.</para></sect3><sect3>
<title>Greek</title>
<para>On 2004-06-18 Nikolaos Tsarmpopoulos <ntsarb at uth dot gr> send me a note that he planned to translate the HowTo into Greek.</para></sect3><sect3>
<title>Turkish</title>
<para>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 <ulink url="http://docs.comu.edu.tr/howto/ipv6-howto.html">http://docs.comu.edu.tr/howto/ipv6-howto.html</ulink>.</para></sect3><sect3>
<title>Portuguese-Brazil</title>
<para>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.</para></sect3></sect2></sect1><sect1>
<title>Technical</title>
<sect2 id='general-original-source' >
<title><!-- anchor id="general-original-source" -->Original source of this HOWTO</title>
<para>This HOWTO is currently written with LyX version 2.2.2 on a Fedora 25 Linux system with template SGML/XML (DocBook book). It's available on <ulink url="https://github.com/tLDP/Linux-IPv6/">github / tLDP / Linux-IPv6</ulink> for contribution.</para><sect3>
<title>Code line wrapping</title>
<para>Code line wrapping is done using selfmade utility ”lyxcodelinewrapper.pl”, you can get it from GitHub for your own usage: <ulink url="https://github.com/tLDP/Linux-IPv6/">github / tLDP / Linux-IPv6</ulink></para></sect3><sect3>
<title>SGML generation</title>
<para>SGML/XML is generated using export function in LyX.</para></sect3></sect2><sect2>
<title>On-line references to the HTML version of this HOWTO (linking/anchors)</title>
<sect3>
<title>Master index page</title>
<para>Generally, a reference to the master index page is recommended. </para></sect3><sect3>
<title>Dedicated pages</title>
<para>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.</para>
<para>If you think that I have forgotten a tag, please let me know, and I will add it.</para></sect3></sect2></sect1><sect1>
<title>Preface</title>
<para>Some things first:</para><sect2>
<title>How many versions of a Linux & IPv6 related HOWTO are floating around?</title>
<para>Including this, there are three (3) HOWTO documents available. Apologies, if that is too many ;-)</para><sect3>
<title>Linux IPv6 FAQ/HOWTO (outdated)</title>
<para>The first IPv6 related document was written by <emphasis>Eric Osborne</emphasis> and called <ulink url="http://www.linuxhq.com/IPv6/">Linux IPv6 FAQ/HOWTO</ulink> (please use it only for historical issues). Latest version was 3.2.1 released July, 14 1997.</para>
<para>Please help: if someone knows the date of birth of this HOWTO, please send me an e-mail (information will be needed in ”history”).</para></sect3><sect3>
<title>IPv6 & Linux - HowTo (maintained)</title>
<para>There exists a second version called <ulink url="http://www.bieringer.de/linux/IPv6/">IPv6 & Linux - HowTo</ulink> written by me (<emphasis>Peter Bieringer</emphasis>) 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.</para></sect3><sect3>
<title>Linux IPv6 HOWTO (this document)</title>
<para>Because the <ulink url="http://www.bieringer.de/linux/IPv6/">IPv6 & Linux - HowTo</ulink> is written in pure HTML it's not really compatible with the <ulink url="http://www.tldp.org/">The Linux Documentation Project (TLDP)</ulink>. I (<emphasis>Peter Bieringer</emphasis>) got a request in late November 2001 to rewrite the <ulink url="http://www.bieringer.de/linux/IPv6/">IPv6 & Linux - HowTo</ulink> in SGML. However, because of the discontinuation of that HOWTO (<ulink url="http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO-0.html#history">Future of IPv6 & Linux - HowTo</ulink>), 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 (<ulink url="http://www.bieringer.de/linux/IPv6/">IPv6 & Linux - HowTo</ulink>).</para></sect3></sect2></sect1><sect1>
<title>Used terms, glossary and shortcuts</title>
<sect2>
<title>Network related</title>
<variablelist>
<varlistentry><term>Base 10</term><listitem><para>Well known decimal number system, represent any value with digit 0-9.</para></listitem></varlistentry><varlistentry><term>Base 16</term><listitem><para>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).</para></listitem></varlistentry><varlistentry><term>Base 85</term><listitem><para>Representation of a value with 85 different digits/chars, this can lead to shorter strings but never seen in the wild.</para></listitem></varlistentry><varlistentry><term>Bit</term><listitem><para>Smallest storage unit, on/true (1) or off/false (0)</para></listitem></varlistentry><varlistentry><term>Byte</term><listitem><para>Mostly a collection of 8 (but not really a must - see older computer systems) bits</para></listitem></varlistentry><varlistentry><term>Device</term><listitem><para>Here, hardware of network connection, see also NIC</para></listitem></varlistentry><varlistentry><term>Dual homed host</term><listitem><para>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.</para></listitem></varlistentry><varlistentry><term>Host</term><listitem><para>Generally a single homed host on a link. Normally it has only one active network interface, e.g. Ethernet or (not and) PPP.</para></listitem></varlistentry><varlistentry><term>Interface</term><listitem><para>Mostly same as ”device”, see also NIC</para></listitem></varlistentry><varlistentry><term>IP Header</term><listitem><para>Header of an IP packet (each network packet has a header, kind of is depending on network layer)</para></listitem></varlistentry><varlistentry><term>Link</term><listitem><para>A link is a layer 2 network packet transport medium, examples are Ethernet, Token Ring, PPP, SLIP, ATM, ISDN, Frame Relay,...</para></listitem></varlistentry><varlistentry><term>Node</term><listitem><para>A node is a host or a router.</para></listitem></varlistentry><varlistentry><term>Octet</term><listitem><para>A collection of 8 real bits, today also similar to ”byte”.</para></listitem></varlistentry><varlistentry><term>Port</term><listitem><para>Information for the TCP/UDP dispatcher (layer 4) to transport information to upper layers</para></listitem></varlistentry><varlistentry><term>Protocol</term><listitem><para>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)</para></listitem></varlistentry><varlistentry><term>Router</term><listitem><para>A router is a node with two or more network (physical or virtual) interfaces, capable of forwarding packets between the interfaces.</para></listitem></varlistentry><varlistentry><term>Socket</term><listitem><para>An IP socket is defined by source and destination IP addresses and Ports and (binding) </para></listitem></varlistentry><varlistentry><term>Stack</term><listitem><para>Network related a collection of layers</para></listitem></varlistentry><varlistentry><term>Subnetmask</term><listitem><para>IP networks uses bit masks to separate local networks from remote ones</para></listitem></varlistentry><varlistentry><term>Tunnel</term><listitem><para>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.</para></listitem></varlistentry></variablelist><sect3 id='Glossar' >
<title><!-- anchor id="Glossar" -->Shortcuts</title>
<variablelist>
<varlistentry><term>ACL</term><listitem><para>Access Control List</para></listitem></varlistentry><varlistentry><term>API</term><listitem><para>Application Programming Interface</para></listitem></varlistentry><varlistentry><term>ASIC</term><listitem><para>Application Specified Integrated Circuit</para></listitem></varlistentry><varlistentry><term>BSD</term><listitem><para>Berkeley Software Distribution</para></listitem></varlistentry><varlistentry><term>CAN-Bus</term><listitem><para>Controller Area Network Bus (physical bus system)</para></listitem></varlistentry><varlistentry><term>ISP</term><listitem><para>Internet Service Provider</para></listitem></varlistentry><varlistentry><term>KAME</term><listitem><para>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 <ulink url="http://www.kame.net/">www.kame.net</ulink></para></listitem></varlistentry><varlistentry><term>LIR</term><listitem><para>Local Internet Registry</para></listitem></varlistentry><varlistentry><term>NIC</term><listitem><para>Network Interface Card</para></listitem></varlistentry><varlistentry><term>RFC</term><listitem><para>Request For Comments - set of technical and organizational notes about the Internet</para></listitem></varlistentry><varlistentry><term>USAGI</term><listitem><para>UniverSAl playGround for Ipv6 Project - works to deliver the production quality IPv6 protocol stack for the Linux system.</para></listitem></varlistentry></variablelist></sect3></sect2><sect2>
<title>Document related</title>
<sect3>
<title>Long code line wrapping signal char</title>
<para>The special character ”¬” is used for signaling that this code line is wrapped for better viewing in PDF and PS files.</para></sect3><sect3>
<title>Placeholders</title>
<para>In generic examples you will sometimes find the following:</para><screen>
<![CDATA[<myipaddress>
]]></screen><para>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.</para><screen>
<![CDATA[1.2.3.4
]]></screen></sect3><sect3>
<title>Commands in the shell</title>
<para>Commands executable as non-root user begin with $, e.g.</para><screen>
<![CDATA[$ whoami
]]></screen><para>Commands executable as root user begin with #, e.g.</para><screen>
<![CDATA[# whoami
]]></screen></sect3></sect2></sect1><sect1>
<title>Requirements for using this HOWTO</title>
<sect2>
<title>Personal prerequisites</title>
<sect3>
<title>Experience with Unix tools</title>
<para>You should be familiar with the major Unix tools e.g. <emphasis>grep</emphasis>, <emphasis>awk</emphasis>, <emphasis>find</emphasis>, ... , and know about their most commonly used command-line options.</para></sect3><sect3>
<title>Experience with networking theory</title>
<para>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: <ulink url=" https://web.archive.org/web/20121018222845/http://www.rigacci.org/docs/biblio/online/intro_to_networking/book1.htm"> https://web.archive.org/web/20121018222845/http://www.rigacci.org/docs/biblio/online/intro_to_networking/book1.htm</ulink></para></sect3><sect3>
<title>Experience with IPv4 configuration</title>
<para>You should definitely have some experience in IPv4 configuration, otherwise it will be hard for you to understand what is really going on.</para></sect3><sect3>
<title>Experience with the Domain Name System (DNS)</title>
<para>Also you should understand what the Domain Name System (DNS) is, what it provides and how to use it.</para></sect3><sect3>
<title>Experience with network debugging strategies</title>
<para>You should at least understand how to use <emphasis>tcpdump</emphasis> and what<emphasis> </emphasis>it can show you. Otherwise, network debugging will very difficult for you.</para></sect3></sect2><sect2>
<title>Linux operating system compatible hardware</title>
<para>Surely you wish to experiment with real hardware, and not only read this HOWTO to fall asleep here and there. ;-7)</para></sect2></sect1></chapter><chapter id='chapter-basics' >
<title><!-- anchor id="chapter-basics" -->Basics</title>
<sect1>
<title>What is IPv6?</title>
<para>IPv6 is a new layer 3 protocol which will supersede IPv4 (also known as IP). IPv4 was designed a long time ago (<ulink url="http://www.faqs.org/rfcs/rfc760.html">RFC 760 / Internet Protocol</ulink> from January 1980) and since its inception, there have been many requests for more addresses and enhanced capabilities. Latest RFC is <ulink url="http://www.faqs.org/rfcs/rfc2460.html">RFC 2460 / Internet Protocol Version 6 Specification</ulink>. 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.</para>
<para>For more information about the IPv6 history take a look at older IPv6 related RFCs listed e.g. at <ulink url="http://www.switch.ch/lan/ipv6/references.html">SWITCH IPv6 Pilot / References</ulink>.</para></sect1><sect1 id='basic-history-IPv6-Linux' >
<title><!-- anchor id="basic-history-IPv6-Linux" -->History of IPv6 in Linux</title>
<para>The years 1992, 1993 and 1994 of the IPv6 History (in general) are covered by the following document: <ulink url="http://www.laynetworks.com/IPv6.htm#CH3">IPv6 or IPng (IP next generation)</ulink>.</para>
<para>To-do: better time-line, more content...</para><sect2>
<title>Beginning</title>
<para>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:</para><screen>
<![CDATA[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>
]]></screen><para>The shown lines were copied from patch-2.1.8 (e-mail address was blanked on copy&paste).</para></sect2><sect2>
<title>In between</title>
<para>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 <ulink url="http://www.linux-ipv6.org/">USAGI</ulink>, whose aim was to implement all missing, or outdated IPv6 support in Linux. It tracks the current IPv6 implementation in FreeBSD made by the <ulink url="http://www.kame.net/">KAME project</ulink>. From time to time they create snapshots against current vanilla Linux kernel sources.</para>
<para>Until kernel development series 2.5.x was started, the <ulink url="http://www.linux-ipv6.org/">USAGI</ulink> 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.</para>
<para>During kernel development series 2.5.x, <ulink url="http://www.linux-ipv6.org/">USAGI</ulink> tried to insert all of their current extensions into this.</para></sect2><sect2>
<title>Current</title>
<para>Many of the long-term developed IPv6 related patches by <ulink url="http://www.linux-ipv6.org/">USAGI</ulink> and others are integrated into vanilla kernel series 2.6.x.</para></sect2><sect2>
<title>Future</title>
<para><ulink url="http://www.linux-ipv6.org/">USAGI</ulink> 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.</para></sect2></sect1><sect1>
<title>What do IPv6 addresses look like?</title>
<para>As previously mentioned, IPv6 addresses are 128 bits long. This number of bits generates very high decimal numbers with up to 39 digits: </para><screen>
<![CDATA[2^128-1: 340282366920938463463374607431768211455
]]></screen><para>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.</para><screen>
<![CDATA[2^128-1: 0xffffffffffffffffffffffffffffffff
]]></screen><para>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:</para><screen>
<![CDATA[2^128-1: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
]]></screen><para>A usable address (see address types later) is e.g.: </para><screen>
<![CDATA[2001:0db8:0100:f101:0210:a4ff:fee3:9566
]]></screen><para>For simplifications, leading zeros of each 16 bit block can be omitted: </para><screen>
<![CDATA[2001:0db8:0100:f101:0210:a4ff:fee3:9566 ->
¬ 2001:db8:100:f101:210:a4ff:fee3:9566
]]></screen><para>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. </para><screen>
<![CDATA[2001:0db8:100:f101:0:0:0:1 -> 2001:db8:100:f101::1
]]></screen><para>The biggest reduction is seen by the IPv6 localhost address: </para><screen>
<![CDATA[0000:0000:0000:0000:0000:0000:0000:0001 -> ::1
]]></screen><para>There is also a so-called <emphasis>compact</emphasis> (base85 coded) representation defined in <ulink url="http://www.faqs.org/rfcs/rfc1924.html">RFC 1924 / A Compact Representation of IPv6 Addresses</ulink> (published on 1. April 1996), never seen in the wild, probably an April fool's joke, but here is an example: </para><screen>
<![CDATA[# ipv6calc --addr_to_base85 2001:0db8:0100:f101:0210:a4ff:fee3:9566
9R}vSQZ1W=9A_Q74Lz&R
]]></screen><blockquote>
<para>Info: <emphasis>ipv6calc</emphasis> is an IPv6 address format calculator and converter program and can be found here: <ulink url="http://www.deepspace6.net/projects/ipv6calc.html">ipv6calc homepage</ulink> (<ulink url="http://mirrors.bieringer.de/www.deepspace6.net/projects/ipv6calc.html">Mirror</ulink>)</para>
</blockquote></sect1><sect1>
<title>FAQ (Basics)</title>
<sect2>
<title>Why is the name IPv6 and not IPv5 as successor for IPv4?</title>
<para>On any IP header, the first 4 bits are reserved for protocol version. So theoretically a protocol number between 0 and 15 is possible:</para><itemizedlist>
<listitem><para>4: is already used for IPv4</para></listitem><listitem><para>5: is reserved for the Stream Protocol (STP, <ulink url="http://www.faqs.org/rfcs/rfc1819.html">RFC 1819 / Internet Stream Protocol Version 2</ulink>) (which never really made it to the public)</para></listitem></itemizedlist><para>The next free number was 6. Hence IPv6 was born!</para></sect2><sect2>
<title>IPv6 addresses: why such a high number of bits?</title>
<para>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...</para>
<para>So designers have chosen 128 bits, 4 times more in length than in IPv4 today.</para>
<para>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.</para>
<para>See also for more information <ulink url="http://www.faqs.org/rfcs/rfc1715.html">RFC 1715 / The H Ratio for Address Assignment Efficiency</ulink> and <ulink url="http://www.faqs.org/rfcs/rfc3194.html">RFC 3194 / The Host-Density Ratio for Address Assignment Efficiency</ulink>.</para></sect2><sect2>
<title>IPv6 addresses: why so small a number of bits on a new design?</title>
<para>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.</para></sect2></sect1></chapter><chapter id='chapter-addresstypes' >
<title><!-- anchor id="chapter-addresstypes" -->Address types</title>
<para>Like IPv4, IPv6 addresses can be split into network and host parts using subnet masks.</para>
<para>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).</para>
<para>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).
</para>
<para>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.</para><sect1>
<title>Addresses without a special prefix</title>
<sect2>
<title>Localhost address</title>
<para>This is a special address for the loopback interface, similiar to IPv4 with its ”127.0.0.1”. With IPv6, the localhost address is:</para><screen>
<![CDATA[0000:0000:0000:0000:0000:0000:0000:0001
]]></screen><para>or compressed:</para><screen>
<![CDATA[::1
]]></screen><para>Packets with this address as source or destination should never leave the sending host.</para></sect2><sect2>
<title>Unspecified address</title>
<para>This is a special address like ”any” or ”0.0.0.0” in IPv4 . For IPv6 it's:</para><screen>
<![CDATA[0000:0000:0000:0000:0000:0000:0000:0000
]]></screen><para>or:</para><screen>
<![CDATA[::
]]></screen><para>These addresses are mostly used/seen in socket binding (to any IPv6 address) or routing tables.</para>
<para>Note: the unspecified address cannot be used as destination address.</para></sect2><sect2>
<title>IPv6 address with embedded IPv4 address</title>
<para>There are two addresses which contain an IPv4 address.</para><sect3>
<title>IPv4-mapped IPv6 address</title>
<para>IPv4-only IPv6-compatible addresses are sometimes used/shown for sockets created by an IPv6-enabled daemon, but only binding to an IPv4 address.</para>
<para>These addresses are defined with a special prefix of length 96 (a.b.c.d is the IPv4 address):</para><screen>
<![CDATA[0:0:0:0:0:ffff:a.b.c.d/96
]]></screen><para>or in compressed format</para><screen>
<![CDATA[::ffff:a.b.c.d/96
]]></screen><para>For example, the IPv4 address 1.2.3.4 looks like this:</para><screen>
<![CDATA[::ffff:1.2.3.4
]]></screen></sect3><sect3>
<title>IPv4-compatible IPv6 address</title>
<para>IPv4-compatible IPv6 addresses are used for automatic tunneling (<ulink url="http://www.faqs.org/rfcs/rfc2893.html">RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers</ulink>), which is being replaced by <link linkend="tunneling-6to4.">6to4 tunneling</link>.</para><screen>
<![CDATA[0:0:0:0:0:0:a.b.c.d/96
]]></screen><para>or in compressed format</para><screen>
<![CDATA[::a.b.c.d/96
]]></screen></sect3></sect2></sect1><sect1>
<title>Network part, also known as prefix</title>
<para>Designers defined some address types and left a lot of scope for future definitions as currently unknown requirements arise. <ulink url="http://www.faqs.org/rfcs/rfc4291.html">RFC 4291 / IP Version 6 Addressing Architecture</ulink> defines the current addressing scheme.
</para>
<para>Now lets take a look at the different types of prefixes (and therefore address types):</para><sect2>
<title>Link local address type</title>
<para>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:</para><itemizedlist>
<listitem><para>anyone else here on this link?</para></listitem><listitem><para>anyone here with a special address (e.g. looking for a router)?</para></listitem></itemizedlist><para>They begin with ( where <emphasis>”x”</emphasis> is any hex character, normally <emphasis>”0</emphasis>”)</para><screen>
<![CDATA[fe8x: <- currently the only one in use
fe9x:
feax:
febx:
]]></screen><para>An address with this prefix is found on each IPv6-enabled interface after stateless auto-configuration (which is normally always the case).</para></sect2><sect2>
<title>Site local address type</title>
<para>These are addresses similar to the <ulink url="http://www.faqs.org/rfcs/rfc1918.html">RFC 1918 / Address Allocation for Private Internets</ulink> 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.</para>
<para>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.</para>
<para>It begins with: </para><screen>
<![CDATA[fecx: <- most commonly used
fedx:
feex:
fefx:
]]></screen><para>(where<emphasis> ”x”</emphasis> is any hex character, normally <emphasis>”0</emphasis>”) </para>
<para>This address type is now deprecated <ulink url="http://www.faqs.org/rfcs/rfc3879.html">RFC 3879 / Deprecating Site Local Addresses</ulink>, but for a test in a lab, such addresses are still a good choice in my humble opinion.</para></sect2><sect2>
<title>Unique Local IPv6 Unicast Addresses</title>
<para>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 <ulink url="http://www.faqs.org/rfcs/rfc4193.html">RFC 4193 / Unique Local IPv6 Unicast Addresses</ulink>.
</para>
<para>It begins with: </para><screen>
<![CDATA[fcxx:
fdxx: <- currently the only one in use
]]></screen><para>A part of the prefix (40 bits) are generated using a pseudo-random algorithm and it's improbable, that two generated ones are equal.</para>
<para>Example for a prefix (generated using a web-based tool: <ulink url="http://www.goebel-consult.de/ipv6/createLULA">Goebel Consult / createLULA</ulink>):</para><screen>
<![CDATA[fd0f:8b72:ac90::/48
]]></screen></sect2><sect2>
<title>Global address type "(Aggregatable) global unicast"</title>
<para>Today, there is one global address type defined (the first design, called "provider based," was thrown away some years ago <ulink url="http://www.faqs.org/rfcs/rfc1884.html">RFC 1884 / IP Version 6 Addressing Architecture [obsolete]</ulink>, you will find some remains in older Linux kernel sources).</para>
<para>It begins with (<emphasis>x</emphasis> are hex characters)</para><screen>
<![CDATA[2xxx:
3xxx:
]]></screen><para>Note: the prefix ”aggregatable” is thrown away in current drafts.
There are some further subtypes defined, see below:</para><sect3>
<title>6bone test addresses</title>
<para>These were the first global addresses which were defined and in use. They all start with </para><screen>
<![CDATA[3ffe:
]]></screen><para>Example:</para><screen>
<![CDATA[3ffe:ffff:100:f102::1
]]></screen><para>A special 6bone test address which will never be globally unique begins with </para><screen>
<![CDATA[3ffe:ffff:
]]></screen><para>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 <ulink url="http://www.faqs.org/rfcs/rfc3701.html">RFC 3701 / 6bone Phaseout</ulink> for more).</para></sect3><sect3>
<title>6to4 addresses</title>
<para>These addresses, designed for a special tunneling mechanism [<ulink url="http://www.faqs.org/rfcs/rfc3056.html">RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds</ulink> and <ulink url="http://www.faqs.org/rfcs/rfc2893.html">RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers</ulink>], encode a given IPv4 address and a possible subnet and begin with </para><screen>
<![CDATA[2002:
]]></screen><para>For example, representing 192.168.1.1/5:</para><screen>
<![CDATA[2002:c0a8:0101:5::1
]]></screen><para>A small shell command line can help you generating such address out of a given IPv4 one:</para><screen>
<![CDATA[ipv4="1.2.3.4"; sla="5"; printf "2002:%02x%02x:%02x%02x:%04x::1" `echo $ipv4
¬ | tr "." " "` $sla
]]></screen><para>See also <link linkend="tunneling-6to4.">tunneling using 6to4</link> and <link linkend="information-joinipv6-6to4-tunneling">information about 6to4 relay routers</link>.</para></sect3><sect3>
<title>Assigned by provider for hierarchical routing</title>
<para>These addresses are delegated to Internet service providers (ISP) and begin currently with</para><screen>
<![CDATA[2001:
]]></screen><para>Prefixes to major (backbone owning) ISPs (also known as LIRs) are delegated by <link linkend="information-majorregionregistries">local registries</link> and currently have a prefix with length 32 assigned.</para>
<para>Any ISP customer can get a prefix with length 48.</para></sect3><sect3>
<title>Addresses reserved for examples and documentation</title>
<para>Currently, two address ranges are reserved for examples and documentation <ulink url="http://www.faqs.org/rfcs/rfc3849.html">RFC 3849 / IPv6 Address Prefix Reserved for Documentation</ulink>:</para><screen>
<![CDATA[3fff:ffff::/32
2001:0DB8::/32 EXAMPLENET-WF
]]></screen><para>These address ranges should be filtered based on source addresses and should NOT be routed on border routers to the internet, if possible.</para></sect3></sect2><sect2>
<title>Multicast addresses</title>
<para>Multicast addresses are used for related services. </para>
<para>They alway start with (<emphasis>xx</emphasis> is the scope value)</para><screen>
<![CDATA[ffxy:
]]></screen><para>They are split into scopes and types:</para><sect3>
<title>Multicast scopes</title>
<para>Multicast scope is a parameter to specify the maximum distance a multicast packet can travel from the sending entity.</para>
<para>Currently, the following regions (scopes) are defined:</para><itemizedlist>
<listitem><para>ffx1: node-local, packets never leave the node.</para></listitem><listitem><para>ffx2: link-local, packets are never forwarded by routers, so they never leave the specified link.</para></listitem><listitem><para>ffx5: site-local, packets never leave the site.</para></listitem><listitem><para>ffx8: organization-local, packets never leave the organization (not so easy to implement, must be covered by routing protocol).</para></listitem><listitem><para>ffxe: global scope.</para></listitem><listitem><para>others are reserved</para></listitem></itemizedlist></sect3><sect3>
<title>Multicast types</title>
<para>There are many types already defined/reserved (see <ulink url="http://www.faqs.org/rfcs/rfc4291.html">RFC 4291 / IP Version 6 Addressing Architecture</ulink> for details). Some examples are:</para><itemizedlist>
<listitem><para>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).</para></listitem><listitem><para>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)</para></listitem></itemizedlist></sect3><sect3>
<title>Solicited node link-local multicast address</title>
<para>Special multicast address used as destination address in neighborhood discovery, because unlike in IPv4, ARP no longer exists in IPv6.</para>
<para>An example of this address looks like</para><screen>
<![CDATA[ff02::1:ff00:1234
]]></screen><para>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.</para></sect3></sect2><sect2>
<title>Anycast addresses</title>
<para>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.</para>
<para>Note: Anycast addresses cannot be used as source addresses, they are only used as destination addresses.</para><sect3>
<title>Subnet-router anycast address</title>
<para>A simple example for an anycast address is the subnet-router anycast address. Assuming that a node has the following global assigned IPv6 address:</para><screen>
<![CDATA[2001:db8:100:f101:210:a4ff:fee3:9566/64 <- Node's address
]]></screen><para>The subnet-router anycast address will be created blanking the suffix (least significant 64 bits) completely:</para><screen>
<![CDATA[2001:db8:100:f101::/64 <- subnet-router anycast address
]]></screen></sect3></sect2></sect1><sect1>
<title>Address types (host part)</title>
<para>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.</para>
<para>This host part can be inspected differently: </para><sect2>
<title>Automatically computed (also known as stateless)</title>
<para>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.</para>
<para>E.g. a NIC has following MAC address (48 bit):</para><screen>
<![CDATA[00:10:a4:01:23:45
]]></screen><para>This would be expanded according to the<ulink url="http://standards.ieee.org/regauth/oui/tutorials/EUI64.html">IEEE-Tutorial EUI-64</ulink> design for EUI-48 identifiers to the 64 bit interface identifier:</para><screen>
<![CDATA[0210:a4ff:fe01:2345
]]></screen><para>With a given prefix, the result is the IPv6 address shown in example above:</para><screen>
<![CDATA[2001:0db8:0100:f101:0210:a4ff:fe01:2345
]]></screen><sect3>
<title>Privacy problem with automatically computed addresses and a solution</title>
<para>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.</para>
<para>This is a known problem, and a solution was defined: privacy extension, defined in <ulink url="http://www.faqs.org/rfcs/rfc3041.html">RFC 3041 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6</ulink> (there is also already a newer draft available: <ulink url="http://www.ietf.org/ids.by.wg/ipv6.html">draft-ietf-ipv6-privacy-addrs-v2-*</ulink>). 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.</para></sect3></sect2><sect2>
<title>Manually set</title>
<para>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. </para><screen>
<![CDATA[2001:0db8:100:f101::1
]]></screen><para>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.</para></sect2></sect1><sect1>
<title>Prefix lengths for routing</title>
<para>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).
</para>
<para>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: <ulink url="http://www.ietf.org/ids.by.wg/multi6.html">drafts-ietf-multi6-*</ulink>,<ulink url="http://arneill-py.sacramento.ca.us/ipv6mh/">IPv6 Multihoming Solutions</ulink>).</para><sect2>
<title>Prefix lengths (also known as "netmasks")</title>
<para>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, <ulink url="http://www.faqs.org/rfcs/rfc1519.html">RFC 1519 / Classless Inter-Domain Routing</ulink>) scheme, which specifies the number of bits of the IP address to be used for routing. It is also called the "slash" notation.</para>
<para>An example: </para><screen>
<![CDATA[2001:0db8:100:1:2:3:4:5/48
]]></screen><para>This notation will be expanded:</para><itemizedlist>
<listitem><para>Network: </para></listitem></itemizedlist><screen>
<![CDATA[2001:0db8:0100:0000:0000:0000:0000:0000
]]></screen><itemizedlist>
<listitem><para>Netmask: </para></listitem></itemizedlist><screen>
<![CDATA[ffff:ffff:ffff:0000:0000:0000:0000:0000
]]></screen></sect2><sect2>
<title>Matching a route</title>
<para>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.</para>
<para>For example if a routing table shows following entries (list is not complete):</para><screen>
<![CDATA[2001:0db8:100::/48 :: U 1 0 0 sit1
2000::/3 ::192.88.99.1 UG 1 0 0 tun6to4
]]></screen><para>Shown destination addresses of IPv6 packets will be routed through shown device</para><screen>
<![CDATA[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
]]></screen></sect2></sect1></chapter><chapter id='chapter-systemcheck' >
<title><!-- anchor id="chapter-systemcheck" -->IPv6-ready system check</title>
<para>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.</para><sect1 id='systemcheck-kernel' >
<title><!-- anchor id="systemcheck-kernel" -->IPv6-ready kernel</title>
<para>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.</para>
<para>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.</para><sect2>
<title>Check for IPv6 support in the current running kernel</title>
<para>To check, whether your current running kernel supports IPv6, take a look into your /proc-file-system. Following entry must exists: </para><screen>
<![CDATA[/proc/net/if_inet6
]]></screen><para>A short automatical test looks like:</para><screen>
<![CDATA[# test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready"
]]></screen><para>If this fails, it is quite likely, that the IPv6 module is not loaded.</para></sect2><sect2>
<title>Try to load IPv6 module</title>
<para>You can try to load the IPv6 module executing</para><screen>
<![CDATA[# modprobe ipv6
]]></screen><para>If this is successful, this module should be listed, testable with following auto-magically line:</para><screen>
<![CDATA[# lsmod |grep -w 'ipv6' && echo "IPv6 module successfully loaded"
]]></screen><para>And the check shown above should now run successfully.</para>
<para>Note: unloading the module is currently not supported and can result, under some circumstances, in a kernel crash.</para><sect3>
<title>Automatically loading of module</title>
<para>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):</para><screen>
<![CDATA[alias net-pf-10 ipv6 # automatically load IPv6 module on demand
]]></screen><para>It's also possible to disable automatically loading of the IPv6 module using following line</para><screen>
<![CDATA[alias net-pf-10 off # disable automatically load of IPv6 module on demand
]]></screen><para>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.</para></sect3></sect2><sect2>
<title>Compile kernel with IPv6 capabilities</title>
<para>If both above shown results were negative and your kernel has no IP6 support, than you have the following options:</para><itemizedlist>
<listitem><para>Update your distribution to a current one which supports IPv6 out-of-the-box (recommended for newbies)</para></listitem><listitem><para>Compile a new vanilla kernel (easy, if you know which options you needed)</para></listitem><listitem><para>Recompile kernel sources given by your Linux distribution (sometimes not so easy)</para></listitem><listitem><para>Compile a kernel with USAGI extensions</para></listitem></itemizedlist><para>If you decide to compile a kernel, you should have previous experience in kernel compiling and read the <ulink url="http://www.tldp.org/HOWTO/Kernel-HOWTO.html">Linux Kernel HOWTO</ulink>.</para>
<para>A comparison between vanilla and USAGI extended kernels is available on <ulink url="http://www.bieringer.de/linux/IPv6/status/IPv6+Linux-status-kernel.html">IPv6+Linux-Status-Kernel</ulink>.</para><sect3>
<title>Compiling a vanilla kernel</title>
<para>More detailed hints about compiling an IPv6-enabled kernel can be found e.g. on <ulink url="http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO-2.html#kernel">IPv6-HOWTO-2#kernel</ulink>.</para>
<para>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.</para></sect3><sect3>
<title>Compiling a kernel with USAGI extensions</title>
<para>Same as for vanilla kernel, only recommend for advanced users, which are already familiar with IPv6 and kernel compilation. See also <ulink url="http://www.linux-ipv6.org/faq.html">USAGI project / FAQ</ulink> and <ulink url="http://www.deepspace6.net/docs/best_ipv6_support.html">Obtaining the best IPv6 support with Linux (Article)</ulink> (<ulink url="http://mirrors.bieringer.de/www.deepspace6.net/docs/best_ipv6_support.html">Mirror</ulink>).</para></sect3></sect2><sect2>
<title>IPv6-ready network devices</title>
<para>Not all existing network devices have already (or ever) the capability to transport IPv6 packets. A current status can be found at <ulink url="http://www.bieringer.de/linux/IPv6/status/IPv6+Linux-status-kernel.html#transport">IPv6+Linux-status-kernel.html#transport</ulink>.</para>
<para>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).</para><sect3>
<title>Currently known never ”IPv6 capable links”</title>
<itemizedlist>
<listitem><para>Serial Line IP (SLIP, <ulink url="http://www.faqs.org/rfcs/rfc1055.html">RFC 1055 / SLIP</ulink>), should be better called now to SLIPv4, device named: slX</para></listitem><listitem><para>Parallel Line IP (PLIP), same like SLIP, device names: plipX</para></listitem><listitem><para>ISDN with encapsulation <emphasis>rawip</emphasis>, device names: isdnX</para></listitem></itemizedlist></sect3><sect3>
<title>Currently known ”not supported IPv6 capable links”</title>
<itemizedlist>
<listitem><para>ISDN with encapsulation <emphasis>syncppp</emphasis>, device names: ipppX (design issue of the ipppd, will be merged into more general PPP layer in kernel series 2.5.x)</para></listitem></itemizedlist></sect3></sect2></sect1><sect1>
<title>IPv6-ready network configuration tools</title>
<para>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.</para><sect2>
<title>net-tools package</title>
<para>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.</para>
<para>Auto-magically check:</para><screen>
<![CDATA[# /sbin/ifconfig -? 2>& 1|grep -qw 'inet6' && echo "utility 'ifconfig' is
¬ IPv6-ready"
]]></screen><para>Same check can be done for route:</para><screen>
<![CDATA[# /sbin/route -? 2>& 1|grep -qw 'inet6' && echo "utility 'route' is IPv6-ready"
]]></screen></sect2><sect2>
<title>iproute package</title>
<para>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. </para><screen>
<![CDATA[# /sbin/ip 2>&1 |grep -qw 'inet6' && echo "utility 'ip' is IPv6-ready"
]]></screen><para>If the program /sbin/ip isn't found, then I strongly recommend you install the iproute package. </para><itemizedlist>
<listitem><para>You can get it from your Linux distribution (if contained)</para></listitem><listitem><para>You're able to look for a proper RPM package at <ulink url="http://rpmfind.net/linux/rpm2html/search.php?query=iproute">RPMfind/iproute</ulink> (sometimes rebuilding of a SRPMS package is recommended)</para></listitem></itemizedlist></sect2></sect1><sect1>
<title>IPv6-ready test/debug programs</title>
<para>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.</para><sect2 id='program-ping6.' >
<title><!-- anchor id="program-ping6." -->IPv6 ping</title>
<para>This program is normally included in package <emphasis>iputils</emphasis>. It is designed for simple transport tests sending ICMPv6 echo-request packets and wait for ICMPv6 echo-reply packets.</para>
<para>Usage</para><screen>
<![CDATA[# ping6 <hostwithipv6address>
# ping6 <ipv6address>
# ping6 [-I <device>] <link-local-ipv6address>
]]></screen><para>Some implementation also support %<device> suffix instead of using -I <device>, e.g.</para><screen>
<![CDATA[# ping6 <link-local-ipv6address>%<device>
]]></screen><para>Example</para><screen>
<![CDATA[# 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
]]></screen><para>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:</para><orderedlist>
<listitem><para>ping6 is not in users path (probably, because ping6 is generally stored in /usr/sbin -> add path (not really recommended)</para></listitem><listitem><para>ping6 doesn't execute properly, generally because of missing root permissions -> chmod u+s /usr/sbin/ping6</para></listitem></orderedlist><sect3>
<title>Specifying interface for IPv6 ping</title>
<para>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:</para><screen>
<![CDATA[# ping6 fe80::212:34ff:fe12:3456
connect: Invalid argument
]]></screen><para>In this case you have to specify the interface additionally like shown here:</para><screen>
<![CDATA[# 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
]]></screen><para>Example for %<device> notation:</para><screen>
<![CDATA[# ping6 -c 1 fe80::2e0:18ff:fe90:9205%eth0
]]></screen></sect3><sect3>
<title>Ping6 to multicast addresses</title>
<para>An interesting mechanism to detect IPv6-active hosts on a link is to ping6 to the link-local all-node multicast address:</para><screen>
<![CDATA[# 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!)
]]></screen><para>Example for %<device> notation:</para><screen>
<![CDATA[# ping6 ff02::1%eth0
]]></screen><para>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.</para></sect3></sect2><sect2 id='program-traceroute6.' >
<title><!-- anchor id="program-traceroute6." -->IPv6 traceroute6</title>
<sect3>
<title>IPv6 traceroute6 (old)</title>
<para>This older program is normally included in package <emphasis>iputils</emphasis>. It's a program similar to IPv4 traceroute. Below you will see an example:</para><screen>
<![CDATA[# 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
]]></screen><para>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. </para>
<para>If a dedicated interface must be specified, this can be done by -i <device> or using <address>%<device>.</para></sect3><sect3>
<title>traceroute since version 2</title>
<para>traceroute got native IPv6 support with version 2 and support all features as for IPv4. Below you will see an example for an ICMP (ping) traceroute (root permissions required) </para><screen>
<![CDATA[# traceroute -I -n ipv6.google.com
traceroute to ipv6.google.com (2a00:1450:4016:804::200e), 30 hops max, 80 byte packets
1 2001:a61:*** 0.410 ms 0.510 ms 0.655 ms
2 2001:a60::89:705:1 26.428 ms 34.361 ms 41.777 ms
3 2001:a60::89:0:1:2 19.131 ms 19.163 ms 19.248 ms
4 2001:a60:0:106::2 20.464 ms 20.467 ms 20.457 ms
5 2001:4860::9:4000:cf86 21.836 ms * 21.852 ms
6 2001:4860:0:1::19 21.690 ms 21.585 ms 22.919 ms
7 2a00:1450:4016:804::200e 23.176 ms 19.310 ms 20.065 ms
]]></screen><para>If a dedicated interface must be specified, this can be done by -i <device>.</para></sect3></sect2><sect2 id='program-tracepath6.' >
<title><!-- anchor id="program-tracepath6." -->IPv6 tracepath6</title>
<para>This program is normally included in package <emphasis>iputils</emphasis>. 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:</para><screen>
<![CDATA[# 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
]]></screen></sect2><sect2 id='program-tcpdump' >
<title><!-- anchor id="program-tcpdump" -->IPv6 tcpdump</title>
<para>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.</para>
<para>tcpdump uses expressions for filtering packets to minimize the noise:</para><itemizedlist>
<listitem><para>icmp6: filters native ICMPv6 traffic</para></listitem><listitem><para>ip6: filters native IPv6 traffic (including ICMPv6)</para></listitem><listitem><para>proto ipv6: filters tunneled IPv6-in-IPv4 traffic</para></listitem><listitem><para>not port ssh: to suppress displaying SSH packets for running tcpdump in a remote SSH session</para></listitem></itemizedlist><para>Also some command line options are very useful to catch and print more information in a packet, mostly interesting for digging into ICMPv6 packets:</para><itemizedlist>
<listitem><para>“-s 512”: increase the snap length during capturing of a packet to 512 bytes</para></listitem><listitem><para>“-vv”: really verbose output</para></listitem><listitem><para>“-n”: don't resolve addresses to names, useful if reverse DNS resolving isn't working proper</para></listitem></itemizedlist><sect3>
<title>IPv6 ping to 2001:0db8:100:f101::1 native over a local link</title>
<screen>
<![CDATA[# 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)
]]></screen></sect3><sect3>
<title>IPv6 ping to 2001:0db8:100::1 routed through an IPv6-in-IPv4-tunnel</title>
<para>1.2.3.4 and 5.6.7.8 are tunnel endpoints (all addresses are examples)</para><screen>
<![CDATA[# 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)
]]></screen></sect3></sect2></sect1><sect1>
<title>IPv6-ready programs</title>
<para>Current distributions already contain the most needed IPv6 enabled client and servers. See first on <ulink url="http://www.bieringer.de/linux/IPv6/status/IPv6+Linux-status-distributions.html">IPv6+Linux-Status-Distribution</ulink>. If still not included, you can check <ulink url="http://www.deepspace6.net/docs/ipv6_status_page_apps.html">Current Status of IPv6 Support for Networking Applications</ulink> 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.</para></sect1><sect1>
<title>IPv6-ready client programs (selection)</title>
<para>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.</para>
<para>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.</para><sect2>
<title>Checking DNS for resolving IPv6 addresses</title>
<para>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</para><screen>
<![CDATA[# host -t AAAA www.join.uni-muenster.de
]]></screen><para>and should show something like following:</para><screen>
<![CDATA[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
]]></screen></sect2><sect2>
<title>IPv6-ready telnet clients</title>
<para>IPv6-ready telnet clients are available. A simple test can be done with</para><screen>
<![CDATA[$ 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.
]]></screen><para>If the telnet client don't understand the IPv6 address and says something like ”cannot resolve hostname”, then it's not IPv6-enabled.</para></sect2><sect2>
<title>IPv6-ready ssh clients</title>
<sect3>
<title>openssh</title>
<para>Current versions of openssh are IPv6-ready. Depending on configuring before compiling it has two behavior.</para><itemizedlist>
<listitem><para>--without-ipv4-default: the client tries an IPv6 connect first automatically and fall back to IPv4 if not working</para></listitem><listitem><para>--with-ipv4-default: default connection is IPv4, IPv6 connection must be force like following example shows</para></listitem></itemizedlist><screen>
<![CDATA[$ ssh -6 ::1
user@::1's password: ******
[user@ipv6host user]$
]]></screen><para>If your ssh client doesn't understand the option ”-6” then it's not IPv6-enabled, like most ssh version 1 packages.</para></sect3><sect3>
<title>ssh.com</title>
<para>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.</para></sect3></sect2><sect2>
<title>IPv6-ready web browsers</title>
<para>A current status of IPv6 enabled web browsers is available at <ulink url="http://www.deepspace6.net/docs/ipv6_status_page_apps.html#http">Current Status of IPv6 Support for Networking Applications - HTTP</ulink>.</para>
<para>Most of them have unresolved problems at the moment</para><orderedlist>
<listitem><para>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).</para></listitem><listitem><para>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).</para></listitem></orderedlist><para>Also older versions don't understand an URL with IPv6 encoded addresses like <ulink url="http://[2a01:238:4281:8600:812a:5915:8d24:58f3]/">http://[2a01:238:4281:8600:812a:5915:8d24:58f3]/</ulink>, IPv6 address of <ulink url="http://www.ipv6.bieringer.de/">http://www.ipv6.bieringer.de/</ulink> (this given URLs only works with an IPv6-enabled browser!).</para>
<para>A short test is to try shown URL with a given browser and using no proxy.</para><sect3>
<title>URLs for testing</title>
<para>A good starting point for browsing using IPv6 is <ulink url="http://www.kame.net/">http://www.kame.net/</ulink>. If the turtle on this page is animated, the connection is via IPv6, otherwise the turtle is static.</para>
<para>Other test servers are e.g.</para><itemizedlist>
<listitem><para><ulink url="http://ip.bieringer.de/">ip.bieringer.de</ulink></para></listitem><listitem><para><ulink url="http://ipv6-test.com/">IPv6 Test</ulink></para></listitem><listitem><para><ulink url="http://test-ipv6.com/">test-ipv6.com</ulink></para></listitem></itemizedlist></sect3></sect2></sect1><sect1>
<title>IPv6-ready server programs</title>
<para>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 <link linkend="chapter-hints-daemons">Hints for IPv6-enabled daemons</link>.</para></sect1><sect1 id='faq-ipv6-ready-system-check' >
<title><!-- anchor id="faq-ipv6-ready-system-check" -->FAQ (IPv6-ready system check)</title>
<sect2>
<title>Using tools</title>
<sect3>
<title>Q: Cannot ping6 to link-local addresses</title>
<para>Error message: "<emphasis>connect: Invalid argument</emphasis>"</para>
<para>Kernel doesn't know, which physical or virtual link you want to use to send such ICMPv6 packets. Therefore it displays this error message.</para>
<para>Solution: Specify interface like: ”ping6 -I eth0 fe80::2e0:18ff:fe90:9205”, see also <link linkend="program-ping6.">program ping6 usage</link>.</para></sect3><sect3>
<title>Q: Cannot ping6 or traceroute6 as normal user</title>
<para>Error message: ”<emphasis>icmp socket: Operation not permitted</emphasis>”</para>
<para>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.</para>
<para>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 <link linkend="program-ping6.">program ping6 usage</link>. 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. </para></sect3></sect2></sect1></chapter><chapter id='chapter-configuration-interface' >
<title><!-- anchor id="chapter-configuration-interface" -->Configuring interfaces</title>
<sect1>
<title>Different network devices</title>
<para>On a node, there exist different network devices. They can be collected in classes</para><itemizedlist>
<listitem><para>Physically bounded, like eth0, tr0</para></listitem><listitem><para>Virtually existing, like ppp0, tun0, tap0, sit0, isdn0, ippp0</para></listitem></itemizedlist><sect2>
<title>Physically bounded</title>
<para>Physically bounded interfaces like Ethernet or Token-Ring are normal ones and need no special treatment.</para></sect2><sect2>
<title>Virtually bounded</title>
<para>Virtually bounded interfaces always need special support</para><sect3>
<title>IPv6-in-IPv4 tunnel interfaces</title>
<para>These interfaces are normally named sit<emphasis>x</emphasis>. The name <emphasis>sit</emphasis> 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.</para>
<para>sit0 has a special meaning and cannot be used for dedicated tunnels.</para></sect3><sect3>
<title>PPP interfaces</title>
<para>PPP interfaces get their IPv6 capability from an IPv6 enabled PPP daemon.</para></sect3><sect3>
<title>ISDN HDLC interfaces</title>
<para>IPv6 capability for HDLC with encapsulation ip is already built-in in the kernel</para></sect3><sect3>
<title>ISDN PPP interfaces </title>
<para>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.</para></sect3><sect3>
<title>SLIP + PLIP</title>
<para>Like mentioned earlier, this interfaces don't support IPv6 transport (sending is OK, but dispatching on receiving don't work).</para></sect3><sect3>
<title>Ether-tap device</title>
<para>Ether-tap devices are IPv6-enabled and also stateless configured. For use, the module ”ethertap” has to be loaded before.</para></sect3><sect3>
<title>tun devices</title>
<para>Currently not tested by me.</para></sect3><sect3>
<title>ATM</title>
<para>01/2002: Aren't currently supported by vanilla kernel, supported by USAGI extension</para></sect3><sect3>
<title>Others</title>
<para>Did I forget an interface?...</para></sect3></sect2></sect1><sect1>
<title>Bringing interfaces up/down</title>
<para>Two methods can be used to bring interfaces up or down.</para><sect2>
<title>Using "ip"</title>
<para>Usage: </para><screen>
<![CDATA[# ip link set dev <interface> up
# ip link set dev <interface> down
]]></screen><para>Example:</para><screen>
<![CDATA[
# ip link set dev eth0 up
# ip link set dev eth0 down
]]></screen></sect2><sect2>
<title>Using "ifconfig"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/ifconfig <interface> up
# /sbin/ifconfig <interface> down
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ifconfig eth0 up
# /sbin/ifconfig eth0 down
]]></screen></sect2></sect1></chapter><chapter id='chapter-configuration-address' >
<title><!-- anchor id="chapter-configuration-address" -->Configuring IPv6 addresses</title>
<para>There are different ways to configure an IPv6 address on an interface. You can use use "ifconfig" or "ip".</para><sect1>
<title>Displaying existing IPv6 addresses</title>
<para>First you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during stateless auto-configuration).</para>
<para>Just note that addresses beginning with ”fec0” are deprecated, but shown here for completness!</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 addr show dev <interface>
]]></screen><para>Example for a static configured host:</para><screen>
<![CDATA[# /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
]]></screen><para>Example for a host which is auto-configured</para>
<para>Here you see some auto-magically configured IPv6 addresses and their lifetime.</para><screen>
<![CDATA[# /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
]]></screen></sect2><sect2>
<title>Using "ifconfig"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ifconfig <interface>
]]></screen><para>Example (output filtered with grep to display only IPv6 addresses). Here you see different IPv6 addresses with different scopes.</para><screen>
<![CDATA[# /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
]]></screen></sect2></sect1><sect1>
<title>Add an IPv6 address</title>
<para>Adding an IPv6 address is similar to the mechanism of "IP ALIAS" addresses in Linux IPv4 addressed interfaces.</para><sect2>
<title>Using "ip"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/ip -6 addr add <ipv6address>/<prefixlength> dev <interface>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0
]]></screen></sect2><sect2>
<title>Using "ifconfig"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64
]]></screen></sect2></sect1><sect1>
<title>Removing an IPv6 address</title>
<para>Not so often needed, be carefully with removing non existent IPv6 address, sometimes using older kernels it results in a crash.</para><sect2>
<title>Using "ip"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/ip -6 addr del <ipv6address>/<prefixlength> dev <interface>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 addr del 2001:0db8:0:f101::1/64 dev eth0
]]></screen></sect2><sect2>
<title>Using "ifconfig"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64
]]></screen></sect2></sect1><sect1>
<title>Automatic IPv6 Address Configuration</title>
<para>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 <xref linkend="hints-daemons-radvd">).</para></sect1><sect1>
<title>Enable Privacy Extension</title>
<para>Privacy Extension as described in <ulink url="http://www.faqs.org/rfcs/rfc4941.html">RFC 4941 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6</ulink> (obsoleted <ulink url="http://www.faqs.org/rfcs/rfc3041.html">RFC 3041</ulink>) 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.</para><sect2>
<title>Enable Privacy Extension using sysctl</title>
<bridgehead renderas="sect2">Temporary activation</bridgehead>
<para>Enable privacy extension for e.g. interface ”eth0” and prefer the generated address:</para><screen>
<![CDATA[# sysctl -w net.ipv6.conf.eth0.use_tempaddr=2
]]></screen><para>Afterwards, restart of the interface is necessary</para><screen>
<![CDATA[# ip link set dev eth0 down
# ip link set dev eth0 up
]]></screen><para>Once a router advertisement is received, the result should look like following</para><screen>
<![CDATA[# 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
...
]]></screen><bridgehead renderas="sect2">Permanent activation</bridgehead>
<para>For permanent activation, either a special initscript value per interface will enable privacy or an entry in the /etc/sysctl.conf file like</para><screen>
<![CDATA[net.ipv6.conf.eth0.use_tempaddr=2
]]></screen><para>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:</para><screen>
<![CDATA[net.ipv6.conf.all.use_tempaddr=2
net.ipv6.conf.default.use_tempaddr=2
]]></screen><para>Changed/added values in /etc/sysctl.conf can be activated during runtime, but at least an interface down/up or a reboot is recommended.</para><screen>
<![CDATA[# sysctl -p
]]></screen></sect2><sect2>
<title>Enable Privacy Extension using NetworkManager</title>
<para>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.</para>
<para>Examples based on version 0.9.9.1-5.git20140319.fc21</para>
<para>Check existing interfaces with:</para><screen>
<![CDATA[# nmcli connection
NAME UUID TYPE DEVICE
ens4v1 d0fc2b2e-5fa0-4675-96b5-b723ca5c46db 802-3-ethernet ens4v1
]]></screen><para>Current amount of IPv6 privacy extension addresses can be checked with</para><screen>
<![CDATA[# ip -o addr show dev ens4v1 | grep temporary | wc -l
0
]]></screen><para>Current IPv6 privacy extension settings can be checked with</para><screen>
<![CDATA[# nmcli connection show ens4v1 |grep ip6-privacy
ipv6.ip6-privacy: -1 (unknown)
]]></screen><para>Enable IPv6 privacy extension and restart interface</para><screen>
<![CDATA[# nmcli connection modify ens4v1 ipv6.ip6-privacy 2
# nmcli connection down ens4v1; nmcli connection up ens4v1
]]></screen><para>New IPv6 privacy extension settings can be checked with</para><screen>
<![CDATA[# nmcli connection show ens4v1 |grep ip6-privacy
ipv6.ip6-privacy: 2 (active, prefer temporary IP)
]]></screen><para>Now IPv6 privacy extension addresses are configured on the interface</para><screen>
<![CDATA[# ip -o addr show dev ens4v1 | grep temporary | wc -l
2
]]></screen></sect2><sect2>
<title>Test real use of Privacy Extension IPv6 Addresses</title>
<para>Whether the IPv6 address with an Interface ID generated by Privacy Extension is really used for outgoing connections, one can browse to <ulink url="http://ip.bieringer.de/">http://ip.bieringer.de/</ulink>, in case EUI64_SCOPE shows ”iid-privacy”, then everything is working fine.</para></sect2></sect1></chapter><chapter id='chapter-configuration-route' >
<title><!-- anchor id="chapter-configuration-route" -->Configuring normal IPv6 routes</title>
<para>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.</para>
<para>Just note that addresses beginning with ”fec0” are deprecated, but shown here for completness!</para><sect1>
<title>Displaying existing IPv6 routes</title>
<para>First you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during auto-configuration).</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 route show [dev <device>]
]]></screen><para>Example:</para><screen>
<![CDATA[# /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
]]></screen></sect2><sect2>
<title>Using "route"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/route -A inet6
]]></screen><para>Example (output is filtered for interface eth0). Here you see different IPv6 routes for different addresses on a single interface.</para><screen>
<![CDATA[# /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
]]></screen></sect2></sect1><sect1>
<title>Add an IPv6 route through a gateway</title>
<para>Mostly needed to reach the outside with IPv6 using an IPv6-enabled router on your link.</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 route add <ipv6network>/<prefixlength> via <ipv6address>
¬ [dev <device>]
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 route add default via 2001:0db8:0:f101::1
]]></screen></sect2><sect2>
<title>Using "route"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/route -A inet6 add <ipv6network>/<prefixlength> gw
¬ <ipv6address> [dev <device>]
]]></screen><para>A device can be needed, too, if the IPv6 address of the gateway is a link local one.</para>
<para>Following shown example adds a default route through gateway 2001:0db8:0:f101::1</para><screen>
<![CDATA[# /sbin/route -A inet6 add default gw 2001:0db8:0:f101::1
]]></screen></sect2></sect1><sect1>
<title>Removing an IPv6 route through a gateway</title>
<para>Not so often needed manually, mostly done by network configure scripts on shutdown (full or per interface)</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 route del <ipv6network>/<prefixlength> via <ipv6address>
¬ [dev <device>]
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 route del default via 2001:0db8:0:f101::1
]]></screen></sect2><sect2>
<title>Using "route"</title>
<para>Usage: </para><screen>
<![CDATA[# /sbin/route -A inet6 del <network>/<prefixlength> gw <ipv6address> [dev
¬ <device>]
]]></screen><para>Example for removing upper added route again:</para><screen>
<![CDATA[# /sbin/route -A inet6 del default gw 2001:0db8:0:f101::1
]]></screen></sect2></sect1><sect1>
<title>Add an IPv6 route through an interface</title>
<para>Not often needed, sometimes in cases of dedicated point-to-point links.</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 route add <ipv6network>/<prefixlength> dev <device>
¬ metric 1
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 route add default dev eth0 metric 1
]]></screen><para>Metric ”1” is used here to be compatible with the metric used by route, because the default metric on using ”ip” is ”1024”.</para></sect2><sect2>
<title>Using "route"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/route -A inet6 add <ipv6network>/<prefixlength> dev <device>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/route -A inet6 add default dev eth0
]]></screen></sect2></sect1><sect1>
<title>Removing an IPv6 route through an interface</title>
<para>Not so often needed to use by hand, configuration scripts will use such on shutdown.</para><sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 route del <ipv6network>/<prefixlength> dev <device>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/ip -6 route del default dev eth0
]]></screen></sect2><sect2>
<title>Using "route"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/route -A inet6 del <network>/<prefixlength> dev <device>
]]></screen><para>Example:</para><screen>
<![CDATA[# /sbin/route -A inet6 del default dev eth0
]]></screen></sect2></sect1><sect1>
<title>FAQ for IPv6 routes</title>
<sect2>
<title>Support of an IPv6 default route</title>
<para>One idea of IPv6 was a hierachical routing, therefore only less routing entries are needed in routers.</para>
<para>There are some issues in current Linux kernels:</para><sect3>
<title>Clients (not routing any packet!)</title>
<para>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:</para><screen>
<![CDATA[# 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
]]></screen></sect3><sect3>
<title>Routers in case of packet forwarding</title>
<para>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”.</para>
<para>Note: take care about default routing without address filtering on edge routers. Otherwise unwanted multicast or site-local traffic can leave the edge.</para></sect3></sect2></sect1></chapter><chapter id='chapter-Neighbor-Discovery' >
<title><!-- anchor id="chapter-Neighbor-Discovery" -->Neighbor Discovery</title>
<para>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”.</para><sect1>
<title>Displaying neighbors using ”ip”</title>
<para>With following command you can display the learnt or configured IPv6 neighbors</para><screen>
<![CDATA[# ip -6 neigh show [dev <device>]
]]></screen><para>The following example shows one neighbor, which is a reachable router</para><screen>
<![CDATA[# ip -6 neigh show
fe80::201:23ff:fe45:6789 dev eth0 lladdr 00:01:23:45:67:89 router nud reachable
]]></screen></sect1><sect1>
<title>Manipulating neighbors table using ”ip”</title>
<sect2>
<title>Manually add an entry</title>
<para>With following command you are able to manually add an entry</para><screen>
<![CDATA[# ip -6 neigh add <IPv6 address> lladdr <link-layer address> dev <device>
]]></screen><para>Example:</para><screen>
<![CDATA[# ip -6 neigh add fec0::1 lladdr 02:01:02:03:04:05 dev eth0
]]></screen></sect2><sect2>
<title>Manually delete an entry</title>
<para>Like adding also an entry can be deleted:</para><screen>
<![CDATA[# ip -6 neigh del <IPv6 address> lladdr <link-layer address> dev <device>
]]></screen><para>Example:</para><screen>
<![CDATA[# ip -6 neigh del fec0::1 lladdr 02:01:02:03:04:05 dev eth0
]]></screen></sect2><sect2>
<title>More advanced settings</title>
<para>The tool ”ip” is less documentated, but very strong. See online ”help” for more:</para><screen>
<![CDATA[# 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 ]
]]></screen><para>Looks like some options are only for IPv4...if you can contribute information about flags and advanced usage, pls. send.</para></sect2></sect1></chapter><chapter id='chapter-configuring-ipv6-in-ipv4-tunnels' >
<title><!-- anchor id="chapter-configuring-ipv6-in-ipv4-tunnels" -->Configuring IPv6-in-IPv4 tunnels</title>
<para>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.</para>
<para>There are some kind of tunnel mechanism and also some possibilities to setup tunnels.</para><sect1>
<title>Types of tunnels</title>
<para>There are more than one possibility to tunnel IPv6 packets over IPv4-only links.</para><sect2>
<title>Static point-to-point tunneling</title>
<para>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 <ulink url="http://www.faqs.org/rfcs/rfc4213.html">RFC 4213 / Basic Transition Mechanisms for IPv6 Hosts and Routers</ulink>. Requirements:</para><itemizedlist>
<listitem><para>IPv4 address of your local tunnel endpoint must be static, global unique and reachable from the foreign tunnel endpoint
</para><itemizedlist>
<listitem><para>If no static IPv4 address is available, the tunnel provider must support authentication of the dynamic IPv4 address, like <ulink url="http://www.sixxs.net/">SixXS / AICCU</ulink> (3740/udp) or <ulink url="http://gogo6.com/">gogo6</ulink> (3653/udp).</para></listitem></itemizedlist></listitem><listitem><para>A global IPv6 prefix assigned to you
</para><itemizedlist>
<listitem><para>It is also possible that additional IPv6 networks are routed through this tunnel.</para></listitem></itemizedlist></listitem><listitem><para>A foreign tunnel endpoint which is capable to route your IPv6 prefix to your local tunnel endpoint (mostly remote manual configuration required)</para></listitem></itemizedlist><para>Tunnel provider for static point-to-point tunneling:</para><itemizedlist>
<listitem><para><ulink url="http://he.com/">Hurricane Electric</ulink></para></listitem><listitem><para><ulink url="http://www.sixxs.net/">SixXS</ulink></para></listitem></itemizedlist></sect2><sect2>
<title>Automatically tunneling</title>
<para>Automatic tunneling occurs, when a node directly connects another node gotten the IPv4 address of the other node before.</para></sect2><sect2 id='tunneling-6to4.' >
<title><!-- anchor id="tunneling-6to4." -->6to4-Tunneling</title>
<para>6to4 tunneling (<ulink url="http://www.faqs.org/rfcs/rfc3056.html">RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds</ulink>) 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</para><sect3>
<title>Generation of 6to4 prefix</title>
<para>The 6to4 address is defined like following (schema is taken from <ulink url="http://www.faqs.org/rfcs/rfc3056.html">RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds</ulink>):</para><screen>
<![CDATA[| 3+13 | 32 | 16 | 64 bits |
+---+------+-----------+--------+--------------------------------+
| FP+TLA | V4ADDR | SLA ID | Interface ID |
| 0x2002 | | | |
+---+------+-----------+--------+--------------------------------+
]]></screen><para>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.</para>
<para>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.</para></sect3><sect3>
<title>6to4 upstream tunneling</title>
<para>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 <ulink url="http://www.kfu.com/~nsayer/6to4/">NSayer's 6to4 information</ulink> for a list of routers.</para>
<para>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 <ulink url="http://www.faqs.org/rfcs/rfc3068.html">RFC 3068 / An Anycast Prefix for 6to4 Relay Routers</ulink> for details. </para></sect3><sect3>
<title>6to4 downstream tunneling</title>
<para>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:</para><itemizedlist>
<listitem><para>Foreign host uses 6to4 and sends packet direct back to your node (see below)</para></listitem><listitem><para>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.</para></listitem></itemizedlist></sect3><sect3>
<title>Possible 6to4 traffic</title>
<itemizedlist>
<listitem><para>from 6to4 to 6to4: is normally directly tunneled between the both 6to4 enabled hosts</para></listitem><listitem><para>from 6to4 to non-6to4: is sent via upstream tunneling</para></listitem><listitem><para>non-6to4 to 6to4: is sent via downstream tunneling</para></listitem></itemizedlist><para>Note, that because of possible asymmetric routing problems with a broken 6to4 relay can be hard to troubleshoot.</para></sect3></sect2><sect2>
<title>UDP encapsulated IPv6 tunneling</title>
<para>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.</para><sect3>
<title>Teredo Tunnel</title>
<para><ulink url="http://www.faqs.org/rfcs/rfc4380.html">RFC 4380 / Teredo: Tunneling IPv6 over UDP through Network Address Translations</ulink>describes tunneling of IPv6 packets via IPv4 UDP bubbles, see also <ulink url="http://de.wikipedia.org/wiki/Teredo">Wikipedia / Teredo</ulink>. It uses usually 3544/udp. Linux client is named <ulink url="http://www.remlab.net/miredo/">miredo</ulink> and usable out-of-the-box. This tunnel method can only connect a single client to the global IPv6 network..</para></sect3><sect3>
<title>AYIYA Tunnel</title>
<para>Tunnel provider <ulink url="http://www.sixxs.net/">SixXS</ulink> has also IPv6-in-UDP-in-IPv4 (5072/udp) capability, for using it, the AYIYA mode must be enabled.</para></sect3><sect3>
<title>gogo6 Tunnel</title>
<para>Tunnel provider <ulink url="http://gogo6.com/">gogo6</ulink> has also IPv6-in-UDP-in-IPv4 (3653/udp) capability, for using it, the v6udpv4 mode must be enabled.</para></sect3></sect2></sect1><sect1>
<title>Displaying existing tunnels</title>
<sect2>
<title>Using "ip"</title>
<para>Usage:</para><screen>
<![CDATA[# /sbin/ip -6 tunnel show [<device>]
]]></screen><para>Example:</para><screen>
<![CDATA[# /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
]]></screen></sect2><sect2>
<title>Using "route"</title>
<para>Usage:</para><screen>