思科 Cisco 路由重发布

基本信息

在一个大型网络中,可能使用了多种路由协议,为了实现多种协议之间协同工作,路由器使用路由重发布将从一种路由协议学习到的路由分发进另外一种路由协议

配置时要注意管理距离(AD)和种子度量值(metric),不同的协议都有不同的metric,所以配置时要手动指定一个合适的metric

不同的协议在配置时的指令亦不相同

RIP作为目标协议 #必须要metric,1-15

指令 作用
redistribute ospf 1 metric 1 OSPF → RIP
redistribute eigrp 1 metric 1 EIGRP → RIP
redistribute static metric 1 静态 → RIP
redistribute connected metric 1 直连 → RIP

OSPF作为目标协议 #metric可选,默认为20

指令 作用
redistribute rip subnets RIP → OSPF
redistribute eigrp 1 subnets EIGRP → OSPF
redistribute static subnets 静态 → OSPF
redistribute connected subnets 直连 → OSPF

EIGRP 作为目标协议 #metric必须指定,五个值:带宽 延迟 可靠性 负载 MTU

作用 指令
redistribute ospf 1 metric 1544 2000 255 1 1500 OSPF → EIGRP
redistribute rip metric 1544 2000 255 1 1500 RIP → EIGRP
redistribute static metric 1544 2000 255 1 1500 静态 → EIGRP
redistribute connected metric 1544 2000 255 1 1500 直连 → EIGRP

IS-IS 作为目标协议 #metric可选,默认为0

指令 作用
redistribute ospf 1 metric 10 OSPF → IS-IS
redistribute rip metric 10 RIP → IS-IS
redistribute static metric 10 静态 → IS-IS

静态/直连

其他协议都通用,只有RIP和OSPF分别要加metric和subnets

bash 复制代码
router ospf 1
redistribute connected subnets
router rip
redistribute connected metric 1

RIP与OSPF的路由重发布

这里实例讲RIP与OSPF的重发布

命令格式

OSPF再发布进RIP

bash 复制代码
router rip		#进入RIP配置模式
redistribute ospf [进程号] metric(1-15)
#RIP跳数不能超过15,metric也不能

RIP再发布进OSPF

bash 复制代码
router ospf [进程号]	#进入OSPF配置模式
redistriubte rip subnets [metric值]
#路由注入ospf时默认metric为20,类型为OE2
  • 实例
    第一步,设好设备与链路

第二步,按图配置PC,路由器的网关和ip

设备 ip 掩码 网关
PC0 192.168.10.1 255.255.255.0 192.168.10.254
PC1 192.168.20.1 255.255.255.0 192.168.20.254

R0

Router(config)#interface f0/0

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.10.254 255.255.255.0

Router(config-if)#ex

Router(config)#interface f0/1

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#

R1

Router(config)#interface f0/1

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.1.2 255.255.255.0

Router(config-if)#ex

Router(config)#interface s0/0/0

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#clock rate 128000

Router(config-if)#ex

R2

Router(config)#interface f0/0

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.20.254 255.255.255.0

Router(config-if)#ex

Router(config)#interface s0/0/0

Router(config-if)#no shutdown

Router(config-if)#ip address 192.168.2.2 255.255.255.0

Router(config-if)#

第三步,配置RIP与OSPF基础配置,并验证

R0

Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#no auto-summary

Router(config-router)#network 192.168.10.0

Router(config-router)#network 192.168.1.0

Router(config-router)#

R1

Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#no auto-summayr

Router(config-router)#network 192.168.1.0

Router(config-router)#ex

Router(config)#router ospf 1

Router(config-router)#router-id 1.1.1.1

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

R2

Router(config)#router ospf 1

Router(config-router)#router-id 2.2.2.2

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

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

Router(config-router)#

验证 192.168.10.1 ping 192.168.20.1

第四步,配置路由重发布(主

R1 #路由协议交界处

Router(config)#router ospf 1

Router(config-router)#redistribute rip subnets

Router(config-router)#ex

Router(config)#router rip

Router(config-router)#redistribute ospf 1 metric 2

Router(config-router)#ex

第五步,验证

总结

路由重发布的命令其实就是一个固定的开头加上这个协议对应的一些值,大多情况下只需要背过最后的那一点就可以

相关推荐
虎头金猫3 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
wuyk5553 天前
《WiFi 嵌入式物联网开发全套实战》| 第 16 章 ESP32 AP+STA 双模共存原理与工程坑点
网络·stm32·物联网
QYRdata3 天前
年均增速24.2%!机器人数据湖未来六年增长动能强劲
网络·机器人·服务发现
CHENKONG_CK3 天前
破解制鞋打磨痛点:RFID赋能去毛刺工序自动化升级
网络·单片机·嵌入式硬件·网络协议·tcp/ip
chshang19923 天前
工业路由器是什么?浅谈5G工业网络中的IR602
网络·物联网·5g·智能路由器
萧瑟余晖3 天前
Netty 核心组件与 Reactor 模型详解
网络·架构
ITxiaobing20233 天前
IP 定位服务选型指南:从准确率到工程落地的技术考察
linux·服务器·网络
wuyk5553 天前
【Socket 进阶之路】第 9 章 Linux 网络服务量产稳定性优化|心跳保活、TIME_WAIT、SO_LINGER、内存池、断线重连、完整异常防护框架
linux·服务器·开发语言·网络·物联网
z落落3 天前
C#UDP+串口服务端+UDP 客户端(含 CRC16 校验)
网络·网络协议·udp
云运维笔记3 天前
华为设备IP地址配置全攻略
运维·网络·计算机网络·华为