Get On IPv6 Right Now

From Sfvlug

There are currently three ways to get on the IPv6 Internet today. They are either sign up with an ISP that provides native IPv6 connectivity, register with a tunnel broker, or use 6 to 4 relay. I don't believe any ISPs in the United States currently offer IPv6. Using a tunnel broker requires additional software and although the software and the account are usually free, this is kind of a hassle. But using a 6 to 4 relay tunnel is easy to configure and you already have the software necessary to make the connection.

You must configure the 6 to 4 relay tunnel on an Internet-facing interface. Doing this on a computer behind a NAT will not work.

A 6 to 4 tunnel derives your IPv6 address from your IPv4 address. To figure out what it is, just convert your IPv4 address to hexadecimal and prefix it with 2002 (8194 in decimal). This produces a 48-bit prefix. In IPv6, networks are 64 bits wide, and the other 64 bits of the 128-bit address is the host portion. You are free to assign the next 16 bits for up to 65,535 networks. Well, the first network, zero, will be used as an external gateway to your IPv6 internal network. If you don't know which IP to use, it is the one associated with your default route. If you don't know that, try this:

IPV4ADDR=`lynx -dump www.whatismyip.org`

Identify your IPv6 prefix.

IPV6PRE=`echo $IPV4ADDR | awk -F. '{ printf("2002:%x%02x:%x%02x", $1, $2, $3, $4) }'`

Configure your IPv6-to-IPv4 tunnel device. Here, we're going to use zero for the network number, and one for the host number. Remember, in IPv6 addresses, you can substitute a string of zeros with just a blank between colons.

iptables -I INPUT -p 41 -i eth0 -j ACCEPT
ip tunnel add tun6to4 mode sit ttl 64 remote any local $IPV4ADDR
ip link set dev tun6to4 up
ip -6 addr add $IPV6PRE::1 dev tun6to4
ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1

If this is the only computer you want on IPv6, then you're done. You have set up a 6 to 4 tunnel.

If you want to act as an IPv6 gateway, enable forwarding and add an IPv6 subnet to your internal interface. Here, I'm arbitrarily picking one as the network number. It can be anything from 1 to 0xffff (65,536 in decimal).

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
ip -6 addr add $IPV6PRE:1::1/64 dev eth1

If you want to enable automatic address configuration, create a radvd.conf file like this.

interface eth1 {
    AdvSendAdvert on;
    prefix $IPV6PRE:1::0/64 {
        AdvOnLink on;
        AdvAutonomous on;
    };
};

And start radvd (use -C /path/to/radvd.conf if necessary).


Jeff

Personal tools
Other sites