Product SiteDocumentation Site

10.6. ‏IPv6

IPv6, successor to IPv4, is a newer version of the IP protocol designed to fix its flaws, most notably the scarcity of available IP addresses. This protocol handles the network layer; its purpose is to provide a way to address machines, to convey data to their intended destination, and to handle data fragmentation if needed (in other words, to split packets into chunks with a size that depends on the network links to be used on the path and to reassemble the chunks in their proper order on arrival).
تتضمن نوى دبيان دعم IPv6 في لب النواة (عدا بعض المعماريات التي تتضمن دعم IPv6 بشكل وحدة اسمها ipv6). هناك مكافِئات للأدوات الأساسية تعتمد IPv6 مثل ping6 التي تقابل ping وtraceroute6 التي تقابل traceroute، وهاتان متوفرتان في الحزمتين iputils-ping وiputils-tracepath.
يشبه إعداد شبكات IPv6 إعداد شبكات IPv4، عبر الملف /etc/network/interfaces. لكن إذا أردت أن تتاح الشبكة عالميًا، فعليك أن تتأكد أنك تملك موجهاً يدعم IPv6 لتوجيه حركة البيانات إلى شبكة IPv6 العالمية.

مثال 10.10. مثال عن إعدادات IPv6

iface enp7s0 inet6 static
    address 2001:db8:1234:5::1:1/64
    # Disabling auto-configuration
    # autoconf 0
    # The router is auto-configured and has no fixed address
    # (accept_ra 1). If it had:
    # gateway 2001:db8:1234:5::1
لشبكات IPv6 أقنعة من 64 بت عادة. هذا يعني وجود 264 عنوان مستقل ضمن الشبكة الفرعية. هذا يسمح لإعداد العناوين التلقائي SLAAC‏ (Stateless Address Autoconfiguration) باختيار عنوان IP اعتماداً على عنوان MAC الخاص بالوجهة الشبكية. افتراضياً، إذا كان SLAAC مفعلاً على الشبكة، وكان IPv6 مفعلاً على الحاسب، فسوف تعثر النواة آلياً على موجهات الشبكة وتضبط الواجهات الشبكية.
This behavior may have privacy implications. If you switch networks frequently, e.g. with a laptop, you might not want your MAC address being a part of your public IPv6 address. This makes it easy to identify the same device across networks. A solution to this are IPv6 privacy extensions (which Debian enables by default if IPv6 connectivity is detected during initial installation), which will assign an additional randomly generated address to the interface, periodically change them and prefer them for outgoing connections. Incoming connections can still use the address generated by SLAAC. The following example, for use in /etc/network/interfaces, activates these privacy extensions for the interface enp7s0.

مثال 10.11. إضافات الخصوصية في IPv6

iface enp7s0 inet6 auto
    # Prefer the randomly assigned addresses for outgoing connections.
    privext 2
IPv6 connections can be restricted, in the same fashion as for IPv4. nft can be used to create firewall rules for IPv4 and IPv6 (see قسم 14.2.3, “Syntax of nft).

10.6.1. الأنفاق

If a native IPv6 connection is not available, the fallback method is to use a tunnel over IPv4. Hurricane Electric is one (free) provider of such tunnels:
To use a Hurricane Electric tunnel, you need to register an account, login, select a free tunnel and edit the file /etc/network/interfaces with the generated code.
You can install and configure the radvd daemon (from the similarly-named package) if you want to use the configured computer as a router for a local network. This IPv6 configuration daemon has a role similar to dhcpd in the IPv4 world.
The /etc/radvd.conf configuration file must then be created (see /usr/share/doc/radvd/examples/simple-radvd.conf as a starting point). In our case, the only required change is the prefix, which needs to be replaced with the one provided by Hurricane Electric; it can be found in the output of the ip a command, in the block concerning the he-ipv6 interface.
Then run systemctl start radvd. The IPv6 network should now work.