Pay attention that the support of 6to4 tunnels currently lacks on vanilla kernel series 2.2.x (see systemcheck/kernel for more information). Also note that that the prefix length for a 6to4 address is 16 because of from network point of view, all other 6to4 enabled hosts are on the same layer 2.
1.2.3.4 |
the generated 6to4 prefix will be
2002:0102:0304:: |
2002:0102:0304::1 |
Use e.g. following for automatic generation:
ipv4="1.2.3.4"; printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "` |
There are two ways possible to setup 6to4 tunneling now.
This is now the recommended way.
# /sbin/ip tunnel add tun6to4 mode sit remote any local <localipv4address> |
# /sbin/ip link set dev tun6to4 up |
Add local 6to4 address to interface
# /sbin/ip -6 addr add <local6to4address>/16 dev tun6to4 |
Add (default) route to the global IPv6 network using the all-6to4-routers IPv4 anycast address
# /sbin/ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 |
Bring generic tunnel interface sit0 up
# /sbin/ifconfig sit0 up |
Add local 6to4 address to interface
# /sbin/ifconfig sit0 add <local6to4address>/16 |
Add (default) route to the global IPv6 network using the all-6to4-relays IPv4 anycast address
# /sbin/route -A inet6 add 2000::/3 gw ::192.88.99.1 dev sit0 |
Remove all routes through this dedicated tunnel device
# /sbin/ip -6 route flush dev tun6to4 |
# /sbin/ip link set dev tun6to4 down |
# /sbin/ip tunnel del tun6to4 |
Remove (default) route through the 6to4 tunnel interface
# /sbin/route -A inet6 del 2000::/3 gw ::192.88.99.1 dev sit0 |
Remove local 6to4 address to interface
# /sbin/ifconfig sit0 del <local6to4address>/16 |
Shut down generic tunnel device (take care about this, perhaps it's still in use...)
# /sbin/ifconfig sit0 down |