分享

IPv6 OSPFv3路由协议

 海漩涡 2016-06-23
转自:http://xuanbo.blog.51cto.com/499334/200447
IPv6
OSPFv3路由协议
 

3.1      IPv6 OSPFv3

3.1.1 OSPFv3 VS OSPFv2

OSPF路由协议是链路状态型路由协议,这里的链路即设备上的接口。链路状态型路由协议基于连接源和目标设备的链路状态作出路由的决定。链路状态是接口及其与邻接网络设备的的关系的描述,接口的信息即链路的信息,也就是链路的状态(信息)。这些信息包括接口的IPv6前缀(prefix)、网络掩码、接口连接的网络(链路)类型、与该接口在同一网络(链路)上的路由器等信息。这些链路状态信息由不同类型的LSA携带,在网络上传播。
路由器把收集到的LSA存储在链路状态数据库中,然后运行SPF算法计算出路由表。链路状态数据库和路由表的本质不同在于:数据库中包含的是完整的链路状态原始数据,而路由表中列出的是到达所有已知目标网络的最短路径的列表。
OSPF协议是为IP协议提供路由功能的路由协议。OSPFv2OSPF版本2)是支持IPv4的路由协议,为了让OSPF协议支持IPv6,技术人员开发了OSPFv3OSPF版本3),OSPFv3RFC2740定义。
无论是OSPFv2还是OSPFv3OSPF协议的基本运行原理是没有区别的,然而,由于IPv4IPv6协议意义的不同,地址空间大小的不同,它们之间的不同之处也是必然存在的。
相似之处
  路由器类型相同
2  包括内部路由器(internal router)、骨干路由器(backbone router)、区域边界路由器(area border router)和自治系统边界路由器(autonomous system boundary router)。
  支持的区域类型相同
2  包括骨干区域、标准区域、末节区域、NSSA和完全末节区域。
  路由计算方法相同
2  都使用SPF算法。
  DR选举机制相同
2  DRBDR的选举过程相同。
  网络类型相同
2  包括点到点链路、点到多点链路、多路访问、NBMA链路和虚拟链路。
  邻居和邻居形成机制相同
2  OSPF 路由器启动后,便会通过OSPF接口向外发送Hello 报文,收到Hello 报文的OSPF 路由器会检查报文中所定义的参数,如果双方一致就会形成邻居关系。形成邻居关系的双方不一定都能形成邻接关系,这要根据网络类型而定,只有当双方成功交换DBD 报文,交换LSA 并达到LSDB 的同步之后,才形成真正意义上的邻接关系。
2  LSA的传播和老化机制相同。
  基本数据包类型相同
2  都使用HelloDBDLSRLSULSA
 
不同之处
  术语不同
2  OSPFv3中,用"链路(link"取代了OSPFv2中的"网络(network""子网(subnet"的概念。
  路由进程运行方式不同
2  OSPFv3进程运行在链路上,
2  OSPFv2进程运行在子网上。
  链路多实例复用
2  OSPFv3支持链路多实例复用,一条链路上可以运行多个OSPF实例(instance)。例如,可以使用两个实例让一条链路运行在两个区域内。
2  OSPFv2不支持链路多实例复用
  Router ID唯一标识邻居
2  OSPFv2中,当网络类型为点到点或者通过虚连接与邻居相连时,通过Router ID来标识邻居路由器,当网络类型为广播或NBMA时,通过邻居接口的IP地址来标识邻居路由器。
2  OSPFv3取消了这种复杂性,无论对于何种网络类型,都是通过Router ID来唯一标识邻居。
  认证方式不同
2  OSPFv3协议自身不再提供认证功能,而是通过使用IPv6提供的安全机制来保证自身报文的合法性。所以,OSPFv2报文中的认证字段,在OSPFv3报文头中被取消。
2  OSPFv2自身提供认证功能
  报文不同
2  OSPFv3报文封装在IPv6报文中,每一种类型的报文都是以一个16字节的报文头部开始。
2  OSPFv3的报文头、HelloDBD以及LSR报文中的字段与OSPFv2有差别。
  LSA类型不同
2  OSPFv2相比,OSPFv3新增了Link LSAIntra Area Prefix LSA
  LSA的泛洪范围
2  LSA的泛洪范围已经被明确地定义在LSALS Type字段,目前,有三种LSA泛洪范围。
2  链路本地范围:LSA 只在本地链路上泛洪,不会超出这个范围,该范围适用于新定义的Link LSA
2  区域范围:LSA 的泛洪范围仅仅覆盖一个单独的OSPFv3 区域。Router LSANetwork LSAInter Area Prefix LSAInter Area Router LSA Intra Area Prefix LSA 都是区域范围泛洪的LSA
2  自治系统范围:LSA 将被泛洪到整个路由域,AS External LSA 就是自治系统范围泛洪的LSA
  支持对未知类型LSA的处理
2  OSPFv2中,收到类型未知的LSA将直接丢弃
2  OSPFv3LSALS Type字段中增加了一个U比特位来位标识对未知类型LSA的处理方式:
2  如果U 比特置1,则对于未知类型的LSA 按照LSA 中的LS Type 字段描述的泛洪范围进行泛洪;
2  如果U 比特置0,对于未知类型的LSA 仅在链路范围内泛洪。
  Stub区域的支持
2  由于OSPFv3支持对未知类型LSA的泛洪,为防止大量未知类型LSA泛洪进入Stub区域,对于向Stub区泛洪的未知类型LSA进行了明确规定,只有当未知类型LSA的泛洪范围是区域或链路而且U比特没有置位时,未知类型LSA才可以向Stub区域泛洪。
  Option字段不同
2  OSPFv2中,Option字段出现在每一个Hello报文、DD报文以及每一个LSA中。
2  OSPFv3中,Option字段只在Hello报文、DD报文、Router LSA Network LSAInter Area Router LSA以及Link LSA中出现。
  LSA报文格式不同
 

3.1.2 OSPFv3协议数据结构

 
OSPFv3协议直接运行在IPv6上,因此,OSPFv3的数据由IPv6报文携带。在IPv6报文头的'下一个报文头'字段中,用协议号89代表该数据包中携带的是OSPFv3的数据。
紧跟着IPv6报文头的后面是OSPFv3的报文首部,其格式如下图所示。
 
OSPFv3首部报文结构:
如下图所示:
 
其中:
  Version——代表OSPF的版本号,其值为3
  Type ——代表OSPF数据报类型。OSPF数据报的类型包括:
n  Hello包,类型代码为1
n  DBD,类型代码为2
n  LSR,类型代码为3
n  LSU,类型代码为4
n  LSAck,类型代码为5
  Packet length——以字节为单位的OSPF数据报的长度,包含报头部分。
  Router ID——发送该数据包的路由器ID号。
  Area ID ——该数据报所属的区域。
  Checksum——整个OSPF数据报的校验和。
  Instance ID——实例标志号。
  Reservation——OSPFv3报头的最后8比特保留,值总为0
 
下图是使用ethereal采集到的报文。
 
Hello报文结构
如下图所示:
 
  Interface ID——接口标志符。路由器的每一个接口都有一个唯一的标志符。
  Router priority——路由器优先级。路由器根据该值选举DRBDR
  Options——该24比特字段出现在Hello包、DBD和某些LSA中,OSPF路由器使用该字段实现某些与其他路由器通信的能力(详见RFC2740)。
  Hello interval——发送Hello包的周期时间。
  Router dead interval——邻居路由器认为该路由器的失效时间。
  Designated router ID——DR路由器的ID
  Backup designated router ID——BDR路由器的ID
  Neighbors ID——邻居列表。每个邻居ID4字节。
 
如下图所示:







Database Description报文结构
如下图所示:
clip_image002
报文字段的含义:
Options——该24比特字段出现在Hello包、DBD和某些LSA中,OSPF路由器使用该字段实现某些与其他路由器通信的能力(详见RFC2740)。
Interface MTU——接口MTU值。
I-bit——当设置为1,这个包是该数据库描述数据包序列的第一个。
M-bit——当设置为1,则表明后续会有更多的数据库描述数据包。
MS-bit——主/从位。当设置为1,则表明该路由器是主路由器。否则,路由器是从路由器。
DD sequence number——来标识一组DBD包。当第一个发送DBD包(也就是说该DBD包中的I位被置为1,我们可以认为往往第一个DBD包一定是由Master 发的)时,该DD sequence number字段开始被使用,在往后的DBD包中的DD sequence number都会递增1。
如下图所示:
clip_image004
Options 字段结构,
如下图所示
clip_image006
DC比特——当始发路由器具有支持按需电路上的0sPF的能力时,该位将被设置。
R 比特——用来标识设备是否是具备转发能力的路由器。如果R 比特置0,宣告该节点的路由信息将不会参加路由计算,如果当前设备是一个不想转发非本地地址的报文,可以将R 比特置0。
N位——只用在HeIlo数据包中。一台路由器设置N葫←l表明它支持NssA外部LsA。如果设置N=o,那么路由器将不接受和发送NssA外部 LsA。邻居路由器如果错误配置了N位,将不会形成邻接关系,这个限制可以确保一个区域内的所有路由器都同样地具有支持NssA的能力。如果N=1时,E 必须设置为0。
MC位——当始发路由器具有转发IP组播数据包的能力时,该位将被设置。这一位使用在MOsPF协议当中。
E位——当始发路由器具有接受As外部LsA的能力时,该位将被设置。在所有的As外部LSA和所有始发于骨干区域以及非末梢区域的LsA中,该位将设置 为1。而在所有始发于末梢区域的LsA当中,该位设置为0。另外,可以在Hello数据包中使用该位来表明一个接口具有接收和发送类型5的LsA的能力。 E讪t配置错误的邻居路由器将不能形成邻接关系,这个限制可以确保—个区域的所有路由器都同样地具有支持末梢区域的能力。
V 比特——如果V 比特置0,该路由器或链路也不会参加路由计算。
Link State Request报文结构
如下图所示:
clip_image008
LSR中使用以下信息来唯一地标识要请求的LSA:
链路状态(LS)类型号。
LS标识。
通告路由器。
如下图所示:
clip_image010
Link State Update报文结构
如下图所示:
clip_image012
链路状态更新(LSU)报文用于把LSA发送给它的邻居,这些更新报文是用于对LSA请求的应答。一个LSU中可以包括多个LSA条目。
如下图所示:
clip_image014
clip_image016
Link State Acknowledgment报文结构
如下图所示:
clip_image018
LSAck报文唯一地标识其要应答的LSA报文。标识以包含在LSA头中的信息为基础,包括LS顺序号和通告路由器。LSA与应答报文之间无需1对1的对应关系。多个LSA可以用一个报文来应答。
如下图所示:
clip_image020
LSA头报文结构
如下图所示:
clip_image022
所有的LSA使用一个通用的头格式。这个头20字节长并附加于标准的24字节OSPF头后面。LSA头惟一地标识了每种LSA。所以,它包括关于LSA类型、链路-状态ID及通告路由器ID的信息。
下面是LSA头域,其具体字段含义:
LS age——LSA头中的前两个字节包含LSA的年龄(age)。这个年龄是自从LSA产生时已消逝的秒数。
LS type——指出9种LSA类型中的一种。每种LSA类型的格式是不同的。
Link State ID——链路状态ID域4字节长用于指明LSA描述的特定网络环境区域。实际上,这个域的内容直接依赖于LS类型。比如,在路由器LSA中,链路状态ID包含产生了这个报文的OSPF路由器ID。
Advertising Router——通告路由器。该字段填入生成该LSA的路由器的Router ID。
LS sequence number——表示该LSA的序列号,OSPF路由器在刷新LSA时会递增每个LSA报文的序列号。接收路由器可以根据序列号来判断该实力是否是最新的LSA实例。
LS Checksum——校验和用于检查LSA在传输到目的地的过程中是否受到破坏。校验和采用简单的数学算法。它的输出结果依赖于其输入,并且有高度的一致 性。给定相同的输入,校验和算法总是给出相同的输出。LS校验和域使用部分LSA报文内容(包括头,不包括LS年龄和校验和域)来生成校验和值。源节点运 行Fletcher算法并把结果存于LS校验和域中。目的节点执行相同的算法并把结果与存储在校验和域中的结果比较,如果两个值不相同,就可以认为报文在 传输过程中被破坏。
Length——LS长度域用于通知接收方LSA的长度(以字节为单位)。
LS type字段结构如下图所示:
clip_image024
U 位:描述了路由器收到一个类型未知的LSA 时如何处理,取值为0 表示把类型未知LSA 当成具有链路本地范围的LSA 一样处理,取值为1 表示按照S2/S1 位标识的泛洪范围来处理。
S2/S1 位:共同标识LSA 的泛洪范围,取值00 表示LSA 只在产生该LSA 的本地链路上泛洪;取值01 表示LSA 的泛洪范围为产生该LSA 的路由器所在区域;取值10 表示LSA 将在整个自治系统内进行泛洪;取值11 保留。
LSA Function Code:LSA 类型编码,描述LSA 的类型,类型编码取值与LSA 类型的对应关系如下表所示。
常用的有9种LSA的类型,具体见下表。
LS Type
Description
1
0x2001
Router-LSA
2
0x2002
Network-LSA
3
0x2003
Inter-Area-Prefix-LSA
4
0x2004
Inter-Area-Router-LSA
5
0x4005
AS-External-LSA
6
0x2006
Group-membership-LSA
7
0x2007
Type-7-LSA
8
0x0008
Link-LSA
9
0x2009
Intra-Area-Prefix-LSA

 


区域内前缀LSAIntra-Area-Prefix-LSA
该类型LSA在本区域内传播,具有以下两种功能之一:通过参考网络LSA把IPv6地址前缀与转递网络(transit network)相关联;或者通过参考路由器LSA把IPv6地址前缀与路由器相关联。一台路由器可以为给定的区域产生多个该类型的LSA,这些LSA使 用链路状态ID字段(Link State ID)区分。DR为它所代表的链路产生一个或多个该类型的LSA,向整个区域内通告该链路的地址前缀。
clip_image002
Intra Area Prefix LSA描述了Router LSA和Network LSA所携带的路由信息,因此在Intra Area Prefix LSA中需要标明该LSA引用的Router LSA或Network LSA,这是通过Referenced LS Type、Referenced Link State ID和Referenced AdvertisingRouter字段来联合标识的。
主要字段的解释如下:
# Prefixes:包含的IPv6 地址前缀的个数。
Referenced LS Type:引用LSA 的类型,取值为1 表明该LSA 与RouterLSA 相关,取值为2 表明该LSA 与Network LSA 相关。
Referenced Link State ID:引用LSA 的Link State ID。如果引用的是Router LSA,此字段值为0;如果引用的是Network LSA,此字段值为DR在该条链路上的Interface ID。
Referenced Advertising Router:引用LSA 的发布路由器。如果引用的是Router LSA,此字段值为产生该LSA 路由器的Router ID;如果引用的是Network LSA,此字段值为DR 的Router ID。
如下图所示:
clip_image004
3.1.3 OSPFv3路由协议工作机制
OSPFv3协议的工作原理与OSPFv2的工作原理是一样的,因为OSPFv3是在OSPFv2的基础之上修改而成的。在路由器上可以使用show ipv6 ospf adj来了解其邻居、邻接之间形成的工作过程,如下所示:
R1#debug ipv6 ospf adj
OSPFv3 adjacency events debugging is on
R1#clear ipv6 ospf process
Reset ALL OSPF processes? [no]: yes
R1#
*Sep 5 11:56:57.747: OSPFv3: Interface Loopback0 going Down
*Sep 5 11:56:57.747: OSPFv3: Interface Ethernet1/0 going Down
*Sep 5 11:56:57.747: OSPFv3: Neighbor change Event on interface Ethernet1/0
*Sep 5 11:56:57.751: OSPFv3: DR/BDR election on Ethernet1/0
*Sep 5 11:56:57.751: OSPFv3: Elect BDR 0.0.0.0
*Sep 5 11:56:57.751: OSPFv3: Elect DR 2.2.2.2
*Sep 5 11:56:57.751: OSPFv3: Elect BDR 0.0.0.0
*Sep 5 11:56:57.751: OSPFv3: Elect DR 2.2.2.2
*Sep 5 11:56:57.751: DR: 2.2.2.2 (Id) BDR: none
*Sep 5 11:56:57.755: OSPFv3: 2.2.2.2 address FE80::C800:4CFF:FE18:1C on Ethernet1/0 is dead, state DOWN
*Sep 5 11:56:57.755: %OSPFv3-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Ethernet1/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Sep 5 11:56:57.759: OSPFv3: Neighbor change Event on interface Ethernet1/0
*Sep 5 11:56:57.759: OSPFv3: DR/BDR election on Ethernet1/0
*Sep 5 11:56:57.759: OSPFv3: Elect BDR 0.0.0.0
*Sep 5 11:56:57.763: OSPFv3: Elect DR 0.0.0.0
*Sep 5 11:56:57.763: DR: none BDR: none
*Sep 5 11:56:57.763: OSPFv3: Remember old DR 2.2.2.2 (id)
*Sep 5 11:56:57.767: OSPFv3: Interface Loopback0 going Up
*Sep 5 11:56:57.767: OSPFv3: Interface Ethernet1/0 going Up
*Sep 5 11:56:57.787: OSPFv3: 2 Way Communication to 2.2.2.2 on Ethernet1/0, state 2WAY
*Sep 5 11:56:57.787: OSPFv3: Backup seen Event before WAIT timer on Ethernet1/0
*Sep 5 11:56:57.791: OSPFv3: DR/BDR election on Ethernet1/0
*Sep 5 11:56:57.791: OSPFv3: Elect BDR 1.1.1.1
*Sep 5 11:56:57.791: OSPFv3: Elect DR 2.2.2.2
*Sep 5 11:56:57.791: OSPFv3: Elect BDR 1.1.1.1
*Sep 5 11:56:57.791: OSPFv3: Elect DR 2.2.2.2
*Sep 5 11:56:57.795: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
*Sep 5 11:56:57.795: OSPFv3: Send DBD to 2.2.2.2 on Ethernet1/0 seq 0x13E3 opt 0x0013 flag 0x7 len 28
*Sep 5 11:56:57.855: OSPFv3: Rcv DBD from 2.2.2.2 on Ethernet1/0 seq 0xA36 opt 0x0013 flag 0x7 len 28 mtu 1500 state EXSTART
*Sep 5 11:56:57.859: OSPFv3: NBR Negotiation Done. We are the SLAVE
*Sep 5 11:56:57.859: OSPFv3: Send DBD to 2.2.2.2 on Ethernet1/0 seq 0xA36 opt 0x0013 flag 0x0 len 28
*Sep 5 11:56:57.879: OSPFv3: Rcv DBD from 2.2.2.2 on Ethernet1/0 seq 0xA37 opt 0x0013 flag 0x3 len 188 mtu 1500 state EXCHANGE
*Sep 5 11:56:57.883: OSPFv3: Send DBD to 2.2.2.2 on Ethernet1/0 seq 0xA37 opt 0x0013 flag 0x0 len 28
*Sep 5 11:56:57.883: OSPFv3: Database request to 2.2.2.2
*Sep 5 11:56:57.887: OSPFv3: sent LS REQ packet to FE80::C800:4CFF:FE18:1C, length 96
*Sep 5 11:56:58.131: OSPFv3: Rcv DBD from 2.2.2.2 on Ethernet1/0 seq 0xA38 opt 0x0013 flag 0x1 len 28 mtu 1500 state EXCHANGE
*Sep 5 11:56:58.131: OSPFv3: Exchange Done with 2.2.2.2 on Ethernet1/0
*Sep 5 11:56:58.131: OSPFv3: Send DBD to 2.2.2.2 on Ethernet1/0 seq 0xA38 opt 0x0013 flag 0x0 len 28
*Sep 5 11:56:58.139: OSPFv3: Synchronized with 2.2.2.2 on Ethernet1/0, state FULL
*Sep 5 11:56:58.139: %OSPFv3-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Ethernet1/0 from LOADING to FULL, Loading Done
*Sep 5 11:57:00.691: OSPFv3: Neighbor change Event on interface Ethernet1/0
*Sep 5 11:57:00.691: OSPFv3: DR/BDR election on Ethernet1/0
*Sep 5 11:57:00.691: OSPFv3: Elect BDR 1.1.1.1
*Sep 5 11:57:00.695: OSPFv3: Elect DR 2.2.2.2
*Sep 5 11:57:00.695: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
3.1.3 OSPFv3多区域配置
在配置OSPFv3路由协议之前,需要注意到以下几点:
接口要参与OSPFv3运行,必须在接口配置模式下明确启动。而在OSPFv2中,这是通过在OSPF路由配置模式下,通过network命令间接启动。
如果配置接口参与OSPFv3运行,那么接口上所有的地址都将参与IPv6运行。而在OSPFv2中,所有地址都必须通过network命令启动。
在运行OSPFv3的环境中,在同一个链路上能够允许运行多个OSPF实体,该链路所连的不同设备可以选择参与运行某一个OSPF实体。OSPFv2并不支持该功能。
每台运行OSPFv3进程的设备都必须使用一个router ID来标识,router ID使用IPv4地址格式。不同于OSPFv2,OSPFv2进程将自动获取IPv4地址作为router ID,设备在启动OSPFv3进程后,用户必须使用router-id命令为OSPFv3进程配置router ID,否则OSPFv3进程将无法启动。
本实验的网络拓扑如下图所示:
clip_image002[5]
具体配置如下所示:
路由器R1配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:10::1/64
ipv6 ospf 10 area 10
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:5::1/64
ipv6 enable
!
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
路由器R2配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::2/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:2::1/64
ipv6 enable
ipv6 ospf 10 area 0
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
!
路由器R3配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:2::2/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
路收器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:11::1/64
ipv6 ospf 10 area 20
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:3::2/64
ipv6 enable
ipv6 ospf 10 area 20
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:4::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
可以使用show命令来查看路由表和邻居状态。
R1#sh ipv6 route
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
C 2001:1::/64 [0/0]
via ::, Ethernet1/0
L 2001:1::1/128 [0/0]
via ::, Ethernet1/0
OI 2001:2::/64 [110/20]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
OI 2001:3::/64 [110/30]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
OI 2001:4::/64 [110/30]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
C 2001:5::/64 [0/0]
via ::, Ethernet1/1
L 2001:5::1/128 [0/0]
via ::, Ethernet1/1
C 2001:10::/64 [0/0]
via ::, Loopback0
L 2001:10::1/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R3#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 1 FULL/DR 00:00:35 6 Ethernet1/0
4.4.4.4 1 FULL/DR 00:00:33 6 Ethernet1/1




3.1.4 OSPFv3与RIP重分发配置
本实验拓扑,如下图所示:
clip_image002
具体配置如下:
路由器R1配置
R1#
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:10::1/64
ipv6 ospf 10 area 10
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:5::1/64
ipv6 enable
!
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
!
路由器R2配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::2/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:2::1/64
ipv6 enable
ipv6 ospf 10 area 0
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
路由器R3配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:2::2/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 rip ripng enable
!
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
redistribute connected metric 60
redistribute rip ripng metric 50
!
ipv6 router rip ripng
redistribute connected metric 3
redistribute ospf 10 metric 2
!
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:11::1/64
ipv6 rip ripng enable
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:3::2/64
ipv6 enable
ipv6 rip ripng enable
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:4::1/64
ipv6 enable
!
ipv6 router rip ripng
配置完成后,可以使用show命令来查看其路由表:
R1#sh ipv6 route
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
C 2001:1::/64 [0/0]
via ::, Ethernet1/0
L 2001:1::1/128 [0/0]
via ::, Ethernet1/0
OI 2001:2::/64 [110/20]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
OE2 2001:3::/64 [110/60]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
C 2001:5::/64 [0/0]
via ::, Ethernet1/1
L 2001:5::1/128 [0/0]
via ::, Ethernet1/1
C 2001:10::/64 [0/0]
via ::, Loopback0
L 2001:10::1/128 [0/0]
via ::, Loopback0
OE2 2001:11::/64 [110/50]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R4#sh ipv6 route
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
R 2001:1::/64 [120/3]
via FE80::C800:45FF:FEF4:1D, Ethernet1/0
R 2001:2::/64 [120/4]
via FE80::C800:45FF:FEF4:1D, Ethernet1/0
C 2001:3::/64 [0/0]
via ::, Ethernet1/0
L 2001:3::2/128 [0/0]
via ::, Ethernet1/0
C 2001:4::/64 [0/0]
via ::, Ethernet1/1
L 2001:4::1/128 [0/0]
via ::, Ethernet1/1
R 2001:10::1/128 [120/3]
via FE80::C800:45FF:FEF4:1D, Ethernet1/0
C 2001:11::/64 [0/0]
via ::, Loopback0
L 2001:11::1/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
也可以使用show命令来查看其邻居关系
R2#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 1 FULL/BDR 00:00:36 5 Ethernet1/1
1.1.1.1 1 FULL/BDR 00:00:38 5 Ethernet1/0
R2#sh ipv6 ospf neighbor detail
Neighbor 3.3.3.3
In the area 0 via interface Ethernet1/1
Neighbor: interface-id 5, link-local address FE80::C800:45FF:FEF4:1C
Neighbor priority is 1, State is FULL, 12 state changes
DR is 2.2.2.2 BDR is 3.3.3.3
Options is 0x6415D0CD
Dead timer due in 00:00:35
Neighbor is up for 01:32:04
Index 1/1/2, retransmission queue length 0, number of retransmission 2
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 4, maximum is 4
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 1.1.1.1
In the area 10 via interface Ethernet1/0
Neighbor: interface-id 5, link-local address FE80::C800:48FF:FE28:1C
Neighbor priority is 1, State is FULL, 18 state changes
DR is 2.2.2.2 BDR is 1.1.1.1
Options is 0x65605031
Dead timer due in 00:00:37
Neighbor is up for 00:59:52
Index 1/1/1, retransmission queue length 0, number of retransmission 3
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 3, maximum is 5
Last retransmission scan time is 0 msec, maximum is 0 msec
还可以使用show命令来查看OSPFv3路由协议更详细的信息。
R2#sh ipv6 ospf 10
Routing Process "ospfv3 10" with ID 2.2.2.2
It is an area border router
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 2. Checksum Sum 0x00BEFE
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 1
SPF algorithm executed 6 times
Number of LSA 8. Checksum Sum 0x042AA1
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 10
Number of interfaces in this area is 1
SPF algorithm executed 6 times
Number of LSA 9. Checksum Sum 0x057BF3
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
3.1.5 OSPFv3末节区域配置
本实验拓扑图如下所示:
clip_image004
具体配置如下:
路由器R1配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:10::1/64
ipv6 ospf 10 area 10
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:5::1/64
ipv6 enable
!
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
area 10 stub
路由器R2配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::2/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:2::1/64
ipv6 enable
ipv6 ospf 10 area 0
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
area 10 stub no-summary
!
路由器R3配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:2::2/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
路收器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:11::1/64
ipv6 ospf 10 area 20
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:3::2/64
ipv6 enable
ipv6 ospf 10 area 20
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:4::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
可以使用show命令来查看其路由信息。
R1#sh ipv6 route
IPv6 Routing Table - 9 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
OI ::/0 [110/11]
via FE80::C800:4CFF:FE18:1C, Ethernet1/0
C 2001:1::/64 [0/0]
via ::, Ethernet1/0
L 2001:1::1/128 [0/0]
via ::, Ethernet1/0
C 2001:5::/64 [0/0]
via ::, Ethernet1/1
L 2001:5::1/128 [0/0]
via ::, Ethernet1/1
C 2001:10::/64 [0/0]
via ::, Loopback0
L 2001:10::1/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0






3.1.7 OSPFv3 虚链路配置
clip_image002
具体配置如下:
路由器R1配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:10::1/64
ipv6 rip ripng enable
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:5::1/64
ipv6 enable
ipv6 rip ripng enable
!
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
redistribute connected metric 50
redistribute rip ripng metric 50
!
ipv6 router rip ripng
路由器R2配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::2/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:2::1/64
ipv6 enable
ipv6 ospf 10 area 10
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
area 10 virtual-link 3.3.3.3
!
路由器R3配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:2::2/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
area 10 virtual-link 2.2.2.2
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:11::1/64
ipv6 ospf 10 area 20
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:3::2/64
ipv6 enable
ipv6 ospf 10 area 20
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:4::1/64
ipv6 enable
!
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
可以使用show命令来查看其路由信息。
R3#sh ipv6 ospf virtual-links
Virtual Link OSPFv3_VL0 to router 2.2.2.2 is up
Interface ID 11, IPv6 address 2001:1::2
Run as demand circuit
DoNotAge LSA allowed.
Transit area 10, via interface Ethernet1/0, Cost of using 10
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Adjacency State FULL (Hello suppressed)
Index 1/1/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
R2#sh ipv6 ospf virtual-links
Virtual Link OSPFv3_VL0 to router 3.3.3.3 is up
Interface ID 11, IPv6 address 2001:3::1
Run as demand circuit
DoNotAge LSA allowed.
Transit area 10, via interface Ethernet1/1, Cost of using 10
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Adjacency State FULL (Hello suppressed)
Index 1/2/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
R4#sh ipv6 route
IPv6 Routing Table - 14 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
OI 2001:1::/64 [110/30]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
OI 2001:1::2/128 [110/20]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
OI 2001:2::/64 [110/20]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
C 2001:3::/64 [0/0]
via ::, Ethernet1/0
OI 2001:3::1/128 [110/10]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
L 2001:3::2/128 [0/0]
via ::, Ethernet1/0
C 2001:4::/64 [0/0]
via ::, Ethernet1/1
L 2001:4::1/128 [0/0]
via ::, Ethernet1/1
OE2 2001:5::/64 [110/50]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
OE2 2001:10::/64 [110/50]
via FE80::C800:73FF:FE68:1D, Ethernet1/0
C 2001:11::/64 [0/0]
via ::, Loopback0
L 2001:11::1/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R2#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 1 FULL/ - - 11 OSPFv3_VL0
1.1.1.1 1 FULL/BDR 00:00:35 5 Ethernet1/0
3.3.3.3 1 FULL/DR 00:00:14 5 Ethernet1/1
3.1.8 OSPFv3 身份验证配置
本实验拓扑图,如下所示:
clip_image004
具体配置如下所示:
路由器R1配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:10::1/64
ipv6 rip ripng enable
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:5::1/64
ipv6 enable
ipv6 rip ripng enable
!
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
redistribute connected metric 50
redistribute rip ripng metric 50
!
ipv6 router rip ripng
路由器R2配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:1::2/64
ipv6 enable
ipv6 ospf 10 area 0
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:2::1/64
ipv6 enable
ipv6 ospf 10 area 10
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
area 10 authentication ipsec spi 10111 md5 1234567890ABCDEF1234567890ABCDEF
area 10 virtual-link 3.3.3.3
!
路由器R3配置
ipv6 unicast-routing
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:2::2/64
ipv6 enable
ipv6 ospf 10 area 10
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 ospf 10 area 20
!
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
area 10 authentication ipsec spi 10111 md5 1234567890ABCDEF1234567890ABCDEF
area 10 virtual-link 2.2.2.2
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:11::1/64
ipv6 ospf 10 area 20
!
interface Ethernet1/0
no ip address
duplex full
ipv6 address 2001:3::2/64
ipv6 enable
ipv6 ospf 10 area 20
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address 2001:4::1/64
ipv6 enable
!
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
可以使用show命令来查看其路由信息。
R2#sh ipv6 ospf
Routing Process "ospfv3 10" with ID 2.2.2.2
It is an area border router
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 4. Checksum Sum 0x0201A8
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 2
SPF algorithm executed 21 times
Number of LSA 15. Checksum Sum 0x086F59
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 6
Flood list length 0
Area 10
Number of interfaces in this area is 1
MD5 Authentication, SPI 10111
SPF algorithm executed 15 times
Number of LSA 16. Checksum Sum 0x09D294
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R2#sh ipv6 ospf interface ethernet 1/1
Ethernet1/1 is up, line protocol is up
Link Local Address FE80::C800:73FF:FE6C:1D, Interface ID 6
Area 10, Process ID 10, Instance ID 0, Router ID 2.2.2.2
Network Type BROADCAST, Cost: 10
MD5 Authentication (Area) SPI 10111, secure socket state UP (errors: 0)
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 3.3.3.3, local address FE80::C800:73FF:FE68:1C
Backup Designated router (ID) 2.2.2.2, local address FE80::C800:73FF:FE6C:1D
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Index 1/1/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 2, maximum is 5
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.3 (Designated Router)
Suppress hello for 0 neighbor(s)
可以使用ethereal抓取其认证的报文,如下图所示:
根据下图所示,当路由器启用身份验证时,不论是Hello报文、DBD报文、LSR报文和LSU还是LSAck报文,都会在其OSPF报文的头 之前加上一个认证的报头(AH),这只不过是对接收和发送OSPFv3报文进行一个身份验证,MD5加密的只是进行身份验证的口令,并不是对OSFPv3 协议传输的报文的内容进行加密。
因为OSPFv3路由协议本身是不提供安全机制的,所以只能在OSPFv3报文的前边加上一个验证报头。
这只是对接收和发送OSPFv3各种报文的路由器进行合法身份的验证,如果想对报文进行加密或更好的提高其安全,可以使用IPSec协议。关于OSPFv3使用IPSec协议提高安全性,会在下篇博文中详细讲述。
clip_image006
clip_image008






3.1.9 OSPFv3 网络类型的配置 3.1.9.1 OSPFv3 point-to-point环境下配置
clip_image002
具体配置如下所示:
路由器R1配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:1::1/64
ipv6 ospf 10 area 0
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.1 point-to-point
ipv6 address 2001:DB2:1::1/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 100 CISCO
!
interface Serial1/0.2 point-to-point
ipv6 address 2001:DB2:2::1/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 110 CISCO
!
interface Serial1/0.3 point-to-point
ipv6 address 2001:DB2:3::1/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 120 CISCO
!
logging alarm informational
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
路由器R2配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:2::1/64
ipv6 ospf 10 area 0
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.1 point-to-point
ipv6 address 2001:DB2:1::2/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 200 CISCO
!
logging alarm informational
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
!
路由器R3配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:3::1/64
ipv6 ospf 10 area 0
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.1 point-to-point
ipv6 address 2001:DB2:2::2/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 300
!
logging alarm informational
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
!
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:DB:4::1/64
ipv6 ospf 10 area 0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.1 point-to-point
ipv6 address 2001:DB2:3::2/64
ipv6 ospf 10 area 0
frame-relay interface-dlci 400 CISCO
!
logging alarm informational
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
!
使用show命令查看状态信息
R1#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
4.4.4.4 1 FULL/ - 00:00:36 17 Serial1/0.3
3.3.3.3 1 FULL/ - 00:00:37 16 Serial1/0.2
2.2.2.2 1 FULL/ - 00:00:31 16 Serial1/0.1
R1#sh ipv6 ospf interface serial 1/0.1
Serial1/0.1 is up, line protocol is up
Link Local Address FE80::C800:84FF:FE6C:0, Interface ID 16
Area 0, Process ID 10, Instance ID 0, Router ID 1.1.1.1
Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:02
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
R4#sh ipv6 route
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
O 2001:DB:1::/64 [110/65]
via FE80::C800:84FF:FE6C:0, Serial1/0.1
O 2001:DB:2::/64 [110/129]
via FE80::C800:84FF:FE6C:0, Serial1/0.1
O 2001:DB:3::/64 [110/129]
via FE80::C800:84FF:FE6C:0, Serial1/0.1
C 2001:DB:4::/64 [0/0]
via ::, Loopback0
L 2001:DB:4::1/128 [0/0]
via ::, Loopback0
O 2001:DB2:1::/64 [110/128]
via FE80::C800:84FF:FE6C:0, Serial1/0.1
O 2001:DB2:2::/64 [110/128]
via FE80::C800:84FF:FE6C:0, Serial1/0.1
C 2001:DB2:3::/64 [0/0]
via ::, Serial1/0.1
L 2001:DB2:3::2/128 [0/0]
via ::, Serial1/0.1
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
3.1.9.2 OSPFv3 point-to-multipoint环境下配置
本实验拓扑图,如下图所示:
clip_image002[1]
在本配置本实验之前需要注意以下几点:
1、在配置帧中继链路时,需要使用命令:
frame-relay map ipv6 ipv6-address dlci broadcast
这里ipv6-address是对端接口的本地链路地址。
2、在配置OSPF时,需要在接口下配置OSPF的网络类型
ipv6 ospf network point-to-multipoint
3、在此环境下可以指定邻居,也可以不指定邻居
ipv6 ospf neighbor ipv6-address
具体配置如下:
路由器R1配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:1::1/64
ipv6 ospf 10 area 10
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::1/64
ipv6 ospf network point-to-multipoint
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 100 broadcast
frame-relay map ipv6 FE80::C800:80FF:FED4:0 110 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 120 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
路由器R2配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:2::1/64
ipv6 ospf 10 area 20
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::2/64
ipv6 ospf network point-to-multipoint
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:80FF:FED4:0 210 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 220 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 200 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
路由器R3配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:3::1/64
ipv6 ospf 10 area 30
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::3/64
ipv6 ospf network point-to-multipoint
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 310 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 320 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 300 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:DB:4::1/64
ipv6 ospf 10 area 40
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::4/64
ipv6 ospf network point-to-multipoint
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 410 broadcast
frame-relay map ipv6 FE80::C800:80FF:FED4:0 420 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 400 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
使用show命令查看状态信息,如下所示:
R1#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
4.4.4.4 1 FULL/ - 00:01:33 18 Serial1/0.10
3.3.3.3 1 FULL/ - 00:01:43 17 Serial1/0.10
2.2.2.2 1 FULL/ - 00:01:44 17 Serial1/0.10
R1#sh ipv6 route
IPv6 Routing Table - 12 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
C 2001:DB:1::/64 [0/0]
via ::, FastEthernet0/0
L 2001:DB:1::1/128 [0/0]
via ::, FastEthernet0/0
OI 2001:DB:2::/64 [110/65]
via FE80::C800:4CFF:FE78:0, Serial1/0.10
OI 2001:DB:3::/64 [110/65]
via FE80::C800:80FF:FED4:0, Serial1/0.10
OI 2001:DB:4::1/128 [110/64]
via FE80::C800:80FF:FE70:0, Serial1/0.10
C 2001:DB2:1::/64 [0/0]
via ::, Serial1/0.10
L 2001:DB2:1::1/128 [0/0]
via ::, Serial1/0.10
O 2001:DB2:1::2/128 [110/64]
via FE80::C800:4CFF:FE78:0, Serial1/0.10
O 2001:DB2:1::3/128 [110/64]
via FE80::C800:80FF:FED4:0, Serial1/0.10
O 2001:DB2:1::4/128 [110/64]
via FE80::C800:80FF:FE70:0, Serial1/0.10
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R1#sh ipv6 ospf interface serial 1/0.10
Serial1/0.10 is up, line protocol is up
Link Local Address FE80::C800:84FF:FE6C:0, Interface ID 19
Area 0, Process ID 10, Instance ID 0, Router ID 1.1.1.1
Network Type POINT_TO_MULTIPOINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
Hello due in 00:00:17
Index 1/1/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 3
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 3, Adjacent neighbor count is 3
Adjacent with neighbor 4.4.4.4
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
3.1.9.3 OSPFv3 point-to-multipoint non-broadcast环境下配置
本实验拓扑图,如下图所示:
clip_image002[2]
在本配置本实验之前需要注意以下几点:
1、在配置帧中继链路时,需要使用命令:
frame-relay map ipv6 ipv6-address dlci broadcast
——这里ipv6-address是对端接口的本地链路地址。
2、在配置OSPF时,需要在接口下配置OSPF的网络类型
ipv6 ospf network point-to-multipoint non-broadcast
3、在此环境下可以指定邻居,也可以不指定邻居
ipv6 ospf neighbor ipv6-address
——这里ipv6-address是对端接口的本地链路地址。
具体配置如下:
路由器R1配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:1::1/64
ipv6 ospf 10 area 10
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::1/64
ipv6 ospf network point-to-multipoint non-broadcast
ipv6 ospf neighbor FE80::C800:80FF:FED4:0
ipv6 ospf neighbor FE80::C800:4CFF:FE78:0
ipv6 ospf neighbor FE80::C800:80FF:FE70:0
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 100 broadcast
frame-relay map ipv6 FE80::C800:80FF:FED4:0 110 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 120 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
路由器R2配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:2::1/64
ipv6 ospf 10 area 20
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::2/64
ipv6 ospf network point-to-multipoint non-broadcast
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:80FF:FED4:0 210 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 220 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 200 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
路由器R3配置
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex half
ipv6 address 2001:DB:3::1/64
ipv6 ospf 10 area 30
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::3/64
ipv6 ospf network point-to-multipoint non-broadcast
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 310 broadcast
frame-relay map ipv6 FE80::C800:80FF:FE70:0 320 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 300 broadcast
!
logging alarm informational
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
路由器R4配置
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2001:DB:4::1/64
ipv6 ospf 10 area 40
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
no ip address
encapsulation frame-relay
ipv6 enable
serial restart-delay 0
no dce-terminal-timing-enable
!
interface Serial1/0.10 multipoint
ipv6 address 2001:DB2:1::4/64
ipv6 ospf network point-to-multipoint non-broadcast
ipv6 ospf 10 area 0
frame-relay map ipv6 FE80::C800:4CFF:FE78:0 410 broadcast
frame-relay map ipv6 FE80::C800:80FF:FED4:0 420 broadcast
frame-relay map ipv6 FE80::C800:84FF:FE6C:0 400 broadcast
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
no dce-terminal-timing-enable
!
logging alarm informational
ipv6 router ospf 10
router-id 4.4.4.4
log-adjacency-changes
使用show命令查看状态信息
R1#sh ipv6 ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 1 FULL/ - 00:01:49 17 Serial1/0.10
2.2.2.2 1 FULL/ - 00:01:49 17 Serial1/0.10
4.4.4.4 1 FULL/ - 00:01:49 18 Serial1/0.10
R2#sh ipv6 ospf interface s1/0.10
Serial1/0.10 is up, line protocol is up
Link Local Address FE80::C800:4CFF:FE78:0, Interface ID 17
Area 0, Process ID 10, Instance ID 0, Router ID 2.2.2.2
Network Type POINT_TO_MULTIPOINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
Hello due in 00:00:26
Index 1/1/1, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 3
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 1.1.1.1
Suppress hello for 0 neighbor(s)
R4#sh ipv6 route
IPv6 Routing Table - 12 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
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
OI 2001:DB:1::/64 [110/65]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
OI 2001:DB:2::/64 [110/129]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
OI 2001:DB:3::/64 [110/129]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
C 2001:DB:4::/64 [0/0]
via ::, Loopback0
L 2001:DB:4::1/128 [0/0]
via ::, Loopback0
C 2001:DB2:1::/64 [0/0]
via ::, Serial1/0.10
O 2001:DB2:1::1/128 [110/64]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
O 2001:DB2:1::2/128 [110/128]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
O 2001:DB2:1::3/128 [110/128]
via FE80::C800:84FF:FE6C:0, Serial1/0.10
L 2001:DB2:1::4/128 [0/0]
via ::, Serial1/0.10
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多