IPv6 Administration Guide

Solaris Tunneling Interfaces for IPv6


Note –

The best way to encapsulate IPv6 packets over an IPv4 network is to use 6to4 routing. 6to4 automatically creates a tunnel by using tun. For details about 6to4 routing, see 6to4 as a Transition Mechanism. For tasks for configuring 6to4 tunnels, see How to Configure a 6to4 Router.


Tunneling interfaces have the following format:


ip.tun ppa

ppa is the physical point of attachment.

At system startup, the tunneling module (tun) is pushed, by ifconfig, on top of IP to create a virtual interface. The push is accomplished by creating the appropriate hostname6.* file.

For example, to create a tunnel to encapsulate IPv6 packets over an IPv4 network, IPv6 over IPv4, you create the following file name:


/etc/hostname6.ip.tun0

The content of this file is passed to ifconfig(1M) after the interfaces have been plumbed. The content becomes the parameters necessary to configure a point-to-point tunnel.

The following listing is an example of entries in hostname6.ip.tun0 file.


Example 3–7 hostname6.interface Entries


tsrc 120.68.100.23 tdst 120.68.7.19 up
addif 1234:1234::1 5678:5678::2 up

In this example, the IPv4 source and destination addresses are used as tokens to autoconfigure IPv6 link-local addresses. These addresses are the source and destination for the ip.tun0 interface. Two interfaces are configured. The ip.tun0 interface is configured. A logical interface, ip.tun0:1, is also configured. The logical interface has the source and destination IPv6 addresses specified by the addif command.

As mentioned previously, the contents of these configuration files are passed to ifconfig without change when the system is started as multiuser. The previous example is equivalent to the following:


# ifconfig ip.tun0 inet6 plumb
# ifconfig ip.tun0 inet6 tsrc 120.68.100.23 tdst 120.68.7.19 up
# ifconfig ip.tun0 inet6 addif 1234:1234::1 5678:5678::2 up

The following display shows the output of ifconfig -a for this tunnel.


ip.tun0: flags=2200850<UP,POINTOPOINT,RUNNING,MULTICAST,
NONUD,IPv6> mtu 1480 index 6
        inet tunnel src 120.68.100.23  tunnel dst 120.68.7.19
        inet6 fe80::c0a8:6417/10 --> fe80::c0a8:713
ip.tun0:1: flags=2200850<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 
index 5
        inet6 1234:1234::1/128 --> 5678:5678::2 

You can configure more logical interfaces by adding lines to the configuration file by using the following syntax:


addif IPv6-source IPv6-destination up

Note –

When either end of the tunnel is an IPv6 router that advertises one or more prefixes over the tunnel, you do not need addif commands in the tunnel configuration files. Only tsrc and tdst might be required because all other addresses are autoconfigured.


In some situations, specific source and destination link-local addresses need to be manually configured for a particular tunnel. Change the first line of the configuration file to include these link-local addresses. The following line is an example:


tsrc 120.68.100.23 tdst 120.68.7.19 fe80::1/10 fe80::2 up

Notice that the source link-local address has a prefix length of 10. In this example, the ip.tun0 interface resembles the following:


ip.tun0: flags=2200850<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 
index 6
        inet tunnel src 120.68.100.23  tunnel dst 120.68.7.19
        inet6 fe80::1/10 --> fe80::2

To create a tunnel to encapsulate IPv6 packets over an IPv6 network, IPv6 over IPv6, you create the following file name:


/etc/hostname6.ip6.tun0

The following listing is an example of entries in the hostname6.ip6.tun0 file.


Example 3–8 hostname6.interface Entries


tsrc 2000::114:a00:20ff:fe72:668c tdst 2000::103:a00:20ff:fe9b:a1c3
fe80::4 fe80::61 up

To create a tunnel to encapsulate IPv4 packets over an IPv6 network, IPv4 over IPv6, you create the following file name:


/etc/hostname.ip6.tun0

The following listing is an example of entries in the hostname.ip6.tun0 file.


Example 3–9 hostname.interface Entries


tsrc 2000::114:a00:20ff:fe72:668c tdst 2000::103:a00:20ff:fe9b:a1c3
10.0.0.4 10.0.0.61 up

To create a tunnel to encapsulate IPv4 packets over an IPv4 network, IPv4 over IPv4, you create the following file name:


/etc/hostname.ip.tun0

The following listing is an example of entries in thehostname.ip.tun0 file.


Example 3–10 hostname.interface Entries


tsrc 120.46.86.158 tdst 120.46.86.122
10.0.0.4 10.0.0.61 up

For specific information about tun, see the tun(7M) man page. For a general description of tunneling concepts during the transition to IPv6, see Tunneling Mechanism. For a description of procedures for configuring tunnels, see How to Configure IPv6 Over IPv4 Tunnels.