Go to main content

Administering TCP/IP Networks, IPMP, and IP Tunnels in Oracle® Solaris 11.3

Exit Print View

Updated: March 2019
 
 

How to Configure a 6to4 Tunnel

When configuring 6to4 tunnels, a 6to4 router must act as the IPv6 router to the nodes that are in the network's 6to4 sites. Thus, when configuring a 6to4 router, you must also configure the router as an IPv6 router on its physical interfaces. For more information about configuring an Oracle Solaris system as a router, see Configuring an IPv6 Router in Configuring an Oracle Solaris 11.3 System as a Router or a Load Balancer.

  1. Create a 6to4 tunnel.
    # dladm create-iptun -T 6to4 -a local=address tunnel-link
    –a local=address

    Specifies the tunnel local address, which must already be existing in the system to be a valid address.

    tunnel-link

    Specifies the IP tunnel link that you can assign a tunnel.

  2. Create the tunnel IP interface.
    # ipadm create-ip tunnel-interface

    where tunnel-interface uses the same name as the tunnel link.

    The system automatically configures an IPv6 address for the local interface by using interface-id ::1.

  3. (Optional) Add alternative IPv6 addresses for the tunnel's use.
  4. Edit the /etc/inet/ndpd.conf file.
    # pfedit /etc/inet/ndpd.conf
  5. Advertise 6to4 routing by adding the following two lines to the file.
    if subnet-interface AdvSendAdvertisements 1
    prefix IPv6-prefix subnet-interface

    where the first line specifies the local IPv6 interface to send router advertisements over and the second line specifies the IPv6 subnet prefix to use on the LAN that is attached to that interface. The IPv6 prefix must start with the same 48-bit 6to4 prefix that is used on the 6to4 tunnel interface.

    For detailed information about the ndpd.conf file, see the ndpd.conf(4) man page.

  6. Enable IPv6 forwarding.
    # ipadm set-prop -p forwarding=on ipv6
  7. Choose from one of the following options:
    • Reboot the router.
    • Issue a sighup to the /etc/inet/in.ndpd daemon to begin sending router advertisements.

      The IPv6 nodes on each subnet to receive the 6to4 prefix autoconfigured with the new 6to4-derived addresses.

  8. Add the new 6to4-derived addresses for all of the nodes in the 6to4 site to the name service database.

    For instructions, see Chapter 4, Administering Naming and Directory Services on an Oracle Solaris Client in Configuring and Managing Network Components in Oracle Solaris 11.3.

Example 33  Creating a 6to4 Tunnel

The following example shows you would create a 6to4 tunnel. Note that only IPv6 interfaces can be configured over 6to4 tunnels. In this example, the subnet interface is net0 to which the /etc/inet/ndpd.conf refers.

# dladm create-iptun -T 6to4 -a local=192.0.2.23 tun0
# ipadm create-ip tun0
# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           dhcp     ok           192.0.2.23/24
lo0/v6            static   ok           ::1/128
tun0/v6           static   ok           2002:c000:217::1/16

# ipadm create-addr -T addrconf net0
net0/v6
# ipadm create-addr -a 2002:c000:217:cafe::1 net0
net0/v6a
# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           dhcp     ok           192.0.2.23/24
lo0/v6            static   ok           ::1/128
net0/v6           addrconf ok           fe80::214:4fff:fef9:b1a9/10
net0/v6a          static   ok           2002:c000:217:cafe::1/64
tun0/v6           static   ok           2002:c000:217::1/16

# vi /etc/inet/ndpd.conf
if net0 AdvSendAdvertisements on
prefix 2002:c000:217:cafe::0/64 net0

# ipadm set-prop -p forwarding=on ipv6

Note that for 6to4 tunnels, the prefix for the IPv6 address is 2002.