33
1 IPv6 建建 電電電電電電電 2009 電 9 電 24 電

1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

1

IPv6 建置

電算中心呂芳發 2009 年 9 月 24 日

Page 2: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

2©2009 Computer Center, National Central University.

為何要改用 IPv6

與 IPv4 相較之下 , IPv6 不但提供更多的位址數量 , 在安全性、便利性和傳輸效能等方面都有長足的進步 , 其中較為顯著的改進簡述如下:提供不虞匱乏的位址數量

• 依現有 ipv4 的消耗速度, ipv4 預計在 2011 年左右會用完• ipv4 可提供 232 個位址 ,ipv6 可提供 2128 個位址

具有自動設定( Auto-Configuration )機制• 由電腦自動向路由器取得 IPv6 位址

提升路由( Routing )效率

Page 3: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

3©2009 Computer Center, National Central University.

提升路由( Routing )效率

IPv4 封包的檔頭長度不固定 , 佔 20 ~ 60 Bytes, 包含 14 個欄位;而 IPv6 封包的檔頭長度固定為 40 Bytes, 欄位數量也減少為 8 個。

因此路由器在處理 IPv6 的封包時速率較快(省略判斷檔頭長度的動作) , 提升了路由效率。

Page 4: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

4©2009 Computer Center, National Central University.

IPv6 Address 表示方式

IPv4: 32bits,4Bytes ex: 140.115.1.1

IPv6: 128bits ex: 2001:288:3001:0:248:54ff:fe53:d3ee

Page 5: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

5©2009 Computer Center, National Central University.

IPv6 Address 表示方式

xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx

128 bits 固定長度 , 每 16 bits 以 : 隔開 , 共 8 個欄位

每一欄位開頭的 0 可省略Ex: 2001:288:3001:0:248:54ff:fe53:d3ee

Page 6: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

6©2009 Computer Center, National Central University.

IPv6 Address 表示方式 :: 可代表連續多個 0 的欄位 ( 僅可使用一次 )

2001:288:3001:0:0:0:0:1 = 2001:288:3001::1 0:0:0:0:0:0:0:1 = ::1 0:0:0:0:0:0:0:0 = :: 2001:0:0:345:0:0:0:1 = 2001:0:0:345::1

上列的『 :: 』(雙冒號)表示其中包含連續、數量不固定的 0, 也正因為如此 , 如果出現兩個『 :: 』 , 就會讓人搞不清楚實際代表的 IPv6 位址 , 例如:

2001::5688::ABCD 可能是 2001:0:0:5688:0:0:0:ABCD 或 2001:0:0:0:0:5688:0:ABCD 。

Page 7: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

7©2009 Computer Center, National Central University.

IPv6 位址的格式

在 IPv6 位址的 128 bits 之中 , 通常有 N bits 為首碼( Prefix ):

Page 8: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

8©2009 Computer Center, National Central University.

IPv6 位址的格式

另一種常見的 IPv6 位址表示法是『 IPv6 位址 / 首碼長度』 , 亦即在 IPv6 位址之後加上『 / 首碼長度』 , 例如:2001:288:3000:1::254/64

Page 9: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

9©2009 Computer Center, National Central University.

IPv6 -- 定址模式

link local IP 只是其中的一種, link local IP是自己產生的,只要你有啟動 IPv6 功能

設定的應該是屬於 global IP ,另外, link local 只能使用在直接相連在同ㄧ區網上的主機。

Page 10: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

10©2009 Computer Center, National Central University.

IPv6 -- 定址模式

Link local: FE80::/10

Site local: FEC0::/10

Global: 2000::/3

Page 11: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

11©2009 Computer Center, National Central University.

Local-Use AddressLocal-Use Address

Link Local: Not forwarded outside the link,

FE80::xxx

Site Local: Not forwarded outside the site,

FEC0::xxx

bits

1111 1110 10 0 Interface ID 1111 1110 10 0 Interface ID 10 54 64

1111 1110 11 0 Subnet ID Interface ID1111 1110 11 0 Subnet ID Interface IDbits3810 16 64

Page 12: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

12©2009 Computer Center, National Central University.

IPv6 的自動設定機制

Page 13: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

13©2009 Computer Center, National Central University.

產生介面位址

MAC 位址的格式 , 前 24 bits 代表製造廠商;後 24 bits 代表流水號。

但是後來 IEEE 制訂了另一種新的位址格式 , 將流水號所佔的長度擴充為 40 bits, 這種總長度為 64 bits 的 MAC 位址稱為 EUI ( Extended Unique Identifier ) -64 位址。

在自動設定的過程中 , 會根據 48 bits 的 MAC 位址產生 EUI-64 位址 , 再將 EUI-64 位址轉換為 IPv6 的介面位址

Page 14: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

14©2009 Computer Center, National Central University.

產生介面位址

Page 15: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

15©2009 Computer Center, National Central University.

產生介面位址

『自動設定』機制便是利用上述方式 , 以網路卡的 MAC 位址產生 EUI-64 位址 , 再把 EUI-64 位址轉換為介面位址。有了首碼和介面位址 , 就等於有了 IPv6 位址。

Page 16: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

16©2009 Computer Center, National Central University.

IPv6 的自動設定機制

以 FE80 開頭必定是 Link-Local IPv6 位址 , 主要是作為『自動設定』過程中 , 暫時使用的首碼。

到了後續步驟 , 電腦從路由器獲得另一組首碼後 , 就會取代掉 FE80 。

Page 17: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

17©2009 Computer Center, National Central University.

NCU ipv6 分配

Page 18: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

18©2009 Computer Center, National Central University.

Windows xp

Windows XP IPv6 安裝 執行 ipv6 install

檢查 IPv6 位址 執行 ipconfig /all

Page 19: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

19©2009 Computer Center, National Central University.

Windows xp

Page 20: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

20©2009 Computer Center, National Central University.

Windows vista

Page 21: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

21©2009 Computer Center, National Central University.

Windows vista

Page 22: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

22©2009 Computer Center, National Central University.

Windows 2003

Page 23: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

23©2009 Computer Center, National Central University.

Windows 2003

Page 24: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

24©2009 Computer Center, National Central University.

Enabling IPv6 support:

/etc/sysconfig/network file:

NETWORKING_IPV6=“YES”

Enabling IPv6 support on a particular interface:

/etc/sysconfig/network-scripts/ifcfg-etho file:

IPV6INIT=“yes”

Configure IPv6 interface address:

/etc/sysconfig/network-scripts/ifcfg-etho file:

IPV6ADDR=2001:288:3001:1::50

Default Gateway:

/etc/sysconfig/network-scripts/ifcfg-etho file:

IPV6_DEFAULTGW=2001:288:3001:1::254

Linux

Page 25: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

25©2009 Computer Center, National Central University.

/etc/rc.conf file:ipv6_enable="YES"

ipv6_ifconfig_fxp0="2001:288:3000:227::50 prefixlen 64"

defaultrouter="2001:288:3000:227::14"

Freebsd

Page 26: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

26©2009 Computer Center, National Central University.

DNS 啟用 IPv6

/etc/namedb/named.confoptions { listen-on-v6 { any; };};

Disableoptions { listen-on-v6 { none; };};

Page 27: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

27©2009 Computer Center, National Central University.

IPv6 zone file sample(1)

/etc/namedb/named.confzone “tyc.edu.tw” { type master; file “tyc.zone”;};

zone "0.0.0.3.8.8.2.0.1.0.0.2.ip6.arpa" {

type master;

file "tyc.rev";

};

Page 28: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

28©2009 Computer Center, National Central University.

IPv6 zone file sample(2)

tyc.zone@ IN SOA noc4.tyc.edu.tw. postmaster.noc4.tyc.edu.tw. (

2009102501; Serial

3600 ; Refresh

600 ; Retry

604800 ; Expire

1200 ) ; Minimum

IN NS noc4.tyc.edu.tw.

noc4 IN AAAA 2001:288:3000:227:230:48ff:fe2e:e5c4

coco IN AAAA 2001:288:3000:163:202:b3ff:fe50:e8d4.

.

.

Page 29: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

29©2009 Computer Center, National Central University.

IPv6 zone file sample(3)

tyc.rev@ IN SOA noc4.tyc.edu.tw. root.noc4.tyc.edu.tw. (

2009102901 ; Serial

3600 ; Refresh

600 ; Retry

604800 ; Expire

1200 ) ; Minimum

IN NS noc4.tyc.edu.tw.

;

;

$ORIGIN 3.6.1.0.0.0.0.3.8.8.2.0.1.0.0.2.ip6.arpa.

4.d.8.e.0.5.e.f.f.f.3.b.2.0.2.0 IN PTR coco.tyc.edu.tw.

$ORIGIN 7.2.2.0.0.0.0.3.8.8.2.0.1.0.0.2.ip6.arpa.

4.c.5.e.e.2.e.f.f.f.8.4.0.3.2.0 IN PTR noc4.tyc.edu.tw.

Page 30: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

30©2009 Computer Center, National Central University.

IPv6 DNS Test

nslookup -type=AAAA hostname

ping6 addressv6

traceroute6 addressv6

Page 31: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

31©2009 Computer Center, National Central University.

Page 32: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

32©2009 Computer Center, National Central University.

Ipv6 test

http://audp.tyc.edu.tw/TycWiki/pmwiki.php?n=Main.IPv6Testing

http://coco.tyc.edu.tw/IPv6/ip.php

ping 2001:288:3000:163:202:b3ff:fe50:e8d4

tracert -d 2001:288:3000:163:202:b3ff:fe50:e8d4

http://[2001:288:3000:163:202:b3ff:fe50:e8d4]

Page 33: 1 IPv6 建置 電算中心呂芳發 2009 年 9 月 24 日. ©2009 Computer Center, National Central University. 2 為何要改用 IPv6 與 IPv4 相較之下, IPv6 不但提供更多的位址數

33©2009 Computer Center, National Central University.

Thank You!