路由器重分发(OSPF+RIP),RIP充当翻译官,OSPF充当翻译官

路由器重分发(OSPF+RIP)

版本 1 RIP充当翻译官

TypeScript 复制代码
OSPF路由器只会OSPF语言;RIP路由器充当翻译官就要会OSPF语言和RIP语言;则在RIP中还需要将OSPF翻译成RIP
  • OSPF
TypeScript 复制代码
把RIP路由器当成翻译官,OSPF路由器就只需要宣告自己的ip,也就是network 1.1.1.0 0.0.0.255 area 0 

network 2.2.2.0 0.0.0.255 area 0
  • RIP
TypeScript 复制代码
RIP路由器作为翻译官,要做的是宣告自己的IP;还需要为OSPF翻译,所以要有一条通道可以翻译OSPF:
router rip
network 3.3.3.0

还要进入router ospf 1中,
network 2.2.2.0 0.0.0.255 area 0
也宣告一下作为翻译的通道,表示两个都学到,就是会翻译OSPF和RIP

开启端口并配置IP

  • OSPF(路由器)
TypeScript 复制代码
Router>en
Router#conf t
Router(config)#int g0/0
Router(config-if)#no shutdown 
Router(config-if)#ip add 1.1.1.2 255.255.255.0
Router(config-if)#ex
Router(config)#int g0/1 
Router(config-if)#no shutdown 
Router(config-if)#ip ad 2.2.2.1 255.255.255.0
  • RIP(路由器)
TypeScript 复制代码
Router>en
Router#conf t
Router(config)#int g0/0
Router(config-if)#no shutdown 
Router(config-if)#ip add 3.3.3.1 255.255.255.0
Router(config-if)#ex
Router(config)#int g0/1 
Router(config-if)#no shutdown 
Router(config-if)#ip add 2.2.2.2 255.255.255.0
Router(config-if)#ex

OSPF协议

  • OSPF路由器
TypeScript 复制代码
Router(config)#router ospf 1
Router(config-router)#network 1.1.1.0 0.0.0.255 area 0
Router(config-router)#network 2.2.2.0 0.0.0.255 area 0

RIP协议

  • RIP(路由器)
TypeScript 复制代码
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 3.3.3.0
Router(config-router)#ex
Router(config)#router ospf 1
Router(config-router)#network 2.2.2.0 0.0.0.255 area 0
Router(config-router)#ex

路由器重分发

  • RIP(路由器)
TypeScript 复制代码
Router(config)#router rip
Router(config-router)#redistribute ospf 1 metric 5
Router(config-router)#ex
Router(config)#router ospf 1
Router(config-router)#redistribute rip subnets 

版本2 OSPF充当翻译官

TypeScript 复制代码
RIP路由器只会RIP语言;OSPF路由器充当翻译官就要会OSPF语言和RIP语言;则在OSPF中还需要将RIP翻译成OSPF
  • RIP
TypeScript 复制代码
把OSPF路由器当成翻译官,RIP路由器就只需要宣告自己的ip,也就是
network 3.3.3.0 0.0.0.255 area 0 

network 2.2.2.0 0.0.0.255 area 0
  • OSPF
TypeScript 复制代码
OSPF路由器作为翻译官,要做的是宣告自己的IP;
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
还需要为RIP翻译,所以要有一条通道可以翻译RIP:
router rip
version 2
network 2.2.2.0

开启端口并配置IP

  • OSPF(路由器)
TypeScript 复制代码
Router>en
Router#conf t
Router(config)#int g0/0
Router(config-if)#no shutdown 
Router(config-if)#ip add 1.1.1.2 255.255.255.0
Router(config-if)#ex
Router(config)#int g0/1 
Router(config-if)#no shutdown 
Router(config-if)#ip ad 2.2.2.1 255.255.255.0
  • RIP(路由器)
TypeScript 复制代码
Router>en
Router#conf t
Router(config)#int g0/0
Router(config-if)#no shutdown 
Router(config-if)#ip add 3.3.3.1 255.255.255.0
Router(config-if)#ex
Router(config)#int g0/1 
Router(config-if)#no shutdown 
Router(config-if)#ip add 2.2.2.2 255.255.255.0
Router(config-if)#ex

RIP协议

TypeScript 复制代码
Router>en
Router#conf t
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 3.3.3.0
Router(config-router)#network 2.2.2.0

OSPF协议

TypeScript 复制代码
Router>en
Router#conf t
Router(config)#router ospf 1
Router(config-router)#network 1.1.1.0 0.0.0.255 area 0
Router(config-router)#ex
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 2.2.2.0

路由器重分发

TypeScript 复制代码
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#redistribute ospf 1 metric 5
Router(config-router)#ex
Router(config)#router ospf 1
Router(config-router)#redistribute rip subnets 
  • 最终的结果都是要show ip route上显示的ip才能ping通,才算成功
相关推荐
白帽黑客沐瑶6 天前
【网络安全就业】信息安全专业的就业前景(非常详细)零基础入门到精通,收藏这篇就够了
网络·安全·web安全·计算机·程序员·编程·网络安全就业
树码小子6 天前
Java网络编程:(socket API编程:TCP协议的 socket API -- 回显程序的服务器端程序的编写)
java·网络·tcp/ip
绿箭柠檬茶6 天前
Ubuntu 服务器配置转发网络访问
服务器·网络·ubuntu
real 16 天前
传输层协议UDP
网络·网络协议·udp
路由侠内网穿透6 天前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
喵手7 天前
玩转Java网络编程:基于Socket的服务器和客户端开发!
java·服务器·网络
徐子元竟然被占了!!7 天前
实验-基本ACL
网络
ftpeak7 天前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
LabVIEW开发7 天前
LabVIEW气体污染无线监测
网络·labview·labview知识·labview功能·labview程序
error:(7 天前
【从零到公网】本地电脑部署服务并实现公网访问(IPv4/IPv6/DDNS 全攻略)
网络·智能路由器