IPv6 router guide/ru

Основные настройки ядра
Любое из доступных Gentoo деревьев исходных кодов ядра версии 2.6 с легкостью поддерживает соединения IPv6. Новый стэк IPv6 USAGI интегрирован в ядро с версии Linux 2.6.0.

Теперь мы готовы перейти в каталог с исходными кодами ядра и начать его конфигурацию.

Проверка поддержки IPv6
После включения рекомендуемых параметров, скомпилируйте новое ядро с поддержкой IPv6 и перезагрузитесь.

Если программа iproute2 все еще не установлена, мы настоятельно рекомендуем сделать это сейчас. iproute2 - это набор инструментов для конфигурации сети, содержащий  - известную замену для ,  ,   и другие программы...

Если IPv6 работает, loopback-устройство должно показывать IPv6-адрес:

Перед тем как продолжить, убедитесь что ipv6 добавлен в список USE-флагов в файле, чтобы дальнейшие установки пакетов включали поддержку IPv6.

Основная конфигурация
Большинство провайдеров все еще не предоставляют "нативных" соединений IPv6. Чтобы обойти это ограничение, существуют несколько "сервисов туннелей" по всему миру, которые предлагают свободные туннели IPv6. Это делает возможным туннелирование соединений IPv6 через соединение IPv4.

Ниже приведены два примера настройки туннеля с двумя популярными североамериканскими туннелями: Hurricane Electric (также применимо к non-heartbeat туннелям sixxs.net) и Freenet6.

Hurricane Electric
Hurricane Electric (сокращенно, HE) предлагает свободные IPv6-туннели и распределяет блок адресов /64. Также доступна настройка обратного запроса DNS. Получение туннеля от HE так же легко, как и переход по ссылке https://www.tunnelbroker.net/ и заполнение одностраничной формы.

После разрешения туннеля и распределения блока /64, необходимо настроить Gentoo. HE предусматривает образцы настроек, основанные на утилитах ifconfig и iproute. В двух следующих примерах предполагается следующая конфигурация:

Используя команду  из пакета iproute2, выполните следующее.

Создайте туннель между локальным адресом IPv4 (eth0) и удаленным IPv4-адресом Hurricane Electric:

Извлеките overhead туннелирования из MTU (maximum transmission unit):

Откройте туннель:

Назначьте ему IPv6-адрес:

Направьте все глобальные unicast IPv6-адреса через туннельное устройство 'sixbone':

Freenet6
Freenet6 is another free tunnel broker. Optional registration only requires a username and a valid email address. They have chosen to turn the tunnel management into a client/server setup and have created the  client. The client is available in Portage. To install it do:

Теперь при выборе соединения с аутентификацией потребуется настроить, отредактировав файл. Нужно только изменить поля userid и passwd для соответствия полям, назначенным Freenet6, и изменить сетевой шлюз. Ниже приведен пример файла конфигурации.

Пример файла gw6c.conf

Проверка соединения
Теперь, когда туннель настроен, необходимо протестировать соединение. Самым легким способом это сделать является использование утилиты  для проверки связи с хостом IPv6.

Further work is currently in progress to add better IPv6 support to the network init scripts. If you'd like to know the status of this and/or help out, email.

Re-emerging packages
Unless you had USE="ipv6" in your previously, you probably need to re-emerge a bunch of packages to compile in IPv6 support for them. To get a list of all the installed packages which are affected by USE flag changes, use Portage's   option:

If you have changed a lot of USE flags, the list could be quite long. It's suggested to keep your system up-to-date, so it won't hurt if you recompile all affected packages.

IPv6 Specific Packages
There are a few packages which specifically deal with IPv6 items. Most of these are located in.

IPv6 and DNS
Just as DNS for IPv4 uses A records, DNS for IPv6 uses AAAA records. (This is because IPv4 is an address space of 2^32 while IPv6 is an address space of 2^128). For reverse DNS, the INT standard is deprecated but still widely supported. ARPA is the latest standard. Support for the ARPA format will be described here.

BIND configuration
Recent versions of BIND include excellent IPv6 support. This section will assume you have at least minimal knowledge about the configuration and use of BIND. We will assume you are not running bind in a chroot. If you are, simply append the chroot prefix to most of the paths in the following section.

First you need to add entries for both forward and reverse DNS zone files in.

named.conf entries

Now we must create those zone files and add entries for all of our hosts:

pri/ipv6-rules.com

pri/rev-ipv6-rules.com.arpa

DJBDNS configuration
There are currently some third-party patches to DJBDNS available at http://www.fefe.de/dns/ that allow it to do IPv6 nameserving. DJBDNS can be installed with these patches by emerging it with ipv6 in your USE variables.

After djbdns is installed, it can be setup by running  and answering a few questions about which IP addresses to bind to, where to install tinydns, etc.

Assuming we've installed  into, we can now edit. This file will contain all the data needed to get tinydns handling DNS for your IPv6 delegation.

sample data file

Lines prefixed with a  will have both an AAAA and a PTR record created. Those prefixed with a  will only have an AAAA record created. Besides manually editing the file, you can use the scripts   and   to add new entries. After changes are made to the file, you simply need to run   from. This will create, which tinydns will use as its source of information for DNS requests.

Configure routing
Further configuration is required if we want to use our system as a router for other clients wishing to connect to the outside world with IPv6. We need to enable forwarding of IPv6 packets. We can do this in one of two ways.

Or we set the value 1 in the forwarding pseudo-file:

Or we use the  command:

To enable forwarding at boot, you'll need to edit and add the following line.

sysctl.conf addition

Traffic should now be forwarded from this box through the tunnel we've established with our broker.

To assign IPv6 addresses to clients, the IPv6 specification allows for both stateless and stateful IP assignment. Stateless assignment uses a process called Router Advertisement and allows clients to obtain an IP and a default route by simply bringing an interface up. It is called "stateless" because there is no record of IPs assigned and the host they are assigned to. Stateful assignment is handled by DHCPv6. It is "stateful" because the server keeps a state of the clients who've requested IPs and received them.

Stateless Configuration
Stateless configuration is easily accomplished using the Router Advertisement Daemon, or.

After having emerged, we need to create  that contains information about what IP block to assign IPs from. Here is a sample file using the prefix we've been assigned from our tunnel broker.

Sample radvd.conf

Further information is available in. We can now start  and set it to start at boot.

Stateful Configuration
If you'd like to have stateful configuration, you'll need to install and configure.

Now we must configure the dibbler client by editing.

Sample dibbler client configuration

We can now start the dibbler client, and configure it to start at boot.

Using radvd
Clients behind this router should now be able to connect to the rest of the net via IPv6. If using radvd, configuring hosts should be as easy as bringing the interface up. (This is probably already done by your net.ethX init scripts).

Other Resources
There are many excellent resources online pertaining to IPv6.

On IRC, you can try  on Freenode. You can connect to the Freenode servers using an IPv6 enabled client by connecting to irc.ipv6.freenode.net.

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * Peter Johanson
 * Jorge Paulo
 * Sven Vermeulen
 * Camille Huot
 * Pasi Valminen
 * nightmorph
 * hwoarang