首页 > 其他分享 >27-1 BFD联动实验(OSPF/Static Router/VRRP)

27-1 BFD联动实验(OSPF/Static Router/VRRP)

时间:2023-12-08 15:57:04浏览次数:33  
标签:27 BFD 0.0 GigabitEthernet0 12.1 192.168 VRRP ip interface

拓扑

要求:
1.接入层和汇聚层配置MSTP+VRRP实现高可用性
2.汇聚层和核心层配置BFD高可用性
3.汇聚层和核心层之间允许OSPF,OSPF配置BFD实现高可用性
4.核心层到LSP配置静态路由,要求配置BFD实现高可用性

配置

基础配置(VLAN+IP)

PC1配置,PC2参考PC1
image

Access配置

#
vlan batch 10 20
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 20

converge1

#
vlan batch 10 20
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/3
 port link-type access
#
interface Vlanif1
 ip address 12.1.1.2 255.255.255.252
#
interface Vlanif10
 ip address 192.168.1.252 255.255.255.0
#
interface Vlanif20
 ip address 192.168.2.252 255.255.255.0

converge2

#
vlan batch 10 20
#
interface GigabitEthernet0/0/1
 port link-type access
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface Vlanif1
 ip address 12.1.2.2 255.255.255.252
#
interface Vlanif10
 ip address 192.168.1.253 255.255.255.0
#
interface Vlanif20
 ip address 192.168.2.253 255.255.255.0

core

#
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.252 
#
interface GigabitEthernet0/0/1
 ip address 12.1.2.1 255.255.255.252 
#
interface GigabitEthernet0/0/2
 ip address 200.10.10.2 255.255.255.252 
#
interface GigabitEthernet4/0/0
 ip address 200.10.20.1 255.255.255.252 

LSP

#
interface GigabitEthernet0/0/0
 ip address 200.10.10.1 255.255.255.252 
#
interface LoopBack0
 ip address 8.8.8.8 255.255.255.255 
#
interface GigabitEthernet0/0/1
 ip address 200.10.20.1 255.255.255.252 

MSTP配置

converge1

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
stp instance 1 priority 0
stp instance 2 priority 4096

converge2

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
stp instance 1 priority 4096
stp instance 2 priority 0

Access

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#

验证配置

[Access]dis stp instance 1 b
 MSTID  Port                        Role  STP State     Protection
   1    GigabitEthernet0/0/1        ROOT  FORWARDING      NONE
   1    GigabitEthernet0/0/2        DESI  FORWARDING      NONE
   1    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE
[Access]dis stp instance 2 b
 MSTID  Port                        Role  STP State     Protection
   2    GigabitEthernet0/0/1        ALTE  DISCARDING      NONE
   2    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
   2    GigabitEthernet0/0/4        DESI  FORWARDING      NONE

VRRP配置

converge1

#
interface Vlanif10
 ip address 192.168.1.252 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.1.254
 vrrp vrid 1 priority 150
#
interface Vlanif20
 ip address 192.168.2.252 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.254

converge2

#
interface Vlanif10
 ip address 192.168.1.253 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.1.254
#
interface Vlanif20
 ip address 192.168.2.253 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.254
 vrrp vrid 2 priority 150

验证配置

[converge1]display vrrp brief 
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Master       Vlanif10                 Normal   192.168.1.254  
2     Backup       Vlanif20                 Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:1     Backup:1     Non-active:0  
[converge2]display vrrp b
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Backup       Vlanif10                 Normal   192.168.1.254  
2     Master       Vlanif20                 Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:1     Backup:1     Non-active:0 

路由配置(OSPF+静态路由)

core

#
ospf 1 router-id 1.1.1.1 
 default-route-advertise always
 area 0.0.0.0 
  network 12.1.1.0 0.0.0.3 
  network 12.1.2.0 0.0.0.3 
#
ip route-static 0.0.0.0 0.0.0.0 200.10.10.1
ip route-static 0.0.0.0 0.0.0.0 200.10.20.1 preference 70

converge1

#
ospf 1 router-id 2.2.2.2
 area 0.0.0.0
  network 12.1.1.0 0.0.0.3
  network 192.168.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
  network 192.168.1.254 0.0.0.0
  network 192.168.2.254 0.0.0.0
#

converge2

#
ospf 1 router-id 3.3.3.3
 area 0.0.0.0
  network 12.1.2.0 0.0.0.3
  network 192.168.1.0 0.0.0.255
  network 192.168.2.0 0.0.0.255
  network 192.168.1.254 0.0.0.0
  network 192.168.2.254 0.0.0.0
#

VRRP联动BFD配置

converge1

#
bfd 1 bind peer-ip 12.1.1.1 source-ip 12.1.1.2 auto
#
interface Vlanif10
 ip address 192.168.1.252 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.1.254
 vrrp vrid 1 priority 150
 vrrp vrid 1 track bfd-session session-name 1 reduced 60

converge2

#
bfd 2 bind peer-ip 12.1.2.1 source-ip 12.1.2.2 auto
#
interface Vlanif20
 ip address 192.168.2.253 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.254
 vrrp vrid 2 priority 150
 vrrp vrid 2 track bfd-session session-name 1 reduced 60

core

#
bfd 1 bind peer-ip 12.1.1.2 source-ip 12.1.1.1 auto
 commit
#
bfd 2 bind peer-ip 12.1.2.2 source-ip 12.1.2.1 auto
 commit

静态路由联动BFD

core

#
bfd lsp bind peer-ip 200.10.10.1 source-ip 200.10.10.2 auto
#
ip route-static 0.0.0.0 0.0.0.0 200.10.10.1 track bfd-session lsp
ip route-static 0.0.0.0 0.0.0.0 200.10.20.1 preference 70

LSP

#
bfd lsp bind peer-ip 200.10.10.2 source-ip 200.10.10.1 auto

nat配置

#
acl name lsp 3999  
 rule 5 permit ip source 192.168.1.0 0.0.0.255 
 rule 10 permit ip source 192.168.2.0 0.0.0.255 
#
interface GigabitEthernet0/0/2
 ip address 200.10.10.2 255.255.255.252 
 nat outbound 3999
#
interface GigabitEthernet4/0/0
 ip address 200.10.20.2 255.255.255.252 
 nat outbound 3999

OSPF联动BFD

core

[core-ospf-1]bfd all-interfaces enable 

converge1

[core-ospf-1]bfd all-interfaces enable 

converge2

[converge2-ospf-1]bfd all-interfaces enable 

配置验证
core

[core]dis bfd session all 
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------

8192  8192       200.10.10.1     Up        S_AUTO_PEER       -                  
8193  8193       12.1.2.2        Up        D_IP_IF     GigabitEthernet0/0/1     
8195  8198       12.1.1.2        Up        D_IP_IF     GigabitEthernet0/0/0     
8196  8194       12.1.1.2        Up        S_AUTO_PEER       -                  
8198  8197       12.1.2.2        Up        S_AUTO_PEER       -                  
--------------------------------------------------------------------------------
     Total UP/DOWN Session Number : 5/0

converge1

[converge1]dis bfd session all 
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------

8194  8196       12.1.1.1        Up        S_AUTO_PEER       -                  
8195  8194       192.168.2.253   Up        D_IP_IF     Vlanif20                 
8196  8195       192.168.1.253   Up        D_IP_IF     Vlanif10                 
8198  8195       12.1.1.1        Up        D_IP_IF     Vlanif1                  
--------------------------------------------------------------------------------
     Total UP/DOWN Session Number : 4/0

converge2

[converge2]dis bfd session all 
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------

8193  8193       12.1.2.1        Up        D_IP_IF     Vlanif1                  
8194  8195       192.168.2.252   Up        D_IP_IF     Vlanif20                 
8195  8196       192.168.1.252   Up        D_IP_IF     Vlanif10                 
8197  8198       12.1.2.1        Up        S_AUTO_PEER       -                  
--------------------------------------------------------------------------------
     Total UP/DOWN Session Number : 4/0

将core的GE0/0/2接口关闭

配置验证

PC1,PC2访问公网
image
image

关闭converge1的上行链路,BFD分别通知OSPF和VRRP协议,OSPF,VRRP再进行相应操作

[converge1-GigabitEthernet0/0/3]shutdown 
[converge1-GigabitEthernet0/0/3]dis vrrp b
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Backup       Vlanif10                 Normal   192.168.1.254  
2     Backup       Vlanif20                 Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:0     Backup:2     Non-active:0     

[converge2]dis vrrp b
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Master       Vlanif10                 Normal   192.168.1.254  
2     Master       Vlanif20                 Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:2     Backup:0     Non-active:0 

且CONVERGE1和core1之间的邻居也检测后断开
image

LSP的GE0/0/0端口关闭,core通过BFD检测链路故障,切换默认路由

[LSP-GigabitEthernet0/0/0]shutdown 

core
image

image

标签:27,BFD,0.0,GigabitEthernet0,12.1,192.168,VRRP,ip,interface
From: https://www.cnblogs.com/Metkey/p/17884049.html

相关文章

  • 2023-2024-1 20211327 实验四 Web服务器2
    实验四Web服务器2Web服务器的客户端服务器web_server.c#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<arpa/inet.h>#definePORT8080#defineBUFFER_SIZE1024voidhandle_client(intclient_socket){......
  • 2023-2024-1 20211327 实验四 Web服务器1-socket编程
    实验四Web服务器1-socket编程time服务器的客户端服务器time_server.c#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<arpa/inet.h>#include<sys/socket.h>#include<sys/types.h>#include<s......
  • BFD技术与应用
    BFD双向转发检测   作用:检测网络故障,实现快速检测/收敛        提供了一个通用的、标准化的、介质无关和协议无关的快速故障检测机制    1.硬件检测,使用同一条链路相连的两个之间可以通过接口硬件检测功能检测故障        ......
  • 《2023-2024-1 20232427《网络空间安全导论》第五周学习总结》
    《2023-2024-120232427《网络空间安全导论》第五周学习总结》教学学习内容总结第五章内容安全基础5.1信息内容安全概述社会信息化和网络化发展加快,现在全球数据增长十分迅速,数据内容成为了互联网的中心关注点。各种社交网络不断涌现。但是!互联网和信息媒体的发展带来了许多......
  • 2199元起 铭凡新款迷你主机UN1270上市:i7-12700H、支持PD供电
    铭凡迷你主机UN1270目前已上市开售,到手仅需2199元。设计上,这款迷你主机的体积仅为0.9升,为标准台式机的1/40,采用静音风扇,满载43db,待机32db。处理器采用的是i7-12700H,拥有6性能核+8能效核的混合CPU架构,14核心20线程。睿频可达4.7GHz,可实现55W性能释放。此外,这款迷你主机支持3屏......
  • [Re221127周任务]认识寄存器
    1.分析逻辑 我们一个一个点进去看 我们这里是加密过程并且加密后直接与输入对比的,所以我们可以直接动调2.动调 下在这里就好了 点进去eax就有flag了 注意这个flag是不包括上面那个1的 ......
  • Jamf Pro 10.27: IT管理员的幸福指数的又一次提升
    1JamfPro10.27,旨在提升IT管理员的幸福指数。我们听取了您的反馈和要求,并很荣幸为您带来此最新版本。JamfPro10.27专注于改善管理员的日常操作,使Jamf易于使用且设备管理更简单。我们已听取了反馈,并相信10.27会体现出这些工作流程的改进请求。此外,此版本还包括了与JamfProtect的......
  • BFD配置实例
    sw1配置【sw1】bfd//启用bfd[sw1-bfd]default-ip-address224.0.0.184//配置bfd默认使用组播地址[sw1]bfdsw1-2bindpeer-ipdefault-ipinterfaceg0/0/1//创建bfd会话[sw1-bfd-session-sw1-2]discriminatorlocal1//配置本地设备标识为1[sw1-bfd-session-sw1-2......
  • IBM SPSS Statistics 27:洞悉数据,揭示趋势
    IBMSPSSStatistics27是一款功能强大的数据统计分析软件,它可以帮助用户快速、准确地分析和解读数据,并生成高质量的统计图表和报告。点击获取IBMSPSSStatistics27首先,IBMSPSSStatistics27具有广泛的数据分析工具和功能。它支持各种数据导入和预处理方式,可以快速清洗、整......
  • edit-bbbb5b6582764452981ccff0eba44303
    这个开源的博客园主题真火了!这个开源的博客园主题真火了!欢迎来到Dotnet工具箱!在这里,你可以发现各种令人惊喜的开源项。博客园主题silence是一个由.NETCore开发工程师esofar开发的博客园主题,颜值高和专注于阅读是它的标签,并且有非常多的博客园用户选择使用了silen......