How to Set-up IPv6 on Ubuntu Linux Server?
Enable IPV6 on ubuntu Linux Server, In this article we will discuss how to set up or change an IPv6 address in a few very simple steps.
How to Configure Public IPV6 to Ubuntu Linux Server
In the previous article we discussed what IPv6 is and what features it comes with. In short, IPv6 was introduced to the world as a precaution to the exhaustion of IPv4 addresses. IPv4 being a 32 bit address, IPv6 has a massive 128 bit address space.
In this article we will show how to setup IPv6 addresses on Ubuntu. Note that these commands are done on Ubuntu 16.04 LTS.
In order to go through with this setup you will need to be logged in as the root user. Your terminal will look similar to the one below.
If you are not logged in as root user, then in order to login use the following code and type your password.
Now we will need to enable IPv6 configurations and in order to do that we will be working throughout this article with nano editor. You can use any file editor you prefer.
First, you will have edit the sysctl.conf file, which can be done with the following code:
In the opened file at the bottom add these two lines and exit the editor after saving the changes.
Now it’s time to change your IPv6. To do so, write the following code in your terminal.
Once you are in the editor at the end of the file add the following code.
iface enp0s3 inet6 static
pre-up modprobe ipv6
Note that these addresses are examples of IPv6 addresses and in those places you will need to provide your desired IPv6 address. Save the chnages to the file and exit the editor.
Now in order these changes to take effect, you wll need to restart your networking service with the following command:
#sudo systemctl restart networking
All MonoVM Linux VPS servers will be activated with public IPV6 address also we provide a valid hostname records that you can use easily your IPV6.
Настройка и использование IPv6 на сервере Linux
IPv6 – это последняя версия интернет-протокола (или IP), который используется в сети Интернет для создания подключений (в данном случае аббревиатура IP расшифровывается как “internet protocol”, то есть IPv6 – это internet protocol version 6). Предыдущая версия, IPv4, по-прежнему широко используется; тем не менее, адресное пространство IPv4 исчерпывается быстрыми темпами, и оно не позволяет быстро развернуть готовые устройства.
IPv6 решает эти проблемы. Кроме общих улучшений в протоколе, наиболее очевидным преимуществом использования IPv6-адресов является то, что IPv6 имеет более широкое адресное пространство. IPv4 позволяет использовать 232 адресов (некоторые из них зарезервированы для отдельных целей), а адресное пространство IPv6 – 2128 адресов, что гораздо больше IPv4.
IPv6 открывает много возможностей и решает многие давнишние проблемы, но требует небольшой корректировки некоторых из обычных сетевых конфигураций (если ранее использовался исключительно протокол IPv4). В этом руководстве речь пойдет об инструментах IPv6, аналогичных популярным инструментам и утилитам IPv4, а также о настройке некоторых сервисов для использования IPv6.
Диагностика сети с IPv6
Некоторые простейшие утилиты, используемые для диагностики проблем сети, были разработаны с ориентировкой на IPv4. Для работы с трафиком IPv6 можно использовать аналоги этих утилит протокола IPv6.
Прежде всего, чтобы просмотреть имеющиеся на данный момент настроенные IPv6-адреса сервера, используйте инструменты iproute2:
ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2400:6180:0:d0::41f/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::601:15ff:fe43:b201/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 fe80::601:15ff:fe43:b202/64 scope link
valid_lft forever preferred_lft forever
Чтобы вывести на экран таблицу маршрутизации IPv6, можно использовать netstat, набрав что-то вроде:
netstat -A inet6 -rn
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2400:6180:0:d0::/64 :: U 256 0 1 eth0
fe80::/64 :: U 256 0 0 eth1
fe80::/64 :: U 256 0 0 eth0
::/0 2400:6180:0:d0::1 UG 1024 0 0 eth0
::/0 :: !n -1 1 90 lo
::1/128 :: Un 0 1 20 lo
2400:6180:0:d0::41f/128 :: Un 0 1 86 lo
fe80::601:15ff:fe43:b201/128 :: Un 0 1 75 lo
fe80::601:15ff:fe43:b202/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth1
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 90 lo
Пользователи, предпочитающие iproute2, могут получить эту информацию, введя:
ip -6 route show
2400:6180:0:d0::/64 dev eth0 proto kernel metric 256
fe80::/64 dev eth1 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
default via 2400:6180:0:d0::1 dev eth0 metric 1024
Теперь, научившись получать некоторую информацию IPv6, можно ознакомиться с использованием некоторых инструментов, которые работают с IPv6.
На самом деле, часто встречающийся ping является специфичной командой IPv4. Аналогичная команда для IPv6-адресов называется ping6. Например, следующая строка будет пинговать локальный кольцевой интерфейс:
ping6 -c 3 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.028 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.022 ms
— ::1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.021/0.023/0.028/0.006 ms
Как видите, эта команда работает таким же образом, как и ping, с той лишь разницей, что для адресации используется версия протокола.
Еще один важный инструмент, аналог которого можно найти в IPv6 – это traceroute (в IPv6 – traceroute6):
traceroute6 google.com
traceroute to google.com (2404:6800:4003:803::1006) from 2400:6180:0:d0::41f, 30 hops max, 24 byte packets
1 2400:6180:0:d0:ffff:ffff:ffff:fff1 (2400:6180:0:d0:ffff:ffff:ffff:fff1) 0.993 ms 1.034 ms 0.791 ms
2 2400:6180::501 (2400:6180::501) 0.613 ms 0.636 ms 0.557 ms
3 2400:6180::302 (2400:6180::302) 0.604 ms 0.506 ms 0.561 ms
4 10gigabitethernet1-1.core1.sin1.he.net (2001:de8:4::6939:1) 6.21 ms 10.869 ms 1.249 ms
5 15169.sgw.equinix.com (2001:de8:4::1:5169:1) 1.522 ms 1.205 ms 1.165 ms
6 2001:4860::1:0:337f (2001:4860::1:0:337f) 2.131 ms 2.164 ms 2.109 ms
7 2001:4860:0:1::523 (2001:4860:0:1::523) 2.266 ms 2.18 ms 2.02 ms
8 2404:6800:8000:1c::8 (2404:6800:8000:1c::8) 1.741 ms 1.846 ms 1.895 ms
Следующая популярная команда называется tracepath (в IPv6 – tracepath6). Например:
tracepath6 ::1
1?: [LOCALHOST] 0.045ms pmtu 65536
1: ip6-localhost 0.189ms reached
1: ip6-localhost 0.110ms reached
Resume: pmtu 65536 hops 1 back 64
Чтобы контролировать входящий трафик, как правило, используется программа tcpdump. Эта утилита может отфильтровывать IPv6-трафик с помощью выражения ip6 or proto ipv6, введенного после опций.
Например, можно измерить быстрый трафик IPv6, сказав утилите вывести только важную информацию. Данная команда собирает резюме информации, чтобы избежать задержки выхода:
tcpdump -t -n -i eth0 -s 512 -vv ip6 or proto ipv6
Проверка информации DNS
С помощью типичных инструментов IPv6 можно быстро проверить информацию о доменах. Главное отличие от IPv4 состоит в том, что нужно запрашивать записи AAAA ((IPv6 address record), которые используются в IPv6 вместо записей А (в IPv4).
Чтобы получить запись об IPv6-адресе домена, можно просто запросить запись AAAA. С помощью команды host это делается следующим образом:
host -t AAAA google.com
google.com has IPv6 address 2404:6800:4003:803::1004
Подобный результат можно получить при помощи команды dig:
dig google.com AAAA
; <<>> DiG 9.8.1-P1 <<>> google.com AAAA
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14826
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;google.com. IN AAAA
;; ANSWER SECTION:
google.com. 299 IN AAAA 2404:6800:4003:803::1006
;; Query time: 5 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Tue Apr 1 13:59:23 2014
;; MSG SIZE rcvd: 56
Как видите, работая с IPv6-адресами, можно легко проверить, правильно ли разрешается DNS.
Сетевые сервисы IPv6
Большинство общих сетевых сервисов могут обрабатывать трафик IPv6. Иногда они нуждаются в специальных флагах или синтаксисе, а в некоторых случаях они имеют альтернативную версию, разработанную специально для IPv6.
Настройка SSH
В SSH можно настроить демона на прослушивание IPv6-адресов. Это делается в конфигурационном файле, который можно открыть так:
sudo nano /etc/ssh/sshd_config
Директива ListenAddress указывает, к какому адресу должен привязываться демон SSH. Для адресов IPv4 это выглядит так:
То есть, демон прослушивает IPv4-адрес 111.111.111.111 на порту 22. В случае с IPv6-адресами сам адрес нужно взять в квадратные скобки:
Это скажет демону SSH слушать адрес 1341:8954:a389:33:ba33::1 на порту 22. Чтобы сказать демону слушать все доступные адреса IPv6, наберите:
Не забывайте перезагрузить демона после внесения изменений.
sudo service ssh restart
Если на стороне клиента демон, к которому нужно подключиться, настроен на прослушивание адресов IPv4 и IPv6, клиента можно заставить использовать IPv6 только с помощью флага -6, вот так:
ssh -6 username@host.com
Настройка веб-сервера
Как и SSH-демон, веб-сервер должен быть настроен на прослушивание адресов IPv6.
Чтобы Apache отвечал на запросы определенных IPv6-адресов, используйте синтаксис:
Это скажет серверу прослушивать указанный адрес на порту 80. Для большей гибкости эту строку можно скомбинировать с адресами IPv4; это делается так:
Listen 111.111.111.111:80
Listen [1341:8954:a389:33:ba33::1]:80
При необходимости слушать соединения на порт 80 на всех интерфейсах во всех протоколах можно использовать просто:
Указать адрес IPv6 можно также на уровне виртуального хоста. Как видите, здесь можно настроить virtualhost для IPv6- и IPv4-адреса:
<VirtualHost 111.111.111.111:80, [1341:8954:a389:33:ba33::1]:80>
. . .
</VirtualHost>
Не забудьте перезагрузить сервис для активации внесенных изменений.
sudo service apache2 restart
Пользователи, предпочитающие использовать в качестве веб-сервера Nginx, могут выполнить подобную конфигурацию. За прослушивание адресов отвечает директива listen; чтоб прослушивать трафик IPv6:
На самом деле, в Linux трафик IPv4 тоже будет прослушиваться на порту 80, потому что запросы IPv4 автоматически преобразовываются в адрес IPv6. Потому не нужно указывать адреса IPv6 и IPv4 отдельно следующим образом:
listen [1341:8954:a389:33:ba33::1]:80;
listen 111.111.111.111:80;
Это приведет к ошибке, сообщающей, что порт уже привязан к другому сервису. Чтобы использовать отдельные директивы, отключите эту функцию с помощью sysctl:
sysctl -w net.ipv6.bindv6only=1
Чтобы эта строка автоматически выполнялась при загрузке, добавьте ее в /etc/sysctl.conf:
sudo nano /etc/sysctl.conf
. . .
net.ipv6.bindv6only=1
После этого можно использовать отдельные директивы для IPv4 и IPv6, добавив флаг ipv6only=on к директиве, прослушивающей IPv6:
listen [1341:8954:a389:33:ba33::1]:80 ipv6only=on;
listen 111.111.111.111:80;
Опять же, нужно перезапустить Nginx для активации новых настроек:
sudo service nginx restart
Настройки брандмауэра
К счастью, пользователи, привыкшие настраивать правила брандмауэра при помощи фронт-эндов netfilter (например, iptables), могут использовать аналогичный инструмент, который называется ip6tables.
Чтобы узнать, как настроить iptables в Ubuntu, читайте данную статью.
Для управления правилами фильтрации пакетов IPv6 можно просто заменить команду на ip6tables. Например, в список правил IPv6 можно ввести:
sudo ip6tables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
При использовании на сервере инструмента ufw все уже готово! Дело в том, что ufw настраивает сразу оба стека, если не указано иное. Возможно, придется добавить некоторые правила для конкретных адресов IPv6, но использовать другой инструмент не понадобится.
Чтобы узнать больше об использовании ufw, читайте данное руководство.
Настройка TCP-оболочек
При использовании TCP-оболочек для управления доступом к серверу через файлы /etc/hosts.allow и /etc/hosts.deny просто используйте синтаксис IPv6, чтобы соответствовать определенным правилам.
Например, можно разрешить подключаться по SSH только адресам IPv4 и IPv6; для этого внесите в файл /etc/hosts.allow следующее:
sudo nano /etc/hosts.allow
. . .
sshd: 111.111.0.0/255.255.254.0, [1341:8954:a389:33::]/64
Как видите, адаптировать текущие правила оболочки TCP очень легко.
Итоги
Надеемся, данное руководство показало, что переход на IPv6 или использование IPv6 вместе с IPv4 – довольно простой процесс.
Конечно, для рационального использования ресурсов IPv6 часто приходится изучать сетевые сервисы по отдельности, чтобы узнать о необходимости каких-либо дополнительных изменений в конфигурациях. Тем не менее, теперь работать с IPv6, используя основные утилиты и сервисы, будет более комфортно.
Настройка IPv6 в ОС Linux Debian v7.XX, Ubuntu v14.XX, CentOS v6.XX и FreeBSD v10.XX
Изложенный ниже материал не претендует на эксклюзивность. Однако мне пришлось собирать его по крупицам из разных источников, что-то проверяя экспериментально. После этого родилась идея систематизировать полученные знания и опыт, изложив все в одной заметке.
Linux Debian v7.XX, Ubuntu v14.XX
CentOS v6.XX
FreeBSD v10.XX
После внедрения поддержки IPv6, на хостинговой площадке компании в которой я работаю, у нас возникла необходимость автоматизировать настройку VDS соответствующим образом. Необходимо оговорится, что речь идет не о каком-либо туннелировании, а полноценной поддержке. Т.е. сетевая инфраструктура в дата-центре обеспечивает коммутацию и маршрутизацию IPv6, имеются соответствующие стыки по BGPv6 с магистральными провайдерами Internet.
Адреса назначаются и прописываются в настройках ОС статично, т.е. функционал автоматического конфигурирования IPv6 не задействуется. Это связано с особенностями учета адресного пространства и обеспечения безопасности. Задача осложняется тем, что адресов IPv4 и IPv6 у VDS может быть сразу несколько.
Linux Debian v7.XX, Ubuntu v14.XX
В достаточно свежих дистрибутивах ОС Linux уже присутствует полноценная поддержка IPv6. Поэтому доустанавливать что-либо вручную необходимости нет.
Рассмотрим пример настройки.
«/etc/network/interfaces»
Тут следует обратить внимание на два момента. Во-первых, все адреса IPv6 назначаются непосредственно на сам сетевой интерфейс: в отличие от IPv4 нет необходимости создавать виртуальные адаптеры типа «eth0:X». Во-вторых, шлюз по умолчанию для IPv6 указывается один раз для любого из адресов. Действовать он будет для всех.
Результат настроек в выводе команды «ifconfig»:
Базовую диагностику можно выполнить с помощью команд «ping6 -n -c 4 ipv6.google.com» и «traceroute -n -6 -I ipv6.google.com». Проверить MAC-адреса соседей: «ip -6 neighbor show». Изучить таблицу маршрутизации: «route -n6» или «ip -6 route show». Выяснить, какой из адресов IPv6 используется системой по умолчанию для исходящих подключений: «ip -6 route get 2a00:1450:4013:c01::65».
CentOS v6.XX
Настройка CentOS замысловатее из-за того, что опций несколько больше, и они раскиданы по нескольким файлам.
«/etc/sysconfig/network»
В целом картина аналогична Debian. Виртуальные сетевые интерфейсы «eth0:X» необходимы только для IPv4. Опции «NETWORKING_IPV6» и «IPV6INIT» включают поддержку IPv6. В «IPV6_DEFAULTGW» указываем шлюз по умолчанию. Первый адрес IPv6 назначается в «IPV6ADDR», все остальные перечисляются в «IPV6ADDR_SECONDARIES».
Вывод команды «ifconfig» аналогичен Debian:
FreeBSD v10.XX
В ОС FreeBSD уже также есть все необходимое для поддержки IPv6.
Рассмотрим пример настройки.
» /etc/rc.conf»
Основной адрес IPv6 указывается в опции «ifconfig_xn0_ipv6». Поскольку в FreeBSD механизм виртуальных сетевых интерфейсов для IPv4 не используется, то все дополнительные адреса, в том числе IPv6, перечисляются в «ifconfig_xn0_aliases».
Вывод команды «ifconfig» немного отличается от ОС Linux.
Инструмент для диагностики также немного другой: «ping6 -n -c 4 ipv6.google.com» и «traceroute6 -n ipv6.google.com». Проверить MAC-адреса соседей: «ndp -an». Изучить таблицу маршрутизации: «netstat -rn6». Выяснить, какой из адресов IPv6 используется системой по умолчанию для исходящих подключений: «route -nv6 get 2a00:1450:4013:c01::65».
В данном случае адресом по умолчанию является тот, что указан самым последним в выводе команды: «2a04:XXXX:1::12».
IPv6 Introduction
Internet Protocol version 6 (IPv6) is the successor to the well known IPv4 protocol, commonly known as IP. Your Ubuntu system comes with all you will need to use IPv6. This section focuses on getting IPv6 properly configured and running.
- Address autoconfiguration (RFC2462)
- Anycast addresses (“one-out-of many”)
- Mandatory multicast addresses
- IPsec (IP security)
- Simplified header structure
- Mobile IP
- IPv6-to-IPv4 transition mechanisms
Background on IPv6 Addresses
There are different types of IPv6 addresses: Unicast, Anycast and Multicast.
Unicast addresses are the well known addresses. A packet sent to a unicast address arrives exactly at the interface belonging to the address.
Anycast addresses are syntactically indistinguishable from unicast addresses but they address a group of interfaces. The packet destined for an anycast address will arrive at the nearest (in router metric) interface. Anycast addresses may only be used by routers.
Multicast addresses identify a group of interfaces. A packet destined for a multicast address will arrive at all interfaces belonging to the multicast group.
Note: The IPv4 broadcast address (usually xxx.xxx.xxx.255) is expressed by multicast addresses in IPv6.
Reading IPv6 Addresses
The full form is represented as 8 hexquad parcels of 16 bits each written in lower case hexadecimal, separated by colons (:). For example 2001:0db8:382b:23c1:aa49:4592:4efe:9982.
Often an address will have long substrings of all zeros; the longest and first run of all zero hexquads is abbreviated as a double colon (“::”). Since :: is variable length, it can only be used once per address. Leading “0”s are also omitted, up to three per hexquad. For example, fe80::1 is the canonical form of fe80:0000:0000:0000:0000:0000:0000:0001 and 2001:db8:b:23c1:49:4592:efe:9982 is the canonical form of 2001:0db8:000b:23c1:0049:4592:0efe:9982.
A third form is to write the last 32 bits in the well known dotted decimal IPv4 style. For example 2002::10.0.0.1 corresponds to the (hexadecimal) long representation 2002:0000:0000:0000:0000:0000:0a00:0001 with canonical form 2002::a00:1.
By now the reader should be able to understand the following:
fe80::225:adff:fe2c:af17 of interface eth0 is an autoconfigured link-local address. It is generated as an IEEE EUI-64 style identifier from the device’s hardware IEEE EUI-48(MAC) address as part of the autoconfiguration.
For further information on the structure of IPv6 addresses see RFC3513.
Special IPv6 address ranges
Address ranges are specified using a prefix. This is similar to the IPv4 concept of a network prefix and netmask, but in IPv6 we always use CIDR notation to specify the number of bits at the start of the mask that are 1. For example, the address range fe80::/10 includes all addresses that are the same as the address fe80:: in the first 10 bits, i.e. all beginning with the bit pattern 1111 1110 10. One hex digit corresponds to four bits: 1111 is f, 1110 is e. 10 is the most significant two bits of 1000 which is 8 in hex, but since this length is not a multiple of 4, the range also includes addresses with this digit set to 9 (1001), a (1010) and b (1011). Obviously a network prefix of length 128 specifies an individual address.
Some IPv6 address prefixes have been deprecated, and should no longer be used.
Some address prefixes are special use:
Getting Connected
Here you have more than one option:
Native IPv6 connections
Contact your Internet Service Provider to see if they offer IPv6 yet. Only a few Internet Service Providers (ISP) currently offer native IPv6 service, though by 2015 probably all of them will.
If your uplink involves a wifi router or broadband modem, those devices will need to support IPv6. Cable-Modems need to support DOCSIS 3.0 or 2.0+IPv6. As of 2010, very few DSL-Modems support IPv6; this will change by 2012.
If your hardware or ISP does not support native IPv6, which is the best kind, you might still be able to use IPv6 tunneled over IPv4 instead.
Tunneled IPv6
If your uplink only passes IPv4 traffic, you will need to tunnel your IPv6 traffic to a compatible relay somewhere. Most tunnels use IPv4 protocol 41 encapsulation (6in4), where the data payload is just the IPv6 packet itself. Not all firewalls and NATs can properly pass protocol 41. Alternatively providers might provide AYIYA or TSP tunnels which send their tunneled packets over UDP, which is generally accepted by most firewalls and supported by most NATs Note: ICMP is protocol 1, IGMP is protocol 2, TCP is protocol 6, UDP is protocol 17.
point to point tunnels
6to4 tunnels
UDP over NAT tunnels
-
AYIYA or TSP from the above providers
Get connected with Hurricane Electric
First you need to register on the TunnelBroker.net Website. You will be emailed your username and password. Login and in the User Functions Box on the left side click the Create Regular Tunnel link. Put in your IPv4 address and Select a server close to you. Go to the tunnel details page. Run gksudo gedit /etc/network/interfaces and add the following, editing as directed by the comments:
Replace the endpoint setting (216.218.226.238) with the Server IPv4 address field from the tunnel details page and the address setting (2001:470:a:d29f::2) with Client IPv6 address field from the tunnel details page. Save the file.
Right click on the network manager icon in the tray and click Edit Connections. Select the connection to your local network and click Edit. Go to the IPv6 Settings tab and set the Method to Manual. Click Add. For the address put the first address in your Routed 64. (In this example it would be 2001:470:b:d29f::1 — please note that this address is in a different /64 subnet ("b") than the tunnel endpoint.) For the prefix put in 64. For the gateway, put in the address from the "Client IPv6 address" of the tunnel details page (in this example it would be 2001:470:a:d29f::2). Click apply.
Run sudo ifup he-ipv6 and you should have IPv6 connectivity.
To configure your box to give out addresses to the LAN from your /64, see Configure your Ubuntu box as an IPv6 router.
Get connected with SixXS
First you need an account on the SixXS Website. Please consider that they manually approve your information and that you should provide them with correct data about you. The system is very easy to use. For the creation of your account you are going to receive some credit points. You can then use these credits for requesting new tunnels and subnets. A tunnel costs you 15 credits. If you are able to use the requested tunnels you are going to receive 10 Credits after a week.
- Create an account
- Request a tunnel
- 2.1. Wait for tunnel approval
- Request a subnet
- 3.1. Wait for subnet approval
The approval of your requests are done manually, so be patient. Normally you will receive the approval within the hour.
Note: If you only want to connect one computer, you can skip Step 3 and perform subsections "Synchronize with a timeserver" and "Install aiccu".
After your tunnel and the subnet are approved, you should have received an email like the following:
Note: The addresses suplied in this howto are fakes. Please use your addresses supplied in your e-mail. Otherwise you will not have a working network. This means replace 2001:xxxx:xxxx::/48 with your address!
Subnet IPv6: This is the address of your /48 subnet routed to you. We need this address later to configure the prefix of the Router Advertising daemon and for your Routers local IPv6 network address. For a local subnet only /64 subnet should be used. Because of that we configure radvd with a /64 bit prefix and also the network interface.
Routed to: This is the address of your sixxs tunnel interface.
Your IPv4: If you have no static IPv4 address, ayiya should stand here. Otherwise your public IPv4 address.
Replace also eth0 with the name of the network interface connected to your local network. The command line tool ip is your friend if you do not know.
Synchronize with a timeserver
If you have no ntp daemon installed to keep your time synchronised. Then install openntpd or any other ntp daemon you want. This is because we are going to install aiccu, the IPv6 auto tunneling daemon, from SixXS. The tunnel will not work if the time difference of your clock is bigger than 120 seconds.
Install aiccu
aiccu is the SixXS client application. If aiccu runs in the daemon mode, it will make sure your tunnel endpoint is always up to date due to the heartbeat protocol, this thus allows one to have a dynamic IPv4 endpoint. Note that AICCU is only needed for heartbeat and AYIYA tunnels. Static tunnels can be configured using interfaces(5).
The installer will automatically prompt for username, password, and the tunnel_id you want to configure.
Note: If you don’t know the tunnel_id then go to http://www.sixxs.net/home/ and check your tunnel information.
Note: The Tunnel id should also be in your "Tunnel Approval" email.
Configure local network interface
We also have to configure the local network interface with an IPv6 address. I prefer an easy to memorize address for my router so I choose 2001:xxxx:xxxx::1. According the information I got from sixxs, this is the First address I can use. Open the config file /etc/network/interfaces with an editor and add:
Note: replace eth0 with the interface name you used in the /etc/radvd.conf config file.
To configure your box to give out addresses to the LAN from your /64, see Configure your Ubuntu box as an IPv6 router.
Reboot or restart services
- Restart network
- Let aiccu configure your tunnel
So that’s really all. You should now be able to connect to the IPv6 internet with every IPv6 capable client automatically. See section "Conclusion" for testing.
Get connected with freenet6 / TSP
Tunnel Setup Protocol (TSP) is a signalling protocol used to negotiate tunnel setup parameters between two tunnel end-points. This protocol is most commonly used to create IPv6-In-IPv4 tunnels, allowing a person to use IPv6 on his native IPv4 network.
TSPC (client) starts an end-to-end tunnel with the TSP server(tunnel broker). After negotiation of tunnel setup parameters has been done the software goes into daemon mode and maintains the tunnel alive.
Gogo6
Like it was mentioned above, TSPC requires a TSP Server (tunnel broker) to work. The default configuration file is ready for you to use your tunnel, however, it’s configured for anonymous access only, which has a few limitations.
I recommend registering on GOGO6. The following sections of this page will be dedicated to those who created an account there.
TSP in Ubuntu
The client software is called tspc in Intrepid and earlier, gw6c in Karmic and Lucid, and gogoc from Maverick onwards and is available on official repositories.
Configuring TSPC
Configuration file: /etc/gogoc/gogoc.conf Configuration file: /etc/gw6c/gw6c.conf Configuration file: /etc/tsp/tspc.conf
On this configuration file there are three things that we need to change (username, password and server).
Locate the username field and change it to the information you entered on the Go6.net website. Do the same for the password field.
As for the server, the one used by default (anon.freenet6.net) is used only for anonymous accounts. Since we registered an account we will have to use broker.freenet6.net for our tunnel to work.
Testing the tunnel
Check /var/log/tspc.log to see if any errors were reported. This will only work for tspc. For gogoc or gw6c, you will need to edit the configuration file and set log_file to a value between 1 and 3, with 3 being the most verbose. The log file will then be /var/log/gogoc.log or /var/log/gw6c.log respectively.
For a network test using ping6 see the "Conclusion" section
Configure your Ubuntu box as a IPv6 router
Uncomment the line which contains net.ipv6.conf.default.forwarding=1. This is a common step to enable IPv6 routing.
- Install radvd
Note: If the computer is only routing IPv6, then only uncomment net.ipv6.conf.default.forwarding=1 and leave the IPv4 stuff unchanged.
Note: /etc/radvd.conf: This file does not exist after a fresh install. You can look at the sample configuration files in usr/share/doc/radvd/examples/ for further studies.
eth0 is the interface which is used for the Router Advertising messages (RAs). If you are not sure about the interface, check with <tt>ip addr</tt> on the command line.
The prefix you have to take from the information given by SixXS or Hurricane Electric.
Restart the router advertising daemon to propagate your IPv6 address space
Now router should automatically send "Router Advertising Messages" to your network and your IPv6 clients should auto configure them self.
Get connected with Miredo
Ubuntu includes a package named miredo that can tunnel IPv6 through IPv4 connections. Miredo is an implementation of Teredo, which is a way to tunnel IPv6-traffic over IPv4-UDP-traffic. As IPv4-UDP will pass NAT-devices, miredo will work behind most NAT-devices. A further advantage of miredo/teredo is that you don’t need to define tunnel-endpoints or tunnel-accounts: just activate miredo, and you’ll have IPv6 connectivity.
After this command, you should see an IPv6 address beginning with "2001:0:" in your network settings (use ‘ip addr’). If so, you’re connected to the IPv6 world.
IPv6 enabled software and services
The basic unix tools normally have ipv6 support. Network tools like "ping" or "traceroute" have a IPv6 companion like "ping6" or "traceroute6". Tools like ssh are working out of the box.
Almost every web browser I know can communicate over IPv6. There are a lot of IPv6 enabled Websites out there, but they are sometimes hard to find. For a start you can search with ipv6.google.com or see the dancing "Kame" on kame.net. More links are available at Gogo6, SixXS or sixy.ch.
IRSSI supports IPv6 as well as our favorite IRC network (Freenode).
IRSSI needs to be configured to prefer IPv6 to IPv4. In order to do this, please use the command /SET resolve_prefer_ipv6 ON when on IRSSI. As for Freenode, connect to ipv6.chat.freenode.net to test your new IPv6 tunnel or choose another server from their IRC Servers list
Troubleshooting
Conclusion
You should now be able to ping and surf IPv6 enabled sites like ipv6.google.com or www.kame.net. For a ping perform ping6 ipv6.google.com. It’s a good idea to think about firewalling within your clients, because all clients have now a public reachable IPv6 IP. In Ubuntu this is also an very easy task with the new UbuntuFirewall (ufw or uncomplicated firewall), just edit /etc/default/ufw to have IPV6=yes and reload the firewall to get started.
ufw and Routing
To allow routing you need to uncoment the following lines in /etc/ufw/sysctl.conf
If you only want outgoing connections you also need to change
in /etc/default/ufw and add the following lines to /etc/ufw/before6.rules
where eth0 is your internal interface.
IPv6 on APT Repositories
IPv6 is available on Canonical-maintained APT repositories including security.ubuntu.com and archive.ubuntu.com as of 2013 March 12. See Launchpad bug report and RT ticket (SSO login required).
Disabling IPv6
The Ubuntu Community wiki has instructions on disabling IPv6.
- DNS server dropping queries for AAAA records
- Broken IPv6 connectivity. This is less of a problem with Happy Eyeballs, but nonetheless can cause problems when certain network configuration is beyond the control of the end user. Whenever possible, you should attempt to correct the source of the broken IPv6 connectivity instead of disabling IPv6.
See the article for more details.
Copyright Notice
The IPv6 introduction was largely copied and modified from the FreeBSD Handbook. Copyright © 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The FreeBSD Documentation Project.
IPv6 (последним исправлял пользователь 184-105-177-106 2016-01-26 07:16:40)
The material on this wiki is available under a free license, see Copyright / License for details.