实验三十二、路由再发布的配置
一、 实验目的
1. 掌握将RIP 学习到的路由发布到OSPF 的配置方法
2. 理解路由再发布的原理
二、 应用环境
1. 两个网络互连,但各自采用不同的路由协议,需要再发布
三、 实验设备
1. DCR-1751 三台
2. V35 线 一对
四、 实验拓扑
五、 实验要求
配置表:
Router-A Router-B Router-C
S1/1(DCE) 192.168.1.1 S/1/0(DTE) 192.168.1.2 F0/0 192.168.2.2
F0/0 192.168.0.1 F0/0 192.168.2.1 E1/0 192.168.3.1
路由器A 运行RIP 协议
路由器B 运行 RIP 和OSPF 协议
路由器C 运行 OSPF 协议
目标:A 能学习到 192.168.3.0 的路由;C 能学习到 192.168.0.0 的路由
六、 实验步骤
第一步:参考实验三配置各接口地址,并测试连通性
第二步:配置各路由器的路由协议路由器A
Router-A#conf
Router-A_config#router rip
Router-A_config_rip#version 2
Router-A_config_rip#network 192.168.1.0
Router-A_config_rip#network 192.168.0.0
路由器B
Router-B_config#router ospf 1
Router-B_config_ospf_1#network 192.168.2.0 255.255.255.0 area 0 !并不宣告1.0 的网段
Router-B_config_ospf_1#exit
Router-B_config#router rip
Router-B_config_rip#version 2
Router-B_config_rip#network 192.168.1.0 !并不宣告2.0 的网段
路由器C
Router-C#config
Router-C_config#router ospf 1
Router-C_config_ospf_1#network 192.168.2.0 255.255.255.0 area 0
Router-C_config_ospf_1#network 192.168.3.0 255.255.255.0 area 0
第三步:查看各路由器的路由表
路由器A
Router-A#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 192.168.0.0/24 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial1/1
路由器B
Router-B#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0 R 192.168.0.0/24 [120,1] via 192.168.1.1(on Serial1/0)
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
O 192.168.3.0/24 [110,11] via 192.168.2.2(on FastEthernet0/0)
路由器C
Router-C#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
C 192.168.2.0/24 is directly connected, FastEthernet0/0
C 192.168.3.0/24 is directly connected, Ethernet1/0
我们发现虽然 B 上有 192.168.0.0 路由,但由于是 RIP 路由协议得到的,并不能通过 OSPF
使C 学习到;同样,A 也没有 192.168.3.0 的路由
第四步:配置路由再发布
Router-B#config
Router-B_config#router rip
Router-B_config_rip#redistribute ospf 1 !将OSPF 的路由引入到RIP 中
Router-B_config_rip#exit
Router-B_config#router ospf 1
Router-B_config_ospf_1#redistribute rip 将 RIP 路由引入到 OSPF 中
Router-B_config_ospf_1#^Z
第五步:查看路由器A 和C 的路由表
路由器A 的路由表
Router-A#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
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.3.0/24 [120,1] via 192.168.1.2(on Serial1/1) !得到了路由
路由器 C 的路由表Router-C#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
O E2 192.168.0.0/24 [150,100] via 192.168.2.1(on FastEthernet0/0) !得到了路由
C 192.168.2.0/24 is directly connected, FastEthernet0/0
C 192.168.3.0/24 is directly connected, Ethernet1/0