您现在的位置: 万盛学电脑网 >> 网络安全 >> 网络应用技术 >> 应用教程 >> 正文

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

作者:佚名    责任编辑:admin    更新时间:2022-06-22

  Q:IPv6 协议在各操作系统下de安装与配置
  A:本文将为大家介绍如何在 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的路由器http://www.woaidiannao.com。它们之间要么在链路层直接相通,要么经过其他的支持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也是如此。因此,当一