浮动路由和BFD配置

拓扑图

前期的拓扑图没有交换机
在这里插入图片描述

配置步骤

1、配置IP地址

终端IP地址的配置

路由器IP地址的配置

配置router的对应接口的IP地址
<Huawei>sys
[Huawei]sysname router
[router]interface Ethernet 0/0/0
[router-Ethernet0/0/0]ip address 192.168.10.254 24
[router-Ethernet0/0/0]q
[router]undo info-center enable 
[router]interface Ethernet 0/0/1
[router-Ethernet0/0/1]ip address 192.168.20.254 24
[router-Ethernet0/0/1]q
[router]interface GigabitEthernet0/0/0
[router-GigabitEthernet0/0/0]ip address 12.1.1.1 30
[router-GigabitEthernet0/0/0]q
[router]interface GigabitEthernet 0/0/1
[router-GigabitEthernet0/0/1]ip address 13.1.1.1 30
[router-GigabitEthernet0/0/1]q检查一下配置情况
router]display ip interface brief 
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 6
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 6Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     192.168.10.254/24    up         up        
Ethernet0/0/1                     192.168.20.254/24    up         up        
GigabitEthernet0/0/0              12.1.1.1/30          up         up        
GigabitEthernet0/0/1              13.1.1.1/30          up         up        
GigabitEthernet0/0/2              unassigned           down       down      
GigabitEthernet0/0/3              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down 
配置dianxin路由器的IP地址
<Huawei>sys
[Huawei]undo info-center enable 
[Huawei]interface GigabitEthernet  0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 30
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 100.1.1.1 30
[Huawei-GigabitEthernet0/0/1]q
[Huawei]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.1.1.2/30          up         up        
GigabitEthernet0/0/1              100.1.1.1/30         up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[Huawei]sysname dianxin
[dianxin]
配置liantong路由器的IP地址
<Huawei>sys
[Huawei]undo info-center enable
[Huawei]sysname liantong
[liantong]interface g0/0/0
[liantong-GigabitEthernet0/0/0]ip address 13.1.1.2 30
[liantong-GigabitEthernet0/0/0]int g0/0/1
[liantong-GigabitEthernet0/0/1]ip add 200.1.1.1 30
[liantong-GigabitEthernet0/0/1]q
[liantong]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              13.1.1.2/30          up         up        
GigabitEthernet0/0/1              200.1.1.1/30         up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[liantong]
配置互联网的路由器的配置
<Huawei>sys
[Huawei]sysname hulianwang
[hulianwang]undo info-center enable 
[hulianwang]int g0/0/0
[hulianwang-GigabitEthernet0/0/0]ip add 100.1.1.2 30
[hulianwang-GigabitEthernet0/0/0]int g0/0/1
[hulianwang-GigabitEthernet0/0/1]ip  add 200.1.1.2 30
[hulianwang-GigabitEthernet0/0/1]q
环回口:这个地址就不会因为物理接口状态变化而丢失,用于建立路由邻居或远程管理非常理想。
[hulianwang]interface LoopBack 0
[hulianwang-LoopBack0]ip add 22.22.22.22 32 
[hulianwang-LoopBack0]q
[hulianwang]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.2/30         up         up        
GigabitEthernet0/0/1              200.1.1.2/30         up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         22.22.22.22/32       up         up(s)     
NULL0                             unassigned           up         up(s)     
[hulianwang]

2、配置OSPF

在互联网路由器中宣告网段
[hulianwang]ospf
[hulianwang-ospf-1]area 0
[hulianwang-ospf-1-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[hulianwang-ospf-1-area-0.0.0.0]q
[hulianwang-ospf-1]
在liantong路由器中宣告网段
[liantong]ospf 1
[liantong-ospf-1]area 0
[liantong-ospf-1-area-0.0.0.0]network 0.0.0.0 0.0.0.0
[liantong-ospf-1-area-0.0.0.0]q
[liantong-ospf-1][liantong]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 13       Routes : 13       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/30  OSPF    10   3           D   200.1.1.2       GigabitEthernet
0/0/113.1.1.0/30  Direct  0    0           D   13.1.1.2        GigabitEthernet
0/0/013.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/013.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/022.22.22.22/32  OSPF    10   1           D   200.1.1.2       GigabitEthernet
0/0/1100.1.1.0/30  OSPF    10   2           D   200.1.1.2       GigabitEthernet
0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0200.1.1.0/30  Direct  0    0           D   200.1.1.1       GigabitEthernet
0/0/1200.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1200.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0[liantong]
在dianxin路由器中宣告网段
[dianxin]ospf 1
[dianxin-ospf-1-area-0.0.0.0]net 0.0.0.0 0.0.0.0
[dianxin-ospf-1-area-0.0.0.0]q
[dianxin-ospf-1]
[dianxin]display ospf peer bOSPF Process 1 with Router ID 12.1.1.2Peer Statistic Information----------------------------------------------------------------------------Area Id          Interface                        Neighbor id      State    0.0.0.0          GigabitEthernet0/0/1             100.1.1.2        Full        ----------------------------------------------------------------------------
[dianxin][dianxin]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 13       Routes : 13       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface12.1.1.0/30  Direct  0    0           D   12.1.1.2        GigabitEthernet
0/0/012.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/012.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/013.1.1.0/30  OSPF    10   3           D   100.1.1.2       GigabitEthernet
0/0/122.22.22.22/32  OSPF    10   1           D   100.1.1.2       GigabitEthernet
0/0/1100.1.1.0/30  Direct  0    0           D   100.1.1.1       GigabitEthernet
0/0/1100.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1100.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0200.1.1.0/30  OSPF    10   2           D   100.1.1.2       GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0[dianxin]

3、配置出口路由器router

[router]acl 2000
[router-acl-basic-2000]rule 10 permit source 192.168.10.0 0.0.0.255
[router-acl-basic-2000]rule 20 permit source 192.168.20.0 0.0.0.255
[router-acl-basic-2000]q
[router]
[router]int g0/0/0
[router-GigabitEthernet0/0/0]nat outbound 2000
[router-GigabitEthernet0/0/0]int g0/0/1
[router-GigabitEthernet0/0/1]nat outbound 2000
[router-GigabitEthernet0/0/1]q配置出口的默认路由,也就是静态路由,很重要
[router]ip route-static 0.0.0.0 0 12.1.1.2
[router]ip route-static 0.0.0.0 0 13.1.1.2

经过上述实验PC1可以ping通22.22.22.22

测试浮动路由

  • 现在两个静态路由的优先级都是60,优先级越小优先选择谁
<router>dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 17       Routes : 18       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   12.1.1.3        InLoopBack0Static  60   0          RD   13.1.1.3        InLoopBack012.1.1.0/30  Direct  0    0           D   12.1.1.1        GigabitEthernet
0/0/2
  • 测试更改静态路由的优先级
[router]ip route-static 0.0.0.0 0 13.1.1.3 preference 100
Info: Succeeded in modifying route.
  • 配置上述,命令之后,路由表如下,优先级为100的被隐藏。若优先级为60的静态路由shutdown,则会显示优先级为100的静态路由。
[router]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 17       Routes : 17       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   12.1.1.3        InLoopBack012.1.1.0/30  Direct  0    0           D   12.1.1.1        GigabitEthernet
0/0/212.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2

1754407230110

4、新增加交换机

1754407029507

1754407376018

  • 新增加的交换机的链路是绿色的(通的),但是静态路由的选择没有改变,该怎么解决?
  • 使用BFD,做链路的探测。

5、配置BFD

  • BFD(Bidrectional Forwarding Detection,双向转发检测)用于快速检测系统设备之间的发送和接受两个方向的通信故障,并在出现故障时通知生成应用。BFD广泛用于链路故障检测,并能实现与接口、静态路由、动态路由等联动检测。
在router路由器中配置
开启bfd
[router]bfd  
[router-bfd]q
绑定对端IP,源IP
[router]bfd 1 bind peer-ip 12.1.1.3 source-ip 12.1.1.1 auto 
使bdf生效
[router-bfd-session-1]commit 
在dianxin路由器中配置BFD
[Huawei]bfd
[Huawei-bfd]q
[Huawei]bfd 1 bind peer-ip 12.1.1.1 source-ip 12.1.1.3 auto 
Info: The configuration succeeds, but BFD session cannot be created for the mome
nt because the route cannot be found.
[Huawei-bfd-session-1]commit
Info: The configuration succeeds, but BFD session cannot be created for the mome
nt because the route cannot be found.
[Huawei-bfd-session-1]q[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown[Huawei]display bfd session all
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------8192  8192       12.1.1.1        Up        S_AUTO_PEER       -                  
--------------------------------------------------------------------------------Total UP/DOWN Session Number : 1/0
[Huawei]
[router]ip route-static 0.0.0.0 0 12.1.1.3 track bfd-session 1
Info: Succeeded in modifying route.
[router]

1754408210788

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/pingmian/91973.shtml
繁体地址,请注明出处:http://hk.pswp.cn/pingmian/91973.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Docker 实战 -- Nextcloud

文章目录前言1. 创建 docker-compose.yml2. 启动 Nextcloud3. 访问 Nextcloud4. 配置优化&#xff08;可选&#xff09;使用 PostgreSQL使用 redis添加 Cron 后台任务5. 常用命令6. 反向代理&#xff08;Nginx/Apache&#xff09;前言 当你迷茫的时候&#xff0c;请点击 Docke…

【计算机网络 | 第2篇】计算机网络概述(下)

文章目录七.因特网服务提供商&#x1f95d;八.接入网&#x1f95d;主流的家庭宽带接入方式介入网工作原理&#x1f9d0;DSL技术&#xff1a;铜线上的“三通道”通信DSL的速率标准呈现出显著的"不对称"特征&#x1f914;电缆互联网接入技术&#x1f34b;‍&#x1f7e…

SpringMVC 6+源码分析(四)DispatcherServlet实例化流程 3--(HandlerAdapter初始化)

一、概述 HandlerAdapter 是 Spring MVC 框架中的一个核心组件&#xff0c;它在 DispatcherServlet 和处理程序&#xff08;handler&#xff09;之间扮演适配器的角色。DispatcherServlet 接收到 HTTP 请求后&#xff0c;需要调用对应的 handler 来处理请求&#xff08;如控制器…

【lucene】FastVectorHighlighter案例

下面给出一套可直接拷贝运行的 Lucene 8.5.0 FastVectorHighlighter 完整示例&#xff08;JDK 8&#xff09;&#xff0c;演示从建索引、查询到高亮的全过程。 > 关键点&#xff1a;字段必须 1. 存储原始内容&#xff08;setStored(true)&#xff09; 2. 开启 TermVecto…

C++返回值优化(RVO):高效返回对象的艺术

在C开发中&#xff0c;按值返回对象的场景十分常见&#xff08;如运算符重载、工厂函数等&#xff09;&#xff0c;但开发者常因担忧“构造/析构的性能开销”而陷入纠结&#xff1a;该不该返回对象&#xff1f;如何避免额外成本&#xff1f;本文将剖析痛点、拆解错误思路&#…

用 PyTorch 实现一个简单的神经网络:从数据到预测

PyTorch 是目前最流行的深度学习框架之一&#xff0c;以其灵活性和易用性受到开发者的喜爱。本文将带你从零开始&#xff0c;用 PyTorch 实现一个简单的神经网络&#xff0c;用于解决经典的 MNIST 手写数字分类问题。我们将涵盖数据准备、模型构建、训练和预测的完整流程&#…

四级页表通俗讲解与实践(以 64 位 ARM Cortex-A 为例)

&#x1f4d6; &#x1f3a5; B 站博文精讲视频&#xff1a;点击链接&#xff0c;配合视频深度学习 四级页表通俗讲解与实践&#xff08;以 64 位 ARM Cortex-A 为例&#xff09; 本文面向希望彻底理解现代 64 位架构下四级页表的开发者&#xff0c;结合 ARM Cortex-A 系列处理…

AI模型整合包上线!一键部署ComfyUI,2.19TB模型全解析

最近体验了AIStarter平台上线的AI模型整合包&#xff0c;包含2.19TB ComfyUI大模型&#xff0c;整合市面主流模型&#xff0c;一键部署ComfyUI&#xff0c;省去重复下载烦恼&#xff01;以下是使用心得和部署步骤&#xff0c;适合AI开发者参考。工具亮点这款AI模型整合包由熊哥…

灰色优选模型及算法MATLAB代码

电子装备试验方案优选是一个典型的多属性决策问题&#xff0c;通常涉及指标复杂、信息不完整、数据量少且存在不确定性的特点。灰色系统理论&#xff08;Grey System Theory&#xff09;特别擅长处理“小样本、贫信息”的不确定性问题&#xff0c;因此非常适合用于此类方案的优…

AI框架工具FastRTC快速上手6——视频流案例之物体检测(下)

一 前言 上一篇,我们实现了用YOLO对图片上的物体进行检测,并在图片上框出具体的对象并打出标签。但只是应用在单张图片,且还没用上FastRTC。 本篇,我们希望结合FastRTC的能力,实现基于YOLO的实时视频流的物体检测。 本篇文字将不会太多。学习完本篇,对比前面的文章,你…

PHP常见中高面试题汇总

一、 PHP部分 1、PHP如何实现静态化 PHP的静态化分为&#xff1a;纯静态和伪静态。其中纯静态又分为&#xff1a;局部纯静态和全部纯静态。 PHP伪静态&#xff1a;利用Apache mod_rewrite实现URL重写的方法&#xff1b; PHP纯静态&#xff0c;就是生成HTML文件的方式&#xff0…

基于Java AI(人工智能)生成末日题材的实践

Java AI 生成《全球末日》文章的实例 使用Java结合AI技术生成《全球末日》题材的文章可以通过多种方式实现,包括调用预训练模型、使用自然语言处理库或结合生成式AI框架。以下是30个实例的生成方法和示例代码片段。 调用预训练模型(如GPT-3或GPT-4) 使用OpenAI API生成末日…

针对软件定义车载网络的动态服务导向机制

我是穿拖鞋的汉子,魔都中坚持长期主义的汽车电子工程师。 老规矩,分享一段喜欢的文字,避免自己成为高知识低文化的工程师: 做到欲望极简,了解自己的真实欲望,不受外在潮流的影响,不盲从,不跟风。把自己的精力全部用在自己。一是去掉多余,凡事找规律,基础是诚信;二是…

Pytorch实现婴儿哭声检测和识别

Pytorch实现婴儿哭声检测和识别 目录 Pytorch实现婴儿哭声检测识别 1. 项目说明 2. 数据说明 &#xff08;1&#xff09;婴儿哭声语音数据集 &#xff08;2&#xff09;自定义数据集 3. 模型训练 &#xff08;1&#xff09;项目安装 &#xff08;2&#xff09;准备Tra…

海信IP810N/海信IP811N_海思MV320-安卓9.0主板-TTL烧录包-可救砖

海信IP810N&#xff0f;海信IP811N_海思MV320处理器-安卓9主板-TTL烧录包-可救砖准备工作&#xff1a;TTL线自备跑码工具【putty跑码中文版】路径&#xff1a;【工具大全】-【putty跑码中文版】测试跑码以后将跑码窗口关闭&#xff1b;然后到下方下载烧录工具并大致看下教程烧录…

Go 中的 interface{} 与 Java 中的 Object:相似之处与本质差异

在软件系统开发中&#xff0c;“通用类型”的处理是各语言设计中不可忽视的一部分。Java 使用 Object&#xff0c;Go 使用 interface{}&#xff0c;它们都可以容纳任意类型的值&#xff0c;是实现动态行为或通用容器的基础类型。然而&#xff0c;虽然两者在使用层面看似相似&am…

Docker-07.Docker基础-数据卷挂载

一.案例首先我们通过一则案例来引出问题。我们要修改nginx容器内的html目录下的index.html文件&#xff0c;并且要将静态资源部署到nginx的html目录&#xff0c;就要首先知道该html目录的所在位置。我们首先查看nginx镜像的帮助文档&#xff0c;这里就是将有关静态资源目录的&a…

数据结构(三)双向链表

一、什么是 make 工具&#xff1f;make 是一个自动化构建工具&#xff0c;主要用于管理 C/C 项目的编译和链接过程。它通过读取 Makefile 文件中定义的规则&#xff0c;自动判断哪些文件被修改&#xff0c;并仅重新编译这些部分&#xff0c;从而大幅提高构建效率。二、什么是 M…

如何在没有iCloud的情况下将联系人转移到新iPhone?

升级到新 iPhone 后&#xff0c;设置已完成&#xff0c;想在不使用 iCloud 的情况下将联系人从 iPhone 转移到 iPhone 吗&#xff1f;别担心。还有其他 5 种方法可以帮助您轻松地将联系人转移到新 iPhone。这样&#xff0c;您就无需再次重置新设备了。第 1 部分&#xff1a;如何…

SpringBoot3.x入门到精通系列:4.2 整合 Kafka 详解

SpringBoot 3.x 整合 Kafka 详解 &#x1f3af; Kafka简介 Apache Kafka是一个分布式流处理平台&#xff0c;主要用于构建实时数据管道和流应用程序。它具有高吞吐量、低延迟、可扩展性和容错性等特点。 核心概念 Producer: 生产者&#xff0c;发送消息到Kafka集群Consumer: 消…