78-MSR系列路由器与Cisco设备BFD互通的配置举例
本章节下载: 78-MSR系列路由器与Cisco设备BFD互通的配置举例 (153.6 KB)
MSR系列路由器与Cisco设备BFD互通的配置举例
Copyright © 2014 杭州华三通信技术有限公司 版权所有,保留一切权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部, 并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。 |
目 录
本文主要介绍MSR与Cisco设备BFD互通配置。
本文档不严格与具体软、硬件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文档假设您已了解BFD、OSPF和BGP特性。
MSR与Cisco设备之间运行OSPF路由协议,并使能OSPF与BFD联动,当BFD检测到链路故障时,本地OSPF进程将中断与对端的OSPF邻居关系。
图1 BFD联动配置组网图
为了使能BFD,配置OSPF与BFD联动,并根据实际需要配置BFD参数。
H3C版本:
本举例是在Release 2207P14版本上进行配置和验证的。
CISCO版本:
本举例是在RELEASE SOFTWARE (fc2)版本上进行配置和验证的。
· 配置BFD建立会话时必须至少有一方的会话模式初始化设置为主动模式。缺省情况下,MSR设备的会话模式初始工作在主动模式。
· 通过控制方式建立BFD会话时,注意两端的参数设置是否适配:MSR设备工作在控制方式时,可以配置发送BFD控制报文的最小时间间隔的最小值为200ms,可以配置的接收BFD控制报文的最小时间间隔的最小值为200ms;而Cisco 这两个时间间隔最小值可以配置为50ms。
# 配置Loopback接口及接口地址。
<H3C> system-view
[H3C] interface LoopBack0
[H3C-LoopBack0] ip address 30.20.1.1 255.255.255.255
[H3C-LoopBack0] quit
# 配置与Cisco相连的接口GE0/1的IP地址和描述信息。
[H3C] interface GigabitEthernet0/1
[H3C-GigabitEthernet0/1] description to-cisco
[H3C-GigabitEthernet0/1] ip address 25.4.1.1 255.255.255.0
[H3C-GigabitEthernet0/1] quit
# 配置OSPF,并使能Loopback接口和GE0/1接口所在网段。
[H3C] ospf 1
[H3C-ospf-1] area 0.0.0.0
[H3C-ospf-1-area-0.0.0.0] network 25.4.1.0 0.0.0.255
[H3C-ospf-1-area-0.0.0.0] network 30.20.1.1 0.0.0.0
[H3C-ospf-1-area-0.0.0.0] quit
[H3C-ospf-1] quit
# 在G0/1接口下配置OSPF和BFD联动。
[H3C] interface GigabitEthernet0/1
[H3C-GigabitEthernet0/1] ospf bfd enable
# 在G0/1接口下配置发送BFD控制报文的最小时间间隔为200ms。
[H3C-GigabitEthernet0/1] bfd min-transmit-interval 200
# 在G0/1接口下配置接收BFD控制报文的最小时间间隔为200ms。
[H3C-GigabitEthernet0/1] bfd min-receive-interval 200
# 在G0/1接口下配置检测时间倍数。
[H3C-GigabitEthernet0/1] bfd detect-multiplier 3
说明:这里配置接收和发送BFD控制报文的间隔为200ms,检测时间倍数为3;实际应用时可以根据需要进行相应的参数配置。
# 配置接口和相关接口的IP地址
cisco#configure terminal
cisco(config)# interface LoopBack0
cisco(config-if)#ip address 48.4.1.1 255.255.255.255
cisco(config-if)#interface fastethernet0
cisco(config-if)#ip address 25.4.1.2 255.255.255.0
cisco(config-if)#exit
# 配置OSPF路由协议,并使能Loopback0和fastethernet0所在的网段
cisco(config)#router ospf 1
cisco(config-router)#network 25.4.1.0 0.0.0.255 area 0
cisco(config-router)#network 48.4.1.0 0.0.0.255 area 0
cisco(config-if)#exit
# 使能IP CEF 功能:
cisco(config)#ip cef
# 在接口fastethernet0下使能OSPF与BFD联动,并配置BFD的发送间隔为200ms,最小接收间隔为200ms,检测时间倍数为3
cisco(config)#interface fastethernet 0
cisco(config-if)#ip ospf bfd
cisco(config-if)#bfd interval 200 min_rx 200 multiplier 3
(1) 在链路正常的情况下,可以看到MSR与Cisco之间建立了BFD的session,session的状态为up,session应用的协议类型为OSPF。
[H3C] display bfd session
Total Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
LD/RD SourceAddr DestAddr State Holdtime Interface
51/2 25.4.1.1 25.4.1.2 Up 600ms GE0/1
[H3C] display bfd session verbose
Total Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 51 Remote Discr: 2
Source IP: 25.4.1.1 Destination IP: 25.4.1.2
Session State: Up Interface: GigabitEthernet0/1
Min Trans Inter: 200ms Act Trans Inter: 200ms
Min Recv Inter: 200ms Act Detect Inter: 600ms
Recv Pkt Num: 2002 Send Pkt Num: 6637
Hold Time: 500ms Connect Type: Direct
Running Up for: 00:05:56 Auth mode: None
Protocol: OSPF
Diag Info: No Diagnostic
(2) MSR与Cisco可以互相学习到对端Loopback的网段地址
H3C侧:
[H3C] display ip routing-table
Routing Tables: Public
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost NextHop Interface
25.4.1.0/24 Direct 0 0 25.4.1.1 GE0/1
25.4.1.1/32 Direct 0 0 127.0.0.1 InLoop0
30.20.1.1/32 Direct 0 0 127.0.0.1 InLoop0
48.4.1.1/32 OSPF 10 2 25.4.1.2 GE0/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Cisco侧:
cisco#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
25.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 25.4.1.0/24 is directly connected, FastEthernet0
L 25.4.1.2/32 is directly connected, FastEthernet0
30.0.0.0/32 is subnetted, 1 subnets
O 30.20.1.1 [110/1] via 25.4.1.1, 00:01:46, FastEthernet0
48.0.0.0/32 is subnetted, 1 subnets
C 48.4.1.1 is directly connected, Loopback0
· H3C
#
interface LoopBack0
ip address 30.20.1.1 255.255.255.255
#
interface GigabitEthernet0/1
port link-mode route
description to-cisco
ip address 25.4.1.1 255.255.255.0
ospf bfd enable
bfd min-transmit-interval 200
bfd min-receive-interval 200
bfd detect-multiplier 3
#
ospf 1
area 0.0.0.0
network 25.4.1.0 0.0.0.255
network 30.20.1.1 0.0.0.0
#
· CISCO
interface Loopback0
ip address 48.4.1.1 255.255.255.255
!
interface FastEthernet 0
ip address 25.4.1.2 255.255.255.0
ip ospf bfd
bfd interval 200 min_rx 200 multiplier 3!
!
ip cef
!
router ospf 1
log-adjacency-changes
network 25.4.1.0 0.0.0.255 area 0
network 48.4.1.0 0.0.0.255 area 0
!
组网图如图1,MSR与Cisco设备之间运行BGP路由协议,并使能BGP与BFD联动,当BFD检测到链路故障时,本地BGP进程将中断与对端的BGP邻居关系。
为了使能BFD,配置BGP与BFD联动,并根据实际需要配置BFD参数。
本举例是在Release 2207P14版本上进行配置和验证的。
· BFD建立会话时必须至少有一方的会话模式初始化设置为主动模式。缺省情况下,MSR设备的会话模式初始工作在主动模式。
· 通过控制方式建立BFD会话时,注意两端的参数设置是否适配:MSR设备工作在控制方式时,可以配置发送BFD控制报文的最小时间间隔的最小值为200ms,可以配置的接收BFD控制报文的最小时间间隔的最小值为200ms;而Cisco 这两个时间间隔最小值可以配置为50ms。
· Cisco 12.4及12.4以后的版本才支持BFD与BGP联动,版本较低的Cisco设备可能无法在接口上启动BFD。
# 配置与Cisco相连的接口的IP地址和描述信息。
<H3C> system-view
[H3C] interface GigabitEthernet0/1
[H3C-GigabitEthernet0/1] description to-cisco
[H3C-GigabitEthernet0/1] ip address 25.4.1.1 255.255.255.0
[H3C-GigabitEthernet0/1] quit
# 配置BGP。
[H3C] bgp 100
[H3C-bgp] peer 25.4.1.2 as-number 100
# 配置BGP和BFD联动。
[H3C-bgp] peer 25.4.1.2 bfd
[H3C-bgp] quit
# 在GE0/1接口下配置发送和接收BFD控制报文的最小时间间隔为200ms。
[H3C] interface GigabitEthernet 0/1
[H3C-GigabitEthernet0/1] bfd min-transmit-interval 200
# 在GE0/1接口下配置检测时间倍数。
[H3C-GigabitEthernet0/1] bfd detect-multiplier 3
# 配置接口和相关接口的IP地址
cisco#configure terminal
cisco(config-if)#interface FastEthernet 0
cisco(config-if)#ip address 25.4.1.2 255.255.255.0
# 配置BGP路由协议,并配置BGP的邻居
cisco#configure terminal
cisco(config)#router bgp 100
cisco(config-router)#neighbor 25.4.1.1 remote-as 100
# 配置BGP与BFD联动
cisco(config-router)#neighbor 25.4.1.1 fall-over bfd
# 使能IP CEF
cisco(config)#ip cef
# 在接口F0下使能BFD,并配置BFD的发送间隔为200ms,最小接收将为200ms,检测时间倍数为3
cisco(config)#interface FastEthernet 0
cisco(config-if)#bfd interval 200 min_rx 200 multiplier 3
(1) 在链路正常的情况下,可以看到MSR与Cisco之间建立了bfd的session,session的状态为up,session应用的协议类型为BGP,BGP邻居状态为Established.
H3C设备侧:
[H3C] display bfd session
Total Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
LD/RD SourceAddr DestAddr State Holdtime Interface
51/1 25.4.1.1 25.4.1.2 Up 600ms GE0/1
[H3C] display bfd session verbose
Total Session Num: 1 Init Mode: Active
IPv4 Session Working Under Ctrl Mode:
Local Discr: 51 Remote Discr: 1
Source IP: 25.4.1.1 Destination IP: 25.4.1.2
Session State: Up Interface: GigabitEthernet0/1
Min Trans Inter: 200ms Act Trans Inter: 200ms
Min Recv Inter: 200ms Act Detect Inter: 600ms
Recv Pkt Num: 13499 Send Pkt Num: 12593
Hold Time: 400ms Connect Type: Direct
Running Up for: 00:40:01 Auth mode: None
Protocol: BGP
Diag Info: No Diagnostic
[H3C] display bgp peer
BGP local router ID : 25.4.1.1
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Peer AS MsgRcvd MsgSent OutQ PrefRcv Up/Down State
25.4.1.2 100 51 43 0 0 00:42:38 Established
CISCO设备侧:
看到BFD邻居状态为UP ,BFD与BGP 联动,BGP邻居状态为Established。
查看BFD邻居信息:
cisco#show bfd neighbors
NeighAddr LD/RD RH/RS State Int
25.4.1.1 1/51 Up Up Fa0
cisco#show bfd neighbors client bgp
NeighAddr LD/RD RH/RS State Int
25.4.1.1 1/51 Up Up Fa0
(2) 查看BFD邻居的详细信息
可以看到BFD与BGP协议联动
cisco#show bfd neighbors details
NeighAddr LD/RD RH/RS State Int
25.4.1.1 1/51 Up Up Fa0
Session state is UP and not using echo function.
OurAddr: 25.4.1.2
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 200000, MinRxInt: 200000, Multiplier: 3
Received MinRxInt: 200000, Received Multiplier: 3
Holddown (hits): 416(0), Hello (hits): 200(14561)
Rx Count: 12951, Rx Interval (ms) min/max/avg: 176/300/200 last: 184 ms ago
Tx Count: 14562, Tx Interval (ms) min/max/avg: 152/300/177 last: 148 ms ago
Elapsed time watermarks: 0 0 (last: 0)
Registered protocols: BGP
Uptime: 00:43:10
Last packet: Version: 1 - Diagnostic: 0
State bit: Up - Demand bit: 0
Poll bit: 0 - Final bit: 0
Multiplier: 3 - Length: 24
My Discr.: 51 - Your Discr.: 1
Min tx interval: 200000 - Min rx interval: 200000
Min Echo interval: 0
(3) 查看BGP的邻居状态
可以看到BGP与BFD联动,BGP的邻居状态为Established。
cisco# show bgp all neighbors 25.4.1.1
For address family: IPv4 Unicast
BGP neighbor is 25.4.1.1, remote AS 100, internal link
Fall over configured for session
BFD is configured. Using BFD to detect fast fallover
BGP version 4, remote router ID 25.4.1.1
BGP state = Established, up for 01:00:24
Last read 00:00:25, last write 00:00:28, hold time is 180, keepalive interval
is 60 seconds
Neighbor sessions:
1 active, is not multisession capable
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Multisession Capability: advertised
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 1 0
Keepalives: 69 60
Route Refresh: 0 0
Total: 71 61
Default minimum time between advertisement runs is 0 seconds
Address tracking is enabled, the RIB does have a route to 25.4.1.1
Connections established 2; dropped 1
Last reset 03:28:18, due to Peer closed the session
Transport(tcp) path-mtu-discovery is enabled
Graceful-Restart is disabled
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 255
Local host: 25.4.1.2, Local port: 179
Foreign host: 25.4.1.1, Foreign port: 4452
Connection tableid (VRF): 0
Maximum output segment queue size: 50
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0x3D4FF184):
Timer Starts Wakeups Next
Retrans 70 0 0x0
TimeWait 0 0 0x0
AckHold 61 58 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
Linger 0 0 0x0
ProcessQ 0 0 0x0
iss: 3824353515 snduna: 3824354908 sndnxt: 3824354908 sndwnd: 8192
irs: 1119181122 rcvnxt: 1119182308 rcvwnd: 15199 delrcvwnd: 1185
SRTT: 300 ms, RTTO: 303 ms, RTV: 3 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: passive open, gen tcbs
Option Flags: nagle, path mtu capable
IP Precedence value : 6
Datagrams (max data segment is 1460 bytes):
Rcvd: 477 (out of order: 0), with data: 61, total data bytes: 1185
Sent: 476 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0
), with data: 71, total data bytes: 1392
Packets received in fast path: 0, fast processed: 0, slow path: 0
fast lock acquisition failures: 0, slow path: 0
For address family: VPNv4 Unicast
For address family: IPv4 Multicast
· H3C
#
interface GigabitEthernet0/1
port link-mode route
ip address 25.4.1.1 255.255.255.0
bfd min-transmit-interval 200
bfd min-receive-interval 200
bfd detect-multiplier 3
#
bgp 100
undo synchronization
peer 25.4.1.2 as-number 100
peer 25.4.1.2 bfd
#
· CISCO
!
interface FastEthernet 0
ip address 25.4.1.2 255.255.255.0
bfd interval 200 min_rx 200 multiplier 3
!
ip cef
!
router bgp 100
neighbor 25.4.1.1 remote-as 100
neighbor 25.4.1.1 fall-over bfd
!
· H3C MSR 系列路由器 命令参考(V5)-R2311
· H3C MSR 系列路由器 配置指导(V5)-R2311
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!