且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NA-NP-IE系列实验14:RIPv2 基本配置

更新时间:2022-09-21 08:04:36

实验14RIPv2 基本配置
1.实验目的
通过本实验可以掌握:
1)在路由器上启动RIPv2 路由进程
2)启用参与路由协议的接口,并且通告网络
3auto-summary 的开启和关闭
4)查看和调试RIPv2 路由协议相关信息
2.拓扑结构
实验拓扑如图4-1 所示。
NA-NP-IE系列实验14:RIPv2 基本配置
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)#
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)#v 2
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)
RIP: build update entries
      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)#
r0(config-router)#do un all
All possible debugging has been turned off
r0(config-router)#
从上面输出的路由条目“3.3.3.0/24”,可以看到RIPv2 路由更新是携带子网信息的。
2)步骤2:配置路由器R1
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
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
                ^
% Invalid input detected at '^' marker.
 
r1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial1/1/0, changed state to up
r1(config-if)#
r1(config-if)#exit
r1(config)#int s
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1/0, changed state to up
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
r1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial1/1/1, changed state to down
r1(config-if)#
%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-if)#
r1(config-if)#
r1(config-if)#exit
r1(config)#router rip 
r1(config-router)#v 2
r1(config-router)#no auto
r1(config-router)#net 172.16.1
                      ^
% Invalid input detected at '^' marker.
 
r1(config-router)#net 172.16.1.0
r1(config-router)#net 172.16.2.0
r1(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
R       1.1.1.0 [120/1] via 172.16.1.1, 00:00:01, Serial1/1/0
     3.0.0.0/24 is subnetted, 1 subnets
R       3.3.3.0 [120/1] via 172.16.2.2, 00:00:12, Serial1/1/1
     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.1.0 is directly connected, Serial1/1/0
C       172.16.2.0 is directly connected, Serial1/1/1
r1(config-router)#
3)步骤3:配置路由器R2
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho r3
r2(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
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
%LINK-5-CHANGED: Interface Serial1/1/1, changed state to up
r2(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1/1, changed state to up
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,如需转载请自行联系原作者