03-H3C SR6600-F路由器 BFD典型配置举例
本章节下载: 03-H3C SR6600-F路由器 BFD典型配置举例 (424.09 KB)
H3C SR6600-F BFD典型配置举例
Copyright © 2018 新华三技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
|
本文档介绍了BFD配置举例。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文假设您已了解BFD特性、Track特性以及OSPF、IS-IS等路由协议。
某公司内部网络如图3-1所示,从Device A到Device B有两条转发路径,下一跳分别为Device B和Device C。由于Device A和Device B之间物理距离较远,通过一个二层交换机L2 Switch作为中继。假设Device B不支持BFD,要求在Device A上使用静态路由与BFD联动技术,实现当Device B与二层交换机L2 Switch之间的链路出现故障(如链路down)时,Device A能快速感知,并将流量切换到Device C的链路上。
图3-1 静态路由与BFD联动配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
XGE3/1/1 |
192.168.10.101/24 |
Device B |
XGE3/1/1 |
192.168.10.102/24 |
|
XGE3/1/2 |
192.168.20.101/24 |
|
XGE3/1/2 |
192.168.30.101/24 |
|
XGE3/1/3 |
192.168.40.101/24 |
|
XGE3/1/3 |
192.168.50.101/24 |
Device C |
XGE3/1/1 |
192.168.20.102/24 |
|
|
|
|
XGE3/1/2 |
192.168.30.102/24 |
|
|
|
· 由于需要两端设备均支持BFD,才能够使用控制报文方式,本例中Device B不支持BFD,在Device A上配置的BFD功能仅能使用echo报文方式。
· echo报文方式下必须配置echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将echo报文的源IP地址配置为属于该设备任何一个接口所在网段,避免对端发送大量的ICMP重定向报文造成网络拥塞。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] ip address 192.168.10.101 24
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 请参考以上方法配置图3-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device A
# 配置Device A到192.168.50.0/24网段的静态路由,Device A到Device B的流量优先走Device A –> L2 Switch–> Device B链路,当此链路发生故障时,流量切换到Device A –> Device C–> Device B链路上。
[DeviceA] ip route-static 192.168.50.0 24 ten-gigabitethernet 3/1/1 192.168.10.102 bfd echo-packet
[DeviceA] ip route-static 192.168.50.0 24 ten-gigabitethernet 3/1/2 192.168.20.102 preference 65
(2) 配置Device B
# 配置Device B到192.168.40.0/24网段的静态路由,Device B到Device A的流量优先走Device B –> L2 Switch–> Device A链路,当此链路发生故障时,流量切换到Device B –> Device C–> Device A链路上。
[DeviceB] ip route-static 192.168.40.0 24 ten-gigabitethernet 3/1/1 192.168.10.101
[DeviceB] ip route-static 192.168.40.0 24 ten-gigabitethernet 3/1/2 192.168.30.102 preference 65
(3) 配置Device C
# 配置Device C到192.168.40.0/24和192.168.50.0/24网段的静态路由。
[DeviceC] ip route-static 192.168.40.0 24 ten-gigabitethernet 3/1/1 192.168.20.101
[DeviceC] ip route-static 192.168.50.0 24 ten-gigabitethernet 3/1/2 192.168.30.101
# 静态路由支持的BFD会话方式为echo报文方式,该方式下必须配置BFD echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
[DeviceA] bfd echo-source-ip 10.10.10.10
# 配置接口接收BFD echo报文的最小时间间隔为100ms,单跳BFD检测时间倍数为3。
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-echo-receive-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(1) Device A和Device B设备及之间的链路均正常工作时
# 在Device A查看静态路由信息。
[DeviceA] display ip routing-table protocol static
Summary Count : 2
Static Routing table Status : <Active>
Summary Count : 2
Destination/Mask Proto Pre Cost NextHop Interface
192.168.50.0/24 Static 60 0 192.168.10.102 XGE3/1/1
Static Routing table Status : <Inactive>
Summary Count : 0
以上显示信息表示Device A经过L2 Switch到达Device B。
# 查看BFD会话。
[DeviceA] display bfd session
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Echo Mode:
LD/RD SourceAddr DestAddr State Holdtime Interface
67 192.168.10.101 192.168.10.102 Up 300ms XGE3/1/1
以上显示信息表示BFD会话已经创建。
(2) Device B与L2 Switch之间的链路出现故障时
# 查看静态路由。
[DeviceA] display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
192.168.50.0/24 Static 65 0 192.168.20.102 XGE3/1/2
Static Routing table Status : <Inactive>
Summary Count : 0
以上显示信息表示Device A经过Device C到达Device B。
· Device A:
#
bfd echo-source-ip 10.10.10.10
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.10.101 255.255.255.0
bfd min-echo-receive-interval 100
bfd detect-multiplier 3
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.20.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 192.168.40.101 255.255.255.0
#
ip route-static 192.168.50.0 24 Ten-GigabitEthernet3/1/1 192.168.10.102 bfd echo-packet
ip route-static 192.168.50.0 24 Ten-GigabitEthernet3/1/2 192.168.20.102 preference 65
#
· Device B:
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.10.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.30.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 192.168.50.101 255.255.255.0
#
ip route-static 192.168.40.0 24 Ten-GigabitEthernet3/1/1 192.168.10.101
ip route-static 192.168.40.0 24 Ten-GigabitEthernet3/1/2 192.168.30.102 preference 65
#
· Device C:
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.20.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.30.102 255.255.255.0
#
ip route-static 192.168.40.0 24 Ten-GigabitEthernet3/1/1 192.168.20.101
ip route-static 192.168.50.0 24 Ten-GigabitEthernet3/1/2 192.168.30.101
#
如图4-1所示,某公司通过一台二层交换机作为中继将两个相距较远的部门连接。Device A、Device B、Device C上运行RIP,建立RIP邻居关系,保证网络层相互可达。
公司希望在Device A上使用RIP与BFD联动技术,实现当Device C与二层交换机之间的链路出现故障(如链路down)时,BFD能够快速感知并通告RIP协议。
已知Device C不支持BFD功能,公司希望使用RIP与BFD联动技术,采用BFD echo报文方式实现当Device A或Device C与二层交换机之间的链路出现故障时,BFD能够快速感知并通告RIP协议。
现要求通过在Device A和Device C上配置RIP与BFD联动功能,实现:
· 监测通过L2 Switch通信的链路;
· 当链路出现故障时设备能够快速感知并通告RIP协议,快速切换到Device B链路进行通信。
图4-1 RIP与BFD联动配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
XGE3/1/1 |
10.1.0.101/24 |
Device B |
XGE3/1/1 |
192.168.0.102/24 |
|
XGE3/1/2 |
192.168.0.101/24 |
|
XGE3/1/2 |
13.1.1.101/24 |
|
XGE3/1/3 |
120.1.1.1/24 |
|
|
|
Device C |
XGE3/1/1 |
10.1.0.102/24 |
|
|
|
|
XGE3/1/2 |
13.1.1.102/24 |
|
|
|
|
XGE3/1/3 |
121.1.1.1/24 |
|
|
|
· 由于需要两端设备均支持BFD,才能够使用控制报文方式,本例中Device C不支持BFD,在Device A上配置的BFD功能仅能使用echo报文方式。
· echo报文方式下必须配置echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将echo报文的源IP地址配置为属于该设备任何一个接口所在网段,避免对端发送大量的ICMP重定向报文造成网络拥塞。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] ip address 10.1.0.101 24
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 请参考以上方法配置图4-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device A
# 配置Device A的RIP基本功能,引入直连路由,并使能RIP的BFD功能。
<DeviceA> system-view
[DeviceA] rip 1
[DeviceA-rip-1] version 2
[DeviceA-rip-1] undo summary
[DeviceA-rip-1] network 10.1.0.0
[DeviceA-rip-1] network 192.168.0.0
[DeviceA-rip-1] import-route direct
[DeviceA-rip-1] quit
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] rip bfd enable
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 配置Device B
# 配置Device B的RIP基本功能,引入直连路由。
<DeviceB> system-view
[DeviceB] rip 1
[DeviceB-rip-1] version 2
[DeviceB-rip-1] undo summary
[DeviceB-rip-1] network 192.168.0.0
[DeviceB-rip-1] network 13.1.1.0
[DeviceB-rip-1] import-route direct
[DeviceB-rip-1] quit
(3) 配置Device C
# 配置Device C的RIP基本功能,引入直连路由。
<DeviceC> system-view
[DeviceC] rip 1
[DeviceC-rip-1] version 2
[DeviceC-rip-1] undo summary
[DeviceC-rip-1] network 10.1.0.0
[DeviceC-rip-1] network 13.1.1.0
[DeviceC-rip-1] import-route direct
[DeviceC-rip-1] quit
# RIP支持的BFD会话方式为echo报文方式,该方式下必须配置BFD echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
[DeviceA] bfd echo-source-ip 11.11.11.11
# 配置接口接收BFD echo报文的最小时间间隔为100ms,单跳BFD检测时间倍数为3。
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-echo-receive-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-Ten-GigabitEthernet3/1/1] quit
# 查看Device A上BFD会话信息,显示BFD会话已被创建,且状态为Up。
[DeviceA] display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Echo Mode:
Local Discr: 2049
Source IP: 10.1.0.101 Destination IP: 10.1.0.102
Session State: Up Interface: Ten-GigabitEthernet3/1/1
Hold Time: 300ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 464 Tx Count: 465
Connect Type: Direct Running Up for: 00:00:46
Detect Mode: Async Slot: 0
Protocol: RIP
Diag Info: No Diagnostic
# 查看Device A上学到的路由121.1.1.0/24,可以看到Device A经过L2 Switch到达Device C。
<DeviceA> display ip routing-table 121.1.1.0 24 verbose
Summary Count : 1
Destination: 121.1.1.0/24
Protocol: RIP Process ID: 1
SubProtID: 0x1 Age: 04h20m37s
Cost: 1 Preference: 100
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 10.1.0.102
Flags: 0x1008c OrigNextHop: 10.1.0.102
Label: NULL RealNextHop: 10.1.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/1
BkTunnel ID: Invalid BkInterface: N/A
# 当Device C和二层交换机之间的链路发生故障,BFD快速检测到链路发生变化并立刻通告RIP。
%Oct 9 18:42:17:650 2017 Device A BFD/5/BFD_CHANGE_FSM: -MDC=1;Sess[10.1.0.101/10.1.0.102, LD/RD:2049/2049, Interface: Ten-GigabitEthernet3/1/1, SessType:Echo, LinkType:INET] , Sta: UP-> DOWN, Diag:1
# 查看Device A上学到的路由121.1.1.0/24,可以看到Device A经过Device B到达Device C。
<DeviceA> display ip routing-table 121.1.1.0 24 verbose
Summary Count : 1
Destination: 121.1.1.0/24
Protocol: RIP Process ID: 2
SubProtID: 0x1 Age: 04h20m37s
Cost: 2 Preference: 100
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 192.168.0.102
Flags: 0x1008c OrigNextHop: 192.168.0.102
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-Ten-GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
· Device A:
#
bfd echo-source-ip 11.11.11.11
#
rip 1
undo summary
version 2
network 10.0.0.0
network 192.168.0.0
import-route direct
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.101 255.255.255.0
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.0.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 120.1.1.1 255.255.255.0
#
· Device B:
#
rip 1
undo summary
version 2
network 192.168.0.0
network 13.1.1.0
import-route direct
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.0.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.101 255.255.255.0
#
· Device C:
#
rip 1
undo summary
version 2
network 10.1.0.0
network 13.1.1.0
import-route direct
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 121.1.1.1 255.255.255.0
#
如图5-1所示,某公司通过一台二层交换机作为中继将两个相距较远的部门连接。Device A、Device B、Device C上运行OSPF,建立OSPF邻居关系,保证网络层相互可达。
已知Device A和Device C都支持BFD功能,要求使用OSPF与BFD联动技术,采用BFD控制报文方式实现当Device A或Device C与二层交换机之间的链路出现故障(如链路down)时,BFD能够快速感知并通告OSPF协议。
现要求通过在Device A和Device C上配置OSPF与BFD联动功能,实现:
· 监测通过L2 Switch通信的链路;
· 当链路出现故障时设备能够快速感知并通告OSPF协议,快速切换到Device B链路进行通信。
图5-1 OSPF与BFD联动配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
XGE3/1/1 |
10.1.0.101/24 |
Device B |
XGE3/1/1 |
192.168.0.102/24 |
|
XGE3/1/2 |
192.168.0.101/24 |
|
XGE3/1/2 |
13.1.1.101/24 |
|
XGE3/1/3 |
120.1.1.1/24 |
|
|
|
Device C |
XGE3/1/1 |
10.1.0.102/24 |
|
|
|
|
XGE3/1/2 |
13.1.1.102/24 |
|
|
|
|
XGE3/1/3 |
121.1.1.1/24 |
|
|
|
Device A和Device C都支持BFD,可以使用BFD控制报文方式,通信双方至少要有一方运行在主动模式才能成功建立起BFD会话。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] ip address 10.1.0.101 24
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 请参考以上方法配置图5-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device A
# 配置Device A的OSPF基本功能,并使能OSPF的BFD功能。
[DeviceA] ospf
[DeviceA-ospf-1] area 0
[DeviceA-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] network 120.1.1.0 0.0.0.255
[DeviceA-ospf-1-area-0.0.0.0] quit
[DeviceA-ospf-1] quit
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] ospf bfd enable
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 配置Device B
# 配置Device B的OSPF基本功能。
[DeviceB] ospf
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
(3) 配置Device C
# 配置Device C的OSPF基本功能,并使能OSPF的BFD功能。
[DeviceC] ospf
[DeviceC-ospf-1] area 0
[DeviceC-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] network 121.1.1.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] quit
[DeviceC-ospf-1] quit
[DeviceC] interface ten-gigabitethernet 3/1/1
[DeviceC-Ten-GigabitEthernet3/1/1] ospf bfd enable
[DeviceC-Ten-GigabitEthernet3/1/1] quit
# 配置BFD会话建立前的运行模式为主动模式(缺省为主动模式)。
[DeviceA] bfd session init-mode active
# 配置发送和接收单跳BFD控制报文的最小时间间隔都为100ms,单跳BFD检测时间倍数为3。
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 配置Device C
# 配置BFD会话建立前的运行模式为主动模式(缺省为主动模式)。
[DeviceC] bfd session init-mode active
# 配置发送和接收单跳BFD控制报文的最小时间间隔都为100ms,单跳BFD检测时间倍数为3。
[DeviceC] interface ten-gigabitethernet 3/1/1
[DeviceC-Ten-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceC-Ten-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceC-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceC-Ten-GigabitEthernet3/1/1] quit
# 检查Device A连接的主机host A(120.1.1.2)到Device C连接的主机host C(121.1.1.2)是否可达。
<host A> ping 121.1.1.2
PING 121.1.1.2 (121.1.1.2): 56 data bytes
56 bytes from 121.1.1.2: seq=0 ttl=128 time=22.43 ms
56 bytes from 121.1.1.2: seq=1 ttl=128 time=7.17 ms
56 bytes from 121.1.1.2: seq=2 ttl=128 time=8.91 ms
56 bytes from 121.1.1.2: seq=3 ttl=128 time=7.45 ms
56 bytes from 121.1.1.2: seq=4 ttl=128 time=9.11 ms
--- 121.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
# 查看Device A 上OSPF邻居信息,显示Device A和Device C已建立OSPF邻居关系。
[DeviceA] display ospf peer verbose
OSPF Process 1 with Router ID 2.2.2.2
Neighbors
Area 0.0.0.0 interface 10.1.0.101(Ten-GigabitEthernet3/1/1)'s neighbors
Router ID: 1.1.1.1 Address: 10.1.0.102 GR State: Normal
State: Full Mode: Nbr is Slave Priority: 1
DR: 10.1.0.101 BDR: 10.1.0.102 MTU: 0
Options is 0x42 (-|O|-|-|-|-|E|-)
Dead timer due in 39 sec
Neighbor is up for 00:09:01
Authentication Sequence: [ 0 ]
Neighbor state change count: 5
BFD status: Enabled(Control mode)
# BFD会话已被创建,且状态为UP。
[DeviceA] 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.101 Destination IP: 10.1.0.102
Session State: Up Interface: Ten-GigabitEthernet3/1/1
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Rx Count: 3971 Tx Count: 3776
Connect Type: Direct Running Up for: 00:06:52
Hold Time: 300ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: OSPF
Diag Info: No Diagnostic
[DeviceC] 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.102 Destination IP: 10.1.0.101
Session State: Up Interface: Ten-GigabitEthernet3/1/1
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 300ms
Min Trans Inter: 100ms Act Trans Inter: 100ms
Min Recv Inter: 100ms Act Detect Inter: 100ms
Rx Count: 3 Tx Count: 3
Connect Type: Direct Running Up for: 00:06:52
Hold Time: 300ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: OSPF
Diag Info: No Diagnostic
# 在Device A上查看121.1.1.0/24的路由信息,可以看出Device A和Device C是通过L2 Switch进行通信的。
<DeviceA> display ip routing-table 121.1.1.0 verbose
Summary Count : 1
Destination: 120.1.1.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x1 Age: 04h20m37s
Cost: 1 Preference: 10
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 10.1.0.102
Label: NULL RealNextHop: 10.1.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: GigabitEthernet3/1/1
BkTunnel ID: Invalid BkInterface: N/A
# 当Device C和二层交换机之间的链路状态变为Down,BFD快速检测到链路发生变化立刻通告OSPF。
%Apr 2 11:34:26:880 2017 DeviceA BFD/5/BFD_CHANGE_FSM: Sess[10.1.0.101/10.1.0.102,1026/1026
,Ten-GigabitEthernet3/1/1,Ctrl] , Sta: UP-> DOWN, Diag: 5
%Apr 2 11:34:27:011 2017 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.1.0.102 Ten-GigabitEthernet3/1/1) from Full to Down.
# 查看121.1.1.0/24的路由信息,可以看出Device A和Device C已经切换到Device B进行通信。
<Device A> display ip routing-table 121.1.1.0 verbose
Summary Count : 1
Destination: 121.1.1.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x1 Age: 04h20m37s
Cost: 2 Preference: 10
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 192.168.0.102
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
· Device A:
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.0.255
network 120.1.1.0 0.0.0.255
network 192.168.0.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.101 255.255.255.0
ospf bfd enable
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.0.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 120.1.1.1 255.255.255.0
#
· Device B:
#
ospf 1
area 0.0.0.0
network 13.1.1.0 0.0.0.255
network 192.168.0.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.0.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.101 255.255.255.0
#
· Device C:
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.0.255
network 13.1.1.0 0.0.0.255
network 121.1.1.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
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 Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 121.1.1.1 255.255.255.0
#
如图6-1所示,某公司通过一台二层交换机作为中继将两个相距较远的部门连接。Device A、Device B、Device C上运行IS-IS,建立IS-IS邻居关系,保证网络层相互可达。
已知Device A和Device C都支持BFD功能,公司希望使用IS-IS与BFD联动技术,采用BFD控制报文方式实现当Device A或Device C与二层交换机之间的链路出现故障(如链路down)时,BFD能够快速感知并通告IS-IS协议。
现要求通过在Device A和Device C上配置IS-IS与BFD联动功能,实现:
· 监测通过L2 Switch通信的链路;
· 当链路出现故障时设备能够快速感知并通告IS-IS协议,快速切换到Device B链路进行通信。
图6-1 IS-IS与BFD联动配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
XGE3/1/1 |
10.1.0.101/24 |
Device B |
XGE3/1/1 |
192.168.0.102/24 |
|
XGE3/1/2 |
192.168.0.101/24 |
|
XGE3/1/2 |
13.1.1.101/24 |
|
XGE3/1/3 |
120.1.1.1/24 |
|
|
|
Device C |
XGE3/1/1 |
10.1.0.102/24 |
|
|
|
|
XGE3/1/2 |
13.1.1.102/24 |
|
|
|
|
XGE3/1/3 |
121.1.1.1/24 |
|
|
|
Device A和Device C都支持BFD,可以使用BFD控制报文方式,通信双方至少要有一方运行在主动模式才能成功建立起BFD会话。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] ip address 10.1.0.101 24
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 请参考以上方法配置图6-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device A
# 配置Device A的IS-IS基本功能,并使能IS-IS的BFD功能。
[DeviceA] isis
[DeviceA-isis-1] network-entity 10.0000.0000.0001.00
[DeviceA-isis-1] quit
[DeviceA] interface ten-gigabitethernet 3/1/2
[DeviceA-Ten-GigabitEthernet3/1/2] isis enable
[DeviceA-Ten-GigabitEthernet3/1/2] quit
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] isis enable
[DeviceA-Ten-GigabitEthernet3/1/1] isis bfd enable
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 配置Device B
# 配置Device B的IS-IS基本功能。
[DeviceB] isis
[DeviceB-isis-1] network-entity 10.0000.0000.0003.00
[DeviceB-isis-1] quit
[DeviceB] interface ten-gigabitethernet 3/1/1
[DeviceB-Ten-GigabitEthernet3/1/1] isis enable
[DeviceB-Ten-GigabitEthernet1/1/1] quit
[DeviceB] interface ten-gigabitethernet 3/1/2
[DeviceB-Ten-GigabitEthernet3/1/2] isis enable
[DeviceB-Ten-GigabitEthernet3/1/2] quit
(3) 配置Device C
# 配置Device C的IS-IS基本功能,并使能IS-IS的BFD功能。
[DeviceC] isis
[DeviceC-isis-1] network-entity 10.0000.0000.0002.00
[DeviceC-isis-1] quit
[DeviceC] interface ten-gigabitethernet 3/1/1
[DeviceC-Ten-GigabitEthernet3/1/1] isis enable
[DeviceC-Ten-GigabitEthernet3/1/1] isis bfd enable
[DeviceC-Ten-GigabitEthernet3/1/1] quit
[DeviceC] interface ten-gigabitethernet 3/1/2
[DeviceC-Ten-GigabitEthernet3/1/2] isis enable
[DeviceC-Ten-GigabitEthernet3/1/2] quit
# 配置BFD会话建立前的运行模式为主动模式(缺省为主动模式)。
[DeviceA] bfd session init-mode active
# 配置发送和接收单跳BFD控制报文的最小时间间隔都为100ms,单跳BFD检测时间倍数为3。
[DeviceA] interface ten-gigabitethernet 3/1/1
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceA-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-Ten-GigabitEthernet3/1/1] quit
(2) 配置Device C
# 配置BFD会话建立前的运行模式为主动模式(缺省为主动模式)。
[DeviceC] bfd session init-mode active
# 配置发送和接收单跳BFD控制报文的最小时间间隔都为100ms,单跳BFD检测时间倍数为3。
[DeviceC] interface ten-gigabitethernet 3/1/1
[DeviceC-Ten-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceC-Ten-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceC-Ten-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceC-Ten-GigabitEthernet3/1/1] quit
# 查看Device A上IS-IS邻居信息,显示Device A和Device C已建立IS-IS邻居关系。
[DeviceA] display isis peer verbose
Peer information for IS-IS(1)
-----------------------------
System ID: 0000.0000.0002
Interface: Ten-GigabitEthernet3/1/1 Circuit Id: 0000.0000.0002.01
State: Up HoldTime: 6s Type: L1(L1L2) PRI: 64
Area address(es): 00
Peer IP address(es): 10.1.0.102
Peer local circuit ID: 1
Peer circuit SNPA address: ce9d-d91d-d100
Uptime: 00:01:19
Adj protocol: IPv4
Graceful Restart capable
Restarting signal: No
Suppress adjacency advertisement: No
Local topology:
0
Remote topology:
0
# 查看Device A和Device C上BFD会话信息,显示BFD会话已被创建,且状态为Up。
[DeviceA] display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 2049 Remote Discr: 2049
Source IP: 10.1.0.101 Destination IP: 10.1.0.102
Session State: Up Interface: Ten-GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 3 Tx Count: 3
Connect Type: Direct Running Up for: 00:06:09
Hold Time: 300ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: ISIS_BR_L1/ISIS_BR_L2
Diag Info: No Diagnostic
[DeviceC] display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 2049 Remote Discr: 2049
Source IP: 10.1.0.102 Destination IP: 10.1.0.101
Session State: Up Interface: Ten-GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 3 Tx Count: 3
Connect Type: Direct Running Up for: 00:07:10
Hold Time: 300ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: ISIS_BR_L1/ISIS_BR_L2
Diag Info: No Diagnostic
# 在Device A上查看121.1.1.0/24的路由信息,可以看出Device A和Device C是通过L2 Switch进行通信的。
<DeviceA> display ip routing-table 121.1.1.0 verbose
Summary Count : 1
Destination: 121.1.1.0/24
Protocol: isis Process ID: 1
SubProtID: 0x1 Age: 04h20m37s
Cost: 20 Preference: 15
Tag: 0 State: Active Adv
OrigTblID: 0x2 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 10.1.0.102
Label: NULL RealNextHop: 10.1.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/1
BkTunnel ID: Invalid BkInterface: N/A
# 当Device C和二层交换机之间的链路Down了,BFD快速检测到链路发生变化并立刻通告IS-IS。
%Oct 9 16:11:24:163 2017 DeviceC BFD/5/BFD_CHANGE_FSM: -MDC=1; Sess[10.1.0.102/10.1.0.101, LD/RD:2049/2049, Interface: Ten-GigabitEthernet3/1/1, SessType:Ctrl, LinkType:INET] , S
ta: UP-> DOWN, Diag: 1
%Oct 9 16:11:24:164 2017 DeviceC ISIS/5/ISIS_NBR_CHG: -MDC=1; IS-IS 1, Level-1 adj
acency 0000.0000.0001 (Ten-GigabitEthernet3/1/1), state change to: DOWN.
%Oct 9 16:11:24:164 2017 DeviceC ISIS/5/ISIS_NBR_CHG: -MDC=1; IS-IS 1, Level-2 adj
acency 0000.0000.0001 (Ten-GigabitEthernet3/1/1), state change to: DOWN.
# 查看121.1.1.0/24的路由信息,可以看出Device A和Device C已经切换到Device B进行通信。
<Device A> display ip routing-table 121.1.1.0 verbose
Summary Count : 1
Destination: 121.1.1.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x1 Age: 04h20m37s
Cost: 21 Preference: 10
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NBRID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 192.168.0.102
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
· Device A:
#
isis 1
network-entity 10.0000.0000.0001.00
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.101 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 Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.0.101 255.255.255.0
isis enable 1
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 120.1.1.1 255.255.255.0
#
· Device B:
#
isis 1
network-entity 10.0000.0000.0003.00
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.0.102 255.255.255.0
isis enable 1
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.101 255.255.255.0
isis enable 1
#
· Device C:
#
isis 1
network-entity 10.0000.0000.0002.00
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.102 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 Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.102 255.255.255.0
isis enable 1
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 121.1.1.1 255.255.255.0
#
如图7-1所示,某公司的两个部门相距较远,Device A和Device F分别作为这两个部门的出口设备,现通过部署BGP,使两个部门可以进行业务通信。已知Device B和Device D都支持BFD功能,公司希望使用BGP与BFD联动技术,采用BFD控制报文方式检测AS 200与AS 300之间通信的主链路状态,实现当Device B或Device D之间的链路出现故障(如链路down)时,BFD能够快速感知并通告BGP协议。具体要求如下:
· 在AS 100内使用OSPF作为IGP;
· 配置Device B<->Device C<->Device D链路作为主链路,负责转发Device A和Device F之间的流量,并采用BFD控制报文的方式检测主链路;
· 当主链路发生故障时,BFD能够快速检测并通告BGP协议,使得迅速切换到Device B<->Device E<->Device D这条路径进行通信。
图7-1 BGP与BFD联动配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
XGE3/1/1 |
120.1.0.1/24 |
Device D |
XGE3/1/1 |
10.2.0.101/24 |
Device B |
XGE3/1/1 |
10.1.0.101/24 |
|
XGE3/1/2 |
13.1.1.101/24 |
|
XGE3/1/2 |
192.168.0.101/24 |
|
XGE3/1/3 |
120.2.0.2/24 |
|
XGE3/1/3 |
120.1.0.2/24 |
Device E |
XGE3/1/1 |
192.168.0.102/24 |
Device C |
XGE3/1/1 |
10.1.0.102/24 |
|
XGE3/1/2 |
13.1.1.102/24 |
|
XGE3/1/2 |
10.2.0.102/24 |
Device F |
XGE3/1/1 |
120.2.0.1/24 |
· Device B和Device D都支持BFD,可以使用BFD控制报文方式,通信双方至少要有一方运行在主动模式才能成功建立起BFD会话。
· 为了使Device B<->Device C<->Device D成为主链路,需要通过路由策略配置其路由开销低于链路Device B<->Device E<->Device D的路由开销。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/0/1
[DeviceA-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/1] ip address 120.1.0.1 24
[DeviceA-Ten-GigabitEthernet3/0/1] quit
请参考以上方法配置图7-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device B
[DeviceB] ospf
[DeviceB-ospf-1] import-route direct
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
(2) 配置Device C
[DeviceC] ospf
[DeviceC-ospf-1] area 0
[DeviceC-ospf-1-area-0.0.0.0] network 10.1.0.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] network 10.2.0.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] quit
[DeviceC-ospf-1] quit
(3) 配置Device D
[DeviceD] ospf
[DeviceD-ospf-1] import-route direct
[DeviceD-ospf-1] area 0
[DeviceD-ospf-1-area-0.0.0.0] network 10.2.0.0 0.0.0.255
[DeviceD-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[DeviceD-ospf-1-area-0.0.0.0] quit
[DeviceD-ospf-1] quit
(4) 配置Device E
[DeviceE] ospf
[DeviceE-ospf-1] area 0
[DeviceE-ospf-1-area-0.0.0.0] network 13.1.1.0 0.0.0.255
[DeviceE-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[DeviceE-ospf-1-area-0.0.0.0] quit
[DeviceE-ospf-1] quit
(1) 配置Device A
# 启动BGP,指定本地AS号为200。
[DeviceA] bgp 200
[DeviceA-bgp] router id 1.1.1.1
# 配置Device A和Device B建立EBGP连接。
[DeviceA-bgp] peer 120.1.0.2 as-number 100
# 创建BGP IPv4单播地址族,并进入BGP IPv4单播地址族视图。
[DeviceA-bgp] address-family ipv4 unicast
# 在BGP IPv4单播地址族视图下,将本地路由表中到达120.1.0.0/24网段的路由添加到BGP路由表中。
[DeviceA-bgp-ipv4] network 120.1.0.0 255.255.255.0
# 使能Device A与对等体120.1.0.2交换IPv4单播路由信息的能力。
[DeviceA-bgp-ipv4] peer 120.1.0.2 enable
[DeviceA-bgp-ipv4] quit
(2) 配置Device B
# 启动BGP,指定本地AS号为100。
[DeviceB] bgp 100
[DeviceB-bgp] router id 2.2.2.2
# 配置Device B和Device A建立EBGP连接。
[DeviceB-bgp] peer 120.1.0.1 as-number 200
# 配置Device B和Device D建立IBGP连接。
[DeviceB-bgp] peer 10.2.0.101 as-number 100
[DeviceB-bgp] peer 13.1.1.101 as-number 100
# 创建BGP IPv4单播地址族,并进入BGP IPv4单播地址族视图。
[DeviceB-bgp] address-family ipv4 unicast
# 使能Device B与对等体10.2.0.101交换IPv4单播路由信息的能力。
[DeviceB-bgp-ipv4] peer 10.2.0.101 enable
# 在BGP IPv4单播地址族视图下,配置向对等体10.2.0.101发布BGP路由时,将下一跳属性修改为自身的地址。
[DeviceB-bgp-ipv4] peer 10.2.0.101 next-hop-local
# 使能Device B与对等体13.1.1.101交换IPv4单播路由信息的能力。
[DeviceB-bgp-ipv4] peer 13.1.1.101 enable
# 在BGP IPv4单播地址族视图下,配置向对等体13.1.1.101发布BGP路由时,将下一跳属性修改为自身的地址。
[DeviceB-bgp-ipv4] peer 13.1.1.101 next-hop-local
# 使能Device B与对等体120.1.0.1交换IPv4单播路由信息的能力。
[DeviceB-bgp-ipv4] peer 120.1.0.1 enable
[DeviceB-bgp-ipv4] quit
(3) 配置Device D
# 启动BGP,指定本地AS号为100。
[DeviceD] bgp 100
[DeviceD-bgp] router id 4.4.4.4
# 配置Device D和Device B建立IBGP连接。
[DeviceD-bgp] peer 10.1.0.101 as-number 100
[DeviceD-bgp] peer 192.168.0.101 as-number 100
# 配置Device D和Device F建立EBGP连接。
[DeviceD-bgp] peer 120.2.0.1 as-number 300
# 创建BGP IPv4单播地址族,并进入BGP IPv4单播地址族视图。
[DeviceD-bgp] address-family ipv4 unicast
# 使能Device D与对等体10.1.0.101交换IPv4单播路由信息的能力。
[DeviceD-bgp-ipv4] peer 10.1.0.101 enable
# 在BGP IPv4单播地址族视图下,配置向对等体10.1.0.101发布BGP路由时,将下一跳属性修改为自身的地址。
[DeviceD-bgp-ipv4] peer 10.1.0.101 next-hop-local
# 使能Device D与对等体192.168.0.101交换IPv4单播路由信息的能力。
[DeviceD-bgp-ipv4] peer 192.168.0.101 enable
# 在BGP IPv4单播地址族视图下,配置向对等体192.168.0.101发布BGP路由时,将下一跳属性修改为自身的地址。
[DeviceD-bgp-ipv4] peer 192.168.0.101 next-hop-local
# 使能Device D与对等体120.2.0.1交换IPv4单播路由信息的能力。
[DeviceD-bgp-ipv4] peer 120.2.0.1 enable
[DeviceD-bgp-ipv4] quit
(4) 配置Device F
#启动BGP,指定本地AS号为300。
[DeviceF] bgp 300
[DeviceF-bgp] router id 6.6.6.6
# 配置Device F和Device D建立EBGP连接。
[DeviceF-bgp] peer 120.2.0.2 as-number 100
# 创建BGP IPv4单播地址族,并进入BGP IPv4单播地址族视图。
[DeviceF-bgp] address-family ipv4 unicast
# 在BGP IPv4单播地址族视图下,将本地路由表中到达120.2.0.0/24网段的路由添加到BGP路由表中。
[DeviceF-bgp-ipv4] network 120.2.0.0 255.255.255.0
# 使能Device F与对等体120.2.0.2交换IPv4单播路由信息的能力。
[DeviceF-bgp-ipv4] peer 120.2.0.2 enable
[DeviceF-bgp-ipv4] quit
(1) 配置Device B
# 创建ACL 2000,允许源IP地址为120.1.0.0/24的报文通过。
[DeviceB] acl basic 2000
[DeviceB-acl-ipv4-basic-2000] rule permit source 120.1.0.0 0.0.0.255
[DeviceB-acl-ipv4-basic-2000] quit
# 配置向对等体10.2.0.101发布的路由设置本地优先级为200,并配置IBGP路由优先级为100。
[DeviceB] route-policy local-pre permit node 10
[DeviceB-route-policy-local-pre] if-match ip address acl 2000
[DeviceB-route-policy-local-pre] apply local-preference 200
[DeviceB-route-policy-local-pre] quit
[DeviceB] bgp 100
[DeviceB-bgp] address-family ipv4 unicast
[DeviceB-bgp-ipv4] peer 10.2.0.101 route-policy local-pre export
[DeviceB-bgp-ipv4] preference 255 100 130
[DeviceB-bgp-ipv4] quit
(2) 配置Device D
# 创建ACL 2000,允许源IP地址为120.2.0.0/24的报文通过。
[DeviceD] acl basic 2000
[DeviceD-acl-ipv4-basic-2000] rule permit source 120.2.0.0 0.0.0.255
[DeviceD-acl-ipv4-basic-2000] quit
# 配置向对等体10.1.0.101发布的路由设置本地优先级为200,并配置IBGP路由优先级为100。
[DeviceD] route-policy local-pre permit node 10
[DeviceD-route-policy-local-pre] if-match ip address acl 2000
[DeviceD-route-policy-local-pre] apply local-preference 200
[DeviceD-route-policy-local-pre] quit
[DeviceD] bgp 100
[DeviceD-bgp] address-family ipv4 unicast
[DeviceD-bgp-ipv4] peer 10.1.0.101 route-policy local-pre export
[DeviceD-bgp-ipv4] preference 255 100 130
[DeviceD-bgp-ipv4] quit
(1) 配置Device B
[DeviceB] bgp 100
[DeviceB-bgp] peer 10.2.0.101 bfd
[DeviceB-bgp] quit
(2) 配置Device D
[DeviceD] bgp 100
[DeviceD-bgp] peer 10.1.0.101 bfd
[DeviceD-bgp] quit
# 从Device A上ping Device F的IP地址,可以互通。
[DeviceA] ping 120.2.0.1
Ping 120.2.0.1 (120.2.0.1): 56 data bytes, press CTRL_C to break
56 bytes from 120.2.0.1: icmp_seq=0 ttl=252 time=1.189 ms
56 bytes from 120.2.0.1: icmp_seq=1 ttl=252 time=1.095 ms
56 bytes from 120.2.0.1: icmp_seq=2 ttl=252 time=1.086 ms
56 bytes from 120.2.0.1: icmp_seq=3 ttl=252 time=1.097 ms
56 bytes from 120.2.0.1: icmp_seq=4 ttl=252 time=1.089 ms
--- Ping statistics for 120.2.0.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.086/1.111/1.189/0.039 ms
# 在Device B上通过命令display bgp peer查看BGP对等体信息,可以看到Device B与Device D建立IBGP连接,Device B与Device A建立EBGP连接,且均处于Established状态。
[DeviceB] display bgp peer ipv4
BGP local router ID: 2.2.2.2
Local AS number: 100
Total number of peers: 3 Peers in established state: 3
Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State
10.2.0.101 100 6 4 0 1 00:00:56 Established
13.1.1.101 100 6 5 0 1 00:00:56 Established
120.1.0.1 200 6 5 0 1 00:00:56 Established
# 查看Device B上BFD会话信息,显示BFD会话已被创建,且状态为Up。
[DeviceB] display bfd session verbose
Total Session Num: 1 Up Session Num: 0 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 2049 Remote Discr: 0
Source IP: 10.1.0.101 Destination IP: 10.2.0.101
Session State: UP Interface: N/A
Min Tx Inter: 1000ms Act Tx Inter: 1000ms
Min Rx Inter: 1000ms Detect Inter: 5000ms
Rx Count: 0 Tx Count: 910
Connect Type: Indirect Running Up for: 00:00:00
Hold Time: 0ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: BGP
Diag Info: No Diagnostic
# 在Device B上查看120.2.0.0/24的路由信息,可以看出Device B通过Device B<->Device C<->Device D这条路径与120.2.0.0/24网段通信。
[DeviceB] display ip routing-table 120.2.0.0 24 verbose
Summary Count : 3
Destination: 120.2.0.0/24
Protocol: BGP Process ID: 0
SubProtID: 0x1 Age: 00h24m48s
Cost: 0 Preference: 100
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 300
NibID: 0x15000001 LastAs: 300
AttrID: 0x1 Neighbor: 10.2.0.101
Flags: 0x10060 OrigNextHop: 10.2.0.101
Label: NULL RealNextHop: 10.1.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/1
BkTunnel ID: Invalid BkInterface: N/A
Destination: 120.2.0.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x8 Age: 00h26m19s
Cost: 1 Preference: 150
Tag: 1 State: Inactive Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NibID: 0x13000005 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x41 OrigNextHop: 10.1.0.102
Label: NULL RealNextHop: 10.1.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/1
BkTunnel ID: Invalid BkInterface: N/A
Destination: 120.2.0.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x8 Age: 00h26m19s
Cost: 1 Preference: 150
Tag: 1 State: Inactive Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NibID: 0x13000003 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x41 OrigNextHop: 192.168.0.102
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
# 在Device B<->Device C<->Device D链路发生故障后,从Device A上ping Device F的IP地址,可以互通。
<DeviceA> ping 120.2.0.1
Ping 120.1.0.1 (120.2.0.1): 56 data bytes, press CTRL_C to break
56 bytes from 120.2.0.1: icmp_seq=0 ttl=252 time=0.680 ms
56 bytes from 120.2.0.1: icmp_seq=1 ttl=252 time=0.295 ms
56 bytes from 120.2.0.1: icmp_seq=2 ttl=252 time=0.423 ms
56 bytes from 120.2.0.1: icmp_seq=3 ttl=252 time=0.464 ms
56 bytes from 120.2.0.1: icmp_seq=4 ttl=252 time=0.445 ms
--- Ping statistics for 120.2.0.1 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.295/0.461/0.680/0.124 ms
# 在Device B上查看120.2.0.0/24的路由信息,可以看出Device B通过Device B<->Device E<->Device D这条路径与120.2.0.0/24网段通信。
<DeviceB> display ip routing-table 120.2.0.0 24 verbose
Summary Count : 2
Destination: 120.2.0.0/24
Protocol: BGP Process ID: 0
SubProtID: 0x1 Age: 00h00m18s
Cost: 0 Preference: 100
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 300
NibID: 0x15000001 LastAs: 300
AttrID: 0x1 Neighbor: 10.2.0.101
Flags: 0x10060 OrigNextHop: 10.2.0.101
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
Destination: 120.2.0.0/24
Protocol: OSPF Process ID: 1
SubProtID: 0x8 Age: 00h00m18s
Cost: 1 Preference: 150
Tag: 1 State: Inactive Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NibID: 0x13000001 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x41 OrigNextHop: 192.168.0.102
Label: NULL RealNextHop: 192.168.0.102
BkLabel: NULL BkNextHop: N/A
Tunnel ID: Invalid Interface: Ten-GigabitEthernet3/1/2
BkTunnel ID: Invalid BkInterface: N/A
· Device A:
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 120.1.0.1 255.255.255.0
#
bgp 200
router id 1.1.1.1
peer 120.1.0.2 as-number 200
#
address-family ipv4 unicast
network 120.1.0.0 255.255.255.0
peer 120.1.0.2 enable
#
· Device B:
#
ospf 1
import-route direct
area 0.0.0.0
network 10.1.0.0 0.0.0.255
network 192.168.0.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 192.168.0.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 120.1.0.2 255.255.255.0
#
bgp 100
router id 2.2.2.2
peer 10.2.0.101 as-number 100
peer 10.2.0.101 bfd
peer 13.1.1.101 as-number 100
peer 120.1.0.1 as-number 200
#
address-family ipv4 unicast
preference 255 100 130
peer 10.2.0.101 enable
peer 10.2.0.101 next-hop-local
peer 10.2.0.101 route-policy local-pre export
peer 13.1.1.101 enable
peer 13.1.1.101 next-hop-local
peer 120.1.0.1 enable
#
route-policy local-pre permit node 10
if-match ip address acl 2000
apply local-preference 200
#
acl basic 2000
rule 0 permit source 120.1.0.0 0.0.0.255
#
· Device C:
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.0.255
network 10.2.0.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.1.0.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 10.2.0.102 255.255.255.0
#
· Device D
#
ospf 1
import-route direct
area 0.0.0.0
network 10.2.0.0 0.0.0.255
network 13.1.1.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 10.2.0.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.101 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 120.1.0.2 255.255.255.0
#
bgp 100
router id 4.4.4.4
peer 10.1.0.101 as-number 100
peer 10.1.0.101 bfd
peer 120.2.0.1 as-number 300
peer 192.168.0.101 as-number 100
#
address-family ipv4 unicast
preference 255 100 130
peer 10.1.0.101 enable
peer 10.1.0.101 next-hop-local
peer 10.1.0.101 route-policy local-pre export
peer 192.168.0.101 enable
peer 192.168.0.101 next-hop-local
peer 120.2.0.1 enable
#
acl basic 2000
rule 0 permit source 120.2.0.0 0.0.0.255
#
· Device E:
#
ospf 1
area 0.0.0.0
network 13.1.1.0 0.0.0.255
network 192.168.0.0 0.0.0.255
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 192.168.0.102 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 13.1.1.102 255.255.255.0
#
· Device F:
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 120.2.0.1 255.255.255.0
#
bgp 300
router id 6.6.6.6
peer 120.2.0.2 as-number 100
#
address-family ipv4 unicast
network 120.2.0.0 255.255.255.0
peer 120.2.0.2 enable
#
某公司内部网络如图8-1所示,从Device A到Device C有两条转发路径:Link A和Link B。下一跳分别为Device B和Device C。Link A为直连链路,Link B为非直连链路。已知Device C不支持BFD功能,公司希望使用策略路由与BFD联动技术,实现源IP为40.0.0.2的报文优先选择Link B,当Device A和Device B的链路出现故障(如链路down)时,Device A能快速感知,并将流量切换到Link A的链路上。
图8-1 策略路由与BFD联动配置组网图
· 由于需要两端设备均支持BFD,才能够使用控制报文方式,本例中Device C不支持BFD,在Device A上配置的BFD功能仅能使用echo报文方式。
· echo报文方式下必须配置echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将echo报文的源IP地址配置为属于该设备任何一个接口所在网段,避免对端发送大量的ICMP重定向报文造成网络拥塞。
本举例是在R7607版本上进行配置和验证的。
(1) 配置Device A各接口的IP地址
<DeviceA> system-view
[DeviceA] interface Ten-GigabitEthernet 3/1/2
[DeviceA-Ten-GigabitEthernet3/1/2] ip address 40.0.0.1 24
[DeviceA-Ten-GigabitEthernet3/1/2] quit
(2) 请参考以上方法配置图8-1中其它接口的IP地址,配置步骤这里省略
(1) 配置Device A
# 配置Device A到Device C 50.0.0.0网段的静态路由。
[DeviceA] ip route-static 50.0.0.0 24 ten-gigabitEthernet 3/1/1 13.13.13.2
(2) 配置Device B
# 配置Device B到Device C 50.0.0.0网段的静态路由。
[DeviceB] ip route-static 50.0.0.0 24 ten-gigabitEthernet 3/1/2 24.24.24.4
# 配置匹配源IP地址为40.0.0.2的IP报文的ACL规则。
[DeviceA] acl advanced 3010
[DeviceA-acl-ipv4-adv-3010] rule 0 permit ip source 40.0.0.2 0
[DeviceA-acl-ipv4-adv-3010] quit
# 配置策略路由aaa,使满足ACL规则报文的下一跳为12.12.12.2,并与track 11绑定。
[DeviceA] policy-based-route aaa permit node 5
[DeviceA-pbr-aaa-5] if-match acl 3010
[DeviceA-pbr-aaa-5] apply next-hop 12.12.12.2 track 11
[DeviceA-pbr-aaa-5] quit
# 在接口上应用路由策略aaa。
[DeviceA] interface ten-gigabitEthernet 3/1/2
[DeviceA-Ten-GigabitEthernet3/1/2] ip policy-based-route aaa
[DeviceA-Ten-GigabitEthernet3/1/2] quit
(1) 配置Device A
# 策略路由支持的BFD会话方式为echo报文方式,该方式下必须配置BFD echo报文的源IP地址。IP地址可以任意指定,不需要与实际接口地址对应。建议不要将BFD echo报文的源IP地址配置为属于该设备任何一个接口所在网段。
[DeviceA] bfd echo-source-ip 3.3.3.3
# 配置发送和接收单跳BFD控制报文的最小时间间隔都为100ms,单跳BFD检测时间倍数为3。
[DeviceA] interface ten-gigabitEthernet 3/1/3
[DeviceA-Ten-GigabitEthernet3/1/3] bfd min-echo-receive-interval 100
[DeviceA-Ten-GigabitEthernet3/1/3] bfd detect-multiplier 3
[DeviceA-Ten-GigabitEthernet3/1/3] quit
[DeviceA] track 11 bfd echo interface ten-GigabitEthernet 3/1/3 remote ip 12.12.12.2 local ip 12.12.12.1
# 查看Device A上源地址为40.0.0.0网段的流量,可以看到该网段当前流量优先从Ten-GigabitEthernet3/1/3接口(即Link B)转发出去。
<DeviceA> reset counters interface
<DeviceA> display counters outbound interface
Interface Total (pkts) Broadcast (pkts) Multicast (pkts) Err (pkts)
XGE3/1/1 0 0 0 0
XGE3/1/2 0 0 0 0
XGE3/1/3 585414 0 0 0
XGE3/1/4 0 0 0 0
XGE3/1/5 0 0 0 0
XGE3/1/6 0 0 0 0
# 查看BFD会话信息,显示BFD会话已被创建,且状态为Up。
[DeviceA] display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Echo Mode:
Local Discr: 2049
Source IP: 12.12.12.1 Destination IP: 12.12.12.2
Session State: Up Interface: Ten-GigabitEthernet3/1/3
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 128234 Tx Count: 371950
Connect Type: Direct Running Up for: 00:01:04
Detect Mode: Async Chassis/Slot: 1/0
Protocol: TRACK
Diag Info: No Diagnostic
# 当Device A和Device B间链路故障后,BFD会话Down。
%Dec 10 16:39:46:210 2017 DeviceA BFD/5/BFD_CHANGE_FSM: -MDC=1; Sess[12.12.12.1/
12.12.12.2, LD/RD:2049/2049, Interface: Ten-GigabitEthernet3/1/3, SessType:Echo, LinkType:INET] , S
ta: UP-> DOWN, Diag: 1
%Dec 10 16:39:47:342 2017 DeviceA IFNET/3/PHY_UPDOWN: -MDC=1; Ten-GigabitEtherne
T3/1/3 link status is down.
%Dec 10 16:39:47:343 2017 DeviceA IFNET/5/LINK_UPDOWN: -MDC=1; Line protocol on
the interface Ten-GigabitEthernet3/1/3 is down.
%Dec 10 16:39:47:343 2017 DeviceA IFNET/3/PHY_UPDOWN: -MDC=1; Ten-GigabitEthernet3/1/3
link status is down.
# 清除流量后重新查看Device A上源地址为40.0.0.0网段的流量,可以看到当前流量从Ten-GigabitEthernet3/1/1接口(即Link A)转发出去。
<DeviceA> reset counters interface
<DeviceA> display counters outbound interface
Interface Total (pkts) Broadcast (pkts) Multicast (pkts) Err (pkts)
XGE3/1/1 863764 0 0 0
XGE3/1/2 0 0 0 0
XGE3/1/3 0 0 0 0
XGE3/1/4 0 0 0 0
XGE3/1/5 0 0 0 0
XGE3/1/6 0 0 0 0
· Device A
#
bfd echo-source-ip 3.3.3.3
#
policy-based-route aaa permit node 5
if-match acl 3010
apply next-hop 12.12.12.2 track 11
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 13.13.13.1 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 40.0.0.1 255.255.255.0
ip policy-based-route aaa
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 12.12.12.1 255.255.255.0
bfd min-echo-receive-interval 10
bfd detect-multiplier 3
#
ip route-static 50.0.0.0 24 Ten-GigabitEthernet3/1/1 13.13.13.2
#
ip local policy-based-route aaa
#
acl advanced 3010
rule 0 permit ip source 40.0.0.2 0
#
track 11 bfd echo interface Ten-GigabitEthernet3/1/3 remote ip 12.12.12.2 local ip 12.
12.12.1
#
· Device B
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 12.12.12.2 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 24.24.24.2 255.255.255.0
#
ip route-static 50.0.0.0 24 Ten-GigabitEthernet3/1/2 24.24.24.4
· Device C
#
interface Ten-GigabitEthernet3/1/1
port link-mode route
ip address 13.13.13.2 255.255.255.0
#
interface Ten-GigabitEthernet3/1/2
port link-mode route
ip address 50.0.0.1 255.255.255.0
#
interface Ten-GigabitEthernet3/1/3
port link-mode route
ip address 24.24.24.4 255.255.255.0
#
如图9-1所示,Device A和Device B通过三层以太网接口GigabitEthernet3/1/1相互连接。
现要求实现以下需求:在Device A和Device B上配置BFD检测三层接口功能,当Device A与Device B之间出现故障时,BFD能够快速发现并将接口置为Down状态,使上层协议快速感知,确保数据流量不再从该三层接口上转发。
图9-1 BFD单跳检测三层链路配置组网图
本举例是在R7607版本上进行配置和验证的。
# Device A各接口的IP地址。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 3/1/1
[DeviceA-GigabitEthernet3/1/1] ip address 10.1.1.1 24
[DeviceA-GigabitEthernet3/1/1] quit
# 配置BFD。
[DeviceA] bfd session init-mode active
[DeviceA] interface gigabitethernet 3/1/1
[DeviceA-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceA-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceA-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-GigabitEthernet3/1/1] bfd detect-interface source-ip 10.1.1.1
[DeviceA-GigabitEthernet3/1/1] quit
# Device B各接口的IP地址。
<DeviceB> system-view
[DeviceB] interface gigabitethernet 3/1/1
[DeviceB-GigabitEthernet3/1/1] ip address 10.1.1.2 24
[DeviceB-GigabitEthernet3/1/1] quit
# 配置BFD。
[DeviceB] bfd session init-mode active
[DeviceB] interface gigabitethernet 3/1/1
[DeviceB-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceB-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceB-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceB-GigabitEthernet3/1/1] bfd detect-interface source-ip 10.1.1.2
[DeviceB-GigabitEthernet3/1/1] quit
(1) Device A和Device B设备及之间的链路均正常工作时
# 查看Device A的BFD会话。
<DeviceA> display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1537 Remote Discr: 1537
Source IP: 10.1.1.1 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 280 Tx Count: 367
Connect Type: Direct Running Up for: 00:00:28
Hold Time: 276ms Auth mode: None
Detect Mode: Async Slot: 1
Protocol: Interface
Diag Info: No Diagnostic
# 查看Device B的BFD会话。
<DeviceB> display bfd session verbose
Total Session Num: 1 Up Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1537 Remote Discr: 1537
Source IP: 10.1.1.2 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 143 Tx Count: 145
Connect Type: Direct Running Up for: 00:00:14
Hold Time: 251ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
以上显示信息表示Device A和Device B用BFD协议检测本设备GigabitEthernet3/1/1接口及链路状态,报文目的地址固定为224.0.0.184。
(2) Device A的GigabitEthernet3/1/1或Device A与Device B之间的链路Down时
<DeviceB> %Dec 19 11:25:47:528 2017 DeviceB BFD/5/BFD_CHANG
E_FSM: -MDC=1; Sess[10.1.1.2/224.0.0.184, LD/RD:1540/1540, Interface:GE3/1/1, Se
ssType:Ctrl, LinkType:INET], Sta: UP->DOWN, Diag: 1
%Dec 19 11:25:47:530 2017 DeviceB IFNET/5/LINK_UPDOWN: -MDC=1; Line protocol on
the interface GigabitEthernet3/1/1 is down.
%Dec 19 11:25:49:162 2017 DeviceB IFNET/3/PHY_UPDOWN: -MDC=1; GigabitEthernet3/0
/1 link status is down.
# 查看Device B的BFD会话。
<DeviceB> display bfd session verbose
Total Session Num: 1 Up Session Num: 0 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1537 Remote Discr: 0
Source IP: 10.1.1.2 Destination IP: 224.0.0.184
Session State: Down Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 3123 Tx Count: 3133
Connect Type: Direct Running Up for: 00:00:00
Hold Time: 0ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: Control Detection Time Expired
以上显示信息表示当Device B上BFD协议监视的端口或与此端口相连的链路down时,立即将BFD状态置为Down,并通知端口模块将端口的链路层状态置为Down,以便上层协议及时发现,不再将流量从此接口上通过。
· Device A:
#
bfd session init-mode active
#
interface GigabitEthernet3/1/1
port link-mode route
ip address 10.1.1.1 255.255.255.0
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 10.1.1.1
#
· Device B:
#
bfd session init-mode active
#
interface GigabitEthernet3/1/1
port link-mode route
ip address 10.1.1.2 255.255.255.0
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 10.1.1.2
#
如图10-1所示,Device A和Device B通过三层以太网接口GigabitEthernet3/1/1~GigabitEthernet3/1/3相互连接。
现要求实现以下需求:
· 在Device A和Device B上分别配置三层静态链路聚合组,将这些接口加入聚合组。
· 在静态链路聚合组的每个成员接口上分别配置BFD功能,当成员接口或成员链路出现故障(如链路Down)时,BFD能够快速发现并知会三层静态链路聚合组,使聚合组的数据流量不再从该成员接口上转发。
图10-1 BFD检测三层静态聚合组成员接口配置组网图
本举例是在R7607版本上进行配置和验证的。
· 聚合链路的两端应配置相同的聚合模式。
· 配置了下列功能的端口将不能加入三层聚合组:AC与交叉连接关联(请参见“MPLS配置指导”中的“MPLS L2VPN”)以及AC与VSI关联(请参见“MPLS配置指导”中的“VPLS”)。
# 创建三层聚合接口1,并为该接口配置IP地址和子网掩码。
<DeviceA> system-view
[DeviceA] interface route-aggregation 1
[DeviceA-Route-Aggregation1] ip address 192.168.1.1 24
[DeviceA-Route-Aggregation1] quit
# 分别将接口GigabitEthernet3/1/1至GigabitEthernet3/1/3加入到聚合组1中。
[DeviceA] interface gigabitethernet 3/1/1
[DeviceA-GigabitEthernet3/1/1] port link-aggregation group 1
[DeviceA-GigabitEthernet3/1/1] quit
[DeviceA] interface gigabitethernet 3/1/2
[DeviceA-GigabitEthernet3/1/2] port link-aggregation group 1
[DeviceA-GigabitEthernet3/1/2] quit
[DeviceA] interface gigabitethernet 3/1/3
[DeviceA-GigabitEthernet3/1/3] port link-aggregation group 1
[DeviceA-GigabitEthernet3/1/3] quit
# 配置BFD。
[DeviceA] bfd session init-mode active
[DeviceA] interface gigabitethernet 3/1/1
[DeviceA-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceA-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceA-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceA-GigabitEthernet3/1/1] bfd detect-interface source-ip 1.1.1.1
[DeviceA-GigabitEthernet3/1/1] quit
[DeviceA] interface gigabitethernet 3/1/2
[DeviceA-GigabitEthernet3/1/2] bfd min-transmit-interval 100
[DeviceA-GigabitEthernet3/1/2] bfd min-receive-interval 100
[DeviceA-GigabitEthernet3/1/2] bfd detect-multiplier 3
[DeviceA-GigabitEthernet3/1/2] bfd detect-interface source-ip 1.1.1.2
[DeviceA-GigabitEthernet3/1/2] quit
[DeviceA] interface gigabitethernet 3/1/3
[DeviceA-GigabitEthernet3/1/3] bfd min-transmit-interval 100
[DeviceA-GigabitEthernet3/1/3] bfd min-receive-interval 100
[DeviceA-GigabitEthernet3/1/3] bfd detect-multiplier 3
[DeviceA-GigabitEthernet3/1/3] bfd detect-interface source-ip 1.1.1.3
[DeviceA-GigabitEthernet3/1/3] quit
# 创建三层聚合接口1,并为该接口配置IP地址和子网掩码。
<DeviceB> system-view
[DeviceB] interface route-aggregation 1
[DeviceB-Route-Aggregation1] ip address 192.168.1.2 24
[DeviceB-Route-Aggregation1] quit
# 分别将接口GigabitEthernet3/1/1至GigabitEthernet3/1/3加入到聚合组1中。
[DeviceB] interface gigabitethernet 3/1/1
[DeviceB-GigabitEthernet3/1/1] port link-aggregation group 1
[DeviceB-GigabitEthernet3/1/1] quit
[DeviceB] interface gigabitethernet 3/1/2
[DeviceB-GigabitEthernet3/1/2] port link-aggregation group 1
[DeviceB-GigabitEthernet3/1/2] quit
[DeviceB] interface gigabitethernet 3/1/3
[DeviceB-GigabitEthernet3/1/3] port link-aggregation group 1
[DeviceB-GigabitEthernet3/1/3] quit
# 配置BFD。
[DeviceB] bfd session init-mode active
[DeviceB] interface gigabitethernet 3/1/1
[DeviceB-GigabitEthernet3/1/1] bfd min-transmit-interval 100
[DeviceB-GigabitEthernet3/1/1] bfd min-receive-interval 100
[DeviceB-GigabitEthernet3/1/1] bfd detect-multiplier 3
[DeviceB-GigabitEthernet3/1/1] bfd detect-interface source-ip 2.1.1.1
[DeviceB-GigabitEthernet3/1/1] quit
[DeviceB] interface gigabitethernet 3/1/2
[DeviceB-GigabitEthernet3/1/2] bfd min-transmit-interval 100
[DeviceB-GigabitEthernet3/1/2] bfd min-receive-interval 100
[DeviceB-GigabitEthernet3/1/2] bfd detect-multiplier 3
[DeviceB-GigabitEthernet3/1/2] bfd detect-interface source-ip 2.1.1.2
[DeviceB-GigabitEthernet3/1/2] quit
[DeviceB] interface gigabitethernet 3/1/3
[DeviceB-GigabitEthernet3/1/3] bfd min-transmit-interval 100
[DeviceB-GigabitEthernet3/1/3] bfd min-receive-interval 100
[DeviceB-GigabitEthernet3/1/3] bfd detect-multiplier 3
[DeviceB-GigabitEthernet3/1/3] bfd detect-interface source-ip 2.1.1.3
[DeviceB-GigabitEthernet3/1/3] quit
(1) Device A和Device B设备及之间的链路均正常工作时
# 查看Device A的BFD会话。
<DeviceA> display bfd session verbose
Total Session Num: 3 Up Session Num: 3 Init Mode: Passive
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1538 Remote Discr: 1538
Source IP: 1.1.1.3 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/3
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 892 Tx Count: 890
Connect Type: Direct Running Up for: 00:01:29
Hold Time: 299ms Auth mode: None
Detect Mode: Async Slot: 1
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1539 Remote Discr: 1539
Source IP: 1.1.1.2 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/2
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 599 Tx Count: 598
Connect Type: Direct Running Up for: 00:01:00
Hold Time: 290ms Auth mode: None
Detect Mode: Async Slot: 1
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1540 Remote Discr: 1540
Source IP: 1.1.1.1 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 443 Tx Count: 442
Connect Type: Direct Running Up for: 00:00:44
Hold Time: 282ms Auth mode: None
Detect Mode: Async Slot: 1
Protocol: Interface
Diag Info: No Diagnostic
# 查看Device B的BFD会话。
<DeviceB> display bfd session verbose
Total Session Num: 3 Up Session Num: 3 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1538 Remote Discr: 1538
Source IP: 2.1.1.3 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/3
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 2626 Tx Count: 2829
Connect Type: Direct Running Up for: 00:04:22
Hold Time: 297ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1539 Remote Discr: 1539
Source IP: 2.1.1.2 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/2
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 2333 Tx Count: 2543
Connect Type: Direct Running Up for: 00:03:53
Hold Time: 296ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1540 Remote Discr: 1540
Source IP: 2.1.1.1 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 2786 Tx Count: 2789
Connect Type: Direct Running Up for: 00:03:37
Hold Time: 297ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
以上显示信息表示Device A和Device B用BFD协议检测本设备GigabitEthernet3/1/1、GigabitEthernet3/1/2和GigabitEthernet3/1/3接口及链路状态,报文目的地址固定为224.0.0.184。
# 查看Device A接口上的数据流量。
<DeviceA> display counters inbound interface
Interface Total (pkts) Broadcast (pkts) Multicast (pkts) Err (pkts)
GE3/1/1 12691 21 12398 0
GE3/1/2 11551 0 11551 0
GE3/1/3 11837 0 11837 0
# 查看Device B接口上的数据流量。
<DeviceB> display counters inbound interface
Interface Total (pkts) Broadcast (pkts) Multicast (pkts) Err (pkts)
GE3/1/1 11330 16 11028 0
GE3/1/2 10386 0 10386 0
GE3/1/3 10853 0 10853 0
以上显示信息表示Device A和Device B上静态聚合组1中各端口都能正常转发流量。
# 查看Device B上所有聚合组的详细信息。
<DeviceB>display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port Status: S -- Selected, U -- Unselected
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Route-Aggregation1
Aggregation Mode: Static
Loadsharing Type: Shar
Port Status Priority Oper-Key
--------------------------------------------------------------------------------
GE3/1/1 S 32768 1
GE3/1/2 S 32768 1
GE3/1/3 S 32768 1
以上显示信息表示静态聚合组中,GigabitEthernet3/1/1~ GigabitEthernet3/1/3都是选中状态,流量会从这些接口上通过。
(2) Device A的GigabitEthernet3/1/1端口故障或Device A与DeviceB之间的链路Down时
<DeviceB>%Dec 19 11:25:47:528 2017 DeviceB BFD/5/BFD_CHANG
E_FSM: -MDC=1; Sess[2.1.1.1/224.0.0.184, LD/RD:1540/1540, Interface:GE3/1/1, Se
ssType:Ctrl, LinkType:INET], Sta: UP->DOWN, Diag: 1
%Dec 19 11:25:47:530 2017 DeviceB IFNET/5/LINK_UPDOWN: -MDC=1; Line protocol on
the interface GigabitEthernet3/1/1 is down.
%Dec 19 11:25:47:533 2017 DeviceB LAGG/6/LAGG_INACTIVE_PHYSTATE: -MDC=1; Member
port GE3/1/1 of aggregation group RAGG1 changed to the inactive state, because
the physical state of the port is down.
%Dec 19 11:25:49:162 2017 DeviceB IFNET/3/PHY_UPDOWN: -MDC=1; GigabitEthernet3/0
/1 link status is down.
# 查看Device B的BFD会话。
<DeviceB> display bfd session verbose
Total Session Num: 3 Up Session Num: 2 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 1538 Remote Discr: 1538
Source IP: 2.1.1.3 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/3
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 20987 Tx Count: 21191
Connect Type: Direct Running Up for: 00:34:59
Hold Time: 246ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1539 Remote Discr: 1539
Source IP: 2.1.1.2 Destination IP: 224.0.0.184
Session State: Up Interface: GigabitEthernet3/1/2
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 20694 Tx Count: 20905
Connect Type: Direct Running Up for: 00:34:30
Hold Time: 244ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: No Diagnostic
Local Discr: 1540 Remote Discr: 0
Source IP: 2.1.1.1 Destination IP: 224.0.0.184
Session State: Down Interface: GigabitEthernet3/1/1
Min Tx Inter: 100ms Act Tx Inter: 100ms
Min Rx Inter: 100ms Detect Inter: 300ms
Rx Count: 16323 Tx Count: 16816
Connect Type: Direct Running Up for: 00:00:00
Hold Time: 0ms Auth mode: None
Detect Mode: Async Slot: 0
Protocol: Interface
Diag Info: Control Detection Time Expired
# 查看Device B接口上的数据流量。
<DeviceB> reset counters interface
<DeviceB> display counters inbound interface
Interface Total (pkts) Broadcast (pkts) Multicast (pkts) Err (pkts)
GE3/1/1 0 0 0 0
GE3/1/2 185 0 5 0
GE3/1/3 185 0 5 0
# 查看Device B上所有聚合组的详细信息。
<DeviceB>display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port Status: S -- Selected, U -- Unselected
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Route-Aggregation1
Aggregation Mode: Static
Loadsharing Type: Shar
Port Status Priority Oper-Key
--------------------------------------------------------------------------------
GE3/1/1 U 32768 1
GE3/1/2 S 32768 1
GE3/1/3 S 32768 1
以上显示信息表示当Device B上BFD协议监视到Device A的GigabitEthernet3/1/1端口down时,立即将BFD状态置为Down,并通知端口模块将端口的链路层状态置为Down。静态聚合组中,GigabitEthernet3/1/1不再是选中状态,流量不会再从此接口上通过。
· Device A:
#
interface Route-Aggregation1
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet3/1/1
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 1.1.1.1
port link-aggregation group 1
#
interface GigabitEthernet3/1/2
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 1.1.1.2
port link-aggregation group 1
#
interface GigabitEthernet3/1/3
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 1.1.1.3
port link-aggregation group 1
#
· Device B:
#
interface Route-Aggregation1
ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet3/1/1
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 2.1.1.1
port link-aggregation group 1
#
interface GigabitEthernet3/1/2
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 2.1.1.2
port link-aggregation group 1
#
interface GigabitEthernet3/1/3
port link-mode route
bfd min-transmit-interval 100
bfd min-receive-interval 100
bfd detect-multiplier 3
bfd detect-interface source-ip 2.1.1.3
port link-aggregation group 1
#
· H3C SR6600-F 路由器 可靠性配置指导-R7607
· H3C SR6600-F 路由器 可靠性命令参考-R7607
· H3C SR6600-F 路由器 二层技术-以太网交换配置指导-R7607
· H3C SR6600-F 路由器 二层技术-以太网交换命令参考-R7607
· H3C SR6600-F 路由器 三层技术-IP路由配置指导-R7607
· H3C SR6600-F 路由器 三层技术-IP路由命令参考-R7607
· H3C SR6600-F 路由器 MPLS配置指导-R7607
· H3C SR6600-F 路由器 MPLS命令参考-R7607
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!