示例:为 LAG 配置独立微 BFD 会话
此示例展示如何为聚合以太网接口配置独立微 BFD 会话。
要求
此示例使用以下硬件和软件组件:
带 Trio 芯片组的 MX 系列Junos路由器
T Series 4 类 FPC 或 5 类 FPC 的路由器
T 系列上的以下 PIC 类型支持 BFD for LAG:
PC-1XGE-XENPAK(3 类 FPC),
PD-4XGE-XFP(4 类 FPC),
PD-5-10XGE-SFPP(4 类 FPC),
24 个 10GE (LAN/WAN) SFPP、12 个 10GE (LAN/WAN) SFPP、1 个 100GE 5 类PC
带 24 个 10GE (LAN/WAN) SFPP 的 PTX 系列路由器
Junos OS设备上运行的 13.3 或更高版本
概述
示例包括两台直接连接的路由器。配置两个聚合以太网接口,即用于 IPv4 连接的 AE0 和用于 IPv6 连接的 AE1。使用 IPv4 地址作为两个路由器上的本地和邻接端点,在 AE0 捆绑包上配置微 BFD 会话。使用 IPv6 地址作为两个路由器上的本地和邻接端点,在 AE1 捆绑包上配置微 BFD 会话。此示例验证输出中独立的微 BFD 会话是否处于活动状态。
配置
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI 中 [edit] 。
路由器 R0
set interfaces ge-1/0/1 unit 0 family inet address 20.20.20.1/30 set interfaces ge-1/0/1 unit 0 family inet6 address 3ffe::1:1/126 set interfaces xe-4/0/0 gigether-options 802.3ad ae0 set interfaces xe-4/0/1 gigether-options 802.3ad ae0 set interfaces xe-4/1/0 gigether-options 802.3ad ae1 set interfaces xe-4/1/1 gigether-options 802.3ad ae1 set interfaces lo0 unit 0 family inet address 10.255.106.107/32 set interfaces lo0 unit 0 family inet6 address 201:DB8:251::aa:aa:1/126 set interfaces ae0 aggregated-ether-options bfd-liveness-detection minimum-interval 100 set interfaces ae0 aggregated-ether-options bfd-liveness-detection neighbor 10.255.106.102 set interfaces ae0 aggregated-ether-options bfd-liveness-detection local-address 10.255.106.107 set interfaces ae0 aggregated-ether-options minimum-links 1 set interfaces ae0 aggregated-ether-options link-speed 10g set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 unit 0 family inet address 10.0.0.1/30 set interfaces ae1 aggregated-ether-options bfd-liveness-detection minimum-interval 100 set interfaces ae1 aggregated-ether-options bfd-liveness-detection multiplier 3 set interfaces ae1 aggregated-ether-options bfd-liveness-detection neighbor 201:DB8:251::bb:bb:1 set interfaces ae1 aggregated-ether-options bfd-liveness-detection local-address 201:DB8:251::aa:aa:1 set interfaces ae1 aggregated-ether-options minimum-links 1 set interfaces ae1 aggregated-ether-options link-speed 10g set interfaces ae1 aggregated-ether-options lacp active set interfaces ae1 unit 0 family inet6 address 5555::1/126 set interface ae1 unit 0 family inet6 dad-disable set routing-options nonstop-routing set routing-options static route 30.30.30.0/30 next-hop 10.0.0.2 set routing-options rib inet6.0 static route 3ffe::1:2/126 next-hop 5555::2 set protocols bfd traceoptions file bfd set protocols bfd traceoptions file size 100m set protocols bfd traceoptions file files 10 set protocols bfd traceoptions flag all
路由器 R1
set interfaces ge-1/1/8 unit 0 family inet address 30.30.30.1/30 set interfaces ge-1/1/8 unit 0 family inet6 address 3ffe::1:2/126 set interfaces xe-0/0/0 gigether-options 802.3ad ae0 set interfaces xe-0/0/1 gigether-options 802.3ad ae0 set interfaces xe-0/0/2 gigether-options 802.3ad ae1 set interfaces xe-0/0/3 gigether-options 802.3ad ae1 set interfaces lo0 unit 0 family inet address 10.255.106.102/32 set interfaces lo0 unit 0 family inet6 address 201:DB8:251::bb:bb:1/126 set interfaces ae0 aggregated-ether-options bfd-liveness-detection minimum-interval 150 set interfaces ae0 aggregated-ether-options bfd-liveness-detection multiplier 3 set interfaces ae0 aggregated-ether-options bfd-liveness-detection neighbor 10.255.106.107 set interfaces ae0 aggregated-ether-options bfd-liveness-detection local-address 10.255.106.102 set interfaces ae0 aggregated-ether-options minimum-links 1 set interfaces ae0 aggregated-ether-options link-speed 10g set interfaces ae0 aggregated-ether-options lacp passive set interfaces ae0 unit 0 family inet address 10.0.0.2/30 set interfaces ae1 aggregated-ether-options bfd-liveness-detection minimum-interval 200 set interfaces ae1 aggregated-ether-options bfd-liveness-detection multiplier 3 set interfaces ae1 aggregated-ether-options bfd-liveness-detection neighbor 201:DB8:251::aa:aa:1 set interfaces ae1 aggregated-ether-options bfd-liveness-detection local-address 201:DB8:251::bb:bb:1 set interfaces ae1 aggregated-ether-options minimum-links 1 set interfaces ae1 aggregated-ether-options link-speed 10g set interfaces ae1 aggregated-ether-options lacp passive set interfaces ae1 unit 0 family inet6 address 5555::2/126 set routing-options static route 20.20.20.0/30 next-hop 10.0.0.1 set routing-options rib inet6.0 static route 3ffe::1:1/126 next-hop 5555::1
为聚合以太网接口配置微 BFD 会话
程序
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 指南 中的"在CLI模式中使用CLI编辑器 "。
对路由器 R1 重复此过程,修改每个路由器的适当接口名称、地址和任何其他参数。
要为路由器 R0 上的聚合以太网接口配置微 BFD 会话:
配置物理接口。
[edit interfaces] user@R0# set ge-1/0/1 unit 0 family inet address 20.20.20.1/30 user@R0# set ge-1/0/1 unit 0 family inet6 address 3ffe::1:1/126 user@R0# set xe-4/0/0 gigether-options 802.3ad ae0 user@R0# set xe-4/0/1 gigether-options 802.3ad ae0 user@R0# set xe-4/1/0 gigether-options 802.3ad ae1 user@R0# set xe-4/1/1 gigether-options 802.3ad ae1
配置环路接口。
[edit interfaces] user@R0# set lo0 unit 0 family inet address 10.255.106.107/32 user@R0# set lo0 unit 0 family inet6 address 201:DB8:251::aa:aa:1/128
根据网络要求,在聚合以太网接口 ae0 上配置带 IPv4 或 IPv6 地址的 IP 地址。
[edit interfaces] user@R0# set ae0 unit 0 family inet address 10.0.0.1/30
设置路由选项、创建静态路由并设置下一跃点地址。
注意:您可以根据网络需求配置 IPv4 或 IPv6 静态路由。
[edit routing-options] user@R0# set nonstop-routing user@R0# set static route 30.30.30.0/30 next-hop 10.0.0.2 user@R0# set rib inet6.0 static route 3ffe::1:2/126 next-hop 5555::2
配置链路聚合控制协议 (LACP)。
[edit interfaces] user@R0# set ae0 aggregated-ether-options lacp active
为聚合以太网接口 ae0 配置 BFD,并指定最小间隔、本地 IP 地址和邻接 IP 地址。
[edit interfaces] user@R0# set ae0 aggregated-ether-options bfd-liveness-detection minimum-interval 100 user@R0# set ae0 aggregated-ether-options bfd-liveness-detection multiplier 3 user@R0# set ae0 aggregated-ether-options bfd-liveness-detection neighbor 10.255.106.102 user@R0# set ae0 aggregated-ether-options bfd-liveness-detection local-address 10.255.106.107 user@R0# set ae0 aggregated-ether-options minimum-links 1 user@R0# set ae0 aggregated-ether-options link-speed 10g
在聚合以太网接口 ae1 上配置 IP 地址。
您可以根据网络要求分配 IPv4 或 IPv6 地址。
[edit interfaces] user@R0# set ae1 unit 0 family inet6 address 5555::1/126
为聚合以太网接口 ae1 配置 BFD。
[edit interfaces] user@R0# set ae1 aggregated-ether-options bfd-liveness-detection minimum-interval 100 user@R0# set ae1 aggregated-ether-options bfd-liveness-detection multiplier 3 user@R0# set ae1 aggregated-ether-options bfd-liveness-detection neighbor 201:DB8:251::bb:bb:1 user@R0# set ae1 aggregated-ether-options bfd-liveness-detection local-address 201:DB8:251::aa:aa:1 user@R0# set ae1 aggregated-ether-options minimum-links 1 user@R0# set ae1 aggregated-ether-options link-speed 10g
注意:从 Junos OS 16.1 版开始,您还可以在微 BFD 会话中将 AE 接口地址配置为本地地址。
从版本16.1R2开始,Junos OS接口或环路 IP 地址检查并验证配置的微 BFD,然后再
local-address
提交配置。Junos OS IPv4 和 IPv6 微 BFD 地址配置执行此检查,如果不匹配,则提交失败。为 BFD 配置追踪选项以进行故障排除。
[edit protocols] user@R0# set bfd traceoptions file bfd user@R0# set bfd traceoptions file size 100m user@R0# set bfd traceoptions file files 10 user@R0# set bfd traceoptions flag all
结果
在配置模式下,输入 show interfaces show protocols 、 和 show routing-options 命令,然后确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R0> show interfaces traceoptions { flag bfd-events; } ge-1/0/1 { unit 0 { family inet { address 20.20.20.1/30; } family inet6 { address 3ffe::1:1/126; } } } xe-4/0/0 { enable; gigether-options { 802.3ad ae0; } } xe-4/0/1 { gigether-options { 802.3ad ae0; } } xe-4/1/0 { enable; gigether-options { 802.3ad ae1; } } xe-4/1/1 { gigether-options { 802.3ad ae1; } } lo0 { unit 0 { family inet { address 10.255.106.107/32; } family inet6 { address 201:DB8:251::aa:aa:1/128; } } } ae0 { aggregated-ether-options { bfd-liveness-detection { minimum-interval 100; neighbor 10.255.106.102; local-address 10.255.106.107; } minimum-links 1; link-speed 10g; lacp { active; } } unit 0 { family inet { address 10.0.0.1/30; } } } ae1 { aggregated-ether-options { bfd-liveness-detection { minimum-interval 100; multiplier 3; neighbor 201:DB8:251::bb:bb:1; local-address 201:DB8:251::aa:aa:1; } minimum-links 1 link-speed 10g; } unit 0 { family inet6 { address 5555::1/126; } } }
user@R0> show protocols bfd { traceoptions { file bfd size 100m files 10; flag all; } }
user@R0> show routing-options nonstop-routing ; rib inet6.0 { static { route 3ffe:1:2/126 { next-hop 5555::2; } } } static { route 30.30.30.0/30 { next-hop 10.0.0.2; } }
如果完成设备配置,请提交配置。
user@R0# commit
验证
确认配置工作正常。
验证独立 BFD 会话是否启动
目的
验证微 BFD 会话是否已启动,并查看有关 BFD 会话的详细信息。
行动
在操作模式下,输入 show bfd session extensive
命令。
user@R0> show bfd session extensive
Detect Transmit
Address State Interface Time Interval Multiplier
10.255.106.102 Up xe-4/0/0 9.000 3.000 3
Client LACPD, TX interval 0.100, RX interval 0.100
Session up time 4d 23:13, previous down time 00:00:06
Local diagnostic None, remote diagnostic None
Remote heard, hears us, version 1
Replicated
Session type: Micro BFD
Min async interval 0.100, min slow interval 1.000
Adaptive async TX interval 0.100, RX interval 0.100
Local min TX interval 0.100, minimum RX interval 0.100, multiplier 3
Remote min TX interval 3.000, min RX interval 3.000, multiplier 3
Local discriminator 21, remote discriminator 75
Echo mode disabled/inactive
Remote is control-plane independent
Session ID: 0x0
Detect Transmit
Address State Interface Time Interval Multiplier
10.255.106.102 Up xe-4/0/1 9.000 3.000 3
Client LACPD, TX interval 0.100, RX interval 0.100
Session up time 4d 23:13, previous down time 00:00:07
Local diagnostic None, remote diagnostic None
Remote heard, hears us, version 1
Replicated
Session type: Micro BFD
Min async interval 0.100, min slow interval 1.000
Adaptive async TX interval 0.100, RX interval 0.100
Local min TX interval 0.100, minimum RX interval 0.100, multiplier 3
Remote min TX interval 3.000, min RX interval 3.000, multiplier 3
Local discriminator 19, remote discriminator 74
Echo mode disabled/inactive
Remote is control-plane independent
Session ID: 0x0
Detect Transmit
Address State Interface Time Interval Multiplier
201:DB8:251::bb:bb:1 Up xe-4/1/1 9.000 3.000 3
Client LACPD, TX interval 0.100, RX interval 0.100
Session up time 4d 23:13
Local diagnostic None, remote diagnostic None
Remote not heard, hears us, version 1
Replicated
Session type: Micro BFD
Min async interval 0.100, min slow interval 1.000
Adaptive async TX interval 0.100, RX interval 0.100
Local min TX interval 1.000, minimum RX interval 0.100, multiplier 3
Remote min TX interval 3.000, min RX interval 3.000, multiplier 3
Local discriminator 17, remote discriminator 67
Echo mode disabled/inactive, no-absorb, no-refresh
Remote is control-plane independent
Session ID: 0x0
Detect Transmit
Address State Interface Time Interval Multiplier
201:DB8:251::bb:bb:1 UP xe-4/1/0 9.000 3.000 3
Client LACPD, TX interval 0.100, RX interval 0.100
Session up time 4d 23:13
Local diagnostic None, remote diagnostic None
Remote not heard, hears us, version 1
Replicated
Session type: Micro BFD
Min async interval 0.100, min slow interval 1.000
Adaptive async TX interval 0.100, RX interval 0.100
Local min TX interval 1.000, minimum RX interval 0.100, multiplier 3
Remote min TX interval 3.000, min RX interval 3.000, multiplier 3
Local discriminator 16, remote discriminator 66
Echo mode disabled/inactive, no-absorb, no-refresh
Remote is control-plane independent
Session ID: 0x0
4 sessions, 4 clients
Cumulative transmit rate 2.0 pps, cumulative receive rate 1.7 pps
意义
微 BFD 字段表示在 LAG 中的链路上运行的独立微 BFD 会话。TX 间隔 item , RX 间隔 item 输出表示使用 语句配置的 minimum-interval
设置。所有其他输出表示 BFD 的默认设置。要修改默认设置,请添加 语句下的可选 bfd-liveness-detection
语句。
查看详细的 BFD 事件
目的
查看 BFD 追踪文件的内容,帮助进行故障排除(如有必要)。
行动
在操作模式下,输入 file show /var/log/bfd 命令。
user@R0> file show /var/log/bfd Jun 5 00:48:59 Protocol (1) len 1: BFD Jun 5 00:48:59 Data (9) len 41: (hex) 42 46 44 20 6e 65 69 67 68 62 6f 72 20 31 30 2e 30 2e 30 Jun 5 00:48:59 PPM Trace: BFD neighbor 10.255.106.102 (IFL 349) set, 9 0 Jun 5 00:48:59 Received Downstream RcvPkt (19) len 108: Jun 5 00:48:59 IfIndex (3) len 4: 329 Jun 5 00:48:59 Protocol (1) len 1: BFD Jun 5 00:48:59 SrcAddr (5) len 8: 10.255.106.102 Jun 5 00:48:59 Data (9) len 24: (hex) 00 88 03 18 00 00 00 4b 00 00 00 15 00 2d c6 c0 00 2d c6 Jun 5 00:48:59 PktError (26) len 4: 0 Jun 5 00:48:59 RtblIdx (24) len 4: 0 Jun 5 00:48:59 MultiHop (64) len 1: (hex) 00 Jun 5 00:48:59 Unknown (168) len 1: (hex) 01 Jun 5 00:48:59 Unknown (171) len 2: (hex) 02 3d Jun 5 00:48:59 Unknown (172) len 6: (hex) 80 71 1f c7 81 c0 Jun 5 00:48:59 Authenticated (121) len 1: (hex) 01 Jun 5 00:48:59 BFD packet from 10.0.0.2 (IFL 329), len 24 Jun 5 00:48:59 Ver 0, diag 0, mult 3, len 24 Jun 5 00:48:59 Flags: IHU Fate Jun 5 00:48:59 My discr 0x0000004b, your discr 0x00000015 Jun 5 00:48:59 Tx ivl 3000000, rx ivl 3000000, echo rx ivl 0 Jun 5 00:48:59 [THROTTLE]bfdd_rate_limit_can_accept_pkt: session 10.255.106.102 is up or already in program thread Jun 5 00:48:59 Replicate: marked session (discr 21) for update
意义
BFD 消息正在写入指定的追踪文件。