Cisco路由器配置OSPF外部路由汇总

Cisco路由器配置OSPF外部路由汇总

Cisco路由器配置OSPF外部路由汇总
【实验设备】
R2624路由器(2台)、V35DCE(1根)、V35DTE(1根)

 

【实验步骤】

第一步:基本配置
Red-Giant>en
Red-Giant#conf t

Red-Giant(config)#hostname R1
R1(config)#interface serial 0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config)#interface loopback 0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#exi
R1(config)#int loo 1
R1(config-if)#ip address 172.16.2.1 255.255.255.0
Red-Giant>enable
Red-Giant#conf t
Red-Giant(config)#hostname R2
R2(config)#interface s0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#end

第二步:配置OSPF路由协议
R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config)#router ospf 1
R2(config-router)#net 192.168.12.0 0.0.0.255 area 0

验证测试:R2#sh ip os nei

Neighbor ID Pri State Dead Time Address Interface
172.16.2.1 1 FULL/ – 00:00:36 192.168.12.1 Serial0

第三步:配置RIP路由协议.并重分布到OSPF路由协议进程当中
R1(config)#router rip
R1(config-router)#ver 2
R1(config-router)#net 172.16.1.0
R1(config-router)#net 172.16.2.0
R1(config-router)#no auto-summary
R1(config-router)#redistribute rip metric 100 metric-ty 1 subnets !把RIP信息发布到OSPF协议中

验证测试:
R2#sh ip ro
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set

C 192.168.10.0/24 is directly connected, FastEthernet0
C 192.168.12.0/24 is directly connected, Serial0
172.16.0.0/24 is subnetted, 2 subnets
O E1 172.16.1.0 [110/148] via 192.168.12.1, 00:00:15, Serial0
O E1 172.16.2.0 [110/148] via 192.168.12.1, 00:00:15, Serial0

第四步:配置汇总路由
R2(config-router)# summary-address 172.16.0.0 255.255.252.0 !配置外部汇聚路由

R2#sh ip ro
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set

C 192.168.12.0/24 is directly connected, Serial0
172.16.0.0/22 is subnetted, 1 subnets
O E1 172.16.0.0 [110/148] via 192.168.12.1, 00:00:29, Serial0

【注意事项】
注意汇总地址的掩码。

【参考配置】
R2#sh run

成为第一个发表评论的人

发表评论

您的电子邮件地址不会被公开.


*