Linux IPv6: 6to4 standard tunnel

# this only works if the machine is directly on the internet
# not behind NAT!
# assuming is the public IP in a connected network interface
# and 2002:601E:6FA5::1/64 as your IPv6 address, derived from IPv4

ip tunnel add tun6to4 mode sit ttl 128 remote any local
ip -6 addr add 2002:601E:6FA5::1/64 dev tun6to4
ip link set dev tun6to4 up
ip -6 route add 2000::/3 via :: dev tun6to4 metric 1

traceroute -6

This creates a 6to4 SIT tunnel provided by your ISP (if available).
Wiki info:

This method gives you a /64 IPv6 in the 6to4 reserved range 2002::/16.
For this the machine has to be directly on the internet, in other worlds, a network interface has to have a public IPv4 address. In this example we use Your IPv6 address range is derived from the IPv4 address. You can use this calculator to do that: (the 6to4 prefix calculator).

First, check if your ISP is offering 6to4. Just traceroute to and see if you get back a response.

If your IPv4 changes, you must recreate the tunnel with the new addresses.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s