实验11:RIPv1 基本配置
1.
实验目的
通过本实验可以掌握:
(1)在路由器上启动RIPv1 路由进程
(2)启用参与路由协议的接口,并且通告网络
(3)理解路由表的含义
(4)查看和调试RIPv1 路由协议相关信息
2.
拓扑结构
实验拓扑如图 所示。
3.
实验步骤
1)步骤1:配置路由器R0
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho r0
r0(config)#no ip domain-loo
r0(config)#lin c 0
r0(config-line)#logg s
r0(config-line)#exit
r0(config)#lin c 0
r0(config-line)#exec-t 00
r0(config-line)#exit
r0(config)#int s
1/1/0
r0(config-if)#ip add 192.168.12.1 255.255.255.0
r0(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to down
r0(config-if)#exit
r0(config)#int loo 1
%LINK-5-CHANGED: Interface Loopback1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
r0(config-if)#ip add
1.1.1
.1 255.255.255.0
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to up
r0(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
r0#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet0/1 unassigned YES manual administratively down down
FastEthernet1/0 unassigned YES manual administratively down down
Serial
1/1/0
192.168.12.1 YES manual up down
Serial
1/1/1
unassigned YES manual administratively down down
Loopback1
1.1.1
.1 YES manual up up
Vlan1 unassigned YES manual administratively down down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/0
, changed state to up
r0#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet0/1 unassigned YES manual administratively down down
FastEthernet1/0 unassigned YES manual administratively down down
Serial
1/1/0
192.168.12.1 YES manual up up
Serial
1/1/1
unassigned YES manual administratively down down
Loopback1
1.1.1
.1 YES manual up up
Vlan1 unassigned YES manual administratively down down
r0#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r0(config)#router rip
//启动RIP 进程
r0(config-router)#ver 1//配置RIP 版本1
r0(config-router)#net
1.1.1
.0//通告网络
r0(config-router)#net 192.168.12.0
r0(config-router)#do ping 192.168.34.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.34.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 93/93/94 ms
r0(config-router)#do ping
4.4.4
.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
4.4.4
.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 78/90/94 ms
r0(config-router)#do sh 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
C
1.1.1
.0 is directly connected, Loopback1
R
4.0.0
.0/8 [120/3] via 192.168.12.2, 00:00:26, Serial
1/1/0
C 192.168.12.0/24 is directly connected, Serial
1/1/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:26, Serial
1/1/0
R 192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:26, Serial
1/1/0
以上输出表明路由器R1 学到了3 条RIP 路由,其中路由条目“R
4.0.0
.0/8 [120/3]
via 192.168.12.2, 00:00:26, Serial1/1/0”的含义如下:
① R:路由条目是通过RIP 路由协议学习来的;
②
4.0.0
.0/8:目的网络;
③ 120:RIP 路由协议的默认管理距离;
④ 3: 度量值,从路由器R1 到达网络
4.0.0
.0/8 的度量值为3 跳;
⑤ 192.168.12.2:下一跳地址;
⑥ 00:00:26:距离下一次更新还有4(30-26)秒;
⑦ Serial1/1/0:接收该路由条目的本路由器的接口。
同时通过该路由条目的掩码长度可以看到,RIPv1 确实不传递子网信息。
2)步骤2:配置路由器R1
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho r1
r1(config)#no ip domain-loo
r1(config)#lin c 0
r1(config-line)#logg s
r1(config-line)#exec-t 00
r1(config-line)#exit
r1(config)#int s
1/1/0
r1(config-if)#ip add 192.168.12.2 255.255.255.0
r1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to up
r1(config-if)#exit
r1(config)#int s
1/1/1
r1(config-if)#ip add 192.168.23.1 255.255.255.0
r1(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/1
, changed state to up
r1(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
r1#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/1
, changed state to up
r1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r1(config)#int s
1/1/0
r1(config-if)#clo r 64000
r1(config-if)#no sh
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/0
, changed state to up
r1(config-if)#exit
r1(config)#router rip
r1(config-router)#ver 1
r1(config-router)#net 192.168.23.0
r1(config-router)#net 192.168.12.0
3)步骤3:配置路由器R2
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho r2
r2(config)#no ip domain-loo
r2(config)#lin c 0
r2(config-line)#logg s
r2(config-line)#exec-t 00
r2(config-line)#exit
r2(config)#int s
1/1/1
r2(config-if)#ip add 192.168.23.2 255.255.255.0
r2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/1
, changed state to down
r2(config-if)#int s
1/1/0
r2(config-if)#ip add 192.168.34.1 255.255.255.0
r2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to down
r2(config-if)#
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to up
r2(config-if)#
%LINK-5-CHANGED: Interface Serial
1/1/1
, changed state to up
r2(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
r2#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet0/1 unassigned YES manual administratively down down
FastEthernet1/0 unassigned YES manual administratively down down
FastEthernet1/1 unassigned YES manual administratively down down
Serial
1/1/0
192.168.34.1 YES manual up down
Serial
1/1/1
192.168.23.2 YES manual up down
Vlan1 unassigned YES manual administratively down down
r2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r2(config)#int s
1/1/1
r2(config-if)#clo r 64000
r2(config-if)#no sh
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/1
, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/0
, changed state to up
r2(config-if)#exit
r2(config)#router rip
r2(config-router)#ver 1
r2(config-router)#net 192.168.34.0
r2(config-router)#net 192.168.23.0
4)步骤4:配置路由器R3
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho r3
r3(config)#no ip domain-loo
r3(config)#lin c 0
r3(config-line)#logg s
r3(config-line)#exec-t 00
r3(config-line)#exit
r3(config)#int loo 1
%LINK-5-CHANGED: Interface Loopback1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
r3(config-if)#ip add
4.4.4
.4 255.255.255.0
r3(config-if)#no sh
r3(config-if)#int s
1/1/0
r3(config-if)#ip add 192.168.34.2 255.255.255.0
r3(config-if)#no sh
%LINK-5-CHANGED: Interface Serial
1/1/0
, changed state to up
r3(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
r3#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet0/1 unassigned YES manual administratively down down
FastEthernet1/0 unassigned YES manual administratively down down
Serial
1/1/0
192.168.34.2 YES manual up down
Serial
1/1/1
unassigned YES manual administratively down down
Loopback1
4.4.4
.4 YES manual up up
Vlan1 unassigned YES manual administratively down down
r3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r3(config)#int s
1/1/0
r3(config-if)#clo r 64000
r3(config-if)#no sh
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial
1/1/0
, changed state to up
r3(config-if)#^Z
%SYS-5-CONFIG_I: Configured from console by console
r3#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet0/1 unassigned YES manual administratively down down
FastEthernet1/0 unassigned YES manual administratively down down
Serial
1/1/0
192.168.34.2 YES manual up up
Serial
1/1/1
unassigned YES manual administratively down down
Loopback1
4.4.4
.4 YES manual up up
Vlan1 unassigned YES manual administratively down down
r3#ping 192.168.34.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.34.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 47/59/62 ms
r3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r3(config)#router rip
r3(config-router)#ver 1
r3(config-router)#net 192.168.34.0
r3(config-router)#net
4.4.4
.0
r3(config-router)#exit
r3(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
r3#ping
1.1.1
.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
1.1.1
.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 78/90/94 ms
r3#sh 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
R
1.0.0
.0/8 [120/3] via 192.168.34.1, 00:00:02, Serial
1/1/0
C
4.4.4
.0 is directly connected, Loopback1
R 192.168.12.0/24 [120/2] via 192.168.34.1, 00:00:02, Serial
1/1/0
R 192.168.23.0/24 [120/1] via 192.168.34.1, 00:00:02, Serial
1/1/0
C 192.168.34.0/24 is directly connected, Serial
1/1/0