IP : IP 版本 6 (IPv6)

了解IPv6链路本地地址

2015 年 8 月 28 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 4 月 23 日) | 反馈


目录


简介

本文目的将提供对在网络的IPv6链路本地地址的了解。链路本地地址是使用链路本地前缀FE80::/10的IPv6单播地址(1111 1110 10)和在已修改EUI-64格式的接口标识符在所有接口可以自动地配置。链路本地地址不一定一定对MAC地址(配置在EUI-64格式)。使用IPv6地址链路本地命令,链路本地地址在FE80::/10格式可能手工也配置。

这些地址仅参考一条特定的物理链路和使用寻址在目的单条链路例如自动地址配置和邻居发现协议。链路本地地址可以用于到达相邻节点附加对同一条链路。节点不需要一个全局唯一地址传递。使用链路本地地址,路由器不会转发数据包。IPv6路由器不能转发有链路本地来源或目的地址对其他链路的数据包。所有IPv6启用接口有链路本地单播地址。

先决条件

要求

保证您有IPv6编址方案知识,在您尝试此配置前。

使用的组件

本文档不限于特定的软件和硬件版本。

在本文的配置根据Cisco 3700系列路由器用Cisco IOS�软件版本12.4 (15)T1。

规则

有关文档规则的详细信息,请参阅 Cisco 技术提示规则

配置

在本例中,路由器R1, R2和R3通过serial interfaces连接并且有IPv6地址配置按照网络图所述。环回地址在路由器R1和R3配置,并且路由器使用OSPFv3彼此连通。此示例使用ping命令展示使用链路本地地址的路由器之间的连接。路由器R1和R3能互相ping与IPv6全球单播地址,但是不与他们的链路本地地址。然而,因为链路本地地址在网络细节该的本地内仅使用对物理接口,直接地连接对R1和R3的路由器R2能用使用他们的链路本地地址的两路由器连通。

注意: 有关本文档所用命令的详细信息,请使用命令查找工具仅限注册用户)。

网络图

本文档使用以下网络设置:

http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6-ipv6/113328-ipv6-lla-01.gif

配置

本文档使用以下配置:

这是链路到展示IPv6链路本地地址leavingcisco.com 和全球单播地址之间的关键区别在Cisco IOS路由器的视频(在Cisco支持社区的联机) :

了解IPv6链路本地地址leavingcisco.com

http://www.cisco.com/c/dam/en/us/support/docs/ip/ip-version-6-ipv6/113328-ipv6-lla-02.gif

路由器 R1
!
hostname R1
!
ipv6 cef
!
ipv6 unicast-routing
!
interface Loopback10
 no ip address
 
 ipv6 address 2010::/64 eui-64

!--- Assigned a IPv6 unicast address in EUI-64 format.

  ipv6 ospf 1 area 1

!--- Enables OSPFv3 on the interface and associates
 the interface looback10 to area 1.

!
interface Loopback20
 no ip address
 
 ipv6 address 2020::/64 eui-64
 ipv6 ospf 1 area 2

!--- Associates the Interface loopback20 to area 2.

!
interface Serial0/0
 no ip address
 
 ipv6 address 2001::1/124
 ipv6 ospf 1 area 0

!--- Associates the Interface serial0/0 to area 0.

 clock rate 2000000
!
ipv6 router ospf 1
 router-id 1.1.1.1

!--- Router R1 uses 1.1.1.1 as router id.

 log-adjacency-changes
!
end

路由器 R2 路由器 R3
hostname R2
!
ipv6 cef
!
!
!
!
ipv6 unicast-routing
!
!
!
interface Serial0/0
 no ip address
 
 ipv6 address 2001::2/124
 ipv6 ospf 1 area 0
 clock rate 2000000
!
!
interface Serial0/1
 no ip address
 
 ipv6 address 2002::1/124
 ipv6 ospf 1 area 0
 clock rate 2000000
!
!
!
ipv6 router ospf 1
router-id 2.2.2.2
log-adjacency-changes
!
end
!
hostname R3
!
ipv6 cef
!
ipv6 unicast-routing
!
interface Loopback10
 no ip address
 
 ipv6 address 1010::/64 eui-64
 ipv6 ospf 1 area 1
!
interface Loopback20
 no ip address
 
 ipv6 address 2020::/64 eui-64
 ipv6 ospf 1 area 2
!
interface Serial0/0
 no ip address
 
 ipv6 address FE80::AB8 link-local
 ipv6 address 2002::2/124
 ipv6 ospf 1 area 0
 clock rate 2000000
!
ipv6 router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
!
end

验证

检验 OSPF 的配置

使用本部分可确认配置能否正常运行。

为了验证OSPF在路由器R1和R3适当地配置,使用ospf命令的show ipv6 route

show ipv6 route ospf
路由器 R1
R1#show ipv6 route ospf
IPv6 Routing Table - 10 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
OI  1010::C002:1DFF:FEE0:0/128 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0
O   2002::/124 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0
OI  2020::C002:1DFF:FEE0:0/128 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0
路由器 R3
R3#show ipv6 route ospf
IPv6 Routing Table - 10 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
O   2001::/124 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0
OI  2010::C000:1DFF:FEE0:0/128 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0
OI  2020::C000:1DFF:FEE0:0/128 [110/128]
     via FE80::C001:1DFF:FEE0:0, Serial0/0

正在验证的链路本地地址可接通性

路由器能互相ping与全球单播地址。然而,当曾经链路本地地址仅时连接的网络能直接地通信。例如, R1能ping R3使用全球单播地址使用链路本地地址,但是两路由器不能连通。使用ping调试IPv6 icmp in命令路由器R1和R3,这显示。此部分提供方案开发一更加好了解关于链路本地地址。

ping从远程网络的链路本地地址

使用链路本地地址时,当路由器R1设法用路由器R3连通,路由器R1返回与表明的ICMP超时消息链路本地地址本地特定,并且不能通信到直接地连接的网络的外部的链路本地地址。

ping从路由器R1的R3's链路本地地址
在路由器 R1 中
R1#ping FE80::AB8

!--- Pinging Link-Local Address of router R3.

Output Interface: serial0/0

!--- To ping LLA, output interface must be entered.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::AB8, timeout is 2 seconds:
Packet sent with a source address of FE80::C000:1DFF:FEE0:0
.....
Success rate is 0 percent (0/5)

!--- The ping is unsuccessful and the ICMP packet cannot reach
the destination through serial0/0. This timeout indicates that R1 has not
received any replies from the router R3.

直接ping从连接的网络的链路本地地址

对于路由器R2,路由器R1和R3直接地连接并且能通过提及连接到路由器的对应接口ping路由器R1和R2链路本地地址。输出显示此处:

ping R1从路由器R2的链路本地地址
在路由器 R2 中
R2#ping FE80::C000:1DFF:FEE0:0

!--- Pinging Link-Local Address of router R1.

Output Interface: serial0/0

!--- Note that, to ping LLA, output interface should be mentioned
In our case, R2 connects to R1 via serial0/0.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::C000:1DFF:FEE0:0, timeout is 2 seconds:
Packet sent with a source address of FE80::C001:1DFF:FEE0:0
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/19/56 ms
从R1的Debug输出
R1#
*Mar  1 03:59:53.367: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.371: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.423: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.427: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.463: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.463: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.467: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.467: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
R1#
*Mar  1 03:59:53.471: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 03:59:53.471: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0

!--- The debug output shows that the router R2 can
ping router R1's link-local address.

ping R3从路由器R2的链路本地地址
在路由器 R2 中
R2#pingFE80::AB8 

!--- Pinging Link-Local Address of router R3.

Output Interface: serial0/1

!--- Note that,to ping LLA,output interface should be mentioned.
In our case, R2 connects to R3 throught serial0/1.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::AB8, timeout is 2 seconds:
Packet sent with a source address of FE80::C001:1DFF:FEE0:0
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/18/60 ms
从R3的Debug输出
R3#
*Mar  1 04:12:11.518: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.522: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.594: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.598: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.618: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.618: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.622: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.622: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
R3#
*Mar  1 04:12:11.626: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 04:12:11.630: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0

!--- The debug output shows that the router R2 can
ping router R3's link-local address.

链路本地地址作为名称暗示,是仅特定对该本地网络。换句话说,路由器能有同一个链路本地地址,并且连接的网络能与彼此直接地仍然联络,不用任何冲突。这不会是相同的在全球单播地址的情况下。全球单播的地址可路由的应该是唯一在网络。show ipv6 interface brief命令显示关于链路本地地址的信息在接口。

show ipv6 interface brief
在路由器 R1 中
R1#show ipv6 interface brief
Serial0/0                  [up/up]
    FE80::AB8
    2001::1
Loopback10                 [up/up]
    FE80::C000:1DFF:FEE0:0
    2010::C000:1DFF:FEE0:0
Loopback20                 [up/up]
    FE80::C000:1DFF:FEE0:0
    2020::C000:1DFF:FEE0:0
在路由器 R3 中
R3#show ipv6 interface brief

Serial0/0                  [up/up]
    FE80::AB8
    2002::2
Loopback10                 [up/up]
    FE80::C002:1DFF:FEE0:0
    1010::C002:1DFF:FEE0:0
Loopback20                 [up/up]
    FE80::C002:1DFF:FEE0:0
    2020::C002:1DFF:FEE0:0

!--- Shows that R1 and R3's serial interface has same 
link-local address FE80::AB8.

在本例中, R1和R3分配与同一个链路本地地址,并且R2能通过指定对应的输出接口仍然到达两路由器。

ping R1和R3's链路本地地址从R2
ping从R2的R1的链路本地地址
R2#ping FE80::AB8
Output Interface: serial0/0

!--- R2 is connected to R1 through serial0/0.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::AB8, timeout is 2 seconds:
Packet sent with a source address of FE80::C001:1DFF:FEE0:0
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/26/92 ms
从R1的Debug输出
R1#
*Mar  1 19:51:31.855: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.859: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.915: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.919: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.947: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.947: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.955: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.955: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
R1#
*Mar  1 19:51:31.955: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:51:31.955: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
ping从R2的R3's链路本地地址
R2#ping FE80::AB8
Output Interface: serial0/1

!--- R2 is connected to R1 through serial0/1.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::AB8, timeout is 2 seconds:
Packet sent with a source address of FE80::C001:1DFF:FEE0:0
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/28/76 ms
从R3的Debug输出
R3#
*Mar  1 19:53:38.815: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.819: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.911: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.915: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.923: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.927: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.955: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.955: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0
R3#
*Mar  1 19:53:38.963: ICMPv6: Received echo request from FE80::C001:1DFF:FEE0:0
*Mar  1 19:53:38.963: ICMPv6: Sending echo reply to FE80::C001:1DFF:FEE0:0

注意: 只有因为他们直接地连接, R2能ping R1和R3链路本地地址。因为他们没有直接地连接, R2不能ping回环接口的链路本地地址在路由器R1和R3的。Ping仅直接地研究链路本地地址在连接的网络的情况下。

注意: 追踪途径不在链路本地地址的情况下工作并且返回与%目的地的有效的来源源点地址。错误消息。这是因为IPv6路由器不能转发有链路本地来源或目的地址对其他链路的数据包。

相关的思科支持社区讨论

思科支持社区是您提问、解答问题、分享建议以及与工作伙伴协作的论坛。


相关信息


Document ID: 113328