99网
您的当前位置:首页实验8、路由器RIP-1配置

实验8、路由器RIP-1配置

来源:99网
实验八、路由器RIP-1 配置

一、 实验目的

1. 掌握动态路由的配置方法 2. 理解 RIP 协议的工作过程

二、 应用环境

1. 在路由器较多的环境里,手工配置静态路由给管理员带来大的工作负担 2. 在不太稳定的网络环境里,手工修改表不现实

三、 实验设备

1. DCR-1751 三台 2. CR-V35FC 一条 3. CR-V35MT 一条

四、 实验拓扑

五、 实验要求

ROUTER-A S0/3 (DCE) 192.168.1.1/24 F0/0 192.168.4.1/24

ROUTER-C F0/0 192.168.2.2/24 F0/1 192.168.3.1/24

ROUTER-B

S0/2 (DTE) 192.168.1.2/24 F0/0 192.168.2.1/24

六、 实验步骤

第一步:参照实验三,按照上表配置所有接口的IP 地址,保证所有接口全部是up 状态,测试连通性

注意:为测试连通性,要删除PC上“本地连接2”的默认网关,并关闭卡巴斯基。 第二步:查看ROUTER-A 的路由表 Router-A#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2

DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Serial0/3 !直连的路由

C 192.168.4.0/24 is directly connected, FastEthernet0/0 !直连的路由 第三步:查看ROUTER-B 的路由表 Router-B#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Serial0/2

C 192.168.2.0/24 is directly connected, FastEthernet0/0 第四步:查看ROUTER-C 的路由表 Router-C#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.2.0/24 is directly connected, FastEthernet0/0 C 192.168.3.0/24 is directly connected, FastEthernet0/1 第五步:在ROUTER-A 上PING 路由器C Router-A#ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2): 56 data bytes .....

--- 192.168.2.2 ping statistics ---

5 packets transmitted, 0 packets received, 100% packet loss !不通 第六步:在路由器A 上配置RIP 协议并查看路由表 Router-A_config#router rip !启动RIP 协议

Router-A_config_rip#network 192.168.4.0 !宣告网段 Router-A_config_rip#network 192.168.1.0 Router-A_config_rip#^Z Router-A#sh ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Serial0/3

C 192.168.4.0/24 is directly connected, FastEthernet0/0

注意到并没有出现RIP 学习到的路由。

第七步:在路由器B 上配置RIP 协议并查看路由表 Router-B_config#router rip

Router-B_config_rip#network 192.168.1.0 Router-B_config_rip#network 192.168.2.0 Router-B_config_rip#^Z

Router-B#2004-1-1 00:15:58 Configured from console 0 by DEFAULT Router-B#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Seria0/2

C 192.168.2.0/24 is directly connected, FastEthernet0/0

R 192.168.3.0/16 [120,1] via 192.168.1.1(on Serial1/0) !从A 学习到的路由 第八步:在路由器C上配置RIP 协议并查看路由表 Router-C_config#router rip

Router-C_config_rip#network 192.168.2.0 Router-C_config_rip#network 192.168.3.0 Router-C_config_rip#^Z Router-C#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP

D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2

R 192.168.1.0/24 [120,1] via 192.168.2.1(on FastEthernet0/0) C 192.168.2.0/24 is directly connected, FastEthernet0/0 C 192.168.3.0/24 is directly connected, Ethernet1/0

R 192.168.4.0/16 [120,2] via 192.168.2.1(on FastEthernet0/0) 第九步:再次查看A 和B 的路由表 Router-B#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Serial1/0

C 192.168.2.0/24 is directly connected, FastEthernet0/0

R 192.168.3.0/24 [120,1] via 192.168.2.2(on FastEthernet0/0) R 192.168.4.0/16 [120,1] via 192.168.1.1(on Serial0/2) Router-A#show ip route

Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2 OE1 - OSPF external type 1, OE2 - OSPF external type 2 DHCP - DHCP type VRF ID: 0

C 192.168.1.0/24 is directly connected, Serial1/1

R 192.168.2.0/24 [120,1] via 192.168.1.2(on Serial0/3) R 192.168.3.0/24 [120,2] via 192.168.1.2(on Serial0/3) C 192.168.4.0/24 is directly connected, FastEthernet0/0 !注意到所有网段都学习到了路由 第十步:相关的查看命令

Router-A#show ip rip !显示RIP 状态 RIP protocol: Enabled

Global version: default( Decided on the interface version control ) Update: 30, Expire: 180, Holddown: 120 Input-queue: 50

Validate-update-source enable No neighbor

Router-A#sh ip rip protocol !显示协议细节 RIP is Active

Sending updates every 30 seconds, next due in 30 seconds !注意定时器的值 Invalid after 180 seconds, holddown 120 update filter list for all interfaces is: update offset list for all interfaces is: Redistributing:

Default version control: send version 1, receive version 1 2 Interface Send Recv FastEthernet0/0 1 1 2 Serial0/3 1 1 2

Automatic network summarization is in effect Routing for Networks: 192.168.1.0/24 192.168.4.0/24

Distance: 120 (default is 120) !注意默认的管理距离 Maximum route count: 1024, Route count:6

Router-A#show ip rip database ! 显示RIP 数据库 192.168.0.0/24 directly connected FastEthernet0/0 192.168.0.0/24 auto-summary

192.168.1.0/24 directly connected Serial1/1 192.168.1.0/24 auto-summary

192.168.2.0/24 [120,1] via 192.168.1.2 (on Serial1/1) 00:00:13 !收到RIP 广播的时间 192.168.3.0/24 [120,2] via 192.168.1.2 (on Serial1/1) 00:00:13 Router-A#sh ip route rip !仅显示RIP 学习到的路由

R 192.168.2.0/24 [120,1] via 192.168.1.2(on Serial1/1) R 192.168.3.0/24 [120,2] via 192.168.1.2(on Serial1/1)

七、 注意事项和排错

1. 只能宣告直连的网段 2. 宣告时不附加掩码

3. 分配地址时最好是连续的子网,以免 RIP 汇聚出现错误

八、 配置序列

Router-B#show running-config Building configuration... Current configuration: !

!version 1.3.2E

service timestamps log date service timestamps debug date no service password-encryption !

hostname Router-B ! ! ! ! ! ! !

interface FastEthernet0/0

ip address 192.168.2.1 255.255.255.0 no ip directed-broadcast !

interface Serial1/0

ip address 192.168.1.2 255.255.255.0 no ip directed-broadcast !

interface Async0/0 no ip address

no ip directed-broadcast ! !

router rip

network 192.168.2.0 network 192.168.1.0 ! !

!

九、 共同思考

1. 为什么 B 没有配置RIP 协议时,A 没有出现RIP 路由? 2. 如果不是连续的子网,回出现什么结果? 3. RIP 的广播周期是多少?

十、 课后练习

将地址改为 10.0.0.0/24 这个网段重复以上实验

十一、 相关命令详解

router rip

使用router rip 全局命令来配置RIP路由进程,no router rip 则关闭RIP路由进程。 router rip no router rip 参数 无 缺省

系统缺省不运行 RIP。 命令模式 全局配置态 使用说明

必须先启动 RIP,才能进入路由配置态,才能配置RIP 的各种全局性参数,而配置与接口相

关的参数则不受是否已经启动RIP 的。 示例

启动 RIP 并进入路由配置态。

因篇幅问题不能全部显示,请点此查看更多更全内容