实验目的
       掌握RIPv2的手工汇总
       掌握RIPv2的被动接口和单播的配置
       掌握RIPv2认证的配置
实验拓扑
dffgdf
实验要求:
       只有R1可以学习到R3的路由信息,R2学习不到
       R2上配置缺省路由来到达其他网段
       R3、R4之间启用RIP MD5认证
       在R4上对172.16.1.0—172.16.3.0进行手动汇总
       关闭R4上的水平分割,并用debug命令查看
       上述条件下使全网互通
实验步骤:
步骤1 按如上拓扑做好底层配置,并检测相邻设备的连通性
R1# configure terminal
R1(config)# interface loopback 0
R1(config-if)# ip address 1.1.1.1 255.255.255.0
R1(config-if)# interface fastethernet 0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R2# configure terminal
R2(config)# interface loopback 0
R2(config-if)# ip address 1.1.2.1 255.255.255.0
R2(config-if)# interface fastethernet 0/0
R2(config-if)# ip address 192.168.1.2 255.255.255.0
R2(config-if)# no shutdown
R3# configure terminal
R3(config)# interface fastethernet 0/0
R3(config-if)# ip address 192.168.1.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# interface serial2/2
R3(config-if)# ip address 10.1.1.1 255.255.255.252
R3(config-if)# no shutdown
R4# configure terminal
R4(config)# interface loopback 0
R4(config-if)# ip address 172.16.1.1 255.255.255.0
R4(config-if)# interface loopback 1
R4(config-if)# ip address 172.16.2.1 255.255.255.0
R4(config-if)# interface loopback 2
R4(config-if)# ip address 172.16.3.1 255.255.255.0
R4(config-if)# interface serial 2/1
R4(config-if)# ip address 10.1.1.2 255.255.255.0
R4(config-if)# no shutdown
步骤2在R1、R3、R4上启用RIP协议
R1(config)# router rip //启用RIP模式
R1(config-router)# version 2                    //修改RIP的版本为2
R1(config-router)# no auto-summary     //关闭自动汇总
R1(config-router)# network 1.0.0.0        //宣告网段
R1(config-router)# network 192.168.1.0
R3(config)# router rip
R3(config-router)# version 2
R3(config-router)# no auto-summary
R3(config-router)# network 192.168.1.0
R3(config-router)# network 10.0.0.0
R4(config)# router rip
R4(config-router)# version 2
R4(config-router)# no auto-summary
R4(config-router)# network 172.16.0.0
R4(config-router)# network 10.0.0.0
 
步骤3 在R2上配置默认路由
R2(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.3  //配置默认路由
步骤4 在R3上配置被动接口和单播更新,使得R2无法从R3学习路由信息
R3(config)# router rip
R3(config-router)# passive-interface fastethernet 0/0 
//设置fastethernet 0/0为被动接口,被动接口只收来自R1.R2的路由更新,不向它们发送路由更新
R3(config-router)# neighbor 192.168.1.1
//设置单播更新的地址为192.168.1.1 ,单播更新是向192.168.1.1发送单播更新路由
用debug ip rip命令观察R3的单播更新
步骤5  在R3、R4之间做MD5认证
创建数据库
R3(config)# key chain ccna        //定义密码组,组名ccna
R3(config-keychain)# key 1        //配置KEY ID
R3(config-keychain-key)# key-string 123   //配置KEY ID的密码
R3(config-keychain-key)# exit
R3(config-keychain)# exit
R4(config)# key chain ccna
R4(config-keychain)# key 1
R4(config-keychain-key)# key-string 123
R4(config-keychain-key)# exit
R4(config-keychain)# exit
在接口上启用RIP  MD5认证:
R3(config)# interface serial2/2   //进入接口,在接口下调用
R3(config-if)# ip rip authentication mode md5    //配置RIP认证为密文认证(默认为明文)
R3(config-if)# ip rip authentication key-chain ccna  //配置RIP认证使用key-chain ccna
R4(config)# interface serial 2/1
R4(config-if)# ip rip authentication mode md5
R4(config-if)# ip rip authentication key-chain ccna
步骤6 在R4上做汇总
R4(config)# interface serial2/1
R4(config-if)# ip summary-address rip 172.16.0.0 255.255.252.0 //手动汇总
RIP只支持子网汇总,不支持超网汇总
步骤7 关闭R4 serial2/1口上的水平分割并用debug  ip  rip查看结果
R4(config)# interface serial 2/1
R4(config-if)# no ip split-horizon //关闭水平分割
R4(config-if)# end
R4# debug ip rip
RIP protocol debugging is
实验总结:
这个网络不是全网互通 在其它路由器不能ping通1.1.2.1      同样1.1.2.1也不能ping通其它路由器