4 - IPv6 OSPFv3路由协议(续三)


http://xuanbo.blog.51cto.com/499334/200620


区域内前缀LSA(Intra-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

posted @ 2017-04-29 15:11  张同光  阅读(251)  评论(0编辑  收藏  举报