![]() | ![]() |
|
Linux IPv6 HOWTO (en)Peter Bieringer
Chapter 1. GeneralInformation about available translations you will find in section Translations. 1.1. Copyright, license and others1.1.2. LicenseThis Linux IPv6 HOWTO is published under GNU GPL version 2: The Linux IPv6 HOWTO, a guide how to configure and use IPv6 on Linux systems. Copyright (C) 2001-2004 Peter Bieringer This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1.1.3. About the author1.1.3.1. Internet/IPv6 history of the author
1.1.3.2. ContactThe author can be contacted via e-mail at <pb at bieringer dot de> and also via his homepage. He's currently living in Munich [northern part of Schwabing] / Bavaria / Germany (south) / Europe (middle) / Earth (surface/mainland). 1.3. Version, History and To-Do1.3.2. History1.3.2.1. Major history2001-11-30: Starting to design new HOWTO. 2002-01-02: A lot of content completed, first public release of chapter 1 (version 0.10). 2002-01-14: More completed, some reviews, public release of the whole document (version 0.14). 2002-08-16: Polish translation is in progress 2002-10-31: Chinese translation is available (see Translations for more) 2002-11-10: German translation is in progress 2003-02-10: German translation is available 2003-04-09: French translation is in progress 2003-05-09: French translation is available 2003-08-15: Spanish translation is in progress 2003-10-16: Italian translation is in progress 1.4. TranslationsTranslations always have to contain the URL, version number and copyright of the original document (but yours, too). Pls. don't translate the original changelog, this is not very useful - also do not translate the full section about available translations, can be run out-of-date, add an URL to this section here in the English howto. Looks like the document's change frequency is mostly less than once per month. Since version 0.27 it looks like that most of the content contributed by me has been written. Translations always have to use the English version as source. 1.4.1. To language1.4.1.1. TaiwaneseA Taiwanese translation by Burma Chen <expns at yahoo dot com> (announced to me at 2002-10-31) can be found on the CLDP: http://cldp.linuxforum.net/Linux-IPv6-HOWTO.html. It's a snapshot translation, don't know whether kept up-to-date. 1.4.1.2. PolishSince 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. 1.4.1.3. GermanWith 2002-11-10 a German translation was started by Georg Käfer <gkaefer at gmx dot at> and the first public version was published 2003-02-10. It's originally available on Deep Space 6 at http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-de/ (mirrored e.g. on http://mirrors.bieringer.de/Linux+IPv6-HOWTO-de/). This version will stay up-to-date as much as possible. 1.4.1.4. FrenchWith 2003-04-09 a French translation was started by Michel Boucey <mboucey at free dot fr> and the first public version was published 2003-05-09. It's originally available on Deep Space 6 at http://mirrors.deepspace6.net/Linux+IPv6-HOWTO-fr/ (mirrored e.g. on http://mirrors.bieringer.de/Linux+IPv6-HOWTO-fr/). 1.4.1.5. SpanishWith 2003-08-15 a Spanish translation was started by Eduardo Collado <edu at eduangi dot com>. 1.4.1.6. ItalianWith 2003-10-16 a Italian translation was started by Michele Ferritto <m dot ferritto at virgilio dot it> for the ILDP (Italian Linux Documentation Project). 1.5. Technical1.5.1. Original source of this HOWTOThis HOWTO is currently written with LyX version 1.2.0 on a Red Hat Linux 7.3 system with template SGML (DocBook book). It's available on TLDP-CVS / users / Peter-Bieringer for contribution. 1.5.1.1. Code line wrappingCode line wrapping is done using selfmade utility "lyxcodelinewrapper.pl", you can get it from CVS for your own usage: TLDP-CVS / users / Peter-Bieringer 1.5.1.2. SGML generationSGML is generated using export function in LyX. Also some fixes are have to be made to create proper SGML code (see also here for the Perl programs TLDP-CVS / users / Peter-Bieringer):
1.5.2. On-line references to the HTML version of this HOWTO (linking/anchors)1.5.2.2. Dedicated pagesBecause the HTML pages are generated out of the SGML file, the HTML filenames turn out to be quite random. However, some pages are tagged in LyX, resulting in static names. These tags are useful for references and shouldn't be changed in the future. If you think that I have forgotten a tag, please let me know, and I will add it. 1.6. PrefaceSome things first: 1.6.1. How many versions of a Linux & IPv6 related HOWTO are floating around?Including this, there are three (3) HOWTO documents available. Apologies, if that is too many ;-) 1.6.1.1. Linux IPv6 FAQ/HOWTO (outdated)The first IPv6 related document was written by Eric Osborne and called Linux IPv6 FAQ/HOWTO (please use it only for historical issues). Latest version was 3.2.1 released July, 14 1997. Please help: if someone knows the date of birth of this HOWTO, please send me an e-mail (information will be needed in "history"). 1.6.1.2. IPv6 & Linux - HowTo (maintained)There exists a second version called IPv6 & Linux - HowTo written by me (Peter Bieringer) in pure HTML. It was born April 1997 and the first English version was published in June 1997. I will continue to maintain it, but it will slowly fade (but not full) in favour of the Linux IPv6 HOWTO you are currently reading. 1.6.1.3. Linux IPv6 HOWTO (this document)Because the IPv6 & Linux - HowTo is written in pure HTML it's not really compatible with the The Linux Documentation Project (TLDP). I (Peter Bieringer) got a request in late November 2001 to rewrite the IPv6 & Linux - HowTo in SGML. However, because of the discontinuation of that HOWTO (Future of IPv6 & Linux - HowTo), and as IPv6 is becoming more and more standard, I decided to write a new document covering basic and advanced issues which will remain important over the next few years. More dynamic and some advanced content will be still found further on in the second HOWTO (IPv6 & Linux - HowTo). 1.7. Used terms, glossar and shortcuts1.7.1. Network related
1.7.1.1. Shortcuts
1.7.2. Document related1.7.2.1. Long code line wrapping signal charThe special character "¬" is used for signaling that this code line is wrapped for better viewing in PDF and PS files. 1.8. Requirements for using this HOWTO1.8.1. Personal prerequisites1.8.1.1. Experience with Unix toolsYou should be familiar with the major Unix tools e.g. grep, awk, find, ... , and know about their most commonly used command-line options. 1.8.1.2. Experience with networking theoryYou should know about layers, protocols, addresses, cables, plugs, etc. If you are new to this field, here is one good starting point for you: linuxports/howto/intro_to_networking 1.8.1.3. Experience with IPv4 configurationYou should definitely have some experience in IPv4 configuration, otherwise it will be hard for you to understand what is really going on. Chapter 2. Basics2.1. What is IPv6?IPv6 is a new layer 3 protocol (see linuxports/howto/intro_to_networking/ISO - OSI Model) which will supersede IPv4 (also known as IP). IPv4 was designed long time ago (RFC 760 / Internet Protocol from January 1980) and since its inception, there have been many requests for more addresses and enhanced capabilities. Latest RFC is RFC 2460 / Internet Protocol Version 6 Specification. Major changes in IPv6 are the redesign of the header, including the increase of address size from 32 bits to 128 bits. Because layer 3 is responsible for end-to-end packet transport using packet routing based on addresses, it must include the new IPv6 addresses (source and destination), like IPv4. For more information about the IPv6 history take a look at older IPv6 related RFCs listed e.g. at SWITCH IPv6 Pilot / References. 2.2. History of IPv6 in LinuxThe years 1992, 1993 and 1994 of the IPv6 History (in general) are covered by following document: IPv6 or IPng (IP next generation). To-do: better time-line, more content... 2.2.1. BeginningThe first IPv6 related network code was added to the Linux kernel 2.1.8 in November 1996 by Pedro Roque. It was based on the BSD API:
The shown lines were copied from patch-2.1.8 (e-mail address was blanked on copy&paste). 2.2.2. In betweenBecause of lack of manpower, the IPv6 implementation in the kernel was unable to follow the discussed drafts or newly released RFCs. In October 2000, a project was started in Japan, called USAGI, whose aim was to implement all missing, or outdated IPv6 support in Linux. It tracks the current IPv6 implementation in FreeBSD made by the KAME project. From time to time they create snapshots against current vanilla Linux kernel sources. 2.2.3. CurrentUnfortunately, the USAGI patch is so big, that current Linux networking maintainers are unable to include it in the production source of the Linux kernel 2.4.x series. Therefore the 2.4.x series is missing some (many) extensions and also does not confirm to all current drafts and RFCs (see IP Version 6 Working Group (ipv6) Charter). This can cause some interoperability problems with other operating systems. 2.2.4. FutureUSAGI is now making use of the new Linux kernel development series 2.5.x to insert all of their current extensions into this development release. Hopefully the 2.6.x kernel series will contain a true and up-to-date IPv6 implementation. 2.3. How do IPv6 addresses look like?As previously mentioned, IPv6 addresses are 128 bits long. This number of bits generates very high decimal numbers with up to 39 digits:
Such numbers are not really addresses that can be memorized. Also the IPv6 address schema is bitwise orientated (just like IPv4, but that's not often recognized). Therefore a better notation of such big numbers is hexadecimal. In hexadecimal, 4 bits (also known as "nibble") are represented by a digit or character from 0-9 and a-f (10-15). This format reduces the length of the IPv6 address to 32 characters.
This representation is still not very convenient (possible mix-up or loss of single hexadecimal digits), so the designers of IPv6 chose a hexadecimal format with a colon as separator after each block of 16 bits. In addition, the leading "0x" (a signifier for hexadecimal values used in programming languages) is removed:
A usable address (see address types later) is e.g.:
For simplifications, leading zeros of each 16 bit block can be omitted:
One sequence of 16 bit blocks containing only zeroes can be replaced with "::". But not more than one at a time, otherwise it is no longer a unique representation.
The biggest reduction is seen by the IPv6 localhost address:
There is also a so-called compact (base85 coded) representation defined RFC 1924 / A Compact Representation of IPv6 Addresses (published on 1. April 1996), never seen in the wild, probably an April fool's joke, but here is an example:
2.4. FAQ (Basics)2.4.1. Why is the name IPv6 and not IPv5 as successor for IPv4?On any IP header, the first 4 bits are reserved for protocol version. So theoretically a protocol number between 0 and 15 is possible:
The next free number was 6. Hence IPv6 was born! 2.4.2. IPv6 addresses: why such a high number of bits?During the design of IPv4, people thought that 32 bits were enough for the world. Looking back into the past, 32 bits were enough until now and will perhaps be enough for another few years. However, 32 bits are not enough to provide each network device with a global address in the future. Think about mobile phones, cars (including electronic devices on its CAN-bus), toasters, refrigerators, light switches, and so on... So designers have chosen 128 bits, 4 times more in length and 2^96 greater in size than in IPv4 today. The usable size is smaller than it may appear however. This is because in the currently defined address schema, 64 bits are used for interface identifiers. The other 64 bits are used for routing. Assuming the current strict levels of aggregation (/48, /35, ...), it is still possible to "run out" of space, but hopefully not in the near future. See also for more information RFC 1715 / The H Ratio for Address Assignment Efficiency and RFC 3194 / The Host-Density Ratio for Address Assignment Efficiency. 2.4.3. IPv6 addresses: why so small a number of bits on a new design?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 48 octets (fixed). This is 3.4 % of MTU in IPv4 and 3.8 % of 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. Chapter 3. Address typesLike IPv4, IPv6 addresses can be split into network and host parts using subnet masks. IPv4 has shown that sometimes it would be nice, if more than one IP address can be assigned to an interface, each for a different purpose (aliases, multi-cast). To remain extensible in the future, IPv6 is going further and allows more than one IPv6 address to be assigned to an interface. There is currently no limit defined by an RFC, only in the implementation of the IPv6 stack (to prevent DoS attacks). Using this large number of bits for addresses, IPv6 defines address types based on some leading bits, which are hopefully never going to be broken in the future (unlike IPv4 today and the history of class A, B, and C). Also the number of bits are separated into a network part (upper 64 bits) and a host part (lower 64 bits), to facilitate auto-configuration. BTW: a good URL for displaying a given IPv6 address in detail is the Advanced Network Management Laboratory / IPv6 Address Oracle. 3.1. Addresses without a special prefix3.1.1. Localhost addressThis is a special address for the loopback interface, similiar to IPv4 with its "127.0.0.1". With IPv6, the localhost address is:
or compressed:
Packets with this address as source or destination should never leave the sending host. 3.1.2. Unspecified addressThis is a special address like "any" or "0.0.0.0" in IPv4 . For IPv6 it's:
or:
These addresses are mostly used/seen in socket binding (to any IPv6 address) or routing tables. Note: the unspecified address cannot be used as destination address. 3.1.3. IPv6 address with embedded IPv4 addressThere are two addresses which contain an IPv4 address. 3.1.3.1. IPv4-mapped IPv6 addressIPv4-only IPv6-compatible addresses are sometimes used/shown for sockets created by an IPv6-enabled daemon, but only binding to an IPv4 address. These addresses are defined with a special prefix of length 96 (a.b.c.d is the IPv4 address):
or in compressed format
For example, the IPv4 address 1.2.3.4 looks like this:
3.1.3.2. IPv4-compatible IPv6 addressUsed for automatic tunneling (RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers), which is being replaced by 6to4 tunneling.
or in compressed format
3.2. Network part, also known as prefixDesigners defined some address types and left a lot of scope for future definitions as currently unknown requirements arise. RFC 2373 [July 1998] / IP Version 6 Addressing Architecture defines the current addressing scheme but there is already a new draft available: draft-ietf-ipngwg-addr-arch-*.txt. Now lets take a look at the different types of prefixes (and therefore address types): 3.2.1. Link local address typeThese 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:
They begin with ( where "x" is any hex character, normally "0")
An address with this prefix is found on each IPv6-enabled interface after stateless auto-configuration (which is normally always the case). 3.2.2. Site local address typeThese are addresses similar to the RFC 1918 / Address Allocation for Private Internets in IPv4 today, with the added advantage that everyone who use this address type has the capability to use the given 16 bits for a maximum number of 65536 subnets. Comparable with the 10.0.0.0/8 in IPv4 today. Another advantage: because it's possible to assign more than one address to an interface with IPv6, you can also assign such a site local address in addition to a global one. It begins with:
(where "x" is any hex character, normally "0") Note that there are discussions going on in deprecating this kind of addresses because there are several issues. Read the current draft for more: draft-ietf-ipv6-deprecate-site-local-XY.txt. For test in labs, such addresses are still a good choice in my humble opinion. 3.2.3. Global address type "(Aggregatable) global unicast"Today, there is one global address type defined (the first design, called "provider based," was thrown away some years ago RFC 1884 / IP Version 6 Addressing Architecture [obsolete], you will find some remains in older Linux kernel sources). It begins with (x are hex characters)
Note: the prefix "aggregatable" is thrown away in current drafts. There are some further subtypes defined, see below: 3.2.3.1. 6bone test addressesThese were the first global addresses which were defined and in use. They all start with
Example:
A special 6bone test address which will be never be globally unique begins with
and is mostly shown in examples, because if real addresses are shown, its 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). You can still apply for one of these prefixes, see here How to join 6bone. Also some tunnel brokers still distribute 6bone test address prefixes. 3.2.3.2. 6to4 addressesThese addresses, designed for a special tunneling mechanism [RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds and RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers], encode a given IPv4 address and a possible subnet and begin with
For example, representing 192.168.1.1/5:
A small shell command line can help you generating such address out of a given IPv4 one:
See also tunneling using 6to4 and information about 6to4 relay routers. 3.2.3.3. Assigned by provider for hierarchical routingThese addresses are delegated to Internet service providers (ISP) and begin with
Prefixes to major (backbone owning) ISPs are delegated by local registries and currently they assign to them a prefix with length 35. Major ISPs normally delegate to minor ISPs a prefix with length 48. 3.2.4. Multicast addressesMulticast addresses are used for related services. They alway start with (xx is the scope value)
They are split into scopes and types: 3.2.4.1. Multicast scopesMulticast scope is a parameter to specify the maximum distance a multicast packet can travel from the sending entity. Currently, the following regions (scopes) are defined:
3.2.4.2. Multicast typesThere are many types already defined/reserved (see RFC 2373 / IP Version 6 Addressing Architecture for details). Some examples are:
3.2.4.3. Solicited node link-local multicast addressSpecial multicast address used as destination address in neighborhood discovery, because unlike in IPv4, ARP no longer exists in IPv6. An example of this address looks like
Used prefix shows that this is a link-local multicast address. The suffix is generated from the destination address. In this example, a packet should be sent to address "fe80::1234", but the network stack doesn't know the current layer 2 MAC address. It replaces the upper 104 bits with "ff02:0:0:0:0:1:ff00::/104" and leaves the lower 24 bits untouched. This address is now used `on-link' to find the corresponding node which has to send a reply containing its layer 2 MAC address. 3.2.5. Anycast addressesAnycast addresses are special addresses and are used to cover things like nearest DNS server, nearest DHCP server, or similar dynamic groups. Addresses are taken out of the unicast address space (aggregatable global or site-local at the moment). The anycast mechanism (client view) will be handled by dynamic routing protocols. Note: Anycast addresses cannot be used as source addresses, they are only used as destination addresses. 3.2.5.1. Subnet-router anycast addressA simple example for an anycast address is the subnet-router anycast address. Assuming that a node has the following global assigned IPv6 address:
The subnet-router anycast address will be created blanking the suffix (least significant 64 bits) completely:
3.3. Address types (host part)For auto-configuration and mobility issues, it was decided to use the lower 64 bits as host part of the address in most of the current address types. Therefore each single subnet can hold a large amount of addresses. This host part can be inspected differently: 3.3.1. Automatically computed (also known as stateless)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. Consider again the first example
here,
is the host part and computed from the NIC's MAC address
using the IEEE-Tutorial EUI-64 design for EUI-48 identifiers. 3.3.1.1. Privacy problem with automatically computed addresses and a solutionBecause the "automatically computed" host part is globally unique (except when a vendor of a NIC uses the same MAC address on more than one NIC), client tracking is possible on the host when not using a proxy of any kind. This is a known problem, and a solution was defined: privacy extension, defined in RFC 3041 / Privacy Extensions for Stateless Address Autoconfiguration in IPv6 (there is also already a newer draft available: draft-ietf-ipngwg-temp-addresses-*.txt). 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. 3.3.2. Manually setFor servers it's probably easier to remember simpler addresses, this can also be accommodated. It is possible to assign an additional IPv6 address to an interface, e.g.
For manual suffixes like "::1" shown in the above example it's required that the 7th most significant bit is set to 0 (the universal/local bit of the automatically generated identifier). Also some other (otherwise unchosen ) bit combinations are reserved for anycast addresses, too. 3.4. Prefix lengths for routingIn the early design phase it was planned to use a fully hierarchical routing approach to reduce the size of the routing tables maximally. The reasoning behind this approach were the number of current IPv4 routing entries in core routers (> 104 thousand in May 2001), reducing the need of memory in hardware routers (ASIC "Application Specified Integrated Circuit" driven) to hold the routing table and increase speed (fewer entries hopefully result in faster lookups). Todays view is that routing will be mostly hierarchically designed for networks with only one service provider. With more than one ISP connections, this is not possible, and subject to an issue named multi-homing (infos on multi-homing: Procider-Internal Aggregation based on Geography to Support Multihoming in IPv6; GAPI: A Geographically Aggregatable Provider Independent Address Space to Support Multihoming in IPv6; Extension Header for Site-Multi-homing support; IPv6 Multihoming Solutions) 3.4.1. Prefix lengths (also known as "netmasks")Similar to IPv4, the routable network path for routing to take place. Because standard netmask notation for 128 bits doesn't look nice, designers employed the IPv4 Classless Inter Domain Routing (CIDR, RFC 1519 / Classless Inter-Domain Routing) scheme, which specifies the number of bits of the IP address to be used for routing. It is also called the "slash" notation. An example:
This notation will be expanded:
3.4.2. Matching a routeUnder normal circumstances (no QoS) a lookup in a routing table results in the route with the most significant number of address bits means the route with the biggest prefix length matches first. For example if a routing table shows following entries (list is not complete):
Shown destination addresses of IPv6 packets will be routed through shown device
Chapter 4. IPv6-ready system checkBefore 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. 4.1. IPv6-ready kernelModern 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. See IPv6+Linux-Status-Distribution page for most up-to-date information. Note: you shouldn't anymore use kernel series 2.2.x, because it's not IPv6-up-to-date anymore. 4.1.1. Check for IPv6 support in the current running kernelTo check, whether your current running kernel supports IPv6, take a look into your /proc-file-system. Following entry must exists:
A short automatical test looks like:
If this fails, it is quite likely, that the IPv6 module is not loaded. 4.1.2. Try to load IPv6 moduleYou can try to load the IPv6 module executing
If this is successful, this module should be listed, testable with following auto-magically line:
And the check shown above should now run successfully. Note: unloading the module is currently not supported and can result, under some circumstances, in a kernel crash. 4.1.2.1. Automatically loading of moduleIts possible to automatically load the IPv6 module on demand. You only have to add following line in the configuration file of the kernel module loader (normally /etc/modules.conf or /etc/conf.modules):
It's also possible to disable automatically loading of the IPv6 module using following line
Additional note: in future kernels (newer 2.5 series and above), the module loader mechanism was changed. The new configuration file has to be named /etc/modprobe.conf instead of /etc/modules.conf but there is a translate-script available. For further details see module-init-tool. 4.1.3. Compile kernel with IPv6 capabilitiesIf both above shown results were negative and your kernel has no IP6 support, than you have the following options:
If you decide to compile a kernel, you should have previous experience in kernel compiling and read the Linux Kernel HOWTO. A mostly up-to-time comparison between vanilla and USAGI extended kernels is available on IPv6+Linux-Status-Kernel. 4.1.3.1. Compiling a vanilla kernelMore detailed hints about compiling an IPv6-enabled kernel can be found e.g. on IPv6-HOWTO-2#kernel. Note: you should use whenever possible kernel series 2.4.x or above, because the IPv6 support in series 2.2.x is not so in current state and needs some patches for ICMPv6 and 6to4 support (can be found on kernel series 2.2.x IPv6 patches). 4.1.3.2. Compiling a kernel with USAGI extensionsSame as for vanilla kernel, only recommend for advanced users, which are already familiar with IPv6 and kernel compilation. See also USAGI project / FAQ and Obtaining the best IPv6 support with Linux (Article) (Mirror). 4.1.4. IPv6-ready network devicesNot all existing network devices have already (or ever) the capability to transport IPv6 packets. A current status can be found at IPv6+Linux-status-kernel.html#transport. A major issue is that because of the network layer structure of kernel implementation an IPv6 packet isn't really recognized by it's IP header number (6 instead of 4). It's recognized by the protocol number of the Layer 2 transport protocol. Therefore any transport protocol which doesn't use such protocol number cannot dispatch IPv6 packets. Note: the packet is still transported over the link, but on receivers side, the dispatching won't work (you can see this e.g. using tcpdump). 4.1.4.1. Currently known never "IPv6 capable links"
4.2. IPv6-ready network configuration toolsYou 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. 4.2.1. net-tools packageThe net-tool package includes some tools like ifconfig and route, which helps you to configure IPv6 on an interface. Look at the output of ifconfig -? or route -?, if something is shown like IPv6 or inet6, then the tool is IPv6-ready. Auto-magically check:
Same check can be done for route:
4.2.2. iproute packageAlexey N. Kuznetsov (current a maintainer of the Linux networking code) created a tool-set which configures networks through the netlink device. Using this tool-set you have more functionality than net-tools provides, but its not very well documented and isn't for the faint of heart.
If the program /sbin/ip isn't found, then I strongly recommend you install the iproute package.
4.3. IPv6-ready test/debug programsAfter 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. 4.3.1. IPv6 pingThis program is normally included in package iputils. It is designed for simple transport tests sending ICMPv6 echo-request packets and wait for ICMPv6 echo-reply packets. Usage
Example
Hint: ping6 needs raw access to socket and therefore root permissions. So if non-root users cannot use ping6 then there are two possible problems:
4.3.1.1. Specifying interface for IPv6 pingUsing link-local addresses for an IPv6 ping, the kernel does not know through which (physically or virtual) device it must send the packet - each device has a link-local address. A try will result in following error message:
In this case you have to specify the interface additionally like shown here:
4.3.1.2. Ping6 to multicast addressesAn interesting mechanism to detect IPv6-active hosts on a link is to ping6 to the link-local all-node multicast address:
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. 4.3.2. IPv6 traceroute6This program is normally included in package iputils. It's a program similar to IPv4 traceroute. Below you will see an example:
Note: unlike some modern versions of IPv4 traceroute, which can use ICMPv4 echo-request packets as well as UDP packets (default), current IPv6-traceroute is only able to send UDP packets. As you perhaps already know, ICMP echo-request packets are more accepted by firewalls or ACLs on routers inbetween than UDP packets. 4.3.3. IPv6 tracepath6This program is normally included in package iputils. It's a program like traceroute6 and traces the path to a given destination discovering the MTU along this path. Below you will see an example:
4.3.4. IPv6 tcpdumpOn Linux, tcpdump is the major tool for packet capturing. Below you find some examples. IPv6 support is normally built-in in current releases of version 3.6. tcpdump uses expressions for filtering packets to minimize the noise:
Also some command line options are very useful to catch and print more information in a packet, mostly interesting for digging into ICMPv6 packets:
4.3.4.1. IPv6 ping to 3ffe:ffff:100:f101::1 native over a local link
4.3.4.2. IPv6 ping to 3ffe:ffff:100::1 routed through an IPv6-in-IPv4-tunnel1.2.3.4 and 5.6.7.8 are tunnel endpoints (all addresses are examples)
4.4. IPv6-ready programsCurrent distributions already contain the most needed IPv6 enabled client and servers. See first on IPv6+Linux-Status-Distribution. If still not included, you can check IPv6 & Linux - Current Status - Applications whether the program is already ported to IPv6 and usable with Linux. For common used programs there are some hints available at IPv6 & Linux - HowTo - Part 3 and IPv6 & Linux - HowTo - Part 4. 4.5. IPv6-ready client programs (selection)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 6bone is available. 4.5.1. Checking DNS for resolving IPv6 addressesBecause of security updates in the last years every Domain Name System (DNS) server should run newer software which already understands the (intermediate) IPv6 address-type AAAA (the newer one named A6 isn't still common at the moment because only supported using BIND9 and newer and also the non-existent support of root domain IP6.ARPA). A simple test whether the used system can resolve IPv6 addresses is
and should show something like following:
4.5.2. IPv6-ready telnet clientsIPv6-ready telnet clients are available. A simple test can be done with
If the telnet client don't understand the IPv6 address and says something like "cannot resolve hostname", then it's not IPv6-enabled. 4.5.3. IPv6-ready ssh clients4.5.3.1. opensshCurrent versions of openssh are IPv6-ready. Depending on configuring before compiling it has two behavior.
If your ssh client doesn't understand the option "-6" then it's not IPv6-enabled, like most ssh version 1 packages. 4.5.4. IPv6-ready web browsersA current status of IPv6 enabled web browsers is available at IPv6+Linux-status-apps.html#HTTP. Most of them have unresolved problems at the moment
Also older versions don't understand an URL with IPv6 encoded addresses like http://[3ffe:400:100::1]/ (this given URL only works with an IPv6-enabled browser!). A short test is to try shown URL with a given browser and using no proxy. 4.5.4.1. URLs for testingA good starting point for browsing using IPv6 is http://www.kame.net/. If the turtle on this page is animated, the connection is via IPv6, otherwise the turtle is static. 4.6. IPv6-ready server programsIn this part of this HOWTO, more client specific issues are mentioned. Therefore hints for IPv6-ready servers like sshd, httpd, telnetd, etc. are shown below in Hints for IPv6-enabled daemons. 4.7. FAQ (IPv6-ready system check)4.7.1. Using tools4.7.1.1. Q: Cannot ping6 to link-local addressesError message: "connect: Invalid argument" Kernel doesn't know, which physical or virtual link you want to use to send such ICMPv6 packets. Therefore it displays this error message. Solution: Specify interface like: "ping6 -I eth0 fe80::2e0:18ff:fe90:9205", see also program ping6 usage. 4.7.1.2. Q: Cannot ping6 or traceroute6 as normal userError message: "icmp socket: Operation not permitted" These utilities create special ICMPv6 packets and send them out. This is done by using raw sockets in the kernel. But raw sockets can only be used by the "root" user. Therefore normal users get such error message. Solution: If it's really needed that all users should be able to use these utilities, you can add the "suid" bit using "chmod u+s /path/to/program", see also program ping6 usage. If not all users should be able to, you can change the group of the program to e.g. "wheel", add these power users to this group and remove the execution bit for other users using "chmod o-rwx /path/to/program". Or configure "sudo" to enable your security policy. Chapter 5. Configuring interfaces5.1. Different network devicesOn a node, there exist different network devices. They can be collected in classes
5.1.1. Physically boundedPhysically bounded interfaces like Ethernet or Token-Ring are normal ones and need no special treatment. 5.1.2. Virtually boundedVirtually bounded interfaces always need special support 5.1.2.1. IPv6-in-IPv4 tunnel interfacesThese interfaces are normally named sitx. The name sit is a shortcut for Simple Internet Transition. This device has the capability to encapsulate IPv6 packets into IPv4 ones and tunnel them to a foreign endpoint. sit0 has a special meaning and cannot be used for dedicated tunnels. 5.1.2.3. ISDN HDLC interfacesIPv6 capability for HDLC with encapsulation ip is already built-in in the kernel 5.1.2.4. ISDN PPP interfacesISDN 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. 5.1.2.5. SLIP + PLIPLike mentioned earlier, this interfaces don't support IPv6 transport (sending is OK, but dispatching on receiving don't work). Chapter 6. Configuring IPv6 addressesThere are different ways to configure an IPv6 address on an interface. You can use use "ifconfig" or "ip". 6.1. Displaying existing IPv6 addressesFirst you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during stateless auto-configuration). 6.1.1. Using "ip"Usage:
Example for a static configured host:
Example for a host which is auto-configured Here you see some auto-magically configured IPv6 addresses and their lifetime.
6.1.2. Using "ifconfig"Usage:
Example (output filtered with grep to display only IPv6 addresses). Here you see different IPv6 addresses with different scopes.
6.2. Add an IPv6 addressAdding an IPv6 address is similar to the mechanism of "IP ALIAS" addresses in Linux IPv4 addressed interfaces. 6.3. Removing an IPv6 addressNot so often needed, be carefully with removing non existent IPv6 address, sometimes using older kernels it results in a crash. Chapter 7. Configuring normal IPv6 routesIf 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. 7.1. Displaying existing IPv6 routesFirst you should check, whether and which IPv6 addresses are already configured (perhaps auto-magically during auto-configuration). 7.1.1. Using "ip"Usage:
Example:
7.1.2. Using "route"Usage:
Example (output is filtered for interface eth0). Here you see different IPv6 routes for different addresses on a single interface.
7.2. Add an IPv6 route through a gatewayMostly needed to reach the outside with IPv6 using an IPv6-enabled router on your link. 7.2.1. Using "ip"Usage:
Example:
7.2.2. Using "route"Usage:
A device can be needed, too, if the IPv6 address of the gateway is a link local one. Following shown example adds a route for all currently global addresses (2000::/3) through gateway 3ffe:ffff:0:f101::1
7.3. Removing an IPv6 route through a gatewayNot so often needed manually, mostly done by network configure scripts on shutdown (full or per interface) 7.4. Add an IPv6 route through an interfaceNot often needed, sometimes in cases of dedicated point-to-point links. 7.5. Removing an IPv6 route through an interfaceNot so often needed to use by hand, configuration scripts will use such on shutdown. 7.6. FAQ for IPv6 routes7.6.1. Support of an IPv6 default routeOne idea of IPv6 was a hierachical routing, therefore only less routing entries are needed in routers. There are some issues in current Linux kernels: 7.6.1.1. Clients (not routing any packet!)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:
7.6.1.2. Routers in case of packet forwardingCurrent mainstream 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). Therefore at this time "default routing" can be setup using the currently only global address prefix "2000::/3". The USAGI project already supports this in their extension with a hack. Note: take care about default routing without address filtering on edge routers. Otherwise unwanted multicast or site-local traffic leave the edge. Chapter 8. Neighbor DiscoveryNeighbor 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". 8.1. Displaying neighbors using "ip"With following command you can display the learnt or configured IPv6 neighbors
The following example shows one neighbor, which is a reachable router
8.2. Manipulating neighbors table using "ip"8.2.1. Manually add an entryWith following command you are able to manually add an entry
Example:
8.2.2. Manually delete an entryLike adding also an entry can be deleted:
Example:
8.2.3. More advanced settingsThe tool "ip" is less documentated, but very strong. See online "help" for more:
Looks like some options are only for IPv4...if you can contribute information about flags and advanced usage, pls. send. Chapter 9. Configuring IPv6-in-IPv4 tunnelsIf you want to leave your link you have no IPv6 capable network around you, you need IPv6-in-IPv4 tunneling to reach the world wide IPv6-Internet. There are some kind of tunnel mechanism and also some possibilities to setup tunnels. 9.1. Types of tunnelsThere are more than one possibility to tunnel IPv6 packets over IPv4-only links. 9.1.1. Static point-to-point tunneling: 6boneA point-to-point tunnel is a dedicated tunnel to an endpoint, which knows about your IPv6 network (for backward routing) and the IPv4 address of your tunnel endpoint and defined in RFC 2893 / Transition Mechanisms for IPv6 Hosts and Routers. Requirements:
9.1.2. Automatically tunnelingAutomatic tunneling occurs, when a node directly connects another node gotten the IPv4 address of the other node before. 9.1.3. 6to4-Tunneling6to4 tunneling (RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds) uses a simple mechanism to create automatic tunnels. Each node with a global unique IPv4 address is able to be a 6to4 tunnel endpoint (if no IPv4 firewall prohibits traffic). 6to4 tunneling is mostly not a one-to-one tunnel. This case of tunneling can be divided into upstream and downstream tunneling. Also, a special IPv6 address indicates that this node will use 6to4 tunneling for connecting the world-wide IPv6 network 9.1.3.1. Generation of 6to4 prefixThe 6to4 address is defined like following (schema is taken from RFC 3056 / Connection of IPv6 Domains via IPv4 Clouds):
FP and TLA together (16 bits) have the value 0x2002. V4ADDR is the node's global unique IPv4 address (in hexadecimal notation). SLA is the subnet identifier (65536 local subnets possible) and are usable to represent your local network structure. For gateways, such prefix is generated by normally using SLA "0000" and suffix "::1" and assigned to the 6to4 tunnel interface. 9.1.3.2. 6to4 upstream tunnelingThe node has to know to which foreign tunnel endpoint its in IPv4 packed IPv6 packets should be send to. In "early" days of 6to4 tunneling, dedicated upstream accepting routers were defined. See NSayer's 6to4 information for a list of routers. Nowadays, 6to4 upstream routers can be found auto-magically using the anycast address 192.88.99.1. In the background routing protocols handle this, see RFC 3068 / An Anycast Prefix for 6to4 Relay Routers for details. 9.1.3.3. 6to4 downstream tunnelingThe downstream (6bone -> your 6to4 enabled node) is not really fix and can vary from foreign host which originated packets were send to. There exist two possibilities:
9.2. Displaying existing tunnels9.2.1. Using "ip"Usage:
Example:
9.2.2. Using "route"Usage:
Example (output is filtered to display only tunnels through virtual interface sit0):
9.3. Setup of point-to-point tunnelThere are 3 possibilities to add or remove point-to-point tunnels. A good additional information about tunnel setup using "ip" is Configuring tunnels with iproute2 (article) (Mirror). 9.3.1. Add point-to-point tunnels9.3.1.1. Using "ip"Common method at the moment for a small amount of tunnels. Usage for creating a tunnel device (but it's not up afterward, also a TTL must be specified because the default value is 0).
Usage (generic example for three tunnels):
9.3.1.2. Using "ifconfig" and "route" (deprecated)This not very recommended way to add a tunnel because it's a little bit strange. No problem if adding only one, but if you setup more than one, you cannot easy shutdown the first ones and leave the others running. Usage (generic example for three tunnels):
Important: DON'T USE THIS, because this setup implicit enable "automatic tunneling" from anywhere in the Internet, this is a risk, and it should not be advocated. 9.3.1.3. Using "route" onlyIt's also possible to setup tunnels in Non Broadcast Multiple Access (NBMA) style, it's a easy way to add many tunnels at once. But none of the tunnel can be numbered (which is a not required feature). Usage (generic example for three tunnels):
Important: DON'T USE THIS, because this setup implicit enable "automatic tunneling" from anywhere in the Internet, this is a risk, and it should not be advocated. 9.3.2. Removing point-to-point tunnelsManually not so often needed, but used by scripts for clean shutdown or restart of IPv6 configuration. 9.3.2.1. Using "ip"Usage for removing a tunnel device:
Usage (generic example for three tunnels):
9.3.2.2. Using "ifconfig" and "route" (deprecated because not very funny)Not only the creation is strange, the shutdown also...you have to remove the tunnels in backorder, means the latest created must be removed first. Usage (generic example for three tunnels):
9.3.2.3. Using "route"This is like removing normal IPv6 routes. Usage (generic example for three tunnels):
9.3.3. Numbered point-to-point tunnelsSometimes it's needed to configure a point-to-point tunnel with IPv6 addresses like in IPv4 today. This is only possible with the first (ifconfig+route - deprecated) and third (ip+route) tunnel setup. In such cases, you can add the IPv6 address to the tunnel interface like shown on interface configuration. 9.4. Setup of 6to4 tunnelsPay attention that the support of 6to4 tunnels currently lacks on vanilla kernel series 2.2.x (see systemcheck/kernel for more information). Also note that that the prefix length for a 6to4 address is 16 because of from network point of view, all other 6to4 enabled hosts are on the same layer 2. 9.4.1. Add a 6to4 tunnelFirst, you have to calculate your 6to4 prefix using your local assigned global routable IPv4 address (if your host has no global routable IPv4 address, in special cases NAT on border gateways is possible): Assuming your IPv4 address is
the generated 6to4 prefix will be
Local 6to4 gateways should always assigned the suffix "::1", therefore your local 6to4 address will be
Use e.g. following for automatic generation:
There are two ways possible to setup 6to4 tunneling now. 9.4.1.1. Using "ip" and a dedicated tunnel deviceThis is now the recommended way (a TTL must be specified because the default value is 0). Create a new tunnel device
Bring interface up
Add local 6to4 address to interface (note: prefix length 16 is important!)
Add (default) route to the global IPv6 network using the all-6to4-routers IPv4 anycast address
9.4.1.2. Using "ifconfig" and "route" and generic tunnel device "sit0" (deprecated)This is now deprecated because using the generic tunnel device sit0 doesn't let specify filtering per device. Bring generic tunnel interface sit0 up
Add local 6to4 address to interface
Add (default) route to the global IPv6 network using the all-6to4-relays IPv4 anycast address
9.4.2. Remove a 6to4 tunnel9.4.2.1. Using "ip" and a dedicated tunnel deviceRemove all routes through this dedicated tunnel device
Shut down interface
Remove created tunnel device
9.4.2.2. Using "ifconfig" and "route" and generic tunnel device "sit0" (deprecated)Remove (default) route through the 6to4 tunnel interface
Remove local 6to4 address to interface
Shut down generic tunnel device (take care about this, perhaps it's still in use...)
Chapter 10. Configuring IPv4-in-IPv6 tunnelsThis will be filled in the future. At the moment, such tunnels are more used in test environments. More information in the meantime: RFC 2473 / Generic Packet Tunneling in IPv6 Specification Chapter 11. Kernel settings in /proc-filesystemNote: the source of this section is mostly the file "ip-sysctl.txt" which is included in current kernel sources in directory "Documentation/networking". Credits to Pekka Savola for maintaining the IPv6-related part in this file. Also some text is more or less copied & pasted into this document. 11.1. How to access the /proc-filesystem11.1.1. Using "cat" and "echo"Using "cat" and "echo" is the simplest way to access the /proc filesystem, but some requirements are needed for that
Normally, only entries in /proc/sys/* are writable, the others are readonly and for information retrieving only. 11.1.2. Using "sysctl"Using the "sysctl" program to access the kernel switches is a modern method today. You can use it also, if the /proc-filesystem isn't mounted. But you have only access to /proc/sys/*! The program "sysctl" is included in package "procps" (on Red Hat Linux systems).
11.1.2.1. Retrieving a valueThe value of an entry can be retrieved now:
11.1.2.2. Setting a valueA new value can be set (if entry is writable):
Note: Don't use spaces around the "=" on setting values. Also on multiple values per line, quote them like e.g.
11.1.3. Values found in /proc-filesystemsThere are several formats seen in /proc-filesystem:
11.2. Entries in /proc/sys/net/ipv6/11.2.2. conf/all/*Change all the interface-specific settings. Exception: "conf/all/forwarding" has a different meaning here 11.2.2.1. conf/all/forwarding
This enables global IPv6 forwarding between all interfaces. In IPv6 you can't control forwarding per device, forwarding control has to be done using IPv6-netfilter (controlled with ip6tables) rulesets and specify input and output devices (see Firewalling/Netfilter6 for more). This is different to IPv4, where you are able to control forwarding per device (decision is made on interface where packet came in). This also sets all interfaces' Host/Router setting 'forwarding' to the specified value. See below for details. This referred to as global forwarding. If this value is 0, no IPv6 forwarding is enabled, packets never leave another interface, neither physical nor logical like e.g. tunnels. 11.2.3. conf/interface/*Change special settings per interface. The functional behaviour for certain settings is different depending on whether local forwarding is enabled or not. 11.2.3.1. accept_ra
Accept Router Advertisements, and autoconfigure this interface with received data. 11.2.3.2. accept_redirects
Accept Redirects sent by an IPv6 router. 11.2.3.3. autoconf
Configure link-local addresses (see also Addresstypes) using L2 hardware addresses. E.g. this generates automagically an address like "fe80::201:23ff:fe45:6789" on an interface with a L2-MAC address. 11.2.3.4. dad_transmits
The amount of Duplicate Address Detection probes to send. 11.2.3.5. forwarding
Configure interface-specific Host/Router behaviour. Note: It is recommended to have the same setting on all interfaces; mixed router/host scenarios are rather uncommon.
11.2.3.8. router_solicitation_delay
Number of seconds to wait after interface is brought up before sending Router Solicitations. 11.2.4. neigh/default/*Change default settings for neighbor detection and some special global interval and threshold values: 11.2.4.3. gc_thresh3
Tuning parameter for neighbour table size. Increase this value if you have a lot of interfaces and problem with routes start to act mysteriously and fail. Or if a running Zebra (routing daemon) reports:
11.3. IPv6-related entries in /proc/sys/net/ipv4/At the moment (and this will be until IPv4 is completly converted to an independend kernel module) some switches are also used here for IPv6. 11.4. IPv6-related entries in /proc/net/In /proc/net there are several read-only entries available. You cannot retrieve information using "sysctl" here, so use e.g. "cat". 11.4.1. if_inet6
Here all configured IPv6 addresses are shown in a special format. The example displays for loopback interface only. The meaning is shown below (see "net/ipv6/addrconf.c" for more).
11.4.2. ipv6_route
Here all configured IPv6 routes are shown in a special format. The example displays for loopback interface only. The meaning is shown below (see "net/ipv6/route.c" for more).
11.4.3. sockstat6
Statistics about used IPv6 sockets. Example:
Chapter 13. Network debugging13.1. Server socket binding13.1.1. Using "netstat" for server socket binding checkIt's always interesting which server sockets are currently active on a node. Using "netstat" is a short way to get such information: Used options: -nlptu Example:
13.2. Examples for tcpdump packet dumpsHere some examples of captured packets are shown, perhaps useful for your own debugging... ...more coming next... 13.2.1. Router discovery13.2.1.1. Router advertisement
Router with link-local address "fe80::212:34ff:fe12:3450" send an advertisement to the all-node-on-link multicast address "ff02::1" containing two prefixes "2002:0102:0304:1::/64" (lifetime 30 s) and "3ffe:ffff:0:1::/64" (lifetime 2592000 s) including its own layer 2 MAC address "0:12:34:12:34:50". 13.2.1.2. Router solicitation
Node with link-local address "fe80::212:34ff:fe12:3456" and layer 2 MAC address "0:12:34:12:34:56" is looking for a router on-link, therefore sending this solicitation to the all-router-on-link multicast address "ff02::2". 13.2.2. Neighbor discovery13.2.2.1. Neighbor discovery solicitation for duplicate address detectionFollowing packets are sent by a node with layer 2 MAC address "0:12:34:12:34:56" during autoconfiguration to check whether a potential address is already used by another node on the link sending this to the solicited-node link-local multicast address.
13.2.2.2. Neighbor discovery solicitation for looking for host or gateway
Chapter 14. Support for persistent IPv6 configuration in Linux distributionsSome Linux distribution contain already support of a persistent IPv6 configuration using existing or new configuration and script files and some hook in the IPv4 script files. 14.1. Red Hat Linux and "clones"Since starting writing the IPv6 & Linux - HowTo it was my intention to enable a persistent IPv6 configuration which catch most of the wished cases like host-only, router-only, dual-homed-host, router with second stub network, normal tunnels, 6to4 tunnels, and so on. Nowadays there exists a set of configuration and script files which do the job very well (never heard about real problems, but I don't know how many use the set). Because this configuration and script files are extended from time to time, they got their own homepage: initscripts-ipv6 homepage (Mirror). Because I began my IPv6 experience using a Red Hat Linux 5.0 clone, my IPv6 development systems are mostly Red Hat Linux based now, it's kind a logic that the scripts are developed for this kind of distribution (so called historic issue). Also it was very easy to extend some configuration files, create new ones and create some simple hook for calling IPv6 setup during IPv4 setup. Fortunately, in Red Hat Linux since 7.1 a snapshot of my IPv6 scripts is included, this was and is still further on assisted by Pekka Savola. Mandrake since version 8.0 also includes an IPv6-enabled initscript package, but a minor bug still prevents usage ("ifconfig" misses "inet6" before "add"). 14.1.1. Test for IPv6 support of network configuration scriptsYou can test, whether your Linux distribution contain support for persistent IPv6 configuration using my set. Following script library should exist:
Auto-magically test:
The version of the library is important if you miss some features. You can get it executing following (or easier look at the top of the file):
In shown example, the used version is 20011124. Check this against latest information on initscripts-ipv6 homepage (Mirror) to see what has been changed. You will find there also a change-log. 14.1.2. Short hint for enabling IPv6 on current RHL 7.1, 7.2, 7.3, ...
If your system is on a link which provides router advertisement, autoconfiguration will be done automatically. For more information which settings are supported see /usr/share/doc/initscripts-$version/sysconfig.txt. 14.2. SuSE LinuxIn newer 7.x versions there is a really rudimentary support available, see /etc/rc.config for details. Because of the really different configuration and script file structure it is hard (or impossible) to use the set for Red Hat Linux and clones with this distribution. In versions 8.x they completly change their configuration setup. 14.3. Debian LinuxFollowing information was contributed by Stephane Bortzmeyer <bortzmeyer at nic dot fr>
And you reboot or you just
and you have your static address. 14.3.1. Further information
Chapter 15. Auto-configuration and mobility15.1. Stateless auto-configurationIs supported and seen on the assigned link-local address after an IPv6-enabled interface is up. 15.2. Stateful auto-configuration using Router Advertisement Daemon (radvd)to be filled. See radvd daemon autoconfiguration below. 15.3. Dynamic Host Configuration Protocol v6 (DHCPv6)to be filled. For the moment, see Issues Concerning DHCP in IPv6 Specifications; Dynamic Host Configuration Protocol for IPv6 (DHCPv6) ; A Guide to Implementing Stateless DHCPv6 Service and DHCPv6 Options for SIP Servers for more details. 15.4. Mobilityto be filled. For the moment, see Mobile IPv6 for Linux(MIPL) homepage for more details. Further infos can be found here (please report broken links):
Chapter 16. FirewallingIPv6 firewalling is important, especially if using IPv6 on internal networks with global IPv6 addresses. Because unlike at IPv4 networks where in common internal hosts are protected automatically using private IPv4 addresses like RFC 1918 / Address Allocation for Private Internets or Automatic Private IP Addressing (APIPA)Google search for Microsoft + APIPA, in IPv6 normally global addresses are used and someone with IPv6 connectivity can reach all internal IPv6 enabled nodes. 16.1. Firewalling using netfilter6Native IPv6 firewalling is only supported in kernel versions 2.4+. In older 2.2- you can only filter IPv6-in-IPv4 by protocol 41. Attention: no warranty that described rules or examples can really protect your system! Audit your ruleset after installation, see Section 17.3 for more. Note also that the USAGI project is currently working on finishing the connection tracking for IPv6! This will make ruleset easier and more secure in the future! 16.2. Preparation16.2.1. Get sourcesGet the latest kernel source: http://www.kernel.org/ Get the latest iptables package:
16.2.2. Extract sourcesChange to source directory:
Unpack and rename kernel sources
Unpack iptables sources
16.2.3. Apply latest iptables/IPv6-related patches to kernel sourceChange to iptables directory
Apply pending patches
Apply additional IPv6 related patches (still not in the vanilla kernel included)
Say yes at following options (iptables-1.2.2)
Check IPv6 extensions
16.2.4. Configure, build and install new kernelChange to kernel sources
Edit Makefile
Run configure, enable IPv6 related
Configure other related to your system, too Compilation and installing: see the kernel section here and other HOWTOs 16.2.5. Rebuild and install binaries of iptablesMake sure, that upper kernel source tree is also available at /usr/src/linux/ Rename older directory
Create a new softlink
Rebuild SRPMS
Install new iptables packages (iptables + iptables-ipv6)
Perhaps it's necessary to create a softlink for iptables libraries where iptables looks for them
16.3. Usage16.3.1. Check for supportLoad module, if so compiled
Check for capability
16.3.2. Learn how to use ip6tables16.3.2.1. List all IPv6 netfilter entries
16.3.2.3. Insert a log rule at the input filter with options
16.3.2.6. Allow ICMPv6Using older kernels (unpatched kernel 2.4.5 and iptables-1.2.2) no type can be specified
Newer kernels allow specifying of ICMPv6 types:
16.3.2.7. Rate-limitingBecause it can happen (author already saw it to times) that an ICMPv6 storm will raise up, you should use available rate limiting for at least ICMPv6 ruleset. In addition logging rules should also get rate limiting to prevent DoS attacks against syslog and storage of log file partition. An example for a rate limited ICMPv6 looks like:
16.3.2.8. Allow incoming SSHHere an example is shown for a ruleset which allows incoming SSH connection from a specified IPv6 address
16.3.2.9. Enable tunneled IPv6-in-IPv4To accept tunneled IPv6-in-IPv4 packets, you have to insert rules in your IPv4 firewall setup relating to such packets, for example
If you have only a static tunnel, you can specify the IPv4 addresses, too, like
16.3.2.10. Protection against incoming TCP connection requestsVERY RECOMMENDED! For security issues you should really insert a rule which blocks incoming TCP connection requests. Adapt "-i" option, if other interface names are in use!
Perhaps the rules have to be placed below others, but that is work you have to think about it. Best way is to create a script and execute rules in a specified way. 16.3.2.11. Protection against incoming UDP connection requestsALSO RECOMMENDED! Like mentioned on my firewall information it's possible to control the ports on outgoing UDP/TCP sessions. So if all of your local IPv6 systems are using local ports e.g. from 32768 to 60999 you are able to filter UDP connections also (until connection tracking works) like:
16.3.3. Demonstration exampleFollowing lines show a more sophisticated setup as an example. Happy netfilter6 ruleset creation....
Chapter 17. Security17.1. Node securityIt's very recommended to apply all available patches and disable all not necessary services. Also bind services to the needed IPv4/IPv6 addresses only and install local firewalling. More to be filled... 17.2. Access limitationsMany services uses the tcp_wrapper library for access control. Below is described the use of tcp_wrapper. More to be filled... 17.3. IPv6 security auditingCurrently there are no comfortable tools out which are able to check a system over network for IPv6 security issues. Neither Nessus nor any commercial security scanner is as far as I know able to scan IPv6 addresses. 17.3.1. Legal issuesATTENTION: always take care that you only scan your own systems or after receiving a written order, otherwise legal issues are able to come up to you. CHECK destination IPv6 addresses TWICE before starting a scan. 17.3.2. Security auditing using IPv6-enabled netcatWith the IPv6-enabled netcat (see IPv6+Linux-status-apps/security-auditing for more) you can run a portscan by wrapping a script around which run through a port range, grab banners and so on. Usage example:
17.3.3. Security auditing using IPv6-enabled nmapNMap, one of the best portscaner around the world, supports IPv6 since version 3.10ALPHA1. Usage example:
17.3.4. Security auditing using IPv6-enabled strobeStrobe is a (compared to NMap) more a low budget portscanner, but there is an IPv6-enabling patch available (see IPv6+Linux-status-apps/security-auditing for more). Usage example:
Note: strobe isn't really developed further on, the shown version number isn't the right one. 17.3.5. Audit resultsIf the result of an audit mismatch your IPv6 security policy, use IPv6 firewalling to close the holes, e.g. using netfilter6 (see Firewalling/Netfilter6 for more). Info: More detailed information concerning IPv6 Security can be found here:
Chapter 18. Encryption and AuthenticationUnlike in IPv4 encryption and authentication is a mandatory feature of IPv6. This features are normally implemented using IPsec (which can be also used by IPv4). But because of the independence of encryption and authentication from the key exchange protocol there exists currently some interoperability problems regarding this issue. 18.1. Support in kernel18.1.1. Support in vanilla Linux kernel 2.4.xCurrently missing in vanilla 2.4. There is an issue about keeping the Linux kernel source free of export/import-control-laws regarding encryption code. This is also one case why FreeS/WAN project (IPv4 only IPsec) isn't still contained in vanilla source. 18.1.2. Support in USAGI kernelThe USAGI project has taken over in July 2001 the IPv6 enabled FreeS/WAN code from the IABG / IPv6 Project and included in their kernel extensions. Nowadays they are working on implementing IPsec into 2.5.x series. 18.2. UsageIn difference to FreeS/WAN, in IPsec of 2.5.x the IKE daemon "racoon" (taken from KAME) is used instead of "pluto" of FreeS/WAN. It has a different configuration syntax than "pluto", note also that the IPsec setup is splitted into 2 parts (IKE and topology setup). Until some documentation is filled here, take a look at Linux Advanced Routing & Traffic Control HOWTO / IPSEC. Chapter 19. Quality of Service (QoS)IPv6 supports QoS with use of Flow Labels and Traffic Classes. This can be controlled using "tc" (contained in package "iproute"). Additional infos: more to be filled... Chapter 20. Hints for IPv6-enabled daemonsHere some hints are shown for IPv6-enabled daemons. 20.1. Berkeley Internet Name Daemon BIND (named)IPv6 is supported since version 9. Always use newest available version. At least version 9.1.3 must be used, older versions can contain remote exploitable security holes. 20.1.1. Listening on IPv6 addressesNote: unlike in IPv4 current versions doesn't allow to bind a server socket to dedicated IPv6 addresses, so only any or none are valid. Because this can be a security issue, check the Access Control List (ACL) section below, too! 20.1.1.1. Enable BIND named for listening on IPv6 addressTo enable IPv6 for listening, following options are requested to change
This should result after restart in e.g.
And a simple test looks like
and should show you a result. 20.1.2. IPv6 enabled Access Control Lists (ACL)IPv6 enabled ACLs are possible and should be used whenever it's possible. An example looks like following:
This ACLs can be used e.g. for queries of clients and transfer zones to secondary name-servers. This prevents also your caching name-server to be used from outside using IPv6.
It's also possible to set the allow-query and allow-transfer option for most of single zone definitions, too. 20.1.3. Sending queries with dedicated IPv6 addressThis option is not required, but perhaps needed:
20.1.4. Per zone defined dedicated IPv6 addressesIt's also possible to define per zone some IPv6 addresses. 20.1.5. IPv6 DNS zone files examplesSome information can be also found at IPv6 DNS Setup Information (article). Perhaps also helpful is the IPv6 Reverse DNS zone builder for BIND 8/9 (webtool). 20.1.6. Serving IPv6 related DNS dataFor IPv6 new types and root zones for reverse lookups are defined:
Perhaps filled later more content, for the meantime take a look at given RFCs and
Because IP6.INT is deprecated (but still in use), a DNS server which will support IPv6 information has to serve both reverse zones. 20.1.7. Checking IPv6-enabled connectTo check, whether BIND is listening on an IPv6 socket and serving data see following examples. 20.1.7.1. IPv6 connect, but denied by ACLSpecifying a dedicated server for the query, an IPv6 connect can be forced:
Related log entry looks like following:
If you see such entries in the log, check whether requests from this client should be allowed and perhaps review your ACL configuration. 20.1.7.2. Successful IPv6 connectA successful IPv6 connect looks like following:
20.2. Internet super daemon (xinetd)IPv6 is supported since xinetd version around 1.8.9. Always use newest available version. At least version 2.3.3 must be used, older versions can contain remote exploitable security holes. Some Linux distribution contain an extra package for the IPv6 enabled xinetd, some others start the IPv6-enabled xinetd if following variable is set: NETWORKING_IPV6="yes", mostly done by /etc/sysconfig/network (only valid for Red Hat like distributions). In newer releases, one binary supports IPv4 and IPv6. If you enable a built-in service like e.g. daytime by modifying the configuration file in /etc/xinetd.d/daytime like
After restarting the xinetd you should get a positive result like:
Shown example also displays an IMAP and IMAP-SSL IPv4-only listening xinetd. Note: earlier versions had a problem that an IPv4-only xinetd won't start on an IPv6-enabled node and also the IPv6-enabled xinetd won't start on an IPv4-only node. This is known to be fixed in later versions, at least version 2.3.11. 20.3. Webserver Apache2 (httpd2)Apache web server supports IPv6 native by maintainers since 2.0.14. Available patches for the older 1.3.x series are not current and shouldn't be used in public environment, but available at KAME / Misc. 20.3.1. Listening on IPv6 addressesNote: virtual hosts on IPv6 addresses are broken in versions until 2.0.28 (a patch is available for 2.0.28). But always try latest available version first because earlier versions had some security issues. 20.3.1.1. Virtual host listen on an IPv6 address only
20.3.1.2. Virtual host listen on an IPv6 and on an IPv4 address
This should result after restart in e.g.
For simple tests use the telnet example already shown. 20.3.1.3. Additional notes
20.4. Router Advertisement Daemon (radvd)The router advertisement daemon is very useful on a LAN, if clients should be auto-configured. The daemon itself should run on the Linux default IPv6 gateway router (it's not required that this is also the default IPv4 gateway, so pay attention who on your LAN is sending router advertisements). You can specify some information and flags which should be contained in the advertisement. Common used are
After a proper configuration, the daemon sends advertisements through specified interfaces and clients are hopefully receive them and auto-magically configure addresses with received prefix and the default route. 20.4.1. Configuring radvd20.4.1.1. Simple configurationRadvd's config file is normally /etc/radvd.conf. An simple example looks like following:
This results on client side in
Because no lifetime was defined, a very high value was used. 20.4.1.2. Special 6to4 configurationVersion since 0.6.2pl3 support the automatic (re)-generation of the prefix depending on an IPv4 address of a specified interface. This can be used to distribute advertisements in a LAN after the 6to4 tunneling has changed. Mostly used behind a dynamic dial-on-demand Linux router. Because of the sure shorter lifetime of such prefix (after each dial-up, another prefix is valid), the lifetime configured to minimal values:
This results on client side in (assuming, ppp0 has currently 1.2.3.4 as local IPv4 address):
Because a small lifetime was defined, such prefix will be thrown away quickly, if no related advertisement was received. 20.4.2. DebuggingA program called "radvdump" can help you looking into sent or received advertisements. Simple to use:
Output shows you each advertisement package in readable format. You should see your configured values here again, if not, perhaps it's not your radvd which sends the advertisement...look for another router on the link (and take the LLAddress, which is the MAC address for tracing). 20.5. tcp_wrappertcp_wrapper is a library which can help you to protect service against misuse. 20.5.1. Filtering capabilitiesYou can use tcp_wrapper for
20.5.2. Which program uses tcp_wrapperFollowing are known:
20.5.3. Usagetcp_wrapper is controlled by two files name /etc/hosts.allow and /etc/hosts.deny. For more information see
20.5.3.1. Example for /etc/hosts.allowIn this file, each service which should be positive filtered (means connects are accepted) need a line.
Note: there are broken implementations around, which uses following broken IPv6 network description: [3ffe:ffff:100:200::/64]. Hopefully, such versions will be fixed soon. 20.5.3.2. Example for /etc/hosts.denyThis file contains all negative filter entries and should normally deny the rest using
If this node is a more sensible one you can replace the standard line above with this one, but this can cause a DoS attack (load of mailer and spool directory), if too many connects were made in short time. Perhaps a logwatch is better for such issues.
20.5.4. LoggingDepending on the entry in the syslog daemon configuration file /etc/syslog.conf the tcp_wrapper logs normally into /var/log/secure. 20.5.4.1. Refused connectionA refused connection via IPv4 to an xinetd covered daytime service produces a line like following example
A refused connection via IPv4 to an dual-listen sshd produces a line like following example
20.5.4.2. Permitted connectionA permitted connection via IPv4 to an xinetd covered daytime service produces a line like following example
A permitted connection via IPv4 to an dual-listen sshd produces a line like following example
Chapter 21. Programming (using API)I have no experience in IPv6 programming, perhaps this chapter will be filled by others or moved away to another HOWTO. More Information can be found here: Chapter 22. InteroperabilityThere are some projects around the world which checks the interoperability of different operating systems regarding the implementation of IPv6 features. Here some URLs: More coming next... Chapter 23. Further information and URLs23.1. Paper printed books, articles, online reviews (mixed)23.1.1. Printed Books (English)23.1.1.1. Cisco
23.1.1.2. General
23.1.2. Printed Books (German)
23.1.3. Articles, eBooks, Online Reviews (mixed)
23.1.4. Science Publications (abstracts, bibliographies, online resources)
23.3. Online information23.3.1. Join the IPv6 backboneMore to be filled later...suggestions are welcome! 23.3.1.1. Global registries
23.3.1.2. Major regional registries
Also a list of major (prefix length 35) allocations per local registry is available here: Ripe NCC / IPv6 allocations. 23.3.1.3. Tunnel brokersNote: A list of available Tunnel broker can be found in the section Tunnel broker below.
See also here for more information and URLs: ipv6-net.org. 23.3.2. Latest newsMore to be filled later...suggestions are welcome!
23.3.3. Protocol references23.3.3.1. IPv6-related Request For Comments (RFCs)Publishing the list of IPv6-related RFCs is beyond the scope of this document, but given URLs will lead you to such lists:
23.3.3.2. Current drafts of working groupsCurrent (also) IPv6-related drafts can be found here:
23.3.3.3. Others
23.3.4. More informationMore to be filled later...suggestions are welcome! DeepSpace6 / more interesting links 23.3.4.1. Linux related
23.3.4.2. Linux related per distribution
For more see the IPv6+Linux Status Distributions page. 23.3.4.3. General
Something missing? Suggestions are welcome! 23.3.4.4. Market Research
23.3.4.5. Patents
23.3.5. By countries23.3.5.1. Europe
23.3.5.2. Austria
23.3.5.14. Korea
23.3.5.15. Mexico
23.3.5.16. Netherland
23.3.5.20. United Kingdom
23.3.6. By operating systems23.3.6.1. *BSD
23.3.6.2. Cisco IOS
23.3.6.5. IBM
23.3.6.6. Microsoft
23.3.7. IPv6 Security
23.3.8. Application lists
23.3.8.1. Analyzer tools
23.3.8.2. IPv6 Products
23.4. IPv6 Infrastructure23.4.1. Statistics
23.4.2. Internet ExchangesAnother list of IPv6 Internet Exchanges can be found here: IPv6 Exchanges Web Site 23.4.2.3. France
23.4.3. Tunnel broker23.4.3.2. Canada
23.4.3.6. Germany
23.4.3.7. Italy
23.4.3.8. Japan
23.4.3.10. Netherlands
23.4.3.11. Norway
23.4.3.13. UK
23.4.3.14. USA
23.4.4. Native IPv6 ServicesNote: These services are only available with a valid IPv6 connection! 23.4.4.3. Radio Stations, Music Streams
23.5. MaillistsLists of maillists are available at: Major Mailinglists are listed in following table: .
(1) recommended for common Linux & IPv6 issues. (2) very recommended if you provide server applications. Something missing? Suggestions are welcome! Following other maillinglists & newsgroups are available via web:
23.6. Online tools23.6.1. Testing tools
23.7. Trainings, Seminars
Something missing? Suggestions are welcome! 23.8. 'The Online Discovery' ...IPv6: Addressing The Needs Of the Future [DOWNLOAD: PDF] by Yankee Group (Author) List Price: $595.00 Edition: e-book (Acrobat Reader) Pages: 3 (three) Publisher: MarketResearch.com; ISBN B00006334Y; (November 1, 2001) ;-) The number of copies would be interesting... Chapter 24. Revision history / Credits / The End24.1. Revision historyVersions x.y are published on the Internet. Versions x.y.z are work-in-progress and only published as LyX file on CVS. 24.1.1. Releases 0.x
24.2. CreditsThe quickest way to be added to this nice list is to send bug fixes, corrections, and/or updates to me ;-). If you want to do a major review, you can use the native LyX file (see original source) and send diffs against it, because diffs against SGML don't help too much. 24.2.1. Major credits
24.2.2. Other credits24.2.2.1. Document technique relatedWriting a LDP HOWTO as a newbie (in LyX and exporting this to DocBook to conform to SGML) isn't as easy as some people say. There are some strange pitfalls... Nevertheless, thanks to:
24.2.2.2. Content related creditsCredits for fixes and hints are listed here, will grow sure in the future
24.3. The EndThanks for reading. Hope it helps! If you have any questions, subscribe to proper maillist and describe your problem providing as much as information as possible. |