博客统计信息

51cto推荐博客
用户名:meiyanaa
文章数:49
评论数:135
访问量:75986
无忧币:1235
博客积分:1868
博客等级:6
注册日期:2009-04-15

CCNA--LAB-2:配置RIP路由协议
2009-11-20 11:31:37
版权声明:原创作品,如需转载,请与作者联系。否则将追究法律责任。
 
拓扑如上:
 
R1:
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#int
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int f0/1
R1(config-if)#ip add
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router rip     --进入并启用RIP配置模式
R1(config-router)#version 2     --指定版本2
R1(config-router)#no auto-summary     --不要自动汇总
R1(config-router)#network 12.1.1.0     --宣告直连的网段
R1(config-router)#network 192.168.1.0     --宣告直连的网段
R1(config-router)#end

查看路由表:
R1#show 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
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/1] via 12.1.1.2, 00:00:04, FastEthernet0/1     
                      R是通过RIP路由学习到 192.168.2.0/24网段
 
 
 
 
R2:

Router(config)#hostname R2
R2(config)#interface f0/1
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.2.0
R2(config-router)#network 12.1.1.0
R2(config-router)#end
R2#show 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
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/1
R    192.168.1.0/24 [120/1] via 12.1.1.1, 00:00:20, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
 
验证在PC0上拼PC1:
 
PC>ping 192.168.2.1
Pinging 192.168.2.1 with 32 bytes of data:
Reply from 192.168.2.1: bytes=32 time=73ms TTL=126
Reply from 192.168.2.1: bytes=32 time=28ms TTL=126
Reply from 192.168.2.1: bytes=32 time=53ms TTL=126
Reply from 192.168.2.1: bytes=32 time=62ms TTL=126
Ping statistics for 192.168.2.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 28ms, Maximum = 73ms, Average = 54ms
 
总结:
RIP的工作原理在前面都有介绍,下面解释一下为什么要指定版本2(version 2),版本1与版本2最大的区别就是,2是以组播的方式发送更新,地址为224.0.0.9,且支持可变长子网掩码,而1是
广播的方式发送更新,且不支持变长子网掩码!

本文出自 “梅岩〃s博客” 博客,转载请与作者联系!

分享至
更多
一键收藏,随时查看,分享好友!
哥只是菜鸟
1人
了这篇文章
类别:CCNA技术圈()┆阅读()┆评论() ┆ 推送到技术圈返回首页

文章评论

 
2009-11-23 10:22:58
R1(config-router)#auto-summary   --不要自动汇总
这里少写了个NO了。。笔误吧!
博主回复:
2009-11-23 13:00:45
谢了, 多删了!

2009-12-31 17:01:22
博主,您好!
您的这篇博文已被推送到“全方位解析RIP协议”专题 (http://g.51cto.com/rip),成为专题精品文章。
如果您发现有相关主题的文章,欢迎您推送到该专题下的“博友推送区”。

2010-03-29 13:56:00
一点问题提的不知对不对,是否您忘记配DTE和DCE了,我按照上面做了,没成功。SHOW PROTO看不见协议。
博主回复:
2010-03-31 16:55:47
DTE与DCE是在串口上用的, 我用的快速以太网!

 

发表评论            

【技术门诊】专家解析:软考重点难点及应试技巧
昵  称:
登录  快速注册
验证码:

请点击后输入验证码博客过2级,无需填写验证码

内  容: