System Administration Guide: IP Services

Configuring an IPv6 Token

The 64-bit interface ID of an IPv6 address is also referred to as a token, as introduced in IPv6 Addressing Overview. During address autoconfiguration, the token is associated with the interface's MAC address. In most cases, nonrouting nodes, that is IPv6 hosts and servers, should use their autoconfigured tokens.

However, using autoconfigured tokens can be a problem for servers whose interfaces are routinely swapped as part of system maintenance. When the interface card is changed, the MAC address is also changed. Servers that depend on having stable IP addresses can experience problems as a result. Various parts of the network infrastructure, such as DNS or NIS, might have stored specific IPv6 addresses for the interfaces of the server.

To avoid address change problems, you can manually configure a token to be used as the interface ID in an IPv6 address. To create the token, you specify a hexadecimal number of 64 bits or less to occupy the interface ID portion of the IPv6 address. During subsequent address autoconfiguration, Neighbor Discovery does not create an interface ID that is based on the interface's MAC address. Instead, the manually created token becomes the interface ID. This token remains assigned to the interface, even when a card is replaced.


Note –

The difference between user-specified tokens and temporary addresses is that temporary addresses are randomly generated, rather than explicitly created by a user.


ProcedureHow to Configure a User-Specified IPv6 Token

The next instructions are particularly useful for servers whose interfaces are routinely replaced. They also are valid for configuring user-specified tokens on any IPv6 node.

  1. Verify that the interface you want to configure with a token is plumbed.

    An interface must be plumbed before you can configure a token for its IPv6 address.


    # ifconfig -a6
    

    qfe0: flags=2000841 <UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
            ether 0:3:ba:13:14:e1 
            inet6 fe80::203:baff:fe13:14e1/10

    This output shows that the network interface qfe0 is plumbed and has the link-local address fe80::203:baff:fe13:14e1/10. This address was automatically configured during installation.

  2. Create one or more 64-bit hexadecimal numbers to be used as tokens for the node's interfaces. For examples of tokens, refer to Link-Local Unicast Address.

  3. Configure each interface with a token.

    Use the following form of the ifconfig command for each interface to have a user-specified interface ID (token):


    ifconfig interface inet6  token address/64
    

    For example, you would use the following command to configure interface qfe0 with a token:


    # ifconfig qfe0 inet6 token ::1a:2b:3c:4d/64
    

    Repeat this step for every interface that will have a user-specified token.

  4. (Optional) Make the new IPv6 address persist across reboots.

    1. Edit or create an /etc/hostname6.interface file for each interface you configured with a token.

    2. Add the following text at the bottom of each /etc/hostname.6interface file:


      token ::token-name/64

      For example, you might add the following text to the bottom of an/etc/hostname6.interface file:


      token ::1a:2b:3c:4d/64

    After the system reboots, the token that you configured in an /etc/hostname6.interface file is applied to the interface's IPv6 address. This IPv6 address remains persistent across subsequent reboots.

  5. Update the IPv6 daemon with your changes.


    # pkill -HUP -in.ndpd
    

Example 7–6 Configuring a User-Specified Token on an IPv6 Interface

In the following example, the interface bge0:1 has an autoconfigured IPv6 address. The subnet prefix 2001:db8:3c4d:152:/64 is advertised by a router on the node's local link. The interface ID 2c0:9fff:fe56:8255 is generated from bge0:1's MAC address.


# ifconfig -a6
lo0: flags=2002000849 <UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
bge0: flags=2100801 <UP,MULTICAST,IPv6> mtu 1500 index 5
        inet6 fe80::2c0:9fff:fe56:8255/10
        ether 0:c0:9f:56:82:55
bge0:1: flags=2180801 <UP, MULTICAST,ADDRCONF,IPv6>mtu 1500 index 5
        inet6 2001:db8:3c4d:152:c0:9fff:fe56:8255/64
# ifconfig bge0 inet6 token ::1a:2b:3c:4d/64
# vi /etc/hostname6.bge0
token ::1a:2b:3c:4d/64
# pkill -HUP -in.ndpd
# ifconfig -a6
lo0: flags=2002000849 <UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
bge0: flags=2100801 <UP,MULTICAST,IPv6> mtu 1500 index 5
        inet6 fe80::2c0:9fff:fe56:8255/10
        ether 0:c0:9f:56:82:55
bge0:1: flags=2180801 <UP, MULTICAST,ADDRCONF,IPv6>mtu 1500 index 5
        inet6 2001:db8:3c4d:152:1a:2b:3c:4d/64

After the token is configured, the global address on the second status line of bge0:1 now has 1a:2b:3c:4dconfigured for its interface ID.


See Also