IPv6 OSPFv3路由協議(續三)

區域內前綴 LSA Intra-Area-Prefix-LSA
該類型LSA在本區域內傳播,具備如下兩種功能之一:經過參考網絡LSA把IPv6地址前綴與轉遞網絡(transit network)相關聯;或者經過參考路由器LSA把IPv6地址前綴與路由器相關聯。一臺路由器能夠爲給定的區域產生多個該類型的LSA,這些LSA使用鏈路狀態ID字段(Link State ID)區分。DR爲它所表明的鏈路產生一個或多個該類型的LSA,向整個區域內通告該鏈路的地址前綴。
clip_p_w_picpath002
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_p_w_picpath004
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_p_w_picpath002[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
相關文章
相關標籤/搜索