IPv6是Internet Protocol Version 6的缩写,其中Internet Protocol译为“互联网协议”。IPv6是IETF(互联网工程任务组,Internet Engineering Task Force)设计的用于替代现行版本IP协议(IPv4)的下一代IP协议。目前IP协议的版本号是4(简称为IPv4),它的下一个版本就是IPv6。那么在windows xp系统中对IPv6该如何设定呢?
ipv6 在 windowsXP 下的设定,基本上和Windows2003 下的设定大同小异,但还是有点不一样,主要是xp 下的 ipv6 多了一个 ipv6 的指令,是除了 netsh 外的另一个操作方法;此外,目前已知的问题如下:
xp 对 ipv6 的 dhcp6 client 并没有支援。
xp 和2003 防火墙都无法管控 ipv6。
部分防毒防火墙会将 ipv6 视为异常封包而丢弃,所以必须要更新或关闭。
windows XP 在sp2 后就开始支援 ipv6,但预设是没有安装,所以我们来先安装ipv6,到dos下:
C:/>ipv6 install
正在安装...
执行成功。
或是用 netsh 安装
C:/>netsh
netsh>in
netsh interface>ipv6
netsh interface ipv6>
netsh interface ipv6>install
# 查看介面状态
netsh interface ipv6>sh addr
正在查询使用中的状态...
介面 5: Teredo Tunneling Pseudo-Interface
位址类型 DAD 状态 有效存留时间 偏好存留时间 位址
--------- ---------- ------------ ------------ -----------------------------
连结 偏好 infinite infinite fe80::ffff:ffff:fffd
介面 4: 区域连线
位址类型 DAD 状态 有效存留时间 偏好存留时间 位址
--------- ---------- ------------ ------------ -----------------------------
公用 偏好 29d23h53m16s 6d23h53m16s 2001:288:5400:1:211:25ff:fe40:6072 <== autoconf 得到的 IP6
连结 偏好 infinite infinite fe80::211:25ff:fe40:6072
介面 2: Automatic Tunneling Pseudo-Interface
位址类型 DAD 状态 有效存留时间 偏好存留时间 位址
--------- ---------- ------------ ------------ -----------------------------
连结 偏好 infinite infinite fe80::5efe:163.17.39.17
介面 1: Loopback Pseudo-Interface
位址类型 DAD 状态 有效存留时间 偏好存留时间 位址
--------- ---------- ------------ ------------ -----------------------------
回送 偏好 infinite infinite ::1
连结 偏好 infinite infinite fe80::1
# 要修改的区域介面id为4,设定静态位址 store=persistent 代表永久储存
netsh interface ipv6>add address 4 address=2001:288:5400:1::17 store=persistent
# 设定完毕再 sh int 则会看到这笔手动设定的ip6
# 手动 偏好 infinite infinite 2001:288:5400:1::17
# 查看 ipv6 dns
netsh interface ipv6>sh dns
# 设定 v6 的dns,如此这台机器才会查询 v6 的dns,2001:288:5400::1 是要查询的dns ,在XP这个设定是鸡肋,没有实际作用
netsh interface ipv6>add dns interface="区域连线" address=2001:288:5400::1
# 查看 ipv6 路由
netsh interface ipv6>sh rout
正在查询使用中的状态...
发行 类型 公制 首码 索引 闸道/介面名称
------- -------- ---- ------------------------ --- ---------------------
no 自动设定 256 ::/0 4 fe80::209:fff:fe77:1837
也可以在 dos 下指令 ipv6 rt
C:/>ipv6 rt
# 加上 ipv6 路由,下面範例将预设路由设定到 ::FF
netsh interface ipv6>add route ::/0 4 2001:288:5400:1::ff
# 加上 ipv6 路由后再 sh route 则出现一笔手动的
no 手动 0 ::/0 4 2001:288:5400:1::ff
其他指令:
以上指令若要删除,则把 "add" 改为 "del" 即可
清空 ipv6 手动的设定
netsh interface ipv6>reset
重启 ipv6 设定
netsh interface ipv6>renew
或是
C:/>ipv6 renew 介面id <== 指定介面 renew 或不指定
C:/>ipv6 renew
移除 ipv6
netsh interface ipv6>uninstall
或是
C:/>ipv6 uninstall
离开 netsh
netsh interface ipv6>exit
开启/关闭ipv6
C:/>net start/stop tcpip6
检查 v6 介面
C:/>ping6 IP6位址
例如检查自己:
C:/>ping6 ::1
IPv6 安装后的预设介面
C:/>ipv6 if [if number]
– IPv6 安装后有出现4个虚拟介面(interface 1 2 3 5)
– Interface #1是一虚拟介面,用來做loopback
– Interface #2是一虚拟介面,用來设定 Tunnel/ISATAP
– Interface #3是一虚拟介面,提供6to4的服务
– Interface #4是区域連线介面
– Interface #5是Teredo 通道虚拟介面
ping6 和 ipv6 指令在 XP 以后的版本已被移除,所以统一使用以下指令(较佳):
C:/>ping -6 ::1
** 到了 Vista/7 后,连那个 -6 的参数都不必加。