Subject: Re: setting up IPv6
To: Sean Davis <dive-nb@endersgame.net>
From: Michael Richardson <mcr@sandelman.ottawa.on.ca>
List: tech-net
Date: 04/08/2002 11:19:22
-----BEGIN PGP SIGNED MESSAGE-----
>>>>> "Sean" == Sean Davis <dive-nb@endersgame.net> writes:
Sean> 1) Is there a doc somewhere that describes how to do IPv6 addresses in bind
Yes, it is in the bind Admin Reference Manual. Look in /usr/pkg/share/doc/bind9
(You'll want to run bind9 if you want bind to answer on V6 sockets) I'm not
sure that we ship ARM with the default system.
Sean> 2) How do I determine what the IPv6 address for each machine should be
Well, each interface can have multiple addresses.
1) a link local address which is fe80::EUI64 (derived from MAC address).
2) addresses that you configure like IPv4.
3) addresses that you get by neighbour discovery from your IPv6 capable
router.
Since you probably do not have #3 and #2 is more useful if you have your
own address space assigned, you probably want to look at
4) a 6to4 address. See http://www.kfu.com/~nsayer/6to4/
http://www.daemonnews.org/200101/6to4.html
Basically, you get 2002:ABCD:EFGH::/48 where AB.CD.EF.GH is your IP address.
I use the following on my notebook (called from dhclient-exit-hooks) to
make sure that I always have IPv6, so long as there is no NAT.
#!/bin/sh
PATH=/usr/sbin:/sbin:$PATH export PATH
myip=$1
# Now configure my stf driver.
set -- `echo $myip | sed -e 's/\./ /g'`
A=$1
B=$2
C=$3
D=$4
if [ $A = 10 ]
then
exit
fi
if [ $A = 172 ] && [ $B '>=' 16 '|' $B '<=' 31 ]
then
exit
fi
if [ $A = 192 ] && [ $B = 168 ]
then
exit
fi
v6to4addr=`printf '2002:%02x%02x:%02x%02x' $A $B $C $D`
# remove any other addresses
#stf0: flags=1<UP> mtu 1280
# inet6 2002:d11f:72ca::20 prefixlen 16
# inet6 2002:d11f:71c2::20 prefixlen 16
ifconfig stf0 | while read first second third
do
case $first in
inet6) ifconfig stf0 inet6 $second delete;;
esac
done
ifconfig stf0 inet6 $v6to4addr::20 prefixlen 16 alias up
if netstat -rn -f inet6 | grep '^::/0' >/dev/null
then
echo Already got default IPv6 route
else
# gateway6.sandelman.ottawa.on.ca
route add -net -inet6 :: 2002:c08b:2e21:3::1
fi
Sean> 3) Is there anything else I need to know to make it work
Sean> Any help is appreciated
Sean> Thanks,
Sean> -Sean
Sean> --
Sean> /~\ The ASCII Sean Davis
Sean> \ / Ribbon Campaign aka dive
Sean> X Against HTML
Sean> / \ Email! http://eros.endersgame.net:8000/~dive
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Finger me for keys
iQCVAwUBPLGuF4qHRg3pndX9AQFXFAQA3ZOqgaXt7z5LYLrDlZ2WaKBWxBBw28kA
lvzujyXJ5mLj+/HYWokhjvp0f6aYnZ1Gf/JPlBgLsof51ZvCrWlahPoVuIEvJOfN
1VTzgD3g3g0IBHHXMVUbOJn29wpIZlh4xy4rT+G6jDav2hl8+rUi85CHp07rSdVM
k97WnxN69EI=
=pp6g
-----END PGP SIGNATURE-----