天天看點

NA-NP-IE系列實驗14:RIPv2 基本配置

實驗14:RIPv2 基本配置

1.實驗目的

通過本實驗可以掌握:

(1)在路由器上啟動RIPv2 路由程序

(2)啟用參與路由協定的接口,并且通告網絡

(3)auto-summary 的開啟和關閉

(4)檢視和調試RIPv2 路由協定相關資訊

2.拓撲結構

實驗拓撲如圖4-1 所示。

3.實驗步驟

(1)步驟1:配置路由器R0

Router>en

Router#conf t

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

Router(config)#ho r0

r0(config)#int loo 1

%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

r0(config-if)#ip add 1.1.1.1 255.255.255.0

r0(config-if)#int s1/1/0

r0(config-if)#ip add 172.16.1.1 255.255.255.0

r0(config-if)#clo r 64000

r0(config-if)#no sh

%LINK-5-CHANGED: Interface Serial1/1/0, changed state to down

r0(config-if)#

%LINK-5-CHANGED: Interface Serial1/1/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1/0, changed state to up

r0(config-if)#exit

r0(config)#router rip 

r0(config-router)#v 2

r0(config-router)#net 172.16.1.0

r0(config-router)#net 1.1.1.0

r0(config-router)#exit

r0(config)#no auto 

               ^

% Invalid input detected at '^' marker.

r0(config)#router rip

r0(config-router)#no auto 

r0(config-router)#do sh ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

       i - IS-IS, 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

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback1

     3.0.0.0/24 is subnetted, 1 subnets

R       3.3.3.0 [120/2] via 172.16.1.2, 00:00:25, Serial1/1/0

     172.16.0.0/24 is subnetted, 2 subnets

C       172.16.1.0 is directly connected, Serial1/1/0

R       172.16.2.0 [120/1] via 172.16.1.2, 00:00:25, Serial1/1/0

r0(config-router)#do ping 3.3.3.3

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 5/7/9 ms

r0(config-router)#

r0(config-router)#do debug ip rip

RIP protocol debugging is on

r0(config-router)#RIP: sending  v2 update to 224.0.0.9 via Serial1/1/0 (172.16.1.1)

RIP: build update entries

      1.1.1.0/24 via 0.0.0.0, metric 1, tag 0

RIP: sending  v2 update to 224.0.0.9 via Loopback1 (1.1.1.1)

      3.3.3.0/24 via 0.0.0.0, metric 3, tag 0

      172.16.1.0/24 via 0.0.0.0, metric 1, tag 0

      172.16.2.0/24 via 0.0.0.0, metric 2, tag 0

cRIP: received v2 update from 172.16.1.2 on Serial1/1/0

      3.3.3.0/24 via 0.0.0.0 in 2 hops

      172.16.2.0/24 via 0.0.0.0 in 1 hops

r0(config-router)#do un all

All possible debugging has been turned off

從上面輸出的路由條目“3.3.3.0/24”,可以看到RIPv2 路由更新是攜帶子網資訊的。

(2)步驟2:配置路由器R1

Router(config)#ho r1

r1(config)#no ip domain-loo

r1(config)#lin c 0 

r1(config-line)#logg s

r1(config-line)#exec-t 00

r1(config-line)#exit

r1(config)#int s1/1/0

r1(config-if)#ip add 172.16.1.2 255.255.255.0

r1(config-if)#nosh

                ^

r1(config-if)#no sh

r1(config-if)#

r1(config-if)#exit

r1(config)#int s

r1(config)#int s1/1/1

r1(config-if)#ip add 172.16.2.1 255.255.255.0

r1(config-if)#clo r 64000

%LINK-5-CHANGED: Interface Serial1/1/1, changed state to down

%LINK-5-CHANGED: Interface Serial1/1/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1/1, changed state to up

r1(config)#router rip 

r1(config-router)#v 2

r1(config-router)#no auto

r1(config-router)#net 172.16.1

                      ^

r1(config-router)#net 172.16.1.0

r1(config-router)#net 172.16.2.0

r1(config-router)#do sh ip route

R       1.1.1.0 [120/1] via 172.16.1.1, 00:00:01, Serial1/1/0

R       3.3.3.0 [120/1] via 172.16.2.2, 00:00:12, Serial1/1/1

C       172.16.2.0 is directly connected, Serial1/1/1

r1(config-router)#

(3)步驟3:配置路由器R2

Router(config)#ho r3

r2(config)#int loo 1

r2(config-if)#ip add 3.3.3.3 255.255.255.0

r2(config-if)#int s1/1/1

r2(config-if)#ip add 172.16.2.2 255.255.255.0

r2(config-if)#no sh

r2(config-if)#exit

r2(config)#router rip 

r2(config-router)#v 2

r2(config-router)#no auto

r2(config-router)#net 172.16.1.0

r2(config-router)#net 3.3.3.0

r2(config-router)#exit

r2(config)#ho r2

r2(config)#

2

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