配置BFD多跳检测示例

组网需求

如图1所示,通过BFD会话检测SwitchA、SwitchC之间的多跳路径。

Switch的接口为二层接口,配置BFD多跳检测时需将接口加入VLAN、创建接口VLANIF并配置在接口VLANIF上配置IP地址。

配置思路

采用如下思路配置BFD:

1. 在SwitchA上配置BFD会话,检测SwitchA到SwitchC的多跳路径。

2. 在SwitchC上配置BFD会话,检测SwitchC到SwitchA的多跳路径。

数据准备

为完成此配置例,需要准备如下数据:

· BFD会话绑定的对端IP地址

· BFD会话的本地标志符和远端标识符

· SwitchA上接口VLANIF10的IP地址为10.1.1.1/16

· SwitchB上接口VLANIF10的IP地址为10.1.1.2/16

· SwitchB上接口VLANIF20的IP地址为10.2.1.1/16

· SwitchC上接口VLANIF20的IP地址为10.2.1.2/16

BFD控制报文的最小发送间隔、最小接收间隔、本地检测倍数等都使用缺省值

操作步骤

将接口加入VLAN并创建接口VLANIF,在接口VLANIF上配置IP地址

# 在SwitchA上创建VLAN并将接口加入VLAN。

<Quidway> system-view

[Quidway] sysname SwitchA

[SwitchA] vlan batch 10

[SwitchA] interface gigabitethernet 0/0/1

[SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 10

[SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 10

[SwitchA-GigabitEthernet0/0/1] quit

# 在SwitchA上创建接口VLANIF并配置接口VLANIF的IP地址。

[SwitchA] interface vlanif 10

[SwitchA-Vlanif10] ip address 10.1.1.1 16

[SwitchA-Vlanif10] quit

在SwitchB和SwitchC上的配置方法与SwitchA相同,具体配置过程略。

配置静态路由,使SwitchA、SwitchC之间有可达路由

[SwitchA] ip route-static 10.2.0.0 16 10.1.1.2

在SwitchC上的配置方法与SwitchA相同,具体配置过程略。

在SwitchA和SwitchC上配置多跳BFD检测

# 在SwitchA上配置与SwitchC之间的BFD会话。

[SwitchA] bfd

[SwitchA-bfd] quit

[SwitchA] bfd atoc bind peer-ip 10.2.1.2

[SwitchA-bfd-session-atoc] discriminator local 10

[SwitchA-bfd-session-atoc] discriminator remote 20

[SwitchA-bfd-session-atoc] commit

[SwitchA-bfd-session-atoc] quit

# 在SwitchC上配置与SwitchA之间的BFD会话。

<Quidway> system-view

[Quidway] sysname SwitchC

[SwitchC] bfd

[SwitchC-bfd] quit

[SwitchC] bfd ctoa bind peer-ip 10.1.1.1

[SwitchC-bfd-session-ctoa] discriminator local 20

[SwitchC-bfd-session-ctoa] discriminator remote 10

[SwitchC-bfd-session-ctoa] commit

[SwitchC-bfd-session-ctoa] quit

验证配置结果

配置完成后,在SwitchA和SwitchC上执行display bfd session命令,可以看到建立了一个BFD会话,且状态为Up。

以SwitchA上的显示为例。

<SwitchA> display bfd session all verbose

——————————————————————————–

Session MIndex : 4096 (Multi Hop) State : Up Name : atoc

——————————————————————————–

Local Discriminator : 10 Remote Discriminator : 20

Session Detect Mode : Asynchronous Mode Without Echo Function

BFD Bind Type : Peer IP Address

Bind Session Type : Static

Bind Peer IP Address : 10.2.1.2

Bind Interface : –

FSM Board Id : 0 TOS-EXP : 7

Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000

Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000

Local Detect Multi : 3 Detect Interval (ms) : 3000

Echo Passive : Disable Acl Number : –

Destination Port : 3784 TTL : 255

Proc Interface Status : Disable

WTR Interval (ms) : –

Active Multi : 3

Last Local Diagnostic : Control Detection Time Expired

Bind Application : No Application Bind

Session TX TmrID : 16445 Session Detect TmrID : –

Session Init TmrID : 16447 Session WTR TmrID : –

Session Echo Tx TmrID : –

PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0

Session Description : –

——————————————————————————–

Total UP/DOWN Session Number : 1/0

配置文件

SwitchA的配置文件

·

#

sysname SwitchA

#

vlan batch 10

#

bfd

#

interface Vlanif10

ip address 10.1.1.1 255.255.0.0

#

interface GigabitEthernet0/0/1

port hybrid pvid vlan 10

port hybrid untagged vlan 10

#

bfd atoc bind peer-ip 10.2.1.2

discriminator local 10

discriminator remote 20

commit

#

ip route-static 10.2.0.0 255.255.0.0 10.1.1.2

#

return

SwitchB的配置文件

#

sysname SwitchB

#

vlan batch 10 20

#

interface Vlanif10

ip address 10.1.1.2 255.255.0.0

#

interface Vlanif20

ip address 10.2.1.1 255.255.0.0

#

interface GigabitEthernet0/0/1

port hybrid pvid vlan 10

port hybrid untagged vlan 10

#

interface GigabitEthernet0/0/2

port hybrid pvid vlan 20

port hybrid untagged vlan 20

#

return

·

·

SwitchC的配置文件

·

#

sysname SwitchC

#

bfd

#

vlan batch 20

#

interface Vlanif20

ip address 10.2.1.2 255.255.0.0

#

interface GigabitEthernet0/0/1

port hybrid pvid vlan 20

port hybrid untagged vlan 20

#

bfd ctoa bind peer-ip 10.1.1.1

discriminator local 20

discriminator remote 10

commit

#

ip route-static 10.1.0.0 255.255.0.0 10.2.1.1

#

return

为了方便大家讨论,欢迎各位网工进入交流群,和各位大神一起分享专业知识、了解行业更多动态!

来源:丹鱼先生

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

检测之家检测之家
上一篇 2022年8月21日 下午4:34
下一篇 2022年8月21日 下午5:14