当前位置:网站首页>华为设备配置VRRP与BFD联动实现快速切换
华为设备配置VRRP与BFD联动实现快速切换
2022-08-03 20:18:00 【51CTO】

1. 配置设备各接口的IP地址
[LSW1]vlan batch 10 20
[LSW1-GigabitEthernet0/0/3]port link-type hybrid
[LSW1-GigabitEthernet0/0/3]port hybrid pvid vlan 10
[LSW1-GigabitEthernet0/0/3]port hybrid untagged vlan 10
[LSW1-GigabitEthernet0/0/4]port link-type hybrid
[LSW1-GigabitEthernet0/0/4]port hybrid untagged vlan 20
[LSW1-GigabitEthernet0/0/4]port hybrid pvid vlan 20
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW1-Vlanif20]ip add 10.1.2.1 24
[LSW2]vlan batch 10 30
[LSW2-GigabitEthernet0/0/3]port link-type hybrid
[LSW2-GigabitEthernet0/0/3]port hybrid untagged vlan 10
[LSW2-GigabitEthernet0/0/3]port hybrid pvid vlan 10
[LSW2-GigabitEthernet0/0/4]port link-type hybrid
[LSW2-GigabitEthernet0/0/4]port hybrid pvid vlan 30
[LSW2-GigabitEthernet0/0/4]port hybrid untagged vlan 30
[LSW2-Vlanif10]ip add 10.1.1.2 24
[LSW2-Vlanif30]ip add 10.1.3.2 24
[LSW4]vlan batch 20 30 100
[LSW4-GigabitEthernet0/0/1]port link-type hybrid
[LSW4-GigabitEthernet0/0/1]port hybrid untagged vlan 20
[LSW4-GigabitEthernet0/0/1]port hybrid pvid vlan 20
[LSW4-GigabitEthernet0/0/2]port link-type hybrid
[LSW4-GigabitEthernet0/0/2]port hybrid pvid vlan 30
[LSW4-GigabitEthernet0/0/2]port hybrid untagged vlan 30
[LSW4-GigabitEthernet0/0/3]port link-type hybrid
[LSW4-GigabitEthernet0/0/3]port hybrid untagged vlan 100
[LSW4-GigabitEthernet0/0/3]port hybrid pvid vlan 100
[LSW4-Vlanif20]ip add 10.1.2.4 24
[LSW4-Vlanif30]ip add 10.1.3.4 24
[LSW4-Vlanif100]ip add 172.16.1.4 24
2. 配置LSW3的二层转发功能
[LSW3]vlan batch 10
[LSW3-GigabitEthernet0/0/1]port link-type hybrid
[LSW3-GigabitEthernet0/0/1]port hybrid untagged vlan 10
[LSW3-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[LSW3-GigabitEthernet0/0/2]port link-type hybrid
[LSW3-GigabitEthernet0/0/2]port hybrid untagged vlan 10
[LSW3-GigabitEthernet0/0/2]port hybrid pvid vlan 10
3. 配置OSPF协议进行互联
[LSW1]ospf 1
[LSW1-ospf-1]area 0
[LSW1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW1-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW2]ospf 1
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW2-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
[LSW4]ospf 1
[LSW4-ospf-1]area 0
[LSW4-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[LSW4-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255
4. 配置VRRP备份组
[LSW1]int Vlanif 10
[LSW1-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
[LSW1-Vlanif10]vrrp vrid 1 priority 120
[LSW1-Vlanif10]vrrp vrid 1 preempt-mode timer delay 20
[LSW1-Vlanif10]vrrp vrid 2 virtual-ip 10.1.1.253
[LSW2]int Vlanif 10
[LSW2-Vlanif10]vrrp vrid 2 virtual-ip 10.1.1.253
[LSW2-Vlanif10]vrrp vrid 2 priority 120
[LSW2-Vlanif10]vrrp vrid 2 preempt-mode timer delay 20
[LSW2-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
5. 配置静态BFD会话
[LSW1]bfd
[LSW1]bfd 1to2 bind peer-ip 10.1.1.2 interface Vlanif 10
[LSW1-bfd-session-1to2]discriminator local 1
[LSW1-bfd-session-1to2]discriminator remote 2
[LSW1-bfd-session-1to2]min-tx-interval 100
[LSW1-bfd-session-1to2]min-rx-interval 100
[LSW1-bfd-session-1to2]commit
[LSW2]bfd
[LSW2]bfd 2to1 bind peer-ip 10.1.1.1 interface Vlanif 10
[LSW2-bfd-session-2to1]discriminator local 2
[LSW2-bfd-session-2to1]discriminator remote 1
[LSW2-bfd-session-2to1]min-rx-interval 100
[LSW2-bfd-session-2to1]min-tx-interval 100
[LSW2-bfd-session-2to1]commit


6. 配置VRRP与BFD联动功能
[LSW1]int Vlanif 10
[LSW1-Vlanif10]vrrp vrid 2 track bfd-session 1 increased 40
[LSW2]int Vlanif 10
[LSW2-Vlanif10]vrrp vrid 1 track bfd-session 2 increased 40
7. 验证配置


[LSW1-GigabitEthernet0/0/3]shutdown


边栏推荐
猜你喜欢

小马智行起诉擎天智卡:索赔6000万 彭军称要斗争到底

百利药业IPO过会:扣非后年亏1.5亿 奥博资本是股东

tRNA修饰2-甲基胞嘧啶(m2C)|tRNA修饰m2G (N2-methylguanosine)

微导纳米IPO过会:年营收4.28亿 君联与高瓴是股东

ARMuseum

【飞控开发高级教程4】疯壳·开源编队无人机-360 度翻滚

RNA核糖核酸修饰荧光染料|HiLyte Fluor 488/555/594/647/680/750标记RNA核糖核酸

那些年我写过的语言

149. The largest number on a straight line, and check the set

Alexa染料标记RNA核糖核酸|RNA-Alexa 514|RNA-Alexa 488|RNA-Alexa 430
随机推荐
leetcode 448. Find All Numbers Disappeared in an Array 找到所有数组中消失的数字(简单)
极验深知v2分析
622 设计循环队列——Leetcode天天刷【循环队列,数组模拟,双指针】(2022.8.2)
小马智行起诉擎天智卡:索赔6000万 彭军称要斗争到底
matplotlib画polygon, circle
CSDN帐号管理规范
力扣203-移除链表元素——链表
Anaconda virtual environment migration
Edge box + time series database, technology selection behind Midea's digital platform iBuilding
Lecture topics and guest blockbuster, TDengine developers conference to promote data technology "broken"
Detailed steps for tensorflow-gpu2.4.1 installation and configuration
友宏医疗与Actxa签署Pre-M Diabetes TM 战略合作协议
Leetcode 125. Verify palindrome string
Likou 59 - Spiral Matrix II - Boundary Judgment
涨薪5K必学高并发核心编程,限流原理与实战,分布式计数器限流
自定义form表单验证
Detailed demonstration pytorch framework implementations old photo repair (GPU)
消除对特权账户的依赖使用Kaniko构建镜像
Use ControlTemplate or Style from resource file in WPF .cs and find the control
Advantages and Disadvantages of Blind and Buried Via PCB Stacked Via Design