思科企業基礎架構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協議

圖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)。因爲它確實還可以用於性能不太理想的中小型分制企業的路由器,同時它還是一個公有標準的路由協議

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 route

    • 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 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:05, Ethernet0/1
下圖5-3爲RIPv1的報文僅供參考,其中可以看到RIPv1的request報文目標地址爲廣播地址255.255.255.255
思科企業基礎架構CCIE全系實驗:RIP協議

圖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/1
HQ收到了對端的路由。當然最好的方案是兩側都配置RIPv2

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章