打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
OSPF与静态路由的重分布配置

OSPF与静态路由分布配置

如上例图所示:“RIPOSPF路由重分布例子

switchA(config)#router ospf

switchA(config-router)#network 192.168.10.0 0.0.0.255 area 0

switchA(config-router)#network 192.168.20.0 0.0.0.255 area 0

switchA(config-router)#network 192.168.1.0 0.0.0.255 area 0

switchA(config-router)#exit

switchA(config)#end

router(config)#router ospf

router(config-router)#network 192.168.1.0 0.0.0.255 area 0

router(config-router)#network 192.168.2.0 0.0.0.255 area 0

router(config-router)#exit

router(config)#ip route 192.168.30.0 255.255.255.0 192.168.2.1

router(config)#ip route 192.168.40.0 255.255.255.0 192.168.2.1

router(config)#end

switchB(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.2

switchB(config)#ip route 192.168.20.0 255.255.255.0 192.168.2.2

switchB(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1

switchB(config)#end

在互连路由器上进行重分布配置,使其两个不同路由协议的网络进行互通

Router(config)#router ospf

Router(config-router)#redistribute static subnets//OSPF重分布到静态路由

Router(config-router)#exit

Router(config)#end

此例我只是做了把OSPF重分布到静态路由,是因为静态路由本身就是一个明确的邻接路由,因为我们在switchB上已经明确指定静态路由了,所以就没有做相关的重分布配置,话说过来,网络设备也没有提供相就的静态路由重分布的方法。

配置好后:三台设备的路由表情况如下:

Router:

Router#show ip route

 

Codes:  C - connected, S - static,  R - RIP B - BGP

        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

        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

 

        * - candidate default

 

Gateway of last resort is no set

C    192.168.1.0/24 is directly connected, FastEthernet 0/0

C    192.168.1.2/32 is local host.

C    192.168.2.0/24 is directly connected, FastEthernet 0/1

C    192.168.2.2/32 is local host.

O    192.168.10.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0

O    192.168.20.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0

S    192.168.30.0/24 [1/0] via 192.168.2.1

S    192.168.40.0/24 [1/0] via 192.168.2.1

switchA:

switchA#show ip route

 

Codes:  C - connected, S - static,  R - RIP B - BGP

        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

        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

 

        * - candidate default

 

Gateway of last resort is no set

C    192.168.1.0/24 is directly connected, FastEthernet 0/1

C    192.168.1.1/32 is local host.

C    192.168.10.0/24 is directly connected, VLAN 10

C    192.168.10.1/32 is local host.

C    192.168.20.0/24 is directly connected, VLAN 20

C    192.168.20.1/32 is local host.

O    192.168.30.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0

O    192.168.40.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0

O    192.168.2.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0

 

switchB:

switchB#show ip route

 

Codes:  C - connected, S - static,  R - RIP B - BGP

        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

        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

 

        * - candidate default

 

Gateway of last resort is no set

C    192.168.2.0/24 is directly connected, FastEthernet 0/1

C    192.168.2.1/32 is local host.

S    192.168.10.0/24 [1/0] via 192.168.2.2

S    192.168.20.0/24 [1/0] via 192.168.2.2

S    192.168.1.0/24 [1/0] via 192.168.2.2

C    192.168.40.0/24 is directly connected, VLAN 20

C    192.168.40.1/32 is local host.

根据上述的路由表的分析我们得知OSPFstatic的路由重分布成功。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Cisco學習筆記
理解了异地恋,就理解如何配置交换机,你理解了吗?
路由器
H3C 路由器 OSPF基本配置
默认路由配置
[原创] ipsec高可用性试验
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服