思科路由重发布配置小案例,新手入门级,值得学习

2023-08-15 01:02:00

在大型的企业中,可能在同一网内使用到多种路由协议,为了实现多种路由协议的协同工作,路由器可以使用路由重分发(route redistribution)将其学习到的一种路由协议的路由通过另一种路由协议广播出去,这样网络的所有部分都可以连通了。 为了实现重分发,路由器必须同时运行多种路由协议,这样,每种路由协议才可以取路由表中的所有或部分其他协议的路由来进行广播。

重分发分为两种

双向重分发:在两个路由选择进程之间重分发所有路由

单向重分发:将一条路由传递给一种路由选择协议,同时只将通过该路由选择协议获得网络传递给其他路由选择协议。

重发布常用命令

redistriute protocol [metric metric-value] [match internal | external nssa-external type][route-map map-tag]

路由重发布是,必须给重分布而来的路由指定的度量值被称为默认度量值(metric值)或种子度量值,它是在重分发配置期间定义的。OSPF度量值为:代价,RIP度量值为:跳数

路由重发布案例

关键配置

1、配置R1接口IP地址

R1(config)#interface gigabitEthernet 0/0

R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config-if)#no shutdown

2、配置R1动态路由RIP

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#network 192.168.1.0

3、配置R2接口IP地址

R2(config)#interface gigabitEthernet 0/0

R2(config-if)#ip address 192.168.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config)#interface gigabitEthernet 0/1

R2(config-if)#ip address 192.168.2.2 255.255.255.0

R2(config-if)#no shutdown

4、配置R2动态路由RIP和OSPF

R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#network 192.168.1.0

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

R2(config-router)#router-id 2.2.2.2

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

6、配置R3的接口地址

R3(config)#interface gigabitEthernet 0/1

R3(config-if)#ip address 192.168.2.3 255.255.255.0

R3(config-if)#no shutdown

7、配置R3的OSPF

R3(config)#router ospf 1

R3(config-router)#router-id 3.3.3.3

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

8、配置路由重发布策略

R2(config)#router rip

R2(config-router)#redistribute ospf 1 metric 5

R2(config)#router ospf 1

R2(config-router)#redistribute rip subnets