IPv6地址配置
實驗任務
(1)掌握如何在路由器及PC上配置IPv6地址
(2)掌握如何用IPv6 ping命令進行IPv6地址可達性檢查
(3)掌握如何用命令來查看IPv6地址配置
實驗過程
在RT上的配置
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]int g0/0
[H3C-GigabitEthernet0/0]dis ipv6 int g0/0
IP6Stack is not configured.
配置鏈路本地地址
[H3C-GigabitEthernet0/0]ipv6 address fe80::1 link-local
配置全球唯一地址
[H3C-GigabitEthernet0/0]ipv6 address 1::1 64
查看配置情況
[H3C-GigabitEthernet0/0]dis ipv6 int g0/0
GigabitEthernet0/0 current state: UP
Line protocol current state: UP
IPv6 is enabled, link-local address is FE80::1 [TENTATIVE]
Global unicast address(es):
1::1, subnet is 1::/64 [TENTATIVE]
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:1
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
Hosts use stateless autoconfig for addresses
在PC上的配置
安裝IPv6協議並啟用
C:\>netsh interface ipv6 install
確定。
C:\>netsh
netsh>interface ipv6
netsh interface ipv6>show interface
正在查詢活動狀態...
索引 Met MTU 狀態 名稱
---- ---- ----- ------------ -----
8 0 1500 已連接 本地連接 6
7 0 1500 已斷開 本地連接 5
6 0 1500 已斷開 無線網絡連接 2
5 0 1500 已連接 VirtualBox Host-Only Network
4 2 1280 已斷開 Teredo Tunneling Pseudo-Interface
3 1 1280 已連接 6to4 Pseudo-Interface
2 1 1280 已連接 Automatic Tunneling Pseudo-Interface
1 0 1500 已連接 Loopback Pseudo-Interface
查看自動配置的鏈路本地地址
C:\>ipconfig /all
Ethernet adapter 本地連接 6:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Loopback Adapter
Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Autoconfiguration IP Address. . . : 169.254.25.129
Subnet Mask . . . . . . . . . . . : 255.255.0.0
IP Address. . . . . . . . . . . . : fe80::4cff:fe4f:4f50%8
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
netsh interface ipv6>show address 8
正在查詢活動狀態...
接口 8: 本地連接 6
單一廣播地址 : fe80::4cff:fe4f:4f50
類型 : 鏈接
DAD 狀態 : 首選項
有效壽命 : infinite
首選壽命 : infinite
作用域 : 鏈接
前綴起源 : 著名
后綴起源 : 鏈路層地址
沒有找到項目。
netsh interface ipv6>add address 8 fe80::2
確定。
netsh interface ipv6>add address 8 1::2
確定。
netsh interface ipv6>show address 8
正在查詢活動狀態...
接口 8: 本地連接 6
單一廣播地址 : 1::2
類型 : 手動
DAD 狀態 : 首選項
有效壽命 : infinite
首選壽命 : infinite
作用域 : 全局
前綴起源 : 手動
后綴起源 : 手動
單一廣播地址 : fe80::2
類型 : 手動
DAD 狀態 : 首選項
有效壽命 : infinite
首選壽命 : infinite
作用域 : 鏈接
前綴起源 : 手動
后綴起源 : 手動
單一廣播地址 : fe80::4cff:fe4f:4f50
類型 : 鏈接
DAD 狀態 : 首選項
有效壽命 : infinite
首選壽命 : infinite
作用域 : 鏈接
前綴起源 : 著名
后綴起源 : 鏈路層地址
沒有找到項目。
測試IPv6地址可達性
在RT上測試PC
[H3C-GigabitEthernet0/0]ping ipv6 -i g0/0 fe80::2
Ping6(56 data bytes) FE80::1 --> FE80::2, press CTRL_C to break
56 bytes from FE80::2, icmp_seq=0 hlim=128 time=1.150 ms
56 bytes from FE80::2, icmp_seq=1 hlim=128 time=0.662 ms
56 bytes from FE80::2, icmp_seq=2 hlim=128 time=0.691 ms
56 bytes from FE80::2, icmp_seq=3 hlim=128 time=0.543 ms
56 bytes from FE80::2, icmp_seq=4 hlim=128 time=0.732 ms
--- Ping6 statistics for fe80::2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.543/0.756/1.150/0.207 ms
[H3C-GigabitEthernet0/0]%Oct 7 12:30:10:910 2016 H3C PING/6/PING_STATISTICS: Ping6 statistics for fe80::2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.543/0.756/1.150/0.207 ms.
[H3C-GigabitEthernet0/0]
[H3C-GigabitEthernet0/0]ping ipv6 -i g0/0 1::2
Ping6(56 data bytes) 1::1 --> 1::2, press CTRL_C to break
56 bytes from 1::2, icmp_seq=0 hlim=128 time=1.447 ms
56 bytes from 1::2, icmp_seq=1 hlim=128 time=0.708 ms
56 bytes from 1::2, icmp_seq=2 hlim=128 time=0.703 ms
56 bytes from 1::2, icmp_seq=3 hlim=128 time=0.691 ms
56 bytes from 1::2, icmp_seq=4 hlim=128 time=0.688 ms
--- Ping6 statistics for 1::2 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.688/0.847/1.447/0.300 ms
[H3C-GigabitEthernet0/0]%Oct 7 12:32:36:806 2016 H3C PING/6/PING_STATISTICS: Ping6 statistics for 1::2: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.688/0.847/1.447/0.300 ms.
[H3C-GigabitEthernet0/0]
[H3C-GigabitEthernet0/0]ping ipv6 -i g0/0 fe80::4cff:fe4f:4f50
Ping6(56 data bytes) FE80::1 --> FE80::4CFF:FE4F:4F50, press CTRL_C to break
56 bytes from FE80::4CFF:FE4F:4F50, icmp_seq=0 hlim=128 time=0.769 ms
56 bytes from FE80::4CFF:FE4F:4F50, icmp_seq=1 hlim=128 time=0.721 ms
56 bytes from FE80::4CFF:FE4F:4F50, icmp_seq=2 hlim=128 time=0.681 ms
56 bytes from FE80::4CFF:FE4F:4F50, icmp_seq=3 hlim=128 time=0.717 ms
56 bytes from FE80::4CFF:FE4F:4F50, icmp_seq=4 hlim=128 time=0.740 ms
--- Ping6 statistics for fe80::4cff:fe4f:4f50 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.681/0.726/0.769/0.029 ms
[H3C-GigabitEthernet0/0]%Oct 7 12:33:50:652 2016 H3C PING/6/PING_STATISTICS: Ping6 statistics for fe80::4cff:fe4f:4f50: 5 packets transmitted, 5 packets received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.681/0.726/0.769/0.029 ms.
在PC上測試RT
C:\Documents and Settings\Administrator>ping fe80::1%8
Pinging fe80::1%8 with 32 bytes of data:
Reply from fe80::1%8: time<1ms
Reply from fe80::1%8: time<1ms
Reply from fe80::1%8: time<1ms
Reply from fe80::1%8: time<1ms
Ping statistics for fe80::1%8:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Documents and Settings\Administrator>
C:\Documents and Settings\Administrator>ping 1::1
Pinging 1::1 with 32 bytes of data:
Reply from 1::1: time=1ms
Reply from 1::1: time<1ms
Reply from 1::1: time<1ms
Reply from 1::1: time<1ms
Ping statistics for 1::1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms