Linux IPv6: 6to4 standard tunnel

# this only works if the machine is directly on the internet
# not behind NAT!
# assuming 96.30.111.165 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 96.30.111.165
ip -6 addr add 2002:601E:6FA5::1/64 dev tun6to4
ip link set dev tun6to4 up
ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1

#test
traceroute -6 google.com

This creates a 6to4 SIT tunnel provided by your ISP (if available).
Wiki info: https://en.wikipedia.org/wiki/6to4

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 96.30.111.165. Your IPv6 address range is derived from the IPv4 address. You can use this calculator to do that: http://silmor.de/ipaddrcalc.html#ip46 (the 6to4 prefix calculator).

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

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s