05-H3C S12500 BFD典型配置举例
本章节下载: 05-H3C S12500 BFD典型配置举例 (385.33 KB)
H3C S12500 BFD配置举例
Copyright © 2013 杭州华三通信技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
本文档介绍了BFD联动的配置举例。
BFD(Bidirectional Forwarding Detection,双向转发检测)提供了一个通用的、标准化的、介质无关、协议无关的故障检测机制,用于快速检测、监控网络中链路或者IP路由转发的连通状况。但它本身并没有发现机制,而是靠被服务的上层协议通知其与谁建立会话,进而统一地快速检测两台路由器间双向转发路径的故障。
BFD会话的工作方式有以下两种:
· echo报文方式:本端发送echo报文建立BFD会话,对链路进行检测。对端不建立BFD会话,只需把收到的echo报文转发回本端。
· 控制报文方式:链路两端通过周期性发送控制报文建立BFD会话,对链路进行检测。
BFD可以为多种上层协议(如表1所示)快速检测两台设备间双向转发路径的故障。
表1 BFD支持的应用
BFD支持的应用 |
支持的BFD工作方式 |
BFD可以检测的IP跳数 |
VRRP |
echo报文方式 |
单跳 |
OSPF |
控制报文方式 |
单跳 |
IS-IS |
控制报文方式 |
单跳 |
RIP |
echo或控制报文方式 |
单跳或多跳 |
BGP |
控制报文方式 |
单跳或多跳 |
静态路由 |
echo或控制报文方式 |
单跳 |
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文假设您已了解BFD特性。
IP隧道(如IPv6 over IPv4隧道)不支持BFD 检测。
某公司网络布局如图1所示:
· 不同部门被划分至不同的区域,区域内的设备通过L2交换机上行接入核心交换机(Switch A和Switch B);
· 两台核心交换机之间创建VRRP备份组,其中Switch A为Master,Switch B为Backup。
要求使用VRRP与BFD联动实现Master故障的快速检测和流量切换:
· 在Backup上配置BFD检测监视Master的状态。
· 当BFD检测到Master故障时,迅速通知VRRP模块完成流量切换。
图1 VRRP与BFD联动(Backup监视Master)配置组网图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
# 配置VLAN接口IP地址。
<SwitchA> system-view
[SwitchA] vlan 2
[SwitchA–vlan2] port GigabitEthernet 3/0/1
[SwitchA–vlan2] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 2
[SwitchA–Vlan-interface2] undo shutdown
[SwitchA–Vlan-interface2] ip address 192.168.0.101 24
# 创建VRRP备份组,并配置备份组的虚拟IP地址。
[SwitchA–Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 为使Switch A成为Master,配置Switch A在备份组中的优先级为110,高于Switch B(Switch B的优先级采用缺省值100)。
[SwitchA–Vlan-interface2] vrrp vrid 1 priority 110
[SwitchA–Vlan-interface2] return
# 配置VLAN接口IP地址。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB–vlan2] port GigabitEthernet 3/0/1
[SwitchB–vlan2] quit
[SwitchB] interface GigabitEthernet 3/0/1
[SwitchB-GigabitEthernet3/0/1] undo shutdown
[SwitchB-GigabitEthernet3/0/1] quit
[SwitchB] interface vlan-interface 2
[SwitchB–Vlan-interface2] undo shutdown
[SwitchB–Vlan-interface2] ip address 192.168.0.102 24
# 创建VRRP备份组,并配置备份组的虚拟IP地址。
[SwitchB–Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
[SwitchB–Vlan-interface2] quit
# 配置BFD echo报文方式的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。请不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
[SwitchB] bfd echo-source-ip 10.10.10.10
# 配置接口接收BFD echo报文的最小时间间隔。
[SwitchB] interface vlan-interface 2
[SwitchB–Vlan-interface2] bfd min-echo-receive-interval 10
# 配置单跳BFD检测时间倍数。
[SwitchB–Vlan-interface2] bfd detect-multiplier 3
[SwitchB–Vlan-interface2] quit
# 配置Track对象。
[SwitchB] track 1 bfd echo interface vlan-interface 2 remote ip 192.168.0.101 local ip 192.168.0.102
# 配置VRRP监视Track项1,当Track项的状态为Negative时,Backup路由器立即切换成为Master。
[SwitchB] interface vlan-interface 2
[SwitchB–Vlan-interface2] vrrp vrid 1 track 1 switchover
[SwitchB–Vlan-interface2] return
# 显示Switch A上备份组1的详细信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.101
# 显示Switch B上备份组1的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Become Master : 3100ms left
Auth Type : None
Virtual IP : 192.168.0.10
Master IP : 192.168.0.101
VRRP Track Information:
Track Object : 1 State : Positive Switchover
# Switch B上BFD的会话状态。
<SwitchB> display bfd session
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Echo mode:
LD SourceAddr DestAddr State Holdtime Interface
1 192.168.0.102 192.168.0.101 Up 30ms Vlan2
以上显示信息表示在备份组1中Switch A为Master路由器,Switch B为Backup路由器。
# 当Switch A状态为down时,通过display vrrp命令查看备份组的信息,显示当前Switch B的状态为Master。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 192.168.1.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.1.102
VRRP Track Information:
Track Object : 1 State : Negative Switchover
# 显示BFD会话状态。
<SwitchB> display bfd session
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Echo mode:
LD SourceAddr DestAddr State Holdtime Interface
1 192.168.0.102 192.168.0.101 Down / Vlan2
# 显示Switch B上Track项的详细信息,当前Track项状态为Negative。
<SwitchB> display track 1
Track ID: 1
Status: Negative
Duration: 0 days 0 hours 1 minutes 17 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
BFD session:
Packet type: Echo
Interface : Vlan-interface2
Remote IP : 192.168.1.101
Local IP : 192.168.1.102
· Switch A:
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.101 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 priority 110
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
· Switch B:
#
bfd echo-source-ip 10.10.10.10
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.102 255.255.255.0
bfd min-echo-receive-interval 10
bfd detect-multiplier 3
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 track 1 switchover
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
track 1 bfd echo interface Vlan-interface2 remote ip 192.168.0.101 local ip 192.168.0.102
#
某公司网络布局如图2所示:
· 不同部门被划分至不同的区域,区域内的设备通过L2交换机上行接入核心交换机(Switch A和Switch B);
· 两台核心交换机之间创建VRRP备份组,其中Switch A为Master,Switch B为Backup。
当Master上行设备或Master上行链路出现故障时,VRRP无法感知,区域内的用户访问Internet的流量还是会转发给Master(Switch A),导致用户无法访问Internet。
要求使用VRRP与BFD联动解决上述问题:
· 在Master上配置BFD检测监视Master上行链路的状态;
· 当BFD检测到Master上行链路故障时,迅速通知VRRP模块完成流量切换。
图2 VRRP与BFD联动(Master监视上行链路)配置组网图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
# 配置上行VLAN接口和IP地址。
<SwitchA> system-view
[SwitchA] vlan 3
[SwitchA–vlan3] port GigabitEthernet 3/0/1
[SwitchA–vlan3] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 3
[SwitchA–Vlan-interface3] undo shutdown
[SwitchA–Vlan-interface3] ip address 1.1.1.1 24
[SwitchA–Vlan-interface3] quit
# 配置启用VRRP的VLAN接口和IP地址。
[SwitchA] vlan 2
[SwitchA–vlan2] port GigabitEthernet 3/0/2
[SwitchA–vlan2] quit
[SwitchA] interface GigabitEthernet 3/0/2
[SwitchA-GigabitEthernet3/0/2] undo shutdown
[SwitchA-GigabitEthernet3/0/2] quit
[SwitchA] interface vlan-interface 2
[SwitchA–Vlan-interface2] undo shutdown
[SwitchA–Vlan-interface2] ip address 192.168.0.101 24
# 创建VRRP备份组,并配置备份组的虚拟IP地址。
[SwitchA–Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
# 为使Switch A成为Master,配置Switch A在备份组中的优先级为110,高于Switch B(Switch B的优先级采用缺省值100)。
[SwitchA–Vlan-interface2] vrrp vrid 1 priority 110
[SwitchA–Vlan-interface2] quit
# 配置BFD echo报文源IP地址。IP地址可以任意指定,不需要与实际接口地址对应,建议不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
[SwitchA] bfd echo-source-ip 10.10.10.10
# 配置接口接收BFD echo报文的最小时间间隔。
[SwitchA] interface vlan-interface 3
[SwitchA–Vlan-interface3] bfd min-echo-receive-interval 10
# 配置BFD的检测时间倍数。
[SwitchA–Vlan-interface3] bfd detect-multiplier 3
[SwitchA–Vlan-interface3] quit
# 创建和BFD会话关联的Track项,并指定BFD探测的本地和远端IP地址。
[SwitchA] track 1 bfd echo interface vlan-interface 3 remote ip 1.1.1.2 local ip 1.1.1.1
# 配置VRRP监视Track项1,当Track项的状态为Negative时,Switch A在VRRP备份组中的优先级自动降低20,从而低于Switch B的优先级。Switch B竞选成为新的Master,完成流量的切换。
[SwitchA] interface vlan-interface 2
[SwitchA–Vlan-interface2] vrrp vrid 1 track 1 reduced 20
[SwitchA–Vlan-interface2] return
# 配置启用VRRP的VLAN接口和IP地址。
<SwitchB> system-view
[SwitchB] vlan 2
[SwitchB–vlan2] port GigabitEthernet 3/0/1
[SwitchB–vlan2] quit
[SwitchB] interface GigabitEthernet 3/0/1
[SwitchB-GigabitEthernet3/0/1] undo shutdown
[SwitchB-GigabitEthernet3/0/1] quit
[SwitchB] interface vlan-interface 2
[SwitchB–Vlan-interface2] undo shutdown
[SwitchB–Vlan-interface2] ip address 192.168.0.102 24
# 创建VRRP备份组,并配置备份组的虚拟IP地址。
[SwitchB–Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.10
[SwitchB–Vlan-interface2] return
# 显示Switch A上备份组1的详细信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.101
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 20
# 显示Switch B上备份组1的详细信息。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Become Master : 3100ms left
Auth Type : None
Virtual IP : 192.168.0.10
Master IP : 192.168.0.101
# 显示Switch A上BFD的会话状态。
<SwitchA> display bfd session
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Echo mode:
LD SourceAddr DestAddr State Holdtime Interface
1 1.1.1.1 1.1.1.2 Up 30ms Vlan3
以上显示信息表示在备份组1中Switch A为Master路由器,Switch B为Backup路由器。
# 当Switch A监视的上行链路状态为down时,通过display vrrp命令查看备份组的信息。
<SwitchA> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 90
Preempt Mode : Yes Delay Time : 0
Become Master : 3100ms left
Auth Type : None
Virtual IP : 192.168.0.10
Master IP : 192.168.0.102
VRRP Track Information:
Track Object : 1 State : Negative Pri Reduced : 20
# Switch A监视的上行链路状态为down时,显示Switch B上备份组1的详细信息,显示当前Switch B为Master路由器。
<SwitchB> display vrrp verbose
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 192.168.0.10
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.102
# 显示Switch A上BFD的会话状态。
<SwitchA> display bfd session
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Echo mode:
LD SourceAddr DestAddr State Holdtime Interface
1 1.1.1.1 1.1.1.2 Down / Vlan2
# 显示Switch A上Track对象的详细信息。
<SwitchA> display track 1
Track ID: 1
Status: Negative
Duration: 0 days 0 hours 3 minutes 33 seconds
Notification delay: Positive 0, Negative 0 (in seconds)
Reference object:
BFD session:
Packet type: Echo
Interface : Vlan-interface3
Remote IP : 1.1.12
Local IP : 1.1.1.1
· Switch A:
#
bfd echo-source-ip 10.10.10.10
#
vlan 2
#
vlan 3
#
interface Vlan-interface2
ip address 192.168.0.101 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
vrrp vrid 1 priority 110
vrrp vrid 1 track 1 reduced 20
#
interface Vlan-interface3
ip address 1.1.1.1 255.255.255.0
bfd min-echo-receive-interval 10
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 3
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 2
#
track 1 bfd echo interface Vlan-interface3 remote ip 1.1.1.2 local ip 1.1.1.1
#
· Switch B:
#
vlan 2
#
vlan 3
#
interface Vlan-interface2
ip address 192.168.0.102 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.10
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
如图3所示,某公司由于两个部门相隔较远而无法直连,只能在两个站点的出口交换机(Switch A和Switch B)之间增加一台二层交换机作为中继。Switch A和Switch B上运行OSPF,建立OSPF邻居关系。
公司希望使用OSPF与BFD联动技术实现当Switch B与二层交换机之间的链路出现故障时,BFD能够快速感知并通告OSPF协议。
图3 OSPF与BFD联动组网需求图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
对于控制报文方式的BFD会话,会话双方至少有一方为主动模式。
# 配置VLAN接口及IP地址。
<SwitchA> system-view
[SwitchA] vlan 10
[SwitchA-vlan10] port GigabitEthernet 3/0/1
[SwitchA-vlan10] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] undo shutdown
[SwitchA-Vlan-interface10] ip address 10.1.0.102 24
[SwitchA-Vlan-interface10] quit
# 配置OSPF基本功能,使能OSPF的BFD功能。
[SwitchA] ospf
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] ospf bfd enable
[SwitchA-Vlan-interface10] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchA] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchA-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface10] bfd detect-multiplier 3
[SwitchA-Vlan-interface10] quit
[SwitchA] quit
# 配置VLAN接口及IP地址。
<SwitchB> system-view
[SwitchB] vlan 10
[SwitchB-vlan10] port GigabitEthernet 3/0/2
[SwitchB-vlan10] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] undo shutdown
[SwitchB-Vlan-interface10] ip address 10.1.0.100 24
[SwitchB-Vlan-interface10] quit
# 配置OSPF基本功能,使能OSPF的BFD功能。
[SwitchB] ospf
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] ospf bfd enable
[SwitchB-Vlan-interface10] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchB] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchB] interface vlan 10
[SwitchB-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchB-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchB-Vlan-interface10] bfd detect-multiplier 3
[SwitchB-Vlan-interface10] quit
[SwitchB] quit
# Switch A和Switch B已建立OSPF邻居关系。
[SwitchA]display ospf peer verbose
OSPF Process 1 with Router ID 2.2.2.2
Neighbors
Area 0.0.0.0 interface 10.1.0.102(Vlan-interface10)'s neighbors
Router ID: 1.1.1.1 Address: 10.1.0.100 GR State: Normal
State: Full Mode: Nbr is Slave Priority: 1
DR: 10.1.0.102 BDR: 10.1.0.100 MTU: 0
Dead timer due in 32 sec
Neighbor is up for 00:21:37
Authentication Sequence: [ 0 ]
Neighbor state change count: 5
Last Neighbor Down Event:
Router ID: 1.1.1.1
Local Address: 10.1.0.102
Remote Address: 10.1.0.100
Time: Jan 7 10:04:26 2009
Reason: DeadInterval timer expired
# BFD会话已被创建,且状态为UP。
[SwitchA] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 10 Remote Discr: 1
Source IP: 10.1.0.102 Destination IP: 10.1.0.100
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 00:24:03 Auth mode: None
Connect Type: Direct Board Num: 0
Protocol: OSPF
Diag Info: No Diagnostic
[SwitchB] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 1 Remote Discr: 10
Source IP: 10.1.0.100 Destination IP: 10.1.0.102
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 00:27:56 Auth mode: None
Connect Type: Direct Board Num: 1
Protocol: OSPF
Diag Info: No Diagnostic
# 当Switch B和二层交换机之间的链路发生故障,BFD快速检测到链路发生变化立刻通告OSPF。
%Apr 2 11:34:26:880 2013 SwitchA BFD/5/BFD_CHANGE_FSM: Sess[10.1.0.102/10.1.0.100,1026/1026
,Vlan10,Ctrl], Sta: UP->DOWN, Diag: 5
%Apr 2 11:34:27:011 2013 SwitchA OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.1.0.100Vlan-interface10) from Full to Down.
# 使用display ospf peer verbose命令观察到OSPF邻居关系转变为Down状态。
[SwitchA] display ospf peer verbose
OSPF Process 1 with Router ID 2.2.2.2
Last Neighbor Down Event:
Router ID: 1.1.1.1
Local Address: 10.1.0.102
Remote Address: 10.1.0.100
Time: Apr 2 11:34:47 2013
Reason: BFD session down
· Switch A:
#
Vlan 10
#
interface Vlan-interface10
ip address 10.1.0.102 255.255.255.0
ospf bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 10
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.0.255
#
· Switch B:
#
Vlan 10
#
interface Vlan-interface10
ip address 10.1.0.100 255.255.255.0
ospf bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 10
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.0.255
#
如图4所示,某公司由于两个部门相隔较远而无法直连,只能在两个站点的出口交换机(Switch A和Switch B)之间增加一台二层交换机作为中继。Switch A和Switch B上运行IS-IS,建立IS-IS邻居关系。
公司希望使用IS-IS与BFD联动技术,实现当Switch A或Switch B与二层交换机之间的链路出现故障时,BFD能够快速感知并通告IS-IS协议。
图4 IS-IS与BFD联动组网需求图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
对于控制报文方式的BFD会话,会话双方至少有一方为主动模式。
# 配置VLAN接口及IP地址。
<SwitchA> system-view
[SwitchA] vlan 10
[SwitchA-vlan10] port GigabitEthernet 3/0/1
[SwitchA-vlan10] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] undo shutdown
[SwitchA-Vlan-interface10] ip address 167.1.1.1 24
[SwitchA-Vlan-interface10] quit
# 配置IS-IS基本功能,使能IS-IS的BFD功能。
[SwitchA] isis
[SwitchA-isis-1] network-entity 00.0000.0000.0000.0001.00
[SwitchA-isis-1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] isis enable
[SwitchA-Vlan-interface10] isis bfd enable
[SwitchA-Vlan-interface10] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchA] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchA-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface10] bfd detect-multiplier 3
[SwitchA-Vlan-interface10] quit
[SwitchA] quit
# 配置VLAN接口及IP地址。
<SwitchB> system-view
[SwitchB] vlan 10
[SwitchB-vlan10] port GigabitEthernet 3/0/2
[SwitchB-vlan10] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] undo shutdown
[SwitchB-Vlan-interface10] ip address 167.1.1.2 24
[SwitchB-Vlan-interface10] quit
# 配置IS-IS基本功能,使能IS-IS的BFD功能。
[SwitchB] isis
[SwitchB-isis-1] network-entity 00.0000.0000.0000.0002.00
[SwitchB-isis-1] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] isis enable
[SwitchB-Vlan-interface10] isis bfd enable
[SwitchB-Vlan-interface10] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchB] bfd session init-mode active
[SwitchB] interface vlan-interface 10
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchB-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchB-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchB-Vlan-interface10] bfd detect-multiplier 3
[SwitchB-Vlan-interface10] quit
[SwitchB] quit
# Switch A和Switch B已建立IS-IS邻居关系。
[SwitchA] display isis peer verbose
Peer information for ISIS(1)
----------------------------
System Id: 0000.0000.0002
Interface: Vlan10 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 29s Type: L1(L1L2) PRI: 64
Area Address(es):00.0000
Peer IP Address(es): 167.1.1.2
Uptime: 00:21:20
Adj Protocol: IPv4
System Id: 0000.0000.0002
Interface: Vlan10 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 30s Type: L2(L1L2) PRI: 64
Area Address(es):00.0000
Peer IP Address(es): 167.1.1.2
Uptime: 00:21:16
Adj Protocol: IPv4
# BFD会话已被创建,且状态为UP:
[SwitchA] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 11 Remote Discr: 2
Source IP: 167.1.1.1 Destination IP: 167.1.1.2
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 00:22:14 Auth mode: None
Connect Type: Direct Board Num: 0
Protocol: ISIS_BR_L1/ISIS_BR_L2
Diag Info: No Diagnostic
[SwitchB] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 2 Remote Discr: 11
Source IP: 167.1.1.2 Destination IP: 167.1.1.1
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 00:23:52 Auth mode: None
Connect Type: Direct Board Num: 1
Protocol: ISIS_BR_L1/ISIS_BR_L2
Diag Info: No Diagnostic
# 当Switch B和二层交换机之间的链路发生故障,BFD快速检测到链路发生变化立刻通告IS-IS。
%Apr 2 13:43:37:133 2013 SwitchA BFD/5/BFD_CHANGE_FSM: Sess[167.1.1.1/167.1.1.2,1025/1025
,Vlan10,Ctrl], Sta: UP->DOWN, Diag: 5
%Apr 2 13:43:37:265 2013 SwitchA ISIS/5/ISIS_NBR_CHG: ISIS 1 Adjacency to 0000.0000.0
002 (Vlan10) DOWN, Level-1 Adjacency clear.
%Apr 2 13:43:37:396 2013 SwitchA ISIS/5/ISIS_NBR_CHG: ISIS 1 Adjacency to 0000.0000.0
002 (Vlan10) DOWN, Level-2 Adjacency clear.
· Switch A:
#
vlan 10
#
isis 1
network-entity 00.0000.0000.0000.0001.00
#
interface Vlan-interface10
ip address 167.1.1.1 255.255.255.0
isis enable 1
isis bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 10
#
· Switch B:
#
vlan 10
#
isis 1
network-entity 00.0000.0000.0000.0002.00
#
interface Vlan-interface10
ip address 167.1.1.2 255.255.255.0
isis enable 1
isis bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 10
#
如图5所示,某公司由于两个部门相隔较远而无法直连,只能在两个站点的出口交换机(Switch A和Switch B)之间增加一台二层交换机作为中继。Switch A和Switch B上运行RIP,建立RIP邻居关系。
公司希望使用RIP与BFD联动技术,实现当Switch B与二层交换机之间的链路出现故障时,BFD能够快速感知并通告RIP协议。
图5 RIP与BFD联动(echo方式单跳检测)组网需求图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
# 配置VLAN接口及IP地址。
<SwitchA> system-view
[SwitchA] vlan 100
[SwitchA-vlan100] port GigabitEthernet 3/0/1
[SwitchA-vlan100] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] undo shutdown
[SwitchA-Vlan-interface100] ip address 198.168.1.1 24
[SwitchA-Vlan-interface100] quit
# 配置RIP基本功能,使能RIP的BFD功能。
[SwitchA] rip 1
[SwitchA-rip-1] network 198.168.1.0
[SwitchA-rip-1] import-route direct
[SwitchA-rip-1] quit
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] rip bfd enable
[SwitchA-Vlan-interface100] quit
# 配置BFD echo报文的源IP地址。由于Switch A和Switch B为直连下一跳,建立echo报文方式的BFD会话即可。
[SwitchA] bfd echo-source-ip 11.11.11.11
# 配置接口接收BFD echo报文的最小时间间隔。
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] bfd min-echo-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface100] bfd detect-multiplier 3
[SwitchA-Vlan-interface100] quit
[SwitchA] quit
# 配置VLAN接口及IP地址。
<SwitchB> system-view
[SwitchB] vlan 100
[SwitchB-vlan100] port GigabitEthernet 3/0/2
[SwitchB-vlan100] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
[SwitchB] interface vlan-interface 100
[SwitchB-Vlan-interface100] undo shutdown
[SwitchB-Vlan-interface100] ip address 198.168.1.2 24
[SwitchB-Vlan-interface100] quit
# 配置RIP基本功能,引入直连路由,使Switch B所有直连路由都发送至Switch A。
[SwitchB] rip 1
[SwitchB-rip-1] network 198.168.1.0
[SwitchB-rip-1] import-route direct
[SwitchB-rip-1] quit
# SwitchA 学到了由SwitchB发布的直连路由。
[SwitchA] display ip routing-table protocol rip
Public Routing Table : RIP
Summary Count : 4
RIP Routing table Status : < Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
53.0.0.0/24 RIP 100 1 198.168.1.2 Vlan100
RIP Routing table Status : < Inactive>
Summary Count : 3
Destination/Mask Proto Pre Cost NextHop Interface
20.0.0.0/24 RIP 100 1 198.168.1.2 Vlan100
30.0.0.0/24 RIP 100 1 198.168.1.2 Vlan100
100.0.0.0/16 RIP 100 1 198.168.1.2 Vlan100
# BFD会话已被创建,且状态为UP。
[SwitchA] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 1391
Source IP: 198.168.1.1 Destination IP: 198.168.1.2
Session State: Up Interface: Vlan-interface100
Min Recv Inter: 100ms Act Trans Inter: 100ms
Act Detect Inter: 300ms Running Up for: 00:51:31
Connect Type: Direct Board Num: 1
Protocol: RIP
Diag Info: No Diagnostic
# 当Switch B和二层交换机之间的链路发生故障,BFD快速检测到链路发生变化立刻通告RIP。
%Apr 2 13:52:02:638 2013 SwitchA BFD/5/BFD_CHANGE_FSM: Sess[192.168.1.1/192.168.1.2,1027/0,Vlan100,Echo], Sta: UP->DOWN, Diag: 5
# 通过RIP学到的路由被删除。
[SwitchA] display ip routing-table protocol rip
Public Routing Table : RIP
Summary Count : 0
RIP Routing table Status : < Active>
Summary Count : 0
RIP Routing table Status : < Inactive>
Summary Count : 0
· Switch A:
#
bfd echo-source-ip 11.11.11.11
#
vlan 100
#
interface Vlan-interface100
ip address 198.168.1.1 255.255.255.0
rip bfd enable
bfd min-echo-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 100
#
rip 1
network 198.168.1.0
import-route direct
#
· Switch B:
#
vlan 100
#
interface Vlan-interface100
ip address 198.168.1.2 255.255.255.0
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 100
#
rip 1
network 198.168.1.0
import-route direct
#
如图6所示,某公司由于两个部门的出口交换机分别为Switch A和Switch C,Switch A和Switch C通过核心交换机Switch B连接到Internet。Switch A和Switch C通过静态路由连接,并建立RIP邻居关系。
公司希望通过RIP与BFD联动双向检测技术实现Switch A与Switch B之间或当Switch B与Switch C之间的链路出现故障时,BFD能够快速感知并通告RIP协议。
图6 RIP与BFD联动(控制方式双向检测)特性典型配置组网需求图
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
对于控制报文方式的BFD会话,会话双方至少有一方为主动模式。
# 配置VLAN接口及IP地址。
<SwitchA> system-view
[SwitchA] vlan 100
[SwitchA-vlan100] port GigabitEthernet 3/0/1
[SwitchA-vlan100] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] undo shutdown
[SwitchA-Vlan-interface100] ip address 198.168.1.1 24
[SwitchA-Vlan-interface100] quit
# 配置RIP基本功能,使能RIP的BFD功能。由于Switch A和Switch C之间为非直连设备,需使用控制报文方式的BFD会话。
[SwitchA] rip 1
[SwitchA-rip-1] network 198.168.1.0
[SwitchA-rip-1] peer 198.168.2.2
[SwitchA-rip-1] undo validate-source-address
[SwitchA-rip-1] import-route direct
[SwitchA-rip-1] quit
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] rip bfd enable
[SwitchA-Vlan-interface100] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchA] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchA] interface vlan-interface 100
[SwitchA-Vlan-interface100] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchA-Vlan-interface100] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface100] bfd detect-multiplier 3
[SwitchA-Vlan-interface100] quit
# 配置目的为Switch C接口IP的静态路由。
[SwitchA] ip route-static 198.168.2.0 24 vlan-interface 100 198.168.1.2
# 配置VLAN接口及IP地址。
<SwitchB> system-view
[SwitchB] vlan 100
[SwitchB-vlan100] port GigabitEthernet 3/0/2
[SwitchB-vlan100] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
[SwitchB] interface vlan-interface 100
[SwitchB-Vlan-interface100] undo shutdown
[SwitchB-Vlan-interface100] ip address 198.168.1.2 24
[SwitchB] vlan 200
[SwitchB-vlan200] port GigabitEthernet 3/0/1
[SwitchB-vlan200] quit
[SwitchB] interface GigabitEthernet 3/0/1
[SwitchB-GigabitEthernet3/0/1] undo shutdown
[SwitchB-GigabitEthernet3/0/1] quit
[SwitchB] interface vlan-interface 200
[SwitchB-Vlan-interface200] undo shutdown
[SwitchB-Vlan-interface200] ip address 198.168.2.1 24
[SwitchB-Vlan-interface200] quit
# 配置VLAN接口及IP地址。
<SwitchC> system-view
[SwitchC] vlan 200
[SwitchC-vlan200] port GigabitEthernet 3/0/1
[SwitchC-vlan200] quit
[SwitchC] interface GigabitEthernet 3/0/1
[SwitchC-GigabitEthernet3/0/1] undo shutdown
[SwitchC-GigabitEthernet3/0/1] quit
[SwitchC] interface vlan-interface 200
[SwitchC-Vlan-interface200] undo shutdown
[SwitchC-Vlan-interface200] ip address 198.168.2.2 24
[SwitchC-Vlan-interface200] quit
# 配置RIP基本功能,使能RIP的BFD功能。由于Switch A和Switch C之间为非直连设备,需使用控制报文方式的BFD会话。
[SwitchC] rip 1
[SwitchC-rip-1] network 198.168.2.0
[SwitchC-rip-1] peer 198.168.1.1
[SwitchC-rip-1] undo validate-source-address
[SwitchC-rip-1] import-route direct
[SwitchC-rip-1] quit
[SwitchC] interface vlan-interface 200
[SwitchC-Vlan-interface200] rip bfd enable
[SwitchC-Vlan-interface200] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchC] bfd session init-mode active
[SwitchC] interface vlan 200
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchC-Vlan-interface200] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchC-Vlan-interface200] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchC-Vlan-interface200] bfd detect-multiplier 3
[SwitchC-Vlan-interface200] quit
# 配置目的为SwitchA接口IP的静态路由。
[SwitchC] ip route-static 198.168.1.0 24 vlan-interface 200 198.168.2.1
# 链路正常时BFD会话状态。
[SwitchA] display bfd session
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
LD/RD SourceAddr DestAddr State Holdtime Interface
1393/693 198.168.1.1 198.168.2.2 Up 200ms Vlan100
# RIP学到的路由。
[SwitchA] display rip 1 route
Route Flags: R - RIP, T - TRIP
P - Permanent, A - Aging, S - Suppressed, G - Garbage-collect
----------------------------------------------------------------------------
Peer 198.168.2.2 on Vlan-interface100
Destination/Mask Nexthop Cost Tag Flags Sec
3.0.0.0/8 198.168.2.2 1 0 RA 14
65.0.0.0/8 198.168.2.2 1 0 RA 14
198.168.1.0/24 198.168.2.2 1 0 RA 14
# 链路故障后BFD会话down,紧接着路由被删除,BFD会话也被删除。
[SwitchA] display bfd session
[SwitchA] display rip 1 route
Route Flags: R - RIP, T - TRIP
P - Permanent, A - Aging, S - Suppressed, G - Garbage-collect
----------------------------------------------------------------------------
· Switch A:
#
vlan 100
#
bfd session init-mode active
#
interface Vlan-interface100
ip address 198.168.1.1 255.255.255.0
rip bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 100
#
rip 1
peer 198.168.2.2
network 198.168.1.0
undo validate-source-address
import-route direct
#
ip route-static 198.168.2.0 255.255.255.0 Vlan-interface100 198.168.1.2
#
· Switch B:
#
vlan 100
#
vlan 200
#
interface Vlan-interface100
ip address 198.168.1.2 255.255.255.0
#
interface Vlan-interface200
ip address 198.168.2.1 255.255.255.0
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 100
#
· Switch C:
#
bfd session init-mode active
#
vlan 200
#
interface Vlan-interface200
ip address 198.168.2.2 255.255.255.0
rip bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 200
#
rip 1
peer 198.168.1.1
network 198.168.2.0
undo validate-source-address
import-route direct
#
ip route-static 198.168.1.0 255.255.255.0 Vlan-interface200 198.168.2.1
#
如图7所示,某公司由于两个部门相隔较远而无法直连,只能在两个站点的出口交换机(Switch A和Switch B)之间增加一台二层交换机作为中继。Switch A和Switch B之间建立IBGP邻居关系。
公司希望通过BGP与BFD联动实现当Switch B与二层交换机之间的链路出现故障时,BFD能够快速感知并通告BGP协议。
图7 BGP与BFD联动组网需求图
为保证Switch B与二层交换机之间的链路出现故障时,BFD能够快速感知,需在Switch A和Switch B上创建控制报文方式的BFD会话(BGP只支持使用控制报文方式)监视Switch A与Switch B之间的链路。
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
对于控制报文方式的BFD会话,会话双方至少有一方为主动模式。
# 配置VLAN接口及IP地址。
<SwitchA> system-view
[SwitchA] vlan 10
[SwitchA-vlan10] port GigabitEthernet 3/0/1
[SwitchA-vlan10] quit
[SwitchA] interface GigabitEthernet 3/0/1
[SwitchA-GigabitEthernet3/0/1] undo shutdown
[SwitchA-GigabitEthernet3/0/1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] undo shutdown
[SwitchA-Vlan-interface10] ip address 10.1.0.102 24
[SwitchA-Vlan-interface10] quit
# 配置BGP基本功能,使能BFD与BGP联动。
[SwitchA] bgp 100
[SwitchA-bgp] peer 10.1.0.100 as-number 100
[SwitchA-bgp] peer 10.1.0.100 bfd
[SwitchA-bgp] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchA] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchA-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface10] bfd detect-multiplier 3
[SwitchA-Vlan-interface10] quit
[SwitchA] quit
# 配置VLAN接口及IP地址。
<SwitchB> system-view
[SwitchB] vlan 10
[SwitchB-vlan10] port GigabitEthernet 3/0/2
[SwitchB-vlan10] quit
[SwitchB] interface GigabitEthernet 3/0/2
[SwitchB-GigabitEthernet3/0/2] undo shutdown
[SwitchB-GigabitEthernet3/0/2] quit
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] undo shutdown
[SwitchB-Vlan-interface10] ip address 10.1.0.100 24
[SwitchB-Vlan-interface10] quit
# 配置BGP基本功能,使能BFD与BGP联动。
[SwitchB] bgp 100
[SwitchB-bgp] peer 10.1.0.102 as-number 100
[SwitchB-bgp] peer 10.1.0.102 bfd
[SwitchB-bgp] quit
# 配置BFD会话建立前的运行模式为主动模式。
[SwitchB] bfd session init-mode active
# 配置发送单跳BFD控制报文的最小时间间隔。
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] bfd min-transmit-interval 100
# 配置接收单跳BFD控制报文的最小时间间隔。
[SwitchB-Vlan-interface10] bfd min-receive-interval 100
# 配置单跳BFD检测时间倍数。
[SwitchB-Vlan-interface10] bfd detect-multiplier 3
[SwitchB-Vlan-interface10] quit
[SwitchB] quit
# 建立BGP对等体:
[SwitchA] display bgp peer verbose
Peer: 10.1.0.100 Local: 2.2.2.2
Type: IBGP link
BGP version 4, remote router ID 1.1.1.1
BGP current state: Established, Up for 01h51m18s
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
Port: Local - 1024 Remote - 179
Configured: Active Hold Time: 180 sec Keepalive Time: 60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec
Peer optional capabilities:
Peer support bgp multi-protocol extended
Peer support bgp route refresh capability
Peer support bgp route AS4 capability
Address family IPv4 Unicast: advertised and received
Received: Total 100 messages, Update messages 0
Sent: Total 111 messages, Update messages 0
Maximum allowed prefix number: 4294967295
Threshold: 75%
Minimum time between advertisement runs is 15 seconds
Optional capabilities:
Route refresh capability has been enabled
Peer Preferred Value: 0
BFD: Enabled
Routing policy configured:
No routing policy is configured
# BFD会话已被创建,且状态为UP。
[SwitchA] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 12 Remote Discr: 3
Source IP: 10.1.0.102 Destination IP: 10.1.0.100
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 01:51:58 Auth mode: None
Connect Type: Direct Board Num: 0
Protocol: BGP
Diag Info: No Diagnostic
[SwitchB] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 3 Remote Discr: 12
Source IP: 10.1.0.100 Destination IP: 10.1.0.102
Session State: Up Interface: Vlan-interface10
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Running Up for: 01:52:35 Auth mode: None
Connect Type: Direct Board Num: 1
Protocol: BGP
Diag Info: No Diagnostic
# 当Switch B和二层交换机之间的链路发生故障,BFD快速检测到链路发生变化立刻通告BGP。
%Apr 2 14:27:22:171 2013 SwitchA BFD/5/BFD_CHANGE_FSM: Sess[10.1.0.102/10.1.0.100,1025/1025,Vlan10,Ctrl], Sta: UP->DOWN, Diag: 5
%Apr 2 14:27:22:303 2013 SwitchA BGP/5/BGP_STATE_CHANGED:
10.1.0.100 state is changed from ESTABLISHED to IDLE.
· Switch A:
#
vlan 10
#
interface Vlan-interface10
ip address 10.1.0.102 255.255.255.0
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/1
port link-mode bridge
port access vlan 10
#
bgp 100
undo synchronization
peer 10.1.0.100 as-number 100
peer 10.1.0.100 bfd
#
· Switch B:
#
vlan 10
#
interface Vlan-interface10
ip address 10.1.0.100 255.255.255.0
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface GigabitEthernet3/0/2
port link-mode bridge
port access vlan 10
#
bgp 100
undo synchronization
peer 10.1.0.102 as-number 100
peer 10.1.0.102 bfd
#
某公司内部网络如图8所示,从Switch A到Switch C有两条转发路径,下一跳分别为Switch B和Switch D。Switch A和Switch C通过Switch B连入Internet,由于Switch A和Switch B之间物理距离较远,需要通过一个二层交换机作为中继。
已知Switch B不支持BFD,公司希望使用静态路由与BFD联动技术实现当Switch B与二层交换机之间的链路出现故障时,Switch A能快速感知,并将流量切换到其他链路。
图8 静态路由与BFD联动(单跳检测)组网需求图
由于需要两端设备均支持BFD,才能够使用控制报文方式,本例中Switch B不支持BFD,在Switch A上配置的BFD功能仅能使用echo报文方式。
本举例是在S12500-CMW520-R1825P01版本上进行配置和验证的。
# 配置VLAN接口和IP地址。
<SwitchA> system-view
[SwitchA] vlan 10
[SwitchA-vlan10] port GigabitEthernet 4/0/1
[SwitchA-vlan10] quit
[SwitchA] interface GigabitEthernet 4/0/1
[SwitchA-GigabitEthernet4/0/1] undo shutdown
[SwitchA-GigabitEthernet4/0/1] quit
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] undo shutdown
[SwitchA-Vlan-interface10] ip address 10.1.1.102 24
[SwitchA-Vlan-interface10] quit
[SwitchA] vlan 11
[SwitchA-vlan11] port GigabitEthernet 9/0/48
[SwitchA-vlan11] quit
[SwitchA] interface GigabitEthernet 9/0/48
[SwitchA-GigabitEthernet9/0/48] undo shutdown
[SwitchA-GigabitEthernet9/0/48] quit
[SwitchA] interface vlan-interface 11
[SwitchA-Vlan-interface11] undo shutdown
[SwitchA-Vlan-interface11] ip address 11.1.1.1 24
[SwitchA-Vlan-interface11] quit
# 配置2条静态路由,目的地址相同,但是优先级不同,优选高的静态路由(Switch A –> Switch B –> Switch C)上运行BFD检测。其中echo-source-ip需要手动指定任意值,不要与实际接口对应。
[SwitchA] bfd echo-source-ip 10.10.10.10
[SwitchA] ip route-static 120.1.1.1 32 Vlan-interface 10 10.1.1.100 bfd echo-packet preference 40
[SwitchA] ip route-static 120.1.1.1 32 Vlan-interface 11 11.1.1.2 preference 50
# 配置接口接收BFD echo报文的最小时间间隔。
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] bfd min-echo-receive-interval 10
# 配置单跳BFD检测时间倍数。
[SwitchA-Vlan-interface10] bfd detect-multiplier 3
# 查看静态路由,可看到preference值低的被优选。
[SwitchA] display ip routing-table protocol static verbose
Routing Table : Public
Summary Count : 2
Destination: 120.1.1.1/32
Protocol: Static Process ID: 0
Preference: 40 Cost: 0
NextHop: 10.1.1.100 Interface: Vlan-interface10
BkNextHop: 0.0.0.0 BkInterface:
RelyNextHop: 0.0.0.0 Neighbor : 0.0.0.0
Tunnel ID: 0x0 Label: NULL
BKTunnel ID: 0x0 BKLabel: NULL
State: Active Adv Bfd Age: 00h02m13s
Tag: 0
Destination: 120.1.1.1/32
Protocol: Static Process ID: 0
Preference: 50 Cost: 0
NextHop: 11.1.1.2 Interface: Vlan-interface11
BkNextHop: 0.0.0.0 BkInterface:
RelyNextHop: 0.0.0.0 Neighbor : 0.0.0.0
Tunnel ID: 0x0 Label: NULL
BKTunnel ID: 0x0 BKLabel: NULL
State: Inactive Adv Age: 00h00m32s
Tag: 0
#查看BFD会话信息,可以看到设备已经建立相应的会话且状态为UP:
[SwitchA] display bfd session verbose
Total session number: 1 Up session number: 1 Init mode: Active
IPv4 session working under Ctrl mode:
Local Discr: 13
Source IP: 10.1.1.102 Destination IP: 10.1.1.100
Session State: Up Interface: Vlan-interface10
Min Recv Inter: 10ms Act Trans Inter: 10ms
Act Detect Inter: 30ms Running Up for: 00:03:33
Connect Type: Direct Board Num: 0
Protocol: STATIC
Diag Info: No Diagnostic
# SwitchB和二层交换机间链路故障后,BFD会话down,另一条路由被激活:
%Jan 7 14:23:39:786 2009 125/6697 BFD/4/LOG:Sess[10.1.1.102/10.1.1.100,Vlan10,Echo], Sta: UP->DOWN, Diag: 5
*Jan 7 14:23:39:786 2009 125/6697 RM/3/RMDEBUG:Route with Dest : 120.1.1.1, Mask : 255.255.255.255, Nexthop : 10.1.1.100, Neighbor
: 0.0.0.0 made Inactive
*Jan 7 14:23:39:786 2009 125/6697 RM/3/RMDEBUG:
Calculate active route with 120.1.1.1/32 protocol:0 TableID:1
*Jan 7 14:23:39:787 2009 125/6697 RM/3/RMDEBUG:Route with Dest : 120.1.1.1, Mask : 255.255.255.255, Nexthop : 11.1.1.2, Neighbor :
0.0.0.0 made active
[SwitchA] display ip routing-table protocol static verbose
Routing Table : Public
Summary Count : 2
Destination: 120.1.1.1/32
Protocol: Static Process ID: 0
Preference: 40 Cost: 0
NextHop: 10.1.1.100 Interface: Vlan-interface10
BkNextHop: 0.0.0.0 BkInterface:
RelyNextHop: 0.0.0.0 Neighbor : 0.0.0.0
Tunnel ID: 0x0 Label: NULL
BKTunnel ID: 0x0 BKLabel: NULL
State: Invalid Adv Bfd Age: 00h10m58s
Tag: 0
Destination: 120.1.1.1/32
Protocol: Static Process ID: 0
Preference: 50 Cost: 0
NextHop: 11.1.1.2 Interface: Vlan-interface11
BkNextHop: 0.0.0.0 BkInterface:
RelyNextHop: 0.0.0.0 Neighbor : 0.0.0.0
Tunnel ID: 0x0 Label: NULL
BKTunnel ID: 0x0 BKLabel: NULL
State: Active Adv Age: 00h09m17s
Tag: 0
#
vlan 10
#
vlan 11
#
bfd echo-source-ip 10.10.10.10
#
interface Vlan-interface10
ip address 10.1.1.102 255.255.255.0
bfd min-echo-receive-interval 10
bfd detect-multiplier 3
#
interface Vlan-interface11
ip address 11.1.1.1 255.255.255.0
#
interface GigabitEthernet4/0/1
port link-mode bridge
port access vlan 10
#
interface GigabitEthernet9/0/48
port link-mode bridge
port access vlan 11
#
ip route-static 120.1.1.1 255.255.255.255 Vlan-interface10 10.1.1.100 bfd echo-packet preference 40
ip route-static 120.1.1.1 255.255.255.255 Vlan-interface11 11.1.1.2 preference 50
#
· 《H3C S12500系列路由交换机 可靠性配置指导》中的“BFD”
· 《H3C S12500系列路由交换机 可靠性命令参考》中的“BFD”
· 《H3C S12500系列路由交换机 可靠性配置指导》中的“VRRP”
· 《H3C S12500系列路由交换机 可靠性命令参考》中的“VRRP”
· 《H3C S12500系列路由交换机 三层技术-IP路由配置指导》中的“OSPF”
· 《H3C S12500系列路由交换机 三层技术-IP路由命令参考》中的“OSPF”
· 《H3C S12500系列路由交换机 三层技术-IP路由配置指导》中的“IS-IS”
· 《H3C S12500系列路由交换机 三层技术-IP路由命令参考》中的“IS-IS”
· 《H3C S12500系列路由交换机 三层技术-IP路由配置指导》中的“RIP”
· 《H3C S12500系列路由交换机 三层技术-IP路由命令参考》中的“RIP”
· 《H3C S12500系列路由交换机 三层技术-IP路由配置指导》中的“BGP”
· 《H3C S12500系列路由交换机 三层技术-IP路由命令参考》中的“BGP”
· 《H3C S12500系列路由交换机 三层技术-IP路由配置指导》中的“静态路由”
· 《H3C S12500系列路由交换机 三层技术-IP路由命令参考》中的“静态路由”
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!