一.基本配置步骤:
1. 声明使用RIP路由协议的命令:
Router(config)#router rip
2. 启用RIPv2路由协议的命令
Router(config-router)#version 2
3. 发布网段的命令:
Router(config-router)#network [ 网络地址 ]
二.用Packet Tracer 5.0绘制出某公司网络的拓扑结构如下:
三.对路由器进行配置后,各个路由器的当前配置如下(加黑部分为关键配置步骤):
路由器A:
Current configuration:
!
version 12.2
no service udp-small-servers
no service tcp-small-servers
!
hostname A
!
interface f0/0
ip address 148.1.1.1 255.255.255.0
!
interface s1/0
ip address 192.1.1.1 255.255.255.0
!
router rip
version 2
network 148.1.1.0
network 192.1.1.0
!
no ip classless
!
line con 0
line aux 0
line vty 0 4
login
!
End
路由器B:
Current configuration:
!
version 12.2
service udp-small-servers
service tcp-small-servers
!
hostname B
!
interface f0/0
ip address 150.1.1.1 255.255.255.0
!
interface s1/0
ip address 192.1.1.2 255.255.255.0
no fair-queue
!
interface s1/1
ip address 192.1.1.1 255.255.255.0
!
router rip
version 2
network 150.1.1.0
network 192.1.1.0
network 193.1.1.0
!
!
line con 0
line aux 0
line vty 0 4
login
End
路由器C:
Current configuration:
!
version 12.2
service udp-small-servers
service tcp-small-servers
!
hostname C
!
interface f0/0
ip address 152.1.1.1 255.255.255.0
!
interface s1/0
ip address 193.1.1.2 255.255.255.0
!
router rip
version 2
network 152.1.1.0
network 193.1.1.0
!
no ip classless
!
line con 0
line aux 0
line vty 0 4
login
!
End
进行配置和地址分配之后其拓扑为
四.可用于该案例的检测命令:
1. #show ip protocol
该命令可以看到路由器上运行的动态路由选择协议,以及该协议的一些特性。
如我在路由器B上执行了该命令后的显示为:
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 3 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 2, receive 2
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 2 2
Serial1/0 2 2
Serial1/1 2 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
150.1.0.0
192.1.1.0
193.1.1.0
Passive Interface(s):
Routing Information Sources:
Gateway Distance Last Update
192.1.1.1 120 00:00:14
193.1.1.2 120 00:00:26
Distance: (default is 120)
2. #show ip route
该命令用于查看路由表。
如我在路由器B上执行该命令后的显示为:
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
R 148.1.0.0/16 [120/1] via 192.1.1.1, 00:00:07, Serial1/0
150.1.0.0/24 is subnetted, 1 subnets
C 150.1.1.0 is directly connected, FastEthernet0/0
R 152.1.0.0/16 [120/1] via 193.1.1.2, 00:00:26, Serial1/1
C 192.1.1.0/24 is directly connected, Serial1/0
C 193.1.1.0/24 is directly connected, Serial1/1
其中的R项即为RIP产生的路由信息。
五.所遇到的问题:
1. service udp-small-servers
service tcp-small-servers
此属性是什么,怎么设置?
2. 怎么配置无类网络?
在发布网段时,并不能指定子网,在此案例中,B公司总部中的网段150.1.1.0,我们设置的掩码长度是24,但是在发布网段时,是以B类网络发布的,也就是150.1.0.0,RIPv2应该支持无类网络,应该怎么配置?