红联Linux门户
Linux帮助

IPv6协议在各操作系统下的安装与配置

发布时间:2006-01-15 09:45:00来源:红联作者:cha
本文将为大家介绍如何在Redhat Linux 9操作系统、Windows 2000 Server操作系统、Windows XP Professional操作系统和Free BSD Unix操作系统中安装和配置IPv6协议。


一、Linux操作系统

以RedHat9.0为例,系统默认的内核版本为2.4.20-8,已经自带了IPv6这个模块,配置过程如下:

以root用户登录(以下举例中的命令对大小写敏感)

1.加载ipv6模块

运行命令insmod ipv6或者modprobe ipv6,然后用命令lsmod可以查看系统已加载的模块列表,如果看到ipv6,则表示模块已经加载成功。用命令rmmod ipv6可以删除ipv6模块。也可以让系统在网络启动的时候自动加载ipv6模块,方法是编辑/etc/sysconfig/network文件,加入新的一行NETWORKING_IPV6=YES。

2.配置ipv6地址

默认情况下,一旦加载了ipv6模块,系统会自动给网卡配置好ipv6的本地链路地址(link local address),这里地址的特点是以[fe80::]开头。如果机器所接入的网络中,有支持ipv6的路由器,并且该路由器配置的是无状态地址自动配置,那么系统还会自动给网卡配置一个全球地址(Global Address)。本地链路地址是本地链路中唯一的,全球地址是全球IPv6网络中唯一的。

也可以手动给网卡配置地址,比如当网卡是以太网卡时,用以下命令即可为网卡配置一个全球地址为2001:250:3000:1::1:1,网络前缀(Network Prefix)为112的ipv6地址:



ifconfig eth0 add 2001:250:3000:1::1:1/112




3.测试网络连通性

网络连通性测试的前题是有另外一台ipv6的网络节点,可以是普通的支持ipv6的pc,也可以是支持ipv6的路由器。它们之间要么在链路层直接相通,要么经过其他的支持ipv6的网络节点在链路层间接相通。假设另外一台机器的网络节点的全球地址为为2001:250:3000:1::1:2,那么用以下命令:



ping6 2001:250:3000:1::1:2/112




应该可以看到类似如下的结果:



引用:
PING 2001:250:3000:1::1:2(2001:250:3000:2::1:1) 56 data bytes
64 bytes from 2001:250:3000:1::1:2: icmp_seq=1 ttl=64 time=0.082 ms
64 bytes from 2001:250:3000:1::1:2: icmp_seq=2 ttl=64 time=0.058 ms





这就表明这两个节点之间的ipv6网络连通性正常。

4.配置静态路由表



route -A inet6(可以查看ipv6的静态路由表);
route -A inet6 add default gw 2001:250:3000:2:2c0:95ff:fee0:473f(在系统的静态路由表里面加上一条静态路由记录)




5.支持的服务



WEB服务
服务器Apache 2.0.40
启动方法:/etc/init.d/httpd start
客户端lynx 2.8.5
运行方法:lynx http://[ipv6 -address]:port/






LDAP服务
我采用开源项目openldap提供的服务器和客户端,版本号是2.0.25,其网站为http://www.openldap.org/,该软件能够支持IPv6。
服务端启动方法:/etc/init.d/ldap start
客户端访问方法:ldapsearch -x -h [ipv6-addr] -D "cn=Manager"



二、Windows 2000 Server操作系统

1.准备工作

在微软的网址上(www.microsoft.com),有安装协议的简单说明,现将原文摘录如下:

1.Save the file tpipv6-001205.exe from the download page to a local folder (for example, C:\IPv6TP).

2.From the local folder (C:\IPv6TP), run Tpipv6-001205.exe and extract the files to the same location.

3.From the local folder (C:\IPv6TP), run Setup.exe -x and extract the files to a subfolder of the current folder (for example, C:\IPv6TP\files).

4.From the folder containing the extracted files (C:\IPv6TP\files), open the file Hotfix.inf in a text editor.

5.In the [Version] section of the Hotfix.inf file, change the line NTServicePackVersion=256 to NTServicePackVersion=1024, and then save changes.

6.From the folder containing the extracted files (C:\IPv6TP\files), run Hotfix.exe.

7.Restart the computer when prompted.

8.After the computer is restarted, continue installing the Microsoft IPv6 Technology Preview for Windows 2000 starting at step 3 of the "Installing the IPv6 Technology Preview for Windows 2000" section of either the Introduction to the Microsoft IPv6 Technology Preview for Windows 2000 or the Readme.htm file in the folder containing Setup.exe (C:\IPv6TP).

2.安装配置

完成了准备工作之后,还需要给以太网卡添加IPv6协议族,这里也摘录部分原文。

1.From the Windows 2000 desktop, click Start, point to Settings, and then click Network and Dial-up Connections. As an alternative, you can right-click My Network Places, and then click Properties.

2.Right-click the Ethernet-based connection to which you want to add the IPv6 protocol, and then click Properties. Typically, this connection is named Local Area Connection.

3.Click Install.

4.In the Select Network Component Type dialog box, click Protocol, and then click Add.

5.In the Select Network Protocol dialog box, click Microsoft IPv6 Protocol and then click OK.

6.Click Close to close the Local Area Connection Properties dialog box.

3.测试网络连通性

测试的前题条件与之前在Linux环境下的配置类似。

Windows NT系列的操作系统中,一个网卡可以对应于多个接口(interface),一个interface对应一个ipv6地址,Windows 2000 Server也是如此。因此,当一个网卡通常具有多个ipv6地址的时候(至少有本地链路地址,通常还有站点地址,全球地址,ipv4向ipv6过渡阶段的过渡型地址),Windows 2000 Server就用多个interface来对应之,一般情况下一个网卡有4个interface。而其中之一对应的是全球地址,在手动给网卡配置全球地址的时候也要注意对应该接口,该接口的特点是其描述包含“本地连接”或“Local Area Connection”的关键字。

假如“本地连接”对应的接口序号是2,那么切换到命令提示符下,用如下命令手动加入ipv6地址:

ipv6 adu 2/2001:250:3000:1::1:1,2表示该操作对应于interface 2。

假设路由器地址是2001:250:3000:1:2c0:95ff:fee0:473f,用如下命令手动加入静态路由表:

ipv6 rtu ::/0 2/2001:250:3000:1:2c0:95ff:fee0:473f,这里后面的地址表示路由器的IPv6地址,::/0相当于Redhat Linux 9中静态路由表的default gw。

运行命令:ping6 2001:250:3000:1:2c0:95ff:fee0:473f,如果能够收到回应,则表示本机与ipv6路由器之间的ipv6网络是互通的。

三、Windows XP Professional操作系统

安装协议方面简单了许多,只需要进入命令模式,然后运行ipv6 install即可。其他操作与Windows 2000 Server类似。


四、FreeBSD Unix

安装协议的方法也很简单,只需要修改/etc/rc.conf文件,新添加一行即可:

ipv6_enable="YES"

配置地址也可以在该文件中完成,如新增加一行:

ipv6_ifconfig_fxp0="2001:250:3000:1::1:1 prefixlen 64"

就给网卡fxp0进行了一个网络前缀为64,全球地址为2001:250:3000:1::1:1的配置。

其它网络连通性测试的操作与以上所述的原理一样,就不在赘述。
文章评论

共有 2 条评论

  1. wadekobe110 于 2013-06-18 10:38:23发表:

    真是好东西,大家分享吧

  2. 657129880@qq.co 于 2013-04-21 18:06:02发表:

    谢谢分享!!!