|
轉自:http://xuanbo.blog.51cto.com/499334/200447 IPv6 OSPFv3路由協(xié)議 3.1 IPv6 OSPFv33.1.1 OSPFv3 VS OSPFv2OSPF路由協(xié)議是鏈路狀態(tài)型路由協(xié)議,這里的鏈路即設備上的接口。鏈路狀態(tài)型路由協(xié)議基于連接源和目標設備的鏈路狀態(tài)作出路由的決定。鏈路狀態(tài)是接口及其與鄰接網(wǎng)絡設備的的關系的描述,接口的信息即鏈路的信息,也就是鏈路的狀態(tài)(信息)。這些信息包括接口的IPv6前綴(prefix)、網(wǎng)絡掩碼、接口連接的網(wǎng)絡(鏈路)類型、與該接口在同一網(wǎng)絡(鏈路)上的路由器等信息。這些鏈路狀態(tài)信息由不同類型的LSA攜帶,在網(wǎng)絡上傳播。
路由器把收集到的LSA存儲在鏈路狀態(tài)數(shù)據(jù)庫中,然后運行SPF算法計算出路由表。鏈路狀態(tài)數(shù)據(jù)庫和路由表的本質不同在于:數(shù)據(jù)庫中包含的是完整的鏈路狀態(tài)原始數(shù)據(jù),而路由表中列出的是到達所有已知目標網(wǎng)絡的最短路徑的列表。
OSPF協(xié)議是為IP協(xié)議提供路由功能的路由協(xié)議。OSPFv2(OSPF版本2)是支持IPv4的路由協(xié)議,為了讓OSPF協(xié)議支持IPv6,技術人員開發(fā)了OSPFv3(OSPF版本3),OSPFv3由RFC2740定義。
無論是OSPFv2還是OSPFv3,OSPF協(xié)議的基本運行原理是沒有區(qū)別的,然而,由于IPv4和IPv6協(xié)議意義的不同,地址空間大小的不同,它們之間的不同之處也是必然存在的。
相似之處
路由器類型相同
2 包括內部路由器(internal router)、骨干路由器(backbone router)、區(qū)域邊界路由器(area border router)和自治系統(tǒng)邊界路由器(autonomous system boundary router)。
支持的區(qū)域類型相同
2 包括骨干區(qū)域、標準區(qū)域、末節(jié)區(qū)域、NSSA和完全末節(jié)區(qū)域。
路由計算方法相同
2 都使用SPF算法。
DR選舉機制相同
2 DR和BDR的選舉過程相同。
網(wǎng)絡類型相同
2 包括點到點鏈路、點到多點鏈路、多路訪問、NBMA鏈路和虛擬鏈路。
鄰居和鄰居形成機制相同
2 OSPF 路由器啟動后,便會通過OSPF接口向外發(fā)送Hello 報文,收到Hello 報文的OSPF 路由器會檢查報文中所定義的參數(shù),如果雙方一致就會形成鄰居關系。形成鄰居關系的雙方不一定都能形成鄰接關系,這要根據(jù)網(wǎng)絡類型而定,只有當雙方成功交換DBD 報文,交換LSA 并達到LSDB 的同步之后,才形成真正意義上的鄰接關系。
2 LSA的傳播和老化機制相同。
基本數(shù)據(jù)包類型相同
2 都使用Hello、DBD、LSR、LSU和LSA。
不同之處
術語不同
2 在OSPFv3中,用"鏈路(link)"取代了OSPFv2中的"網(wǎng)絡(network)"或"子網(wǎng)(subnet)"的概念。
路由進程運行方式不同
2 OSPFv3進程運行在鏈路上,
2 OSPFv2進程運行在子網(wǎng)上。
鏈路多實例復用
2 OSPFv2不支持鏈路多實例復用
Router ID唯一標識鄰居
2 在OSPFv2中,當網(wǎng)絡類型為點到點或者通過虛連接與鄰居相連時,通過Router ID來標識鄰居路由器,當網(wǎng)絡類型為廣播或NBMA時,通過鄰居接口的IP地址來標識鄰居路由器。
2 OSPFv3取消了這種復雜性,無論對于何種網(wǎng)絡類型,都是通過Router ID來唯一標識鄰居。
認證方式不同
2 OSPFv3協(xié)議自身不再提供認證功能,而是通過使用IPv6提供的安全機制來保證自身報文的合法性。所以,OSPFv2報文中的認證字段,在OSPFv3報文頭中被取消。
2 OSPFv2自身提供認證功能
報文不同
2 OSPFv3報文封裝在IPv6報文中,每一種類型的報文都是以一個16字節(jié)的報文頭部開始。
2 OSPFv3的報文頭、Hello、DBD以及LSR報文中的字段與OSPFv2有差別。
LSA類型不同
2 與OSPFv2相比,OSPFv3新增了Link LSA和Intra Area Prefix LSA。
LSA的泛洪范圍
2 LSA的泛洪范圍已經(jīng)被明確地定義在LSA的LS Type字段,目前,有三種LSA泛洪范圍。
2 鏈路本地范圍:LSA 只在本地鏈路上泛洪,不會超出這個范圍,該范圍適用于新定義的Link LSA。
2 區(qū)域范圍:LSA 的泛洪范圍僅僅覆蓋一個單獨的OSPFv3 區(qū)域。Router LSA、Network LSA、Inter Area Prefix LSA、Inter Area Router LSA 和Intra Area Prefix LSA 都是區(qū)域范圍泛洪的LSA。
2 自治系統(tǒng)范圍:LSA 將被泛洪到整個路由域,AS External LSA 就是自治系統(tǒng)范圍泛洪的LSA。
支持對未知類型LSA的處理
2 在OSPFv2中,收到類型未知的LSA將直接丟棄
2 OSPFv3在LSA的LS Type字段中增加了一個U比特位來位標識對未知類型LSA的處理方式:
2 如果U 比特置1,則對于未知類型的LSA 按照LSA 中的LS Type 字段描述的泛洪范圍進行泛洪;
2 如果U 比特置0,對于未知類型的LSA 僅在鏈路范圍內泛洪。
Stub區(qū)域的支持
2 由于OSPFv3支持對未知類型LSA的泛洪,為防止大量未知類型LSA泛洪進入Stub區(qū)域,對于向Stub區(qū)泛洪的未知類型LSA進行了明確規(guī)定,只有當未知類型LSA的泛洪范圍是區(qū)域或鏈路而且U比特沒有置位時,未知類型LSA才可以向Stub區(qū)域泛洪。
Option字段不同
2 在OSPFv2中,Option字段出現(xiàn)在每一個Hello報文、DD報文以及每一個LSA中。
2 在OSPFv3中,Option字段只在Hello報文、DD報文、Router LSA 、Network LSA、Inter Area Router LSA以及Link LSA中出現(xiàn)。
LSA報文格式不同
3.1.2 OSPFv3協(xié)議數(shù)據(jù)結構OSPFv3協(xié)議直接運行在IPv6上,因此,OSPFv3的數(shù)據(jù)由IPv6報文攜帶。在IPv6報文頭的'下一個報文頭'字段中,用協(xié)議號89代表該數(shù)據(jù)包中攜帶的是OSPFv3的數(shù)據(jù)。
緊跟著IPv6報文頭的后面是OSPFv3的報文首部,其格式如下圖所示。
OSPFv3首部報文結構:
如下圖所示:
![]() 其中:
Version——代表OSPF的版本號,其值為3。
Type ——代表OSPF數(shù)據(jù)報類型。OSPF數(shù)據(jù)報的類型包括:
n Hello包,類型代碼為1。
n DBD,類型代碼為2。
n LSR,類型代碼為3。
n LSU,類型代碼為4。
n LSAck,類型代碼為5。
Packet length——以字節(jié)為單位的OSPF數(shù)據(jù)報的長度,包含報頭部分。
Router ID——發(fā)送該數(shù)據(jù)包的路由器ID號。
Area ID ——該數(shù)據(jù)報所屬的區(qū)域。
Checksum——整個OSPF數(shù)據(jù)報的校驗和。
Instance ID——實例標志號。
Reservation——OSPFv3報頭的最后8比特保留,值總為0。
下圖是使用ethereal采集到的報文。
![]() Hello報文結構
如下圖所示:
![]() Interface ID——接口標志符。路由器的每一個接口都有一個唯一的標志符。
Router priority——路由器優(yōu)先級。路由器根據(jù)該值選舉DR/BDR。
Options——該24比特字段出現(xiàn)在Hello包、DBD和某些LSA中,OSPF路由器使用該字段實現(xiàn)某些與其他路由器通信的能力(詳見RFC2740)。
Hello interval——發(fā)送Hello包的周期時間。
Router dead interval——鄰居路由器認為該路由器的失效時間。
Designated router ID——DR路由器的ID。
Backup designated router ID——BDR路由器的ID。
Neighbors ID——鄰居列表。每個鄰居ID占4字節(jié)。
如下圖所示:
![]() Database Description報文結構
如下圖所示:
報文字段的含義:
Options——該24比特字段出現(xiàn)在Hello包、DBD和某些LSA中,OSPF路由器使用該字段實現(xiàn)某些與其他路由器通信的能力(詳見RFC2740)。
Interface MTU——接口MTU值。
I-bit——當設置為1,這個包是該數(shù)據(jù)庫描述數(shù)據(jù)包序列的第一個。
M-bit——當設置為1,則表明后續(xù)會有更多的數(shù)據(jù)庫描述數(shù)據(jù)包。
MS-bit——主/從位。當設置為1,則表明該路由器是主路由器。否則,路由器是從路由器。
DD sequence
number——來標識一組DBD包。當?shù)谝粋€發(fā)送DBD包(也就是說該DBD包中的I位被置為1,我們可以認為往往第一個DBD包一定是由Master
發(fā)的)時,該DD sequence number字段開始被使用,在往后的DBD包中的DD sequence number都會遞增1。
如下圖所示:
Options 字段結構,
如下圖所示:
DC比特——當始發(fā)路由器具有支持按需電路上的0sPF的能力時,該位將被設置。
R 比特——用來標識設備是否是具備轉發(fā)能力的路由器。如果R 比特置0,宣告該節(jié)點的路由信息將不會參加路由計算,如果當前設備是一個不想轉發(fā)非本地地址的報文,可以將R 比特置0。
N位——只用在HeIlo數(shù)據(jù)包中。一臺路由器設置N葫←l表明它支持NssA外部LsA。如果設置N=o,那么路由器將不接受和發(fā)送NssA外部
LsA。鄰居路由器如果錯誤配置了N位,將不會形成鄰接關系,這個限制可以確保一個區(qū)域內的所有路由器都同樣地具有支持NssA的能力。如果N=1時,E
必須設置為0。
MC位——當始發(fā)路由器具有轉發(fā)IP組播數(shù)據(jù)包的能力時,該位將被設置。這一位使用在MOsPF協(xié)議當中。
E位——當始發(fā)路由器具有接受As外部LsA的能力時,該位將被設置。在所有的As外部LSA和所有始發(fā)于骨干區(qū)域以及非末梢區(qū)域的LsA中,該位將設置
為1。而在所有始發(fā)于末梢區(qū)域的LsA當中,該位設置為0。另外,可以在Hello數(shù)據(jù)包中使用該位來表明一個接口具有接收和發(fā)送類型5的LsA的能力。
E訕t配置錯誤的鄰居路由器將不能形成鄰接關系,這個限制可以確?!獋€區(qū)域的所有路由器都同樣地具有支持末梢區(qū)域的能力。
V 比特——如果V 比特置0,該路由器或鏈路也不會參加路由計算。
Link State Request報文結構
如下圖所示:
LSR中使用以下信息來唯一地標識要請求的LSA:
鏈路狀態(tài)(LS)類型號。
LS標識。
通告路由器。
如下圖所示:
Link State Update報文結構
如下圖所示:
鏈路狀態(tài)更新(LSU)報文用于把LSA發(fā)送給它的鄰居,這些更新報文是用于對LSA請求的應答。一個LSU中可以包括多個LSA條目。
如下圖所示:
Link State Acknowledgment報文結構
如下圖所示:
LSAck報文唯一地標識其要應答的LSA報文。標識以包含在LSA頭中的信息為基礎,包括LS順序號和通告路由器。LSA與應答報文之間無需1對1的對應關系。多個LSA可以用一個報文來應答。
如下圖所示:
LSA頭報文結構
如下圖所示:
所有的LSA使用一個通用的頭格式。這個頭20字節(jié)長并附加于標準的24字節(jié)OSPF頭后面。LSA頭惟一地標識了每種LSA。所以,它包括關于LSA類型、鏈路-狀態(tài)ID及通告路由器ID的信息。
下面是LSA頭域,其具體字段含義:
LS age——LSA頭中的前兩個字節(jié)包含LSA的年齡(age)。這個年齡是自從LSA產(chǎn)生時已消逝的秒數(shù)。
LS type——指出9種LSA類型中的一種。每種LSA類型的格式是不同的。
Link State ID——鏈路狀態(tài)ID域4字節(jié)長用于指明LSA描述的特定網(wǎng)絡環(huán)境區(qū)域。實際上,這個域的內容直接依賴于LS類型。比如,在路由器LSA中,鏈路狀態(tài)ID包含產(chǎn)生了這個報文的OSPF路由器ID。
Advertising Router——通告路由器。該字段填入生成該LSA的路由器的Router ID。
LS sequence number——表示該LSA的序列號,OSPF路由器在刷新LSA時會遞增每個LSA報文的序列號。接收路由器可以根據(jù)序列號來判斷該實力是否是最新的LSA實例。
LS
Checksum——校驗和用于檢查LSA在傳輸?shù)侥康牡氐倪^程中是否受到破壞。校驗和采用簡單的數(shù)學算法。它的輸出結果依賴于其輸入,并且有高度的一致
性。給定相同的輸入,校驗和算法總是給出相同的輸出。LS校驗和域使用部分LSA報文內容(包括頭,不包括LS年齡和校驗和域)來生成校驗和值。源節(jié)點運
行Fletcher算法并把結果存于LS校驗和域中。目的節(jié)點執(zhí)行相同的算法并把結果與存儲在校驗和域中的結果比較,如果兩個值不相同,就可以認為報文在
傳輸過程中被破壞。
Length——LS長度域用于通知接收方LSA的長度(以字節(jié)為單位)。
LS type字段結構如下圖所示:
U 位:描述了路由器收到一個類型未知的LSA 時如何處理,取值為0 表示把類型未知LSA 當成具有鏈路本地范圍的LSA 一樣處理,取值為1 表示按照S2/S1 位標識的泛洪范圍來處理。
S2/S1 位:共同標識LSA 的泛洪范圍,取值00 表示LSA 只在產(chǎn)生該LSA 的本地鏈路上泛洪;取值01 表示LSA 的泛洪范圍為產(chǎn)生該LSA 的路由器所在區(qū)域;取值10 表示LSA 將在整個自治系統(tǒng)內進行泛洪;取值11 保留。
LSA Function Code:LSA 類型編碼,描述LSA 的類型,類型編碼取值與LSA 類型的對應關系如下表所示。
常用的有9種LSA的類型,具體見下表。
區(qū)域內前綴LSA(Intra-Area-Prefix-LSA)
該類型LSA在本區(qū)域內傳播,具有以下兩種功能之一:通過參考網(wǎng)絡LSA把IPv6地址前綴與轉遞網(wǎng)絡(transit
network)相關聯(lián);或者通過參考路由器LSA把IPv6地址前綴與路由器相關聯(lián)。一臺路由器可以為給定的區(qū)域產(chǎn)生多個該類型的LSA,這些LSA使
用鏈路狀態(tài)ID字段(Link State ID)區(qū)分。DR為它所代表的鏈路產(chǎn)生一個或多個該類型的LSA,向整個區(qū)域內通告該鏈路的地址前綴。
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字段來聯(lián)合標識的。
主要字段的解釋如下:
# Prefixes:包含的IPv6 地址前綴的個數(shù)。
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 的發(fā)布路由器。如果引用的是Router LSA,此字段值為產(chǎn)生該LSA 路由器的Router ID;如果引用的是Network LSA,此字段值為DR 的Router ID。
如下圖所示:
3.1.3 OSPFv3路由協(xié)議工作機制
OSPFv3協(xié)議的工作原理與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多區(qū)域配置
在配置OSPFv3路由協(xié)議之前,需要注意到以下幾點:
接口要參與OSPFv3運行,必須在接口配置模式下明確啟動。而在OSPFv2中,這是通過在OSPF路由配置模式下,通過network命令間接啟動。
如果配置接口參與OSPFv3運行,那么接口上所有的地址都將參與IPv6運行。而在OSPFv2中,所有地址都必須通過network命令啟動。
在運行OSPFv3的環(huán)境中,在同一個鏈路上能夠允許運行多個OSPF實體,該鏈路所連的不同設備可以選擇參與運行某一個OSPF實體。OSPFv2并不支持該功能。
每臺運行OSPFv3進程的設備都必須使用一個router ID來標識,router
ID使用IPv4地址格式。不同于OSPFv2,OSPFv2進程將自動獲取IPv4地址作為router
ID,設備在啟動OSPFv3進程后,用戶必須使用router-id命令為OSPFv3進程配置router ID,否則OSPFv3進程將無法啟動。
本實驗的網(wǎng)絡拓撲如下圖所示:
具體配置如下所示:
路由器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命令來查看路由表和鄰居狀態(tài)。
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重分發(fā)配置 本實驗拓撲,如下圖所示:
具體配置如下:
路由器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路由協(xié)議更詳細的信息。
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末節(jié)區(qū)域配置
本實驗拓撲圖如下所示:
具體配置如下:
路由器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 虛鏈路配置 具體配置如下:
路由器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 身份驗證配置
本實驗拓撲圖,如下所示:
具體配置如下所示:
路由器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抓取其認證的報文,如下圖所示:
根據(jù)下圖所示,當路由器啟用身份驗證時,不論是Hello報文、DBD報文、LSR報文和LSU還是LSAck報文,都會在其OSPF報文的頭
之前加上一個認證的報頭(AH),這只不過是對接收和發(fā)送OSPFv3報文進行一個身份驗證,MD5加密的只是進行身份驗證的口令,并不是對OSFPv3
協(xié)議傳輸?shù)膱笪牡膬热葸M行加密。
因為OSPFv3路由協(xié)議本身是不提供安全機制的,所以只能在OSPFv3報文的前邊加上一個驗證報頭。
這只是對接收和發(fā)送OSPFv3各種報文的路由器進行合法身份的驗證,如果想對報文進行加密或更好的提高其安全,可以使用IPSec協(xié)議。關于OSPFv3使用IPSec協(xié)議提高安全性,會在下篇博文中詳細講述。
3.1.9 OSPFv3 網(wǎng)絡類型的配置 3.1.9.1 OSPFv3 point-to-point環(huán)境下配置 具體配置如下所示:
路由器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命令查看狀態(tài)信息
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環(huán)境下配置
本實驗拓撲圖,如下圖所示:
在本配置本實驗之前需要注意以下幾點:
1、在配置幀中繼鏈路時,需要使用命令:
frame-relay map ipv6 ipv6-address dlci broadcast
這里ipv6-address是對端接口的本地鏈路地址。
2、在配置OSPF時,需要在接口下配置OSPF的網(wǎng)絡類型
ipv6 ospf network point-to-multipoint
3、在此環(huán)境下可以指定鄰居,也可以不指定鄰居
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命令查看狀態(tài)信息,如下所示:
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環(huán)境下配置
本實驗拓撲圖,如下圖所示:
在本配置本實驗之前需要注意以下幾點:
1、在配置幀中繼鏈路時,需要使用命令:
frame-relay map ipv6 ipv6-address dlci broadcast
——這里ipv6-address是對端接口的本地鏈路地址。
2、在配置OSPF時,需要在接口下配置OSPF的網(wǎng)絡類型
ipv6 ospf network point-to-multipoint non-broadcast
3、在此環(huán)境下可以指定鄰居,也可以不指定鄰居
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命令查看狀態(tài)信息
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 |
|
|