当前位置: 首页 > article >正文

路由引入中次优路由和路由环路问题

        A公司用的是IS-IS,B公司用的是OSPF,现在这两个公司要合并,网络要相通

项目目标

前期准备

  1. 配置IP地址:完成IP地址规划,A公司和B公司内部网络通过路由器R2和R4环回接口模拟。配置路由器接口的IP地址并测试所有直连链路的连通性
  2. 配置IS-IS:路由器R1、R2和R3上网络配置IS-IS路由协议,区域为49.0001,R2上引入直连路由
  3. 配置OSPF:路由器R1、R3和R4上配置OSPF路由协议,区域为0,R4上引入直连路由

核心

  1. 配置路由引入:在边界设备R1和R3上配置路由引入。
  2. 分析次优路由:在路由器R3上首先执行OSPF和IS-IS双向路由引入,在路由器R1的路由表中出现到达R4环回接口所在网络的次优路由。
  3. 分析路由环路:在路由器R1上也完成OSPF和IS-IS双向路由引入,在器R1、R2和R3路由器上中出现到达R4环回接口所在网络的路由环路。
  4. 解决路由环路和次优路由:在路由引入时使用路由策略和路由标记来解决次优路由、路由反馈和路由环路的方案扩展性非常好

项目步骤

准备工作

(1)配置各设备的IP地址

        完成实验拓扑图的IP的地址规划,AR2、AR4之间的内部网络通过环回接口模拟

# AR1配置
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 172.16.12.1 255.255.255.0
[AR1-GigabitEthernet0/0/0]q
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 172.16.134.1 24
[AR1-GigabitEthernet0/0/1]q
[AR1]

# AR2配置
[AR2]interface LoopBack 2
[AR2-LoopBack2]ip address 172.16.2.2 24
[AR2-LoopBack2]q
[AR2]interface LoopBack 22
[AR2-LoopBack22]ip address 172.16.22.2 24
[AR2-LoopBack22]q
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 172.16.12.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 172.16.23.2 24
[AR2-GigabitEthernet0/0/1]q
[AR2]

# AR3配置
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 172.16.23.3 24
[AR3-GigabitEthernet0/0/0]q
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip address 172.16.134.3 24
[AR3-GigabitEthernet0/0/1]q
[AR3]

# AR4配置
[AR4]interface GigabitEthernet 0/0/0
[AR4-GigabitEthernet0/0/0]ip address 172.16.134.4 24
[AR4-GigabitEthernet0/0/0]q
[AR4]interface LoopBack 4
[AR4-LoopBack4]ip address 172.16.4.4 24
[AR4-LoopBack4]q
[AR4]interface LoopBack 44
[AR4-LoopBack44]ip address 172.16.44.4 24
[AR4-LoopBack44]q
[AR4]

        验证(以AR2为例)

<AR2>display ip interface brief | exclude unassigned

(2)配置IS-IS

        路由器AR1、AR2、AR3上网络配置IS-IS路由协议,区域为49.0001,AR2上引入直连路由

# AR1配置
[AR1]isis 1
[AR1-isis-1]cost-style wide
[AR1-isis-1]network-entity 49.0001.1111.1111.1111.00
[AR1-isis-1]q
[AR1]interface  GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]isis enable 1
[AR1-GigabitEthernet0/0/0]q
[AR1]

# AR2配置
[AR2]isis 1	
[AR2-isis-1]cost-style wide
[AR2-isis-1]network-entity 49.0001.2222.2222.2222.00	
[AR2-isis-1]import-route direct 
[AR2-isis-1]q
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]isis enable 1
[AR2-GigabitEthernet0/0/0]q
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]isis enable 1
[AR2-GigabitEthernet0/0/1]q
[AR2]

# AR3配置
[AR3]isis 1
[AR3-isis-1]cost-style wide
[AR3-isis-1]network-entity 49.0001.3333.3333.3333.00
[AR3-isis-1]q
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]isis enable 1
[AR3-GigabitEthernet0/0/0]q
[AR3]

        验证(以AR1为例)

<AR1>display ip routing-table protocol isis

(3)配置OSPF

        路由器AR1、AR3、AR4上配置OSPF路由协议,区域为0,AR4上引入直连路由

# AR1配置
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]bandwidth-reference 1000
Info: Reference bandwidth is changed. Please ensure that the reference bandwidth
 that is configured for all the routers are the same.
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 172.16.134.1 0.0.0.0
[AR1-ospf-1-area-0.0.0.0]q
[AR1-ospf-1]q
[AR1]

# AR3配置
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]bandwidth-reference 1000
Info: Reference bandwidth is changed. Please ensure that the reference bandwidth
 that is configured for all the routers are the same.
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 172.16.134.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]q
[AR3]

# AR4配置
[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]import-route direct cost 10
[AR4-ospf-1]bandwidth-reference 1000
Info: Reference bandwidth is changed. Please ensure that the reference bandwidth
 that is configured for all the routers are the same.
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]network 172.16.134.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]q
[AR4-ospf-1]q
[AR4]

        验证(以AR1为例)

<AR1>display ip routing-table protocol ospf

核心工作

(1)配置路由引入

        在路由器AR3上首先执行OSPF和IS-IS双向路由引入

[AR3]ospf 1
[AR3-ospf-1]import-route isis 1
[AR3-ospf-1]q

[AR3]isis 1
[AR3-isis-1]import-route ospf 1
[AR3-isis-1]q
[AR3]

(2)分析次优路由

        在路由器AR3上首先执行OSPF和IS-IS双向路由引入后,在路由器AR1的路由表中,发现到目的网络172.16.4.0和172.16.44.0的下一跳地址是172.16.12.2,也就是经过路由器AR2和AR3到达,而没有选择直接到AR4,就是次优路由

<AR1>display ip routing-table protocol isis

        由于172.16.4.0和172.16.44.0是通过在路由器AR4引入直连进入OSPF的,所以是OSPF ASE路由,在路由器AR1和AR3上没有执行双向路由引入之前,路由172.16.4.0和172.16.44.0会以O_ASE代码出现在路由器AR1和AR3的路由表上,路由优先级为150。

        在路由器AR3上首先执行了OSPF和IS-IS双向路由引入,外部路由条目172.16.4.0和172.16.44.0进入OSPF进程,该条目通过5类LSA传递给路由器AR1,路由器AR1通过比较路由优先级,发现从路由器AR2收到该路由条目的优先级为15,而从路由器AR4收到的路由条目优先级为150,所以路由器AR1更新路由表,选择路由条目优先级低的路由安装进路由表,即下一跳指向路由器AR2,所以造成了次优路由

        查看AR1到达172.16.4.4的信息

<AR1>tracert 172.16.4.4

(3)分析次优路由

        在路由器AR1上也完成OSPF和IS-IS双向路由引入,在路由器AR1、AR2和AR3上出现到达AR4环回接口所在网络的路由环路

[AR1]ospf 1	
[AR1-ospf-1]import-route isis 1
[AR1-ospf-1]q

[AR1]isis 1
[AR1-isis-1]import-route ospf 1
[AR1-isis-1]q
[AR1]

        接下来在路由器AR1、AR2、AR3上查看路由表,只需要关注172.16.4.0和172.16.44.0两条路由(以AR1为例)

<AR1>display ip routing-table

        以上输出关注3台路由器上路由条目172.16.4.0和172.16.44.0的下一跳,发现路由环路已经产生

(4)解决路由环路和次优路由

        在路由引入时使用路由策略和路由标记来解决次优路由、路由反馈和路由环路

        首先通过修改路由优先级来解决次优路由和路由反馈的问题

# AR1配置
[AR1]ip ip-prefix 4 index 10 permit 172.16.4.0 24
[AR1]ip ip-prefix 4 index 20 permit 172.16.44.0 24
[AR1]route-policy PRE permit node 10
Info: New Sequence of this List.
[AR1-route-policy]if-match ip-prefix 4
[AR1-route-policy]apply preference 160
[AR1-route-policy]q
[AR1]route-policy PRE permit node 20
Info: New Sequence of this List.
[AR1-route-policy]q
[AR1]isis 1	
[AR1-isis-1]preference route-policy PRE
[AR1-isis-1]q
[AR1]

# AR3配置
[AR3]ip ip-prefix 4 index 10 permit 172.16.4.0 24
[AR3]ip ip-prefix 4 index 20 permit 172.16.44.0 24
[AR3]route-policy PRE permit node 10
Info: New Sequence of this List.
[AR3-route-policy]if-match ip-prefix 4
[AR3-route-policy]apply preference 160
[AR3-route-policy]q
[AR3]route-policy PRE permit node 20
Info: New Sequence of this List.
[AR3-route-policy]q
[AR3]isis 1
[AR3-isis-1]preference route-policy PRE
[AR3-isis-1]q
[AR3]

        然后用路由策略和路由标记来解决路由环路问题

# AR1配置
[AR1]route-policy O2I deny node 10
Info: New Sequence of this List.
[AR1-route-policy]if-match tag 200
[AR1-route-policy]q
[AR1]route-policy O2I permit node 20
Info: New Sequence of this List.
[AR1-route-policy]apply tag 100
[AR1-route-policy]q
[AR1]route-policy I2O deny node 10
Info: New Sequence of this List.
[AR1-route-policy]if-match tag 400
[AR1-route-policy]q
[AR1]route-policy I2O permit node 20
Info: New Sequence of this List.
[AR1-route-policy]apply tag 300
[AR1-route-policy]q

[AR1]ospf 1
[AR1-ospf-1]import-route isis 1 route-policy I2O
[AR1-ospf-1]q
[AR1]isis 1
[AR1-isis-1]import-route ospf 1 route-policy O2I
[AR1-isis-1]q
[AR1]

# AR3配置
[AR3]route-policy I2O deny node 10
Info: New Sequence of this List.
[AR3-route-policy]if-match tag 100
[AR3-route-policy]q
[AR3]route-policy I2O permit node 20
Info: New Sequence of this List.
[AR3-route-policy]apply tag 200
[AR3-route-policy]q
[AR3]route-policy O2I deny node 10
Info: New Sequence of this List.
[AR3-route-policy]if-match tag 300
[AR3-route-policy]q
[AR3]route-policy O2I permit node 20
Info: New Sequence of this List.
[AR3-route-policy]apply tag 400
[AR3-route-policy]q

[AR3]ospf 1
[AR3-ospf-1]import-route isis 1 route-policy I2O
[AR3-ospf-1]q
[AR3]isis 1
[AR3-isis-1]import-route ospf 1 route-policy I2O
[AR3-isis-1]q
[AR3]

查看路由表(以AR1为例)


http://www.kler.cn/a/414588.html

相关文章:

  • 【RL Base】强化学习核心算法:深度Q网络(DQN)算法
  • Web 毕设篇-适合小白、初级入门练手的 Spring Boot Web 毕业设计项目:电影院后台管理系统(前后端源码 + 数据库 sql 脚本)
  • 1、Three.js开端准备环境
  • Spring Boot【二】
  • CA系统(file.h---申请认证的处理)
  • 初试无监督学习 - K均值聚类算法
  • Linux:进程的概念
  • c/c++ 用easyx图形库写一个射击游戏
  • 探索C/C++的奥秘之C++中的继承
  • 【C++】 list接口以及模拟实现
  • 【AI技术赋能有限元分析应用实践】pycharm终端与界面设置导入Abaqus2024自带python开发环境
  • 美畅物联丨如何通过ffmpeg排查视频问题
  • 直播实时美颜平台开发详解:基于视频美颜SDK的技术路径
  • go 和java 编写方式的理解
  • 数据安全与隐私保护:大数据时代的挑战与机遇
  • 华为海思2025届校招笔试面试经验分享
  • 关于Spring基础了解
  • SOLID原则学习【目录篇】
  • Ubuntu20.04下安装VSCode(配置C/C++开发环境)和设备树插件用于嵌入式开发
  • ESP32学习笔记_Peripherals(1)——UART
  • 企业建站高性能的内容管理系统
  • Swagger记录一次生成失败
  • 关于IDE的相关知识之一【使用技巧】
  • python(四)os模块、sys模块
  • git如何给历史提交打标签
  • 【Vue2.x】vue-treeselect修改宽度、回显