浮動路由和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
英文地址,請注明出處:http://en.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: 消…