6to4 is a small script to create/delete 6to4 tunnels.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
Public Domain 
Olaf Titz
ROOT \ System \ Networking
6to4 is a small script to create/delete 6to4 tunnels.

This creates a standard 6to4 tunnel. With this tunnel, everyone with an IPv4 connection can give their network full IPv6 connectivity without the need for further configuration. In case of a dynamically assigned IPv4 address, this creates a dynamic, but fully functional, IPv6 network prefix. See RFC 3056, RFC 3068.

Requires Linux 2.6 and an appropriate version of iproute; radvd recommended.

Assume your IPv4 address (e.g. the local end of your PPP connection) is, the tunnel is created from 2002:0102:0304::1 to :: Also the local network is assigned the address 2002:0102:0304::/48 and the IPv6 default route is set into the tunnel. (Where "default" currently means 2000::/3, which includes all assigned global unicast addresses.) The kernel routing handles the 2002::/16 prefix specially as defined in RFC 3056. The remote address is a globally assigned anycast address for tunneling; there are routers all over the world which handle this transparently. (If you happen to have a dedicated IPv6 tunnel router change the REMOTE addresses below.)

This script can be called from /etc/ppp/ip-up like:

6to4 up "$4" eth0

and likewise from /etc/ppp/ip-down:

6to4 down "$4" eth0

Substitute the local ethernet interface for eth0 as needed.

To announce the 6to4 network prefix and default route into your local network, use the following radvd.conf:

interface eth0 {
AdvSendAdvert on;
MinRtrAdvInterval 20;
MaxRtrAdvInterval 60;
AdvLinkMTU 1400; adapt as needed
prefix 2002::/64 {
AdvOnLink off;
AdvAutonomous on;
AdvRouterAddr on;
Base6to4Interface tun64; note this!
AdvPreferredLifetime 90;
AdvValidLifetime 120;

The trick here is that we assign the local IPv4 address (redundantly) to the tunnel interface, so radvd picks it from the tunnel instead of the PPP device. So radvd announces the tunnel only when it's really up.

Last updated on January 25th, 2007

#IPv4 tunnel #IPv6 tunnel #IPv6 connectivity #create #delete #6to4 #tunnels

Add your review!