1. 程式人生 > >IPv6協議在各作業系統下的安裝與配置

IPv6協議在各作業系統下的安裝與配置

本文將為大家介紹如何在Redhat Linux 9作業系統、Windows 2000 Server作業系統、indows 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的配置。

  其它網路連通性測試的操作與以上所述的原理一樣,就不在贅述。

  希望本篇文章能夠給讀者在下一代網際網路(NGN,Next Generation Network)核心協議--IPv6協議方面帶來一些興趣。