Essentially, an IPv6 prefix, 2002::/16
has been allocated to
the scheme, and sites can automatically obtain address space from this
prefix, by inserting the globally unique IPv4 address of an interface on
your target 6to4 gateway into the IPv6 NLA. This is illustrated in the draft[1]:
| 3 | 13 | 32 | 16 | 64 bits | +---+------+-----------+--------+--------------------------------+ |FP | TLA | V4ADDR | SLA ID | Interface ID | |001|0x0002| | | | +---+------+-----------+--------+--------------------------------+If, for instance, the address of an interface on your 6to4 gateway was 32.33.34.35, then your site can use the IPv6 prefix 2002:2021:2223::/48. If you have a dynamic IP address, for instance via typical ISP dialup (like me), then converting your assigned IP address into hexdecimal is a pain - and you might appreciate the fact that in bash
export IP=32.33.34.35 printf "2002:%x%02x:%x%02x:\n" `echo ${IP} | sed 's/\./ /g'`outputs 2002:2021:2223:.
If we assume that you have IPv6 support in your linux kernel then, and also have the Kuznetsov's iproute2 tools, but don't have a connection to the 6bone, AND you use dynamic PPP access, you can run the following fragment in /etc/ppp/ip-up.local (don't forget to make it executable):
IP=$4 # I use microsoft's 6to4 site - more at http://www.kfu.com/~nsayer/6to4/ SIX2FOURGW=131.107.65.121 quads=`echo ${IP} | sed 's/\./ /g'` prefix=`printf "2002:%x%02x:%x%02x:\n" ${quads}` ip link set sit0 up # we want sit0 running in wildcard send/receive mode ip addr add ${prefix}:1 dev sit0 # simplest case... ip route add 2002::/16 dev sit0 # route to 6to4 land via sit0 ip route add 2000::/3 via ::${SIX2FOURGW} ip route add 3ffe::/16 via ::${SIX2FOURGW} # fix up radvd.conf cat /etc/radvd.conf.template | sed "s/THE6TO4/${prefix}0001::0/" > /etc/radvd.conf kill -HUP `pidof radvd`It is practice to form the device ID from the 6to4 gateway IPv4 address. Using the local IP addresses like this (should) guarantee uniqueness across your site.
Beware: if you want to set your box up as a gateway, there are several more steps.
Ideally, you should run a router advertisement daemon like radvd, but this won't work
so well if you have dynamically assigned IP. You also will need to turn on IPv6
forwarding, echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
, for instance.
[1]
Connection of IPv6 Domains via IPv4 Clouds
(work in progress), B. Carpenter & K. Moore, draft-ietf-ngtrans-6to4-06.txt
http://www.ietf.org/internet-drafts/draft-ietf-ngtrans-6to4-07.txt
Note: newer versions may have replaced this at a later date.
Bugspotters: Felix "Leitner", ... your name could be here :-)