思科企業基礎架構CCIE全系實驗:RIP協議

第5章
從本章開始,咱們將進入到正式的路由協議,在TCP/IP協議棧中,最重要和應用最普遍的幾個路由協議有:RIP協議、EIGRP協議(思科私有)、OSPF協議和BGP協議,咱們將在從此幾部分中一一爲你們講解。固然這些都是CCIE認證考試的重要組成部分,並且路由是一切應用的基礎數據庫

乾頤堂安德
RIP協議網絡

本章要點
 RIP理論基礎和場景需求
 實驗拓撲和需求描述
 RIP實驗步驟架構

5.1 RIP理論基礎和場景需求

RIP即路由信息協議,是最先的用於生產環境的TCP/IP協議棧的動態路由協議。相對靜態來說,動態路由更加靈活,可是相對的要維護動態路由協議的多種報文
RIP協議的處理是經過UDP520的端口來操做的。固然RIP的最終極目的仍是更新路由,使得路由器的控制層面得以構建
RIP定義了兩種信息類型:請求信息和響應信息。做爲參考,咱們給出一個RIPv2的典型報文,能夠清晰的看到其工做在UDP層面,這是一個response報文(RIP另一個報文是request,用於請求路由表)
思科企業基礎架構CCIE全系實驗:RIP協議app

圖5-1 Wireshark抓取的RIPv2的Response報文
RIP使用一個單一的路由度量(跳數)測量到達目的網絡的距離,最大度量爲15跳,若是一條路由的條數爲16跳則不可達
RIP有一系列的計時器協同工做:
更新計時器update timer(30秒)
無效計時器invalid timer(180秒)
flush沖刷計時器(無效計時器長60秒,RFC1058規定爲120S)
抑制計時器(180秒,思科私有參數)
若是路由更新通告的跳數大於路由表已記錄的跳數,而且更新來自於已記錄條目的下一跳路由器,那麼該路由將在一個指定的抑制時間段內被標記爲不可到達。若是在抑制時間超時後,同一臺鄰居路由器仍然通告這個有較大跳數的路由,路由器則接受該路由新的度量值
RIP還有一系列的防環機制:
① 水平分割-把信息從收到它的方向發回去沒有任何意義。
② 毒性逆轉-從一個接口接收到的路由,從同一個接口update出去的時候,metric值設爲最大,16跳。
③ 路由毒化-路由器向外宣告無效路由時,將其跳數置爲最大值。
④ 觸發更新。
RIP的分類:RIP分爲V1和V2.其中RIPv1爲有類路由(它在更新路由信息時不攜帶子網掩碼)
RIP做爲TCP/IP協議棧的第一代動態路由協議已經不多使用,可是仍然是CCIE認證中不可或缺的部分,雖然分值僅僅在2分左右(同時不會涉及RIPv1)。由於它確實還能夠用於性能不太理想的中小型分制企業的路由器,同時它仍是一個公有標準的路由協議ide

5.2 實驗拓撲和需求描述

思科企業基礎架構CCIE全系實驗:RIP協議

圖5-2 在Branch和HQ完成RIP協議
本實驗中僅僅用到Branch和HQ設備,不用關心SW1和SW2。經過配置Branch和HQ設備完成對RIP的理解。如圖5-2爲本實驗的拓撲圖。性能

5.3 RIP實驗步驟

5.3.1 配置RIPv1,並觀察有類路由

RIP分爲v1和v2,RIPv1有不少弱點,好比它是一個有類路由,更新路由時僅僅有前綴,而沒有掩碼,不攜帶下一跳,不支持認證等特色。咱們在此依舊使用和配置RIPv1的目的是爲了理解動態路由協議,同時是爲了保持知識的完整性和流暢性
Branch的IP地址驗證:
Branch#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES NVRAM up up
Ethernet0/0.10 10.1.10.254 YES manual up up
Ethernet0/0.20 10.1.20.254 YES manual up up
Ethernet0/1 192.168.1.1 YES manual up up
說明:e0/0的兩個子接口爲下聯PC的網關,相關配置以下:
interface Ethernet0/0.10
encapsulation dot1Q 10
ip address 10.1.10.254 255.255.255.0
interface Ethernet0/0.20
encapsulation dot1Q 20
ip address 10.1.20.254 255.255.255.0
HQ設備地址配置:
HQ#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 172.16.1.254 YES manual up up
Ethernet0/1 192.168.1.2 YES manual up up
Ethernet0/2 unassigned YES NVRAM up up
Ethernet0/3 unassigned YES NVRAM up up
Branch和HQ配置RIPv1
Branch:
router rip
network 10.0.0.0—RIP僅僅能夠通告主類路由,不帶任何掩碼
network 192.168.1.0—通告和HQ的直連網段,用於同步RIP的數據庫
no auto-summary---須要說明的是,RIPv1爲有類路由,是否關掉自動彙總沒有任何意義,由於它在
更新時不攜帶任何掩碼信息,都爲主類的路由,咱們將在後邊專門討論RIP的
自動彙總(事實上,任何一種距離適量協議咱們都作討論)
HQ:
router rip
network 172.16.0.0
network 192.168.1.0—通告和Branch的直連網段,用於同步RIP的數據庫。注意HQ沒有關掉自動彙總
驗證:
Branch#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application routeui

    • replicated route, % - next hop override

Gateway of last resort is not set
R 172.16.0.0/16 [120/1] via 192.168.1.2, 00:00:22, Ethernet0/1—雖然HQ的接口爲24位掩碼,但
是因爲RIPv1是有類的,則老是
傳遞不帶子網的路由
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application routedebug

    • replicated route, % - next hop override

Gateway of last resort is not set3d

R 10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:05, Ethernet0/1
下圖5-3爲RIPv1的報文僅供參考,其中能夠看到RIPv1的request報文目標地址爲廣播地址255.255.255.255
思科企業基礎架構CCIE全系實驗:RIP協議code

圖5-3 RIPv1的報文

5.3.2 認識和配置RIPv2

RIPv2協議不是一個新的協議,它只是在RIPv1協議的基礎上增長了一些擴展特性:
每一個路由條目都攜帶本身的子網掩碼,支持VLSM、支持無類路由CIDR查找
路由選擇更新具備認證功能
每一個路由條目都攜帶下一跳地址
經過組播路由更新(224.0.0.9)
默認狀況下路由在跨越主類網絡邊界時,會自動彙總,可是也能夠關閉自動彙總,進行手動彙總
特別須要說明的是,有無數的學員會在實施RIP時,在某一端忘記配置」version 2「命令,這將引發巨大的麻煩
Branch:
router rip
version 2—配置爲RIPv2,注意兩端都須要配置RIPv2,不然會出現路由缺失的問題
network 10.0.0.0
network 192.168.1.0
no auto-summary—關閉自動彙總,而後觀察路由,注意,RIPv2爲無類路由,即路由更新攜帶掩碼
信息,咱們會看到子網。注意關掉自動彙總纔是咱們經常使用的策略
HQ:
router rip
version 2
network 172.16.0.0
network 192.168.1.0
no auto-summary
驗證:
若是咱們沒有經過clear ip route 的命令來清除路由的話,咱們可能會看到下面的狀況:
Branch#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area,
- candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
R 172.16.0.0/16 is possibly down,
routing via 192.168.1.2, Ethe---該路由可能已經不可達。這是由於該路由已經無效,可是
還沒被沖刷掉,因此RIP並非一個收斂速度很快的協議
R 172.16.1.0/24 [120/1] via 192.168.1.2, 00:00:24, Ethernet0/1
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 2 subnets

R 10.1.10.0 [120/1] via 192.168.1.1, 00:00:24, Ethernet0/1
R 10.1.20.0 [120/1] via 192.168.1.1, 00:00:24, Ethernet0/1
此時咱們獲得的路由纔是一個正確的很是具體的明細路由,這是也最一般的狀況

5.3.3 觀察RIP的自動彙總

再次重申,關掉自動彙總纔是咱們最經常使用的手段,必定意義上自動彙總(目的是減小路由表)會形成某些拓撲中的路由器不知道如何路由數據包
① RIP會把自己產生的路由(通告)、重分佈的路由彙總到主類的邊界,好比10.1.1.0/24的路由會自動彙總到10.0.0.0/8。
Branch(config)#router rip
Branch(config-router)#auto-summary---該命令是默認的,在以前咱們關掉,此時再次配置
!
HQ(config)#router rip
HQ(config-router)#auto-summary
此時,沒有刷新路由表時的狀況:
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

R 10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:16, Ethernet0/1—自動彙總獲得的路由
R 10.1.10.0/24 [120/1] via 192.168.1.1, 00:00:44, Ethernet0/1---以前關閉自動彙總獲得的路由
R 10.1.20.0/24 [120/1] via 192.168.1.1, 00:00:44, Ethernet0/1
若是你有足夠的耐心,你能夠看到下面的狀況:
Branch#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks

R 172.16.0.0/16 [120/1] via 192.168.1.2, 00:00:21, Ethernet0/1---從對端更新獲得的彙總到主
類的路由(B類默認的16位
的掩碼)
R 172.16.1.0/24 [120/1] via 192.168.1.2, 00:03:03, Ethernet0/1---請讀者注意一下次此處的時間,3分03秒即180秒(會多出一點點)該路由還出於老化計時器的時間以內
Branch#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks

R 172.16.0.0/16 [120/1] via 192.168.1.2, 00:00:25, Ethernet0/1
R 172.16.1.0/24 is possibly down,
routing via 192.168.1.2, Ethe---此時在沖刷計時器的時間內
爲了更好的觀察RIPv2,HQ觀察debug ip rip獲得的報文
Oct 20 06:18:07.594: RIP: sending v2 update to 224.0.0.9 via Ethernet0/1 (192.168.1.2)---從該接口發送
組播更新
Oct 20 06:18:07.594: RIP: build update entries
Oct 20 06:18:07.594: 172.16.0.0/16 via 0.0.0.0, metric 1, tag 0---更新彙總以後的16的路由,注意
此處的0.0.0.0是固定的,tag爲0
(外部路由能夠設置該值)
HQ#
Oct 20 06:18:09.113: RIP: received v2 update from 192.168.1.1 on Ethernet0/1
Oct 20 06:18:09.113: 10.0.0.0/8 via 0.0.0.0 in 1 hops---一個彙總到主類邊界的路由
HQ#
Oct 20 06:18:19.163: RIP: sending v2 update to 224.0.0.9 via Ethernet0/0 (172.16.1.254)
Oct 20 06:18:19.164: RIP: build update entries
Oct 20 06:18:19.165: 10.0.0.0/8 via 0.0.0.0, metric 2, tag 0
Oct 20 06:18:19.165: 192.168.1.0/24 via 0.0.0.0, metric 1, tag 0
② 接下來HQ關掉自動彙總,Branch保持自動彙總。
HQ(config-router)#no auto-summary
兩臺設備clear ip route

HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

R 10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:20, Ethernet0/1---Branch保持了自動彙總,那麼該設
備更新報文時就已經進行過彙總,
因此獲得了/8的路由
Branch#sh ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 1 subnets

R 172.16.1.0 [120/1] via 192.168.1.2, 00:00:12, Ethernet0/1---HQ關掉了自動彙總,那麼HQ
更新報文時就是/24的路由,所
以該設備獲得了明細路由
③ 不自動彙總的狀況。
對於連續子網的環境,在通告路由給鄰居的時候,會帶上子網掩碼,通告明細路由
爲了觀察該現象,咱們須要改造一下拓撲,把Branch和HQ的直連改成/30的子網,把HQ的e0/0地址改成192.168.1.5/30.同時兩臺設備都開啓自動彙總
Branch:
interface Ethernet0/1
ip address 192.168.1.1 255.255.255.252
router rip
version 2
network 10.0.0.0
network 192.168.1.0
HQ:
interface Ethernet0/0
ip address 192.168.1.5 255.255.255.252
interface Ethernet0/1
ip address 192.168.1.2 255.255.255.252
router rip
version 2
network 172.16.0.0
network 192.168.1.0
驗證:
Branch#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks

R 192.168.1.4/30 [120/1] via 192.168.1.2, 00:00:15, Ethernet0/1
咱們發現此時Branch獲得的路由是一個沒有彙總的路由,由於此時HQ的192.168.1.0/30和192.168.1.4/30是連續的子網(在同一個主類網絡前綴)

5.3.4 RIP的單播更新和PASSIVE

passive-interface是指RIP不發組播更新,能夠接收更新,此時能夠用neighbor命令指定鄰居能夠單播更新。整體上而言這是一種節省路由器資源的技術,由於須要把鏈接主機的接口所在網絡更新給對端,而同時該接口是不須要對主機發送路由更新的。
若是沒有passive-interface,而用neighbor命令指定鄰居,那麼RIP進程單播、組播更新一塊兒發送。
在配置下面步驟以前請自行關掉兩個設備的自動彙總(省略)
Branch:
router rip
version 2
passive-interface default—passive掉全部運行RIP的接口,固然此時也能夠單獨passive掉e0/1接口
network 10.0.0.0
network 192.168.1.0
no auto-summary
HQ:
router rip
version 2
passive-interface default
network 172.16.0.0
network 192.168.1.0
no auto-summary
清除完畢路由以後會發現沒有任何路由,由於自己這就是一種抑制路由更新的技術
下面配置單播更新路由
Branch(config-router)#neighbor 192.168.1.2

HQ(config-router)#neighbor 192.168.1.1
若是開啓debug ip rip 的話會看到以下信息:
Oct 20 07:55:44.668: RIP: sending v2 update to 192.168.1.2 via Ethernet0/1 (192.168.1.1)—單播更新
Oct 20 07:55:44.668: RIP: build update entries
Oct 20 07:55:44.668: 10.1.10.0/24 via 0.0.0.0, metric 1, tag 0
Oct 20 07:55:44.668: 10.1.20.0/24 via 0.0.0.0, metric 1, tag 0

5.3.5 RIPv2的認證

RIPv1不支持認證
RIPv2支持明文和MD5認證,若是認證不經過,則不會收到來自鄰居的路由信息。須要說明的是路由協議的認證並不像ppp同樣是認證鏈路的
配置MD5認證:
Branch:
key chain QYT---「鑰匙鏈」名爲QYT,具備本地意義,即兩端能夠不一樣
key 1---任何的MD5的key ID必需要相同
key-string cisco---key的密碼兩端要相同
interface Ethernet0/1
ip address 192.168.1.1 255.255.255.252
ip rip authentication mode md5---開啓RIP的認證模式爲MD5
ip rip authentication key-chain QYT---調用key chain

HQ:
key chain QYT
key 1
key-string cisco
interface Ethernet0/1
ip address 192.168.1.2 255.255.255.252
ip rip authentication mode md5
ip rip authentication key-chain QYT
驗證:
HQ#show key chain
Key-chain QYT:
key 1 -- text "cisco"
accept lifetime (always valid) - (always valid) [valid now]
send lifetime (always valid) - (always valid) [valid now]
驗證路由狀況
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 2 subnets

R 10.1.10.0 [120/1] via 192.168.1.1, 00:00:20, Ethernet0/1
R 10.1.20.0 [120/1] via 192.168.1.1, 00:00:20, Ethernet0/1
配置明文認證更加簡單,默認狀況下RIPv2就是明文認證,只要不開啓MD5認證即爲明文認證
Branch(config)#interface e0/1
Branch(config-if)#no ip rip authentication mode md5
此時就開啓了text認證,若是另一端不去掉則沒法同步路由信息

5.3.6 RIPv1和RIPv2的兼容性問題

該問題存在於一端運行RIPv1,另一端運行RIPv2的場景。咱們用以下實驗驗證兼容性以及解決方案
咱們恢復配置以下:
Branch:
router rip
network 10.0.0.0
network 192.168.1.0
no auto-summary---注意,此時默認運行了RIPv1,關閉自動彙總實際上是無效的
HQ:
router rip
version 2
network 192.168.1.0
no auto-summary
驗證路由狀況:
Branch#show ip route rip ---Branch收到了HQ的路由
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 3 subnets, 3 masks

R 192.168.1.4/30 [120/1] via 192.168.1.2, 00:00:17, Ethernet0/1
Branch#show ip protocols
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 14 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Ethernet0/0.10 1 1 2
Ethernet0/0.20 1 1 2
Ethernet0/1 1 1 2 ---默認狀況下RIPv1一側發送V1的報文,接收V1和V2
的報文,全部Branch接收了HQ的RIPv2報文,生成了
路由表
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
10.0.0.0
192.168.1.0
Routing Information Sources:
Gateway Distance Last Update
192.168.1.2 120 00:00:20
Distance: (default is 120)
此時HQ就沒有那麼幸運,它不會收到路由:
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set
經過以下命令驗證RIP的信息
HQ#show ip protocols
IP Routing is NSF aware

Routing Protocol is "application"
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Maximum path: 32
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 4)

Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 9 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Ethernet0/0 2 2
Ethernet0/1 2 2 ---HQ由於運行了RIPv2,默認狀況下發送並接收的報文
僅僅是RIPv2,因此不能收取RIPv1的報文,RIP的數據
庫都不會顯示
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
192.168.1.0
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 120)
HQ#show ip rip database ---數據庫沒有對端的路由表項
192.168.1.0/24 auto-summary
192.168.1.0/30 directly connected, Ethernet0/1
192.168.1.4/30 directly connected, Ethernet0/0
咱們可使用接口下的兼容命令完成解決方案:
HQ:
interface Ethernet0/1
ip address 192.168.1.2 255.255.255.252
ip rip receive version 1 2---HQ接口下能夠接收兩個版本的RIP消息(固然也能夠設置發送的報文類型)
驗證:
HQ#show ip route rip
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route

    • replicated route, % - next hop override

Gateway of last resort is not set

R 10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:25, Ethernet0/1HQ收到了對端的路由。固然最好的方案是兩側都配置RIPv2

相關文章
相關標籤/搜索