ClueNet is looking for a new Chief Technical Admin. More information here.

Introduction to IPv6

From ClueWiki

Jump to: navigation, search

IPv6 is a relatively new technology for OSI Layer 3 of networking. The biggest difference from the currently most widespread technology (IPv4, or just IP) is that IPv6 addresses are 128 bits long, while IPv4 addresses are only 32 bits long.

A typical IPv4 address looks something like 192.168.10.20 . Each octet (section, separated by periods) is a single byte, or 8 bits. Each byte is represented in decimal (base 10). IPv6 addresses are usually represented by 8 sets of 4 hexdecimal digits each, with each set separated by a colon.

An example IPv6 address is 2002:453d:8d7a:aaaa:0202:2dfa:fdb2:eab9 . If a given set of hex digits starts with one or more zeros, the zeros can be left off. For example, 2002:453d:8d7a:aaaa:0202:2dfa:fdb2:0012 becomes 2002:453d:8d7a:aaaa:0202:2dfa:fdb2:12 . Also, if one or more sets in a row are all zeros, they can be left out altogether, with an extra colon in their place. For example, 2002:453d:8d7a:aaaa:0000:0000:0000:12 becomes 2002:453d:8d7a:aaaa::12 . There can only be one double-colon per address.

The main advantage of IPv6 over IPv4 is that there are many more different addresses. In IPv4, there are only 4,294,967,296 different addresses possible in the entire network, and many of those are reserved for special purposes. With IPv6, there are 340,282,366,920,938,463,463,374,607,431,768,211,456 different possible addresses. With the IPv4 Internet, many machines do not have their own public IP address, including many Cluenet servers. With IPv6, there are plenty of addresses for all.

Cluenet strives to be as compatible as possible with IPv6, and almost all services are accessible via IPv6. Some services are even IPv6-only. We strongly recommend that all users get IPv6, and there are/will be tutorials here to help you do that. Your ISP doesn't have to support IPv6 to get a connection, and connections like 6to4 are nearly free of latency. If for some reason 6to4 connectivity or other IPv6 broker connections won't work for you, Cluenet provides its own IPv6 tunneling service, ClueTun. Unlike most other IPv6 tunnels, ClueTun works over TCP, so you don't have to forward any ports or protocols to your machine to make it work.

With ClueTun, you get a /80 IPv6 network for yourself, or 281,474,976,710,656 different IP addresses. You can subnet them as you like. With a 6to4 connection, you have less latency than with a TCP tunnel with a static endpoint, and you get a /48 subnet, or 1,208,925,819,614,629,174,706,176 different IP addresses. Many tunnel brokers give out /64's, or 18,446,744,073,709,551,616 different IP addresses.

For connectivity to many Cluenet services, we strongly encourage users to get some kind of IPv6 connection, and we may require servers to have an IPv6 connection before joining Cluenet, if possible.

[edit] Alternative Way

6to4 won't always work with your router. Quite a few routers don't support the 6to4 protocol and won't forward it properly. 6to4 also doesn't work with NAT. Only a few routers support 6to4 via the DMZ. If you're using the DMZ on your host and want to use 6to4, use this script (link below.) It requires your distribution's iproute package and will set up 6to4 with your /48 subnet. All you need to do is be running Linux and have your distribution's iproute package (or more specifically, the `ip' utility) installed, and root access.

Here is the script:

export MYHOST=`wget -O /dev/stdout -q -4 http://whatismyip.org`
export HOST=`printf "2002:%02x%02x:%02x%02x::1" \`echo ${MYHOST} | tr "." " "\``
echo "IPv4 host: ${MYHOST}  IPv6 host: ${HOST}"
echo "Adding 6to4 tunnel.."
ip tunnel add tun6to4 mode sit ttl 0 remote any local ${MYHOST} 

echo "Bringing interface tun6to4 up"
ip link set dev tun6to4 up 

# Add local 6to4 address to interface (note: prefix length 16 is important!)
echo "Adding 6to4 address to interface"
ip -6 addr add ${HOST}/16 dev tun6to4 

# Add (default) route to the global IPv6 network using the all-6to4-routers IPv4 anycast address
echo "Adding IPv6 route"
ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1

# Make sure you're routed properly.
echo "Being redundant with the routing"
route -A inet6 add ${HOST}/16 tun6to4

It should leave something like this in your ifconfig.

tun6to4   Link encap:UNSPEC  HWaddr 4B-3F-80-13-00-00-00-00-00-00-00-00-00-00-00-00  
          inet6 addr: 2002:4b3f:8013::1/16 Scope:Global
          inet6 addr: ::75.63.128.19/128 Scope:Compat
          UP RUNNING NOARP  MTU:1480  Metric:1
          RX packets:1571 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1770 errors:21 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1127976 (1.0 Mb)  TX bytes:311765 (304.4 Kb)
Personal tools
Server information
Useless