7.4.5 RIP路由基本配置示例
本示例拓扑结构如图7-7所示。各路由器接口分配的IP地址也在图中作了标注。现要求通过RIP动态路由协议实现各路由器的互通。
|
(点击查看大图)图7-7 RIP路由配置示例拓扑结构 |
下面是具体的配置步骤:
(1)按照图中所标注的接口IP地址,配置各路由器的接口IP地址(略)。
(2)先来使用"show ip route"命令查看一下各路由器当前的路由表。结果证实各路由器当前仅有各自直接连接的路由。下面是Router A上当前的路由表项(注意输出信息中的粗体字部分)。
- RouterA#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, su - IS-IS summary, 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
-
- C 192.168.0.0/24 is directly connected,FastEthernet0/0
- C 192.168.1.0/24 is directly connected,Serial1/1
(3)在Router A上ping Router C,结果显示不通,输出信息如下所示。
- RouterA#ping 192.168.2.2
- PING 192.168.2.2(192.168.2.2):56 data bytes
- ……
- ----192.168.2.2 ping statistcs----
- 5 packets transmitted,0 packets received,100% packet loss
(4)在Router A上启用RIP路由协议。
- RouterA#en
- RouterA(Config)#router rip
- RouterA(Config)#network 192.168.0.0
- RouterA(Config)#network 192.168.1.0
- RouterA(Config)#end
现在再来查看Router A上的路由表,结果显示仍是前面第2步中所显示的两条直连路由。因为其他路由器上没有启用RIP协议,所以它根本无法学习到来自其他路由器的路由。
(5)在Router B上启用RIP路由协议。
- RouterB#en
- RouterB(Config)#router rip
- RouterB(Config)#network 192.168.1.0
- RouterB(Config)#network 192.168.2.0
- RouterB(Config)#end
现在来查看Router B上的路由表,此时可以看到它已学习到了Router A路由器上所连接的网络,有一个RIP路由。具体如下(注意输出信息中的粗体字部分):
- RouterB#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, su - IS-IS summary, 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
-
- R 192.168.0.0/24 [120/1] via 192.168.1.1,
00:00:25, Serial1/0
- C 192.168.1.0/24 is directly connected, Serial1/0
- C 192.168.2.0/24 is directly connected, FastEthernet0/0
【说明】RIP路由项说明如下(后面的RIP路由按照同样的方法来理解):
R:说明该路由条目是通过 RIP 路由协议学习来的;
192.168.0.0/24:这是路由条目的目的网络地址;
120:这是RIP路由协议的默认管理距离;
1: 这从路由器Router B到达目的网络192.168.0.0/24的度量值为 1跳,因为只经过一个路由器;
Via 192.168.1.1:这是该RIP路由的下一跳地址;
00:00:025:这是指明距离下一次更新还有 5(30-25)秒;
Serial1/0:指出接收该RIP路由条目的本地路由器接口为s1/0。
(6)在Router C上启用RIP协议。
- RouterC#en
- RouterC(Config)#router rip
- RouterC(Config)#network 192.168.2.0
- RouterC(Config)#network 192.168.3.0
- RouterC(Config)#end
此时查看Router C上的路由表,可以看到它从Router A和Router B上学习到两条RIP路由。具体如下(注意输出信息中的粗体字部分):
- RouterC#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, su - IS-IS summary, 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
-
- R 192.168.0.0/24 [120/2] via 192.168.2.1,
00:00:25, FastEthernet0/0
- R 192.168.1.0/24 [120/1] via 192.168.2.1,
00:00:25, FastEthernet0/0
- C 192.168.1.0/24 is directly connected, Serial1/0
- C 192.168.2.0/24 is directly connected, FastEthernet0/0
(7)现在再次查看Router A和Router B上的路由表,可以得到如下结果(注意输出信息中的粗体字部分),显示它们相互从其他两个路由器上学习到了所有网段的路由。
- RouterA#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, su - IS-IS summary, 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
-
- C 192.168.0.0/24 is directly connected,FastEthernet0/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,
00:00:25, Serial1/1
- R 192.168.3.0/24 [120/2] via 192.168.1.2,
00:00:25, Serial1/1
-
- RouterB#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, su - IS-IS summary, 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
-
- R 192.168.0.0/24 [120/1] via 192.168.1.1,
00:00:25, Serial1/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,
00:00:25, FastEthernet0/0
(8)最后同样进行ping操作,来验证路由器之间是否已连通。结果显示都是通的,证明RIP路由配置是正确的。在此就不具体举例了。
【责任编辑: 云霞 TEL:(010)68476606】