-
RIPv2
鎖定
- 中文名
- Routing Information Protocol
- 簡 稱
- RIP
- 組播地址
- 224.0.0.9
- UDP端口號
- 520
RIPv2定義
RIP 使用跳數來衡量到達目的地的距離,稱為路由量度。在RIP 中,設備到與它直接相連網絡的跳數為0;通過一個設備可達的網絡的跳數為1 ,其餘依此類推;不可達網絡的跳數為16。
RIPv2RIP版本2
RFC 1388 [Malkin 1993a]中對R I P定義進行了擴充,通常稱其結果為RIP-2。這些擴充並不改變協議本身,而是利用RIPv1中的一些標註為“必須為0”的字段來傳遞一些額外的信息。如果RIP忽略這些必須為0的字段,那麼,RIP和RIP-2可以互操作。
選路域(routing domain)是一個選路守護程序的標識符,它指出了這個數據報的所有者。在一個Unix實現中,它可以是選路守護程序的進程號。該域允許管理者在單個路由器上運行多個RIP實例,每個實例在一個選路域內運行。
RIP-2提供了一種簡單的鑑別機制。可以指定RIP報文的前20字節表項地址系列為0xffff,路由標記為2。表項中的其餘16字節包含一個明文口令。
RIPv2優勢
RIP有RIP-1和RIP-2兩個版本。
RIP-1是有類別路由協議(Classful Routing Protocol),它只支持以廣播方式發佈協議報文。RIP-1的協議報文無法攜帶掩碼信息,它只能識別A、B、C類這樣的自然網段的路由,因此RIP-1不支持非連續子網(Discontiguous Subnet)。
RIP-2是一種無類別路由協議(Classless Routing Protocol),與RIP-1相比,它有以下優勢:
支持路由標記,在路由策略中可根據路由標記對路由進行靈活的控制。
支持指定下一跳,在廣播網上可以選擇到最優下一跳地址。
支持組播路由發送更新報文,減少資源消耗。
支持對協議報文進行驗證,並提供明文驗證和MD5驗證兩種方式,增強安全性。
【説明】RIP-2有兩種報文傳送方式:廣播方式和組播方式,默認將採用組播方式發送報文,使用的組播地址為224.0.0.9。當接口運行RIP-2廣播方式時,也可接收RIP-1的報文。
RIPv2配置方法
配置各路由器接口IP地址
routerA(config)#interface f0/0
routerA(config-if)#no shutdown
routerA(config-if)#interface f0/1
routerA(config-if)# ip address 192.168.1.1 255.255.255.0
routerA(config-if)#no shutdown
routerB(config)#interface f0/0
routerB(config-if)#ip address 10.1.2.1 255.255.255.0
routerB(config-if)#no shutdown
routerB(config)#interface f0/1
routerB(config-if)#ip address 192.168.1.2 255.255.255.0
routerB(config-if)#no shutdown
routerC(config)#interface f0/0
routerC(config-if)#ip address 192.168.1.3 255.255.255.0
routerC(config-if)#no shutdown
routerC(config)#interface f0/1
routerC(config-if)#ip address 192.168.2.1 255.255.255.0
routerC(config-if)#no shutdown
在路由器上配置RIP V2 路由協議
routerA(config)#router rip (設置路由協議為RIP)
routerA(config-router)#version 2
routerA(config-router)#no auto-summary (關閉路由協議的自動彙總功能)
routerA(config-router)#network 10.0.0.0
routerA(config-router)#network 192.168.1.0
routerB(config)#router rip
routerB(config-router)#version 2
routerB(config-router)# no auto-summary
routerB(config-router)#network 10.0.0.0
routerB(config-router)#network 192.168.1.0
routerC(config)#router rip
routerC(config-router)# version 2
routerC(config-router)# no auto-summary
routerC(config-router)#network192.168.1.0
routerC(config-router)#network 192.168.2.0
驗證配置是否正確
(1)查看路由表
router#show ip route
(2)查看路由協議配置
router#show ip protocols
(3)打開RIP協議調試命令
router#debug ip rip
測試連通性
在PC上設置IP地址、子網掩碼、默認網關,用ping命令測試連通性