成都理工大学工程技术学院
通过默认路由学习到的路由信息以“S*”代码表示。
六、实验调试
如果不能连通,请检查:
1. 双绞线线序是否正确
2. 路由器接口是否和电缆虚接 3. 接口地址和掩码是否正确 4. 接口是否真正UP
14
成都理工大学工程技术学院
实验三:配置RIP、OSPF路由协议(单区域)
一、实验目的
1. 学习在路由器上配置RIPV1协议 2. RIPV1路由协议的验证命令 3. 学习在路由器上配置OSPF协议 4. OSPF路由协议的验证命令 5. 理解OSPF的工作过程 6. 理解链路状态数据库
二、实验内容
1. 在路由器上配置RIPV1路由协议 2. 查看已配置RIPV1的路由器 3. 在路由器上配置OSPF路由协议 4. 查看已配置OSPF的路由器 三、 实验设备
路由器: 华为2509 ; 思科2611 2811 计算机两台 四、 实验步骤
A. 配置RIPv1路由协议
实验拓扑图:
图3.1
15
成都理工大学工程技术学院
表3.1 IP地址划分一览表
设备名称 R1接口Fa0/0 R1接口fa0/1 R2接口Fa0/0 R2接口Fa0/1 R3接口Fa0/0 R3接口Fa0/1 主机PC0 主机PC1 网络地址 192.168.1.0 10.1.1.0 10.1.1.0 12.1.1.0 12.1.1.0 172.16.1.0 192.168.1.0 172.16.1.0 IP地址 192.168.1.1 10.1.1.1 10.1.1.2 12.1.1.1 12.1.1.2 172.16.1.1 192.168.1.2 172.16.1.2 子网掩码 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 (1) 步骤1:配置路由器R1 R1(config)#int fa0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#no sh
R1(config-if)#no shutdown R1(config-if)#int fa0/1
R1(config-if)#ip add 10.1.1.1 255.255.255.0 R1(config-if)#no sh
R1(config-if)#no shutdown R1(config-if)#exit R1(config)#router rip R1(config-router)#net
R1(config-router)#network 192.168.1.0 R1(config-router)#network 10.0.0.0 R1(config-router)#^Z
(2) 步骤2:配置路由器R2 R2#conf t
Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int fa0/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0 R2(config-if)#no sh
R2(config-if)#no shutdown R2(config-if)#int fa0/1
R2(config-if)#ip add 12.1.1.1 255.255.255.0 R2(config-if)#no sh
R2(config-if)#no shutdown
16
成都理工大学工程技术学院
R2(config-if)#exit R2(config)#router rip R2(config-router)#net
R2(config-router)#network 10.0.0.0 R2(config-router)#network 12.0.0.0 R2(config-router)#^Z
(3) 步骤3:配置路由器R3 R3#conf t
Enter configuration commands, one per line. End with CNTL/Z. R3(config)#int fa0/0
R3(config-if)#ip add 12.1.1.2 255.255.255.0 R3(config-if)#no sh
R3(config-if)#no shutdown R3(config-if)#int fa0/1
R3(config-if)#ip add 172.16.1.1 255.255.255.0 R3(config-if)#no sh
R3(config-if)#no shutdown R3(config-if)#exit R3(config)#router rip R3(config-router)#net
R3(config-router)#network 12.0.0.0 R3(config-router)#network 172.16.0.0 R3(config-router)#^Z
在PC0上去PING PC1:
图3.2
至此,RIPV1路由协议已经配置成功!
17
成都理工大学工程技术学院
(4) 步骤4::检查路由器R1上运行的路由协议 R1#show ip protocols Routing Protocol is \
Sending updates every 30 seconds, next due in 4 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 1, receive any version
Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1 FastEthernet0/1 1 2 1 Automatic network summarization is in effect Maximum path: 4 Routing for Networks: 10.0.0.0 192.168.1.0 Passive Interface(s):
Routing Information Sources: Gateway Distance Last Update 10.1.1.2 120 00:00:02 Distance: (default is 120)
(5) 步骤5:查看路由器R1的路由表 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
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/1
R 12.0.0.0/8 [120/1] via 10.1.1.2, 00:00:15, FastEthernet0/1
18