天天看點

CCNA配置試驗之二 RIPv2協定的配置

<b>RIP</b><b>概述</b>

<b>RIP</b><b>也稱距離矢量協定,用資訊包所經過的網關來做距離的機關,超過15</b><b>跳便無法到達</b>

<b>RIP</b><b>是通過UDP</b><b>端口520</b><b>來進行操作的,RIP</b><b>資訊包是封裝在UDP segment</b><b>中的.RIP</b><b>定義了2</b><b>種資訊類型</b>

<b> </b>

<b>Request message(</b><b>請求資訊)</b><b>和Response message(</b><b>應答資訊).</b><b>請求資訊是用來向鄰居請求發送一個update(</b><b>更新),</b><b>應答資訊運載着這個被請求的update.</b>

<b>RIP</b><b>的 metric</b><b>是基于hop count(</b><b>跳數)</b><b>的,metric</b><b>為16</b><b>代表不可達</b>

<b>RIPv2 </b><b>與 RIPv1 </b><b>的差別</b>

-         <b>是個無類的路由協定</b>

-         <b>多點傳播(224.0.0.9</b><b>)路由更新(不用廣播)</b>

-         <b>支援 VLSM</b><b>(在更新過程中發送掩碼)</b>

-         <b>支援手動彙總</b>

-         <b>支援 (MD5) </b><b>或者 </b><b>純文字認證</b>

<b>RIP  </b><b>配</b><b>  </b><b>置</b>

<b>Router(config)#router rip</b>

激活RIP協定

<b>Router(config-router)# version 2</b>

啟用RIPv2

<b>Router(config-router)#network network-number</b>

<b>選擇需要激活的接口所在的網段</b>

用試驗驗證RIPv2的配置:

試驗環境如下:

試驗環境說明:

R1的ip位址為10.1.1.1 (S0/0)                      網絡掩碼為255.255.255.0

R2的ip位址為 10.1.1. 2   (S0/0)  10.2.2.2 (S0/1) 網絡掩碼為255.255.255.0

R3的ip位址為 10.2.2.3    (S0/1)                  網絡掩碼為255.255.255.0

R1的S0/0  R2的S0/1 為DCE端

試驗要求:在路由器間配置RIPv2 使路由器間互相ping通。

下面開始試驗(紅色字型為配置内容)

R1

Router&gt;en

Router#conf t

Enter configuration commands, .e per line.  End with CNTL/Z.

Router(config)#host r1

r1(config)#int s0/0

r1(config-if)#ip addr 10.1.1.1 255.255.255.0

r1(config-if)#no shut

r1(config-if)#clock rate 64000

r1(config-if)#exit

r1(config)#router rip

r1(config-router)#ver 2

r1(config-router)#network 10.0.0.0

R2

Router(config)#host r2

r2(config)#int s0/0

r2(config-if)#ip addr 10.1.1.2 255.255.255.0

r2(config-if)#no shut

r2(config-if)#exit

r2(config)#int s0/1

r2(config-if)#ip addr 192.168.1.1 255.255.255.0

r2(config-if)#clock rate 64000

r2(config)#router rip

r2(config-router)#ver 2

r2(config-router)#network 10.0.0.0

r2(config-router)#network 192.168.1.0

R3

Router(config)#host r3

r3(config)#int s0/1

r3(config-if)#ip addr 192.168.1.2 255.255.255.0

r3(config-if)#no shut

r3(config-if)#exit

r3(config)#router rip

r3(config-router)#ver 2

r3(config-router)#network 192.168.1.0

在路由器 R1  R2  R3上show ip route 檢視路由表資訊

r1#show ip route

Codes: 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

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, Serial0/0

R    192.168.1.0/24 [120/1] via 10.1.1.2, 00:00:54, Serial0/0

r2#show ip route

C    192.168.1.0/24 is directly connected, Serial0/1

r3&gt;show ip route

R    10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:15, Serial0/1

在路由器R1上 show ip protocols 檢視路由協定   如下内容所示 路由器之間通訊協定為rip

r1#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 10 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

    Serial0/0             2     2

  Automatic network summarization is in effect

  Maximum path: 4

  Routing for Networks:

    10.0.0.0

  Routing Information Sources:

    Gateway         Distance      Last Update

    10.1.1.2             120      00:00:16

  Distance: (default is 120)

在R1上對R3  R4 進行ping 測試,如下所示,全部ping通啦

r1#ping 10.1.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 144/402/576 ms

r1#ping 192.168.1.1

Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

Success rate is 100 percent (5/5), round-trip min/avg/max = 140/258/500 ms

r1#ping 192.168.1.2

Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

Success rate is 100 percent (5/5), round-trip min/avg/max = 356/548/860 ms

OK 試驗成功

本文轉自 範琳琳 51CTO部落格,原文連結:http://blog.51cto.com/fanlinlin/132305,如需轉載請自行聯系原作者

繼續閱讀