Linux DevCenter    
 Published on Linux DevCenter (http://www.linuxdevcenter.com/)
 See this if you're having trouble printing code examples


Connecting to the IPv6 Internet

by Ibrahim Haddad
01/22/2004

In a previous article published on LinuxDevCenter.com, we introduced the IPv6 protocol and demonstrated how to support IPv6 on you Linux machine. This article goes a bit further into demonstrating how to connect your Linux machine to the IPv6 Internet (also known as the 6bone) using the Freenet6 Tunnel Server Protocol (TSP).

The IPv6 Internet

The IPv6 Internet was established in 1996 as a test network for IPv6. At the beginning, most of the backbone was established using tunnels over the current IPv4 Internet, making it appear as a virtual IPv6 network. Currently, the IPv6 Internet is made of both IPv6 native links and tunneled links over the IPv4 Internet.

The initial goal of the IPv6 Internet was to provide an experimental worldwide network for testing standards and IPv6 implementations. Years after its creation, the IPv6 Internet has changed its focus in a new direction: testing of transition and operational procedures. For many years to come, IPv4 and IPv6 will co-exist before a complete migration to IPv6 takes place. For this reason, the IETF has developed a number of co-existence and transition techniques that should be applied to help adopters migrate toward a full IPv6 deployment. In this context, the IPv6 Internet is playing a major role as a test IPv6 backbone for transitional mechanisms and operational procedures.

Related Reading

IPv6 Essentials
By Silvia Hagen

Connecting to the IPv6 Internet

To connect to the IPv6 Internet, you need a provider that offers the service. Quite a few ISPs offer IPv6 connectivity depending on where you live. If you cannot find one directly or if your current provider does not offer the service, then the easiest and cheapest solution to connect to the IPv6 Internet is to create a tunnel to a provider or a site that is willing to offer you the transit service (sometimes for free). Hexago (a spin-off of Viagénie) started the Freenet6 initiative to help people experiment and deploy IPv6. Freenet6 offers a free and automated tunnel service that can connect any individual or organization to the IPv6 Internet.

For the purpose of clarity, we will first cover the concept of tunneling, discuss which Freenet6 connection model is best for you, and follow a step-by-step tutorial on how to set up the connection.

Tunneling

The IETF has standardized tunneling as the transitional method to deploy IPv6, in coexistence with IPv4. A tunnel encapsulates IPv6 packets over IPv4. As a result, IPv6 hosts will be able to establish a link to the IPv6 Internet through an IPv4 connection. An IPv6-over-IPv4 tunnel is established with both endpoints configuring the IPv4 and the IPv6 address of the other endpoint. When one of the endpoints changes its IPv4 address, both endpoints of the tunnel need to change their configuration accordingly. This is especially cumbersome when the IPv4 node has a dialup connection or if it changes addresses often.

Freenet6 Tunnel Server Protocol provides an IPv6-over-IPv4 tunneling implementation that overcomes this problem: each time the tunnel client changes its IPv4 address, for instance at boot time if the host is configured for a DHCP service, the TSP client sends updated and authenticated information to the server, so the tunnel remains active without any reconfiguration.

Freenet6 Tunnel Server Protocol (TSP)

As previously mentioned, the Freenet6 service was the first public tunnel server service, and the most used in the world to delegate automatically one single IPv6 address to any host already connected to an IPv4 network over configured tunnels.

Freenet6's TSP is based on a client/server approach. It uses a protocol where a client requests one single IPv6 address or a full IPv6 prefix from a tunnel server. TSP is modeled after the tunnel broker (RFC 3053) where an IPv6-over-IPv4 tunnel is established between a node and the tunnel broker. However, Freenet6 is an enhanced version, where the node is using a tunnel-setup protocol to negotiate the establishment of the tunnel with the server. The client node, in this case, may be a host or a router.

Learning Lab TigerLinux/Unix System Administration Certification -- Would you like to polish your system administration skills online and receive credit from the University of Illinois? Learn how to administer Linux/Unix systems and gain real experience with a root access account. The four-course series covers the Unix file system, networking, Unix services, and scripting. It's all at the O'Reilly Learning Lab.

The TSP server of Freenet6 provides not only tunnels but also a large address space to any user of the service. The address space provided is a /48 network, giving 2^16 subnets, each of which may have up to 264 nodes -- more addresses than the entire current IPv4 Internet address space. This address space is assigned to the user of the service to enable any user, university, or organization to have the freedom of an abundance of addresses for servers and services that were not easy to do with NAT in IPv4.

How the Tunnel Is Established

Here are the steps that take place when establishing a tunnel session using the Freenet6 TSP:

Freenet6 has a detailed description on how TSP works.

Freenet6 TSP Connection Models

TSP supports two connection models.

In the Single Host Connection Model, as shown in Figure 1, only a single host is connected to the IPv6 Internet using the Freenet6 service.

Single Host Connection Model
Figure 1. Connecting a single machine.

In the Multiple Hosts Connection Model, as shown in Figure 2, you can connect a full network to the IPv6 Internet using the Freenet6 service. What differs from the first scenario is the need for a machine to act as an IPv6 router, which will be providing router advertisement for the hosts on your network to auto-configure themselves for IPv6.

Multiple Hosts Connection Model
Figure 2. Connecting a full network.

Freenet6 TSP Requirements

Your Linux host should meet some basic requirements to be able to use the Freenet6 TSP service:

Setting the Tunnel and Connecting a Single Host

We will demonstrate how to set up your Linux host to connect to the IPv6 Internet using Freenet6 TSP. We assume that your already meet the requirements previously presented. My own test installation used Fedora Core.

To proceed with the installation and configuration please follow these steps:

The -v flag in the command line indicates the verbose mode, which lets you see exactly what is happening during the process. Let's examine the network interfaces after successfully establishing the tunnel:

[root@fedora-core bin]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:B0:D0:A4:A9:FA
          inet6 addr: fe80::2b0:d0ff:fea4:a9fa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1635 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1516 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1327322 (1.2 Mb)  TX bytes:189687 (185.2 Kb)
          Interrupt:10 Base address:0xfc00
 
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2348 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2348 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1672742 (1.5 Mb)  TX bytes:1672742 (1.5 Mb)
 
ppp0      Link encap:Point-to-Point Protocol
          inet addr:67.69.185.115  P-t-P:64.230.254.136  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:1554 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1429 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:1288010 (1.2 Mb)  TX bytes:152686 (149.1 Kb)
 
sit1      Link encap:IPv6-in-IPv4
          inet6 addr: fe80::4345:b973/64 Scope:Link
          inet6 addr: 3ffe:bc0:8000::1bf9/128 Scope:Global
          UP POINTOPOINT RUNNING NOARP  MTU:1472  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:72 (72.0 b)  TX bytes:0 (0.0 b)
[root@fedora-core bin]# 

The tunnel interface is sit1. The global IPv6 address assigned to this interface is 3ffe:bc0:8000::1bf9 and the local scope IPv6 address is fe80::4345:b973. The ppp0 interface is my xDSL connection providing me with an IPv4 address and a connection to the Internet.

The easiest way to test your connection is to ping6 some web sites that support IPv6.

[root@fedora-core bin]# ping6 www.6bone.net
PING www.6bone.net(www.6bone.net) 56 data bytes
64 bytes from www.6bone.net: icmp_seq=0 ttl=62 time=60.1 ms
64 bytes from www.6bone.net: icmp_seq=1 ttl=62 time=59.8 ms
64 bytes from www.6bone.net: icmp_seq=2 ttl=62 time=48.1 ms
64 bytes from www.6bone.net: icmp_seq=3 ttl=62 time=49.1 ms
64 bytes from www.6bone.net: icmp_seq=4 ttl=62 time=75.3 ms
 
--- www.6bone.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 80932ms
rtt min/avg/max/mdev = 48.185/58.530/75.303/9.807 ms, pipe 2
[root@fedora-core bin]#

[root@fedora-core bin]# ping6 www.kame.net
PING www.6bone.net(www.6bone.net) 56 data bytes
64 bytes from www.6bone.net: icmp_seq=0 ttl=62 time=63.7 ms
64 bytes from www.6bone.net: icmp_seq=1 ttl=62 time=60.5 ms
64 bytes from www.6bone.net: icmp_seq=2 ttl=62 time=57.4 ms
64 bytes from www.6bone.net: icmp_seq=3 ttl=62 time=47.2 ms
64 bytes from www.6bone.net: icmp_seq=4 ttl=62 time=50.8 ms
                                                                                                 
--- www.6bone.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 80980ms
rtt min/avg/max/mdev = 47.265/55.972/63.749/6.092 ms, pipe 2
[root@fedora-core bin]# 

Conclusion

In this article, we demonstrated how to connect your Linux machine to the IPv6 Internet using the Freenet6 service. In an upcoming article, we'll show you how to connect a full network to the IPv6 Internet using a Linux machine as a router. Stay tuned!

Ibrahim Haddad is the Director of Technology for the Software Operations Group (Home & Network Mobility Business Unit) at Motorola Inc.


Return to the LinuxDevCenter.com.

Copyright © 2009 O'Reilly Media, Inc.