设置pkgsrc/net/hf6to4软件包的步骤是:
- 1. 安装软件包,无论是从pkgsrc编译它,或者通过 pkg_add命令安装6to4-1.2 package.
代码: 全选
# cd /usr/pkgsrc/net/hf6to4
# make install
- 2. 请确认你的内核中启用了 stf(4) 伪设备, 参上面.
- 3. 配置'hf6to4'软件包. 首先, 拷贝 /usr/pkg/share/examples/hf6to4/hf6to4.conf 到 /usr/pkg/etc/hf6to4.conf, 然后调整变量. 注意这个文件使用 /bin/sh 语法.
代码: 全选
# cd /usr/pkg/etc
# cp ../share/examples/hf6to4/hf6to4.conf hf6to4.conf
# vi hf6to4.conf
$in_if="rtk0"; # Inside (ethernet) interface
- 4. 现在拨号, 然后手动启动6to4命令:
代码: 全选
# /usr/pkg/sbin/hf6to4 start
- 5. 接下来, 你应该已经连上了, 使用 ping6(8): 查看一下是否一切正常:
代码: 全选
# ping6 www.NetBSD.org
PING6(56=40+8+8 bytes) 2002:d954:110b:1::1 --> 2001:4f8:4:7:2e0:81ff:fe52:9a6b
16 bytes from 2001:4f8:4:7:2e0:81ff:fe52:9a6b, icmp_seq=0 hlim=60 time=250.234 ms
16 bytes from 2001:4f8:4:7:2e0:81ff:fe52:9a6b, icmp_seq=1 hlim=60 time=255.652 ms
16 bytes from 2001:4f8:4:7:2e0:81ff:fe52:9a6b, icmp_seq=2 hlim=60 time=251.237 ms
^C
--- www.NetBSD.org ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 250.234/252.374/255.652/2.354 ms
# traceroute6 www.NetBSD.org
traceroute6 to www.NetBSD.org (2001:4f8:4:7:2e0:81ff:fe52:9a6b)
from 2002:d954:110b:1::1, 64 hops max, 12 byte packets
1 2002:c25f:6cbf:1::1 66.31 ms 66.382 ms 69.062 ms
2 nr-erl1.6win.dfn.de 76.134 ms * 76.87 ms
3 nr-fra1.6win.dfn.de 76.371 ms 80.709 ms 79.482 ms
4 dfn.de6.de.6net.org 92.763 ms 90.863 ms 94.322 ms
5 de.nl6.nl.6net.org 116.115 ms 93.463 ms 96.331 ms
6 nl.uk6.uk.6net.org 103.347 ms 99.334 ms 100.803 ms
7 uk1.uk61.uk.6net.org 99.481 ms 100.421 ms 100.119 ms
8 2001:798:28:300::2 89.711 ms 90.435 ms 90.035 ms
9 ge-1-0-0-2.r20.londen03.uk.bb.verio.net 179.671 ms 185.141 ms 185.86 ms
10 p16-0-0-0.r81.nycmny01.us.bb.verio.net 177.067 ms 179.086 ms 178.05 ms
11 p16-1-1-3.r20.nycmny01.us.bb.verio.net 178.04 ms 179.727 ms 184.165 ms
12 p16-0-1-1.r20.mlpsca01.us.bb.verio.net 249.856 ms 247.476 ms 249.012 ms
13 p64-0-0-0.r21.snjsca04.us.bb.verio.net 239.691 ms 241.404 ms 240.998 ms
14 p64-0-0-0.r21.plalca01.us.bb.verio.net 247.541 ms 246.661 ms 246.359 ms
15 xe-0-2-0.r20.plalca01.us.bb.verio.net 240.987 ms 239.056 ms 241.251 ms
16 ge-6-1.a01.snfcca05.us.ra.verio.net 240.868 ms 241.29 ms 242.337 ms
17 fa-5-2.a01.snfcca05.us.ce.verio.net 249.477 ms 250.4 ms 256.035 ms
18 2001:4f8:4:7:2e0:81ff:fe52:9a6b 268.164 ms 252.97 ms 252.366 ms
- 6. 如果一切正常, 你可将下列内容写入 /etc/ppp/ip-up 脚本以便每次你连上网络时自动运行命令:
logger -p user.info -t ip-up Configuring 6to4 IPv6
/usr/pkg/sbin/hf6to4 stop
/usr/pkg/sbin/hf6to4 start
- 7. 如果你想为局域网发送IPv6, 你可以指示 6to4.pl 也为你建立路由器广告:
代码: 全选
# /usr/pkg/sbin/hf6to4 rtadvd-start
- 8. 如果你已经修改了 /etc/ppp/ip-up 让6to4自动设置, 你很有可能也想修改 /etc/ppp/ip-down , 当你离线时关闭它. 将下列内容添加到 /etc/ppp/ip-down:
logger -p user.info -t ip-down Shutting down 6to4 IPv6
/usr/pkg/sbin/hf6to4 rtadvd-stop
/usr/pkg/sbin/hf6to4 stop