1.準備機器
三台PC機器,通過1個hub連接配接,1台windows,安裝成雙網卡,1個網卡連接配接外網,1個網卡連接配接IPv6環網。系統版本:xp sp3 for japan
2台linux機器。作業系統版本:
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-no arch:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.0 (Santiago) Release: 6.0 Codename: Santiago |
2.Windows機器上的操作步驟
1)安裝ipv6協定棧
操作指令如下: C:\Documents and Settings\Administrator>cd \ cd \ C:\> IPv6 install 驗證: C:\>ipconfig | find "fe80"------如果出現fe80的本地鍊路位址,就表明成功安裝 |
2)連到環網網卡手動添加ipv6 global位址
此處是2塊網卡,确定連到環網的網卡很重要。通常的,安裝IPv6協定棧後,一塊網卡預設網絡接口有4個,但是有的時候顯示多個,是因為其中一塊網卡
禁掉了IPv4或者有多塊網卡。
interface 1用于回環接口,
interface 2用于自動隧道虛拟接口,
interface 3用于6to4隧道虛拟接口,
interface 4用于正常的網絡連接配接接口,即IPv6位址的單點傳播接口。
檢視網卡接口:
C:\>ipv6 if | find "Interface" Interface 5: Ethernet: Network Connect Adapter Interface 4: Ethernet: ローカル エリア接続 Interface 3: 6to4 Tunneling Pseudo-Interface Interface 2: Automatic Tunneling Pseudo-Interface Interface 1: Loopback Pseudo-Interface |
3)給指定接口配置IPv6位址,操作樣例如下:
C:\>IPv6 adu 4/3eff:124e::1 //給索引号為4的接口界面配置IPv6位址3eff:124e::1,同樣的可以把這個改成其他的global位址 驗證: C:\>ping6 2000:3440::1 出現如下資訊,即表示配置成功: Pinging 2000:3440::::1 from 2000:3440::::1 with 32 bytes of data: Reply from 2000:3440::1: bytes=32 time<1ms Reply from 2000:3440::1: bytes=32 time<1ms Reply from 2000:3440::1: bytes=32 time<1ms |
4)打開接口4的ipv6轉發功能
C:\>IPv6 ifc 4 forwards |
5)修改windows的路由表項
示例如下: C:\> IPv6 rtu 2000:3440::/64 4 //為接口4添加一條路由 |
3.linux機器上的操作步驟
1)禁用IPv4(可以不禁用)
2)然後使用ping6分别對鍊路位址和回環位址進行ping6驗證
①[root@RHEL62GA ~]# ping6 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.028 ms 64 bytes from ::1: icmp_seq=2 ttl=64 time=0.019 ms 2000:3440::64 bytes from ::1: icmp_seq=3 ttl=64 time=0.018 ms ②[root@RHEL62GA ~]# ping6 -I eth0 fe80::219:99ff:fe97:7570 PING fe80::219:99ff:fe97:7570(fe80::219:99ff:fe97:7570) from fe80::219:99ff:fe97:7570 eth0: 56 data bytes 64 bytes from fe80::219:99ff:fe97:7570: icmp_seq=1 ttl=64 time=0.034 ms 64 bytes from fe80::219:99ff:fe97:7570: icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from fe80::219:99ff:fe97:7570: icmp_seq=3 ttl=64 time=0.045 ms 64 bytes from fe80::219:99ff:fe97:7570: icmp_seq=4 ttl=64 time=0.046 ms |
3)給網卡添加IPv6 global位址 (預設網卡裝置名為eth0,根據實際情況酌情換成eth1或者eth2等)
①ifconfig eth0 add 2000:3440::2/64 ②然後進行回環驗證: [root@RHEL62GA ~]# ping6 2000:3440::2 PING 2000:3440::2(2000:3440::2) 56 data bytes 64 bytes from 2000:3440::2: icmp_seq=1 ttl=64 time=0.024 ms 64 bytes from 2000:3440::2: icmp_seq=2 ttl=64 time=0.033 ms 64 bytes from 2000:3440::2: icmp_seq=3 ttl=64 time=0.034 ms ③最後進行3台機器的對ping 注:如果添加錯誤,需要删除: ifconfig eth0 del 2000:3440::2/64 |
4.如何判定三台機器是連通的
當然對ping也可以,檢視所有接口的鄰居緩存,類似于ipv4中的arp緩存(筆者的了解是使用ipv6 nc檢視ipv6的臨節點,如果環網中的機器硬體位址和狀态列比對,就說明三者可以連通的)
C:\>ipv6 nc 5: fe80::2ff:30ff:fea7:6c89 incomplete 4: fe80::4637:e6ff:fe29:d451 44-37-e6-29-d4-51 permanent 2: fe80::5efe:10.167.228.103 127.0.0.1 permanent 1: fe80::1 permanent 1: ::1 permanent 4: 2000:3440::::1 00-AC-01-02-03-58 stale 4: 2000:3440::::2 00-BC-01-ad-03-58 stale 4: 2000:3440::::2 00-BC-02-ad-03-58 permanent |
5.如何使用用戶端通過IPV6位址的形式連接配接linux伺服器
windows遠端操作伺服器的用戶端,這裡推薦使用putty6。windows往linux機器上傳輸東西的話,推薦使用winscp3或者使用mount –t cifs(這點在RHEL5上不行,RHEL6暫時未知),當然其他的ftp工具也是可以的,比如psftp。關鍵step如下,putty界面如圖所示:
連接配接的setting設定成Auto或者IPv6,一般預設為Auto。
最後
這是多年前發表在chinaunix上的一篇舊文,部落格園搬家功能暫不支援chinaunix,故手動搬家。謝絕轉載。
原文連結:http://blog.chinaunix.net/uid-22516838-id-3145384.html