Penguin

Differences between version 57 and predecessor to the previous major change of 6to4.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 57 Last edited on Wednesday, March 7, 2007 12:42:49 am by NickClifford Revert
Older page: version 56 Last edited on Thursday, July 28, 2005 7:21:50 pm by MattBrown Revert
@@ -24,13 +24,16 @@
  
 You don't need to 'get' one - if you have an IPv4 addresss (even a dynamic one) you can get a 6to4 address. 
  
 To figure out your 6to4 address based on your IPv4 address: 
+<pre>  
  printf "2002:%02x%02x:%02x%02x::1\n" `echo $IPV4ADDR | tr . ' '` 
-  
+</pre>  
 Where $IPV4ADDR is your IPv4 address. Eg, if your IPv4 address is 192.0.2.3, then: 
+<pre>  
  printf "2002:%02x%02x:%02x%02x::1\n" `echo 192.0.2.23 | tr . ' '` 
  2002:c000:0217::1 
+</pre>  
 The network should be "/16". 
  
 There are two cases for setting this up under linux: if your IPv4 address is a static IP, or if its dynamic. 
 In either case you'll need to know what your 6to4 address is. The script mentioned above will help here. 
@@ -40,37 +43,39 @@
 !!Static IP 
  
 Static IP is obviously preferable, as you can set up DNS properly for it. Thats another issue entirely however :) 
 The following commands should set up a 6to4 tunnel for you: 
-  
+<pre>  
  ip tunnel add tun6to4 mode sit remote any local __''your-ipv4-address''__ 
  ip link set dev tun6to4 mtu 1472 up 
  ip -6 addr add __''your-6to4-address''__/16 dev tun6to4 
-  
+</pre>  
 So for our example IP above: 
-  
+<pre>  
  ip tunnel add tun6to4 mode sit remote any local 192.0.2.3 
  ip link set dev tun6to4 mtu 1472 up 
  ip -6 addr add 2002:c000:0217::1/16 dev tun6to4 
-  
+</pre>  
 If you don't have the 6bone configured, run the following two commands: 
+<pre>  
  ip -6 route add ::/96 dev tun6to4 metric 1 # This line is never mentioned anywhere, but it appears critical. 
  ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 
-  
+</pre>  
 192.88.99.1 is an AnyCast address for places that provide connectivity to non-6to4 addresses to 6to4 hosts. 
  
 To take the tunnel down again, run 
+<pre>  
  /sbin/ip -6 route flush dev tun6to4 
  /sbin/ip link set dev tun6to4 down 
  /sbin/ip tunnel del tun6to4 
-  
+</pre>  
  
 !Static IP under Debian: 
  
 Add the following stanza to /etc/network/interfaces, making obvious substitutions. It should "just" work. 
  
 If you are using woody (stable) then you'll need a backport of ifupdown from testing/unstable; available from http://debian.zugschlus.de/zg/pool/main/ifupdown/ifupdown_0.6.4-4.5zg6_i386.deb 
-  
+<pre>  
  auto tun6to4 
  iface tun6to4 inet6 v4tunnel 
  address __''your-6to4-address''__ 
  netmask 16 
@@ -79,16 +84,17 @@
  up ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 
  down ip -6 route flush dev tun6to4 
  mtu 1472 
  ttl 255 
-  
+</pre>  
 !!Dynamic IP 
  
 This is a bit of a hassle. You need to update your 6to4 configuration every time you change IP. If your dynamic IP address isn't terminated on your Linux box (that is, you have a DSL router or similar, which handles NAT and so on for you), this might be tricky. 
  
 The best way to do this is to put a script in /etc/ppp/ip-up.d/ or whatever is most appropriate for your system 
  
 An example ip-up.d script. 
+<pre>  
  #!/bin/bash 
  # Kill any existing tunnels 
  /sbin/ip -6 route flush dev tun6to4 
  /sbin/ip link set dev tun6to4 down 
@@ -114,8 +120,9 @@
  # ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1 
  
  # Restart radvd (if you have it running) 
  killall -1 radvd 
+</pre>  
  
 ! Dynamic IP under Debian 
  
 I have prepared a (hackish, I'll admit) init script for Debian. 
@@ -133,21 +140,25 @@
 !!Testing 
 Use the __ping6__ program. (On Debian, you need to install the iputils-ping package to get the ipv6 version of ping). 
  
 If this webserver (Hoiho) has its 6to4 set up correctly, you should be able to do: 
+<pre>  
  $ ping6 2002:cb61:a32::1 
  PING 2002:cb61:a32::1(2002:cb61:a32::1) from ::1 : 56 data bytes 
  64 bytes from 2002:cb61:a32::1: icmp_seq=1 ttl=64 time=0.203 ms 
  64 bytes from 2002:cb61:a32::1: icmp_seq=2 ttl=64 time=0.077 ms 
  64 bytes from 2002:cb61:a32::1: icmp_seq=3 ttl=64 time=0.080 ms 
-  
+</pre>  
  
  
 !!Using 6to4 addresses on your internal network 
  
 First you need to configure radvd. Zebra is not recommended as it cannot handle dynamic 6to4 address advertising (as radvd can) and also has a bug where it will write out a configuration to it's file that is invalid and then die when it tries to reload it again. 
  
 Your config file should look something like: 
+  
+<pre>  
+  
  interface eth0 
 
  !AdvSendAdvert on; 
  prefix fec0::/64 
@@ -166,8 +177,10 @@
 
  Base6to4Interface lo:1; 
  }; 
  }; 
+  
+</pre>  
  
 You can omit any of the prefix stanza's you don't like. 
 In the config above the timers have been turned down in anticipation that you are advertising a 6to4 address generated from a dynamic IP on ppp0. Note that if you do this you __must__ turn down the retransmit time on the unsolicited announcements. In particular ensure that ''!MaxRtrAdvInterval'' and ''!AdvPreferredLifetime'' are less than ''!AdvValidLifetime''. If you don't understand why this is important then you can just go with what is shown above.