實驗要求及步驟:
1. 配置各臺路由器的IPv6地址,並且使用ping命令確認直連接口的互通性
2. 在R1,R2和R3路由器上配置OSPFv3路由協議
R1(config)#ipv6 unicast-routing 啓用IPv6單播路由功能
R1(config)#ipv6 router ospf 20 全局啓用ospf路由進程號爲20
*Nov22 19:47:58.883: %OSPFv3-4-NORTRID: Process OSPFv3-20-IPv6 could not pick arouter-id, please configure manually 由於ospfv3雖然用於IP6網絡,但是其router-id仍然爲32bit,所以會自動尋找本地是否配置IP v4地址以便使用其作爲router-id,因此需要手工配置一個router-id
R1(config-rtr)#router-id 1.1.1.1
R1(config-rtr)#exit
R1(config)#int s1/0
R1(config-if)#ipv6 ospf 20 area 0 將接口加入到ospf的進程中,並指定其屬於area0區域
R1(config-if)#exit
R1(config)#int lo0
R1(config-if)#ipv6 ospf 20 area 0
R1(config-if)#ipv6 ospf network point-to-point 配置環回口類型爲p2p,避免向外通告/128的主機路由
R2(config)#ipv6 unicast-routing
R2(config)#ipv6 router ospf 30
R2(config-rtr)#router-id 2.2.2.2
R2(config-rtr)#exit
R2(config)#int s1/0
R2(config-if)#ipv6 ospf 30 area 0
*Nov 2219:50:47.087: %OSPFv3-5-ADJCHG: Process 30, Nbr 1.1.1.1 on Serial1/0 fromLOADING to FULL, Loading Done提示ospf的鄰居關係已經建立好
R2(config-if)#int s1/1
R2(config-if)#ipv6 ospf 30 area 0
R2(config-if)#
R3(config)#ipv6 unicast-routing
R3(config)#
R3(config)#ipv6 router ospf 40
R3(config-rtr)#
*Nov 22 19:51:37.399: %OSPFv3-4-NORTRID: ProcessOSPFv3-40-IPv6 could not pick a router-id, please configure manually
R3(config-rtr)#
R3(config-rtr)#router-id 3.3.3.3
R3(config-rtr)#
R3(config-rtr)#
R3(config-rtr)#exit
R3(config)#int s1/0
R3(config-if)#ipv6 ospf 40 area 0
R3(config-if)#int lo0
R3(config-if)#ipv6 ospf 40 area 0
R3(config-if)#ipv6 ospf network point-to-point
3.查看ospf的鄰居關係
R2#show ipv6 ospf neighbor
OSPFv3 Router with ID (2.2.2.2) (Process ID 30)
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 0 FULL/ - 00:00:35 3 Serial1/1 因爲採用串行口,默認接口類型 爲p2p,所以不選DR和BDR
1.1.1.1 0 FULL/ - 00:00:36 3 Serial1/0
4.查看ospf的數據庫信息
R3#sho ipv6 ospf database
OSPFv3 Router with ID (3.3.3.3) (Process ID 20)
Router Link States (Area 0) LSA0x2002此類型LSA僅僅用於描述區域內部鏈路上的鄰居信息,在區域 內泛洪
ADV Router Age Seq# Fragment ID Link count Bits
1.1.1.1 645 0x80000003 0 1 None
2.2.2.2 543 0x80000003 0 2 None
3.3.3.3 543 0x80000002 0 1 None
Link (Type-8) Link States (Area 0) LSA 0x2008 此類LSA僅僅用於描述直連路由器鄰居向鏈路上的 ipv6的前綴信息,在本地鏈路上泛洪
ADV Router Age Seq# Link ID Interface
2.2.2.2 658 0x80000002 4 Se1/0
3.3.3.3 543 0x80000002 3 Se1/0
Intra Area Prefix Link States (Area 0) LSA0x2009 此類LSA用於提供拓撲信息,用於通告已知的ipv6 前綴信息,在區域內泛洪
ADV Router Age Seq# Link ID Ref-lstype Ref-LSID
1.1.1.1 878 0x80000004 0 0x2001 0
2.2.2.2 646 0x80000002 3072 0x2002 0
3.3.3.3 543 0x80000002 4096 0x2002 0
5.對ospfv3的LSA的補充
LSA 名稱 | LSA類型編號 | LSA類型編碼 |
Router-LSA | 1 | 0x2001 |
Network-LSA | 2 | 0x2002 |
Inter-Area-Prefix-LSA | 3 | 0x2003 |
Inter-Area-Router-LSA | 4 | 0x2004 |
AS-External-LSA | 5 | 0x2005 |
Group-membership-LSA | 6 | 0x2006 |
Type-7-LSA | 7 | 0x2007 |
Link-LSA | 8 | 0x2008 |
Intra-Area-Prefix-LSA | 9 | 0x2009 |
(1)路由器LSA(Router-LSA):描述在特定區域內的路由器接口的鏈路狀態及鏈路開銷。僅在接口所在的區域內傳播。該類型LSA還指出產生該類型LSA的路由器是否是一臺ABR或ASBR,以及路由器是否是虛鏈路的一端。類型1LSA也被用來通告端(stub)網絡。
(2)網絡LSA(Network-LSA):由DR產生,用來描述DR所代表的網絡的鏈路狀態信息和鏈路開銷信息。該LSA是BMA網絡上的所有鏈路信息和鏈路開銷信息的集合信息。
(3)區域間前綴LSA(Inter-Area-Prefix-LSA):該類型LSA在OSPFv2中叫做‘概括的網絡鏈路狀態條目(summary net link states)’。該類型LSA由ABR產生,用來把一個區域內的路由信息通告到另外一個區域。這種類型的LSA既可以描述一條具體的路由信息,也可以描述總結的路由信息。在OSPFv3中,地址是用前綴和前綴長度表達的,而不再使用地址和掩碼的表達形式。缺省路由的前綴長度用0代表。
(4)區域間路由器LSA(Inter-Area-Router-LSA):由ASBR產生,用以通告ASBR的位置。試圖把數據送達外網的路由器使用該LSA確定通往下一跳的最佳路徑。
(5)自治系統外LSA(AS-External-LSA):用來攜帶自治系統外路由信息的LSA。例如,把其它AS的路由重發布到OSPF中的路由信息。在該類型的LSA中,地址用前綴和前綴長度表達,缺省路由的前綴長度用0表達。
(6)類型7LSA(Type-7 LSA):由NSSA中的ASBR產生,只在NSSA中傳播。在ABR上它被轉換成類型5並且被擴散到骨幹區域。
(7)鏈路LSA(Link-LSA):僅在本鏈路上傳播,具有以下3種目的:向本鏈路上的其它路由器提供路由器的本鏈路地址;向本鏈路上的其它路由器通告IPv6地址前綴,使其與本鏈路相關聯;允許路由器在該類型LSA中插入一些選項比特,與爲本鏈路產生的網絡LSA相關聯。
(8)區域內前綴LSA(Intra-Area-Prefix-LSA):該類型LSA在本區域內傳播,具有以下兩種功能之一:通過參考網絡LSA把IPv6地址前綴與轉遞網絡(transitnetwork)相關聯;或者通過參考路由器LSA把IPv6地址前綴與路由器相關聯。一臺路由器可以爲給定的區域產生多個該類型的LSA,這些LSA使用鏈路狀態ID字段(Link State ID)區分。DR爲它所代表的鏈路產生一個或多個該類型的LSA,向整個區域內通告該鏈路的地址前綴。