l
两台路由器Router A、Router B通过二层交换机互连,并且在双方接口上使能BFD应用,在路由器上运行OSPF,网络层相互可达。
l
在Router A和交换机之间的链路发生故障后,BFD能够快速检测并通告OSPF协议。
图1
BFD
for
OSPF配置举例组网图
l 配置OSPF基本功能
l 配置BFD for OSPF
#
配置OSPF基本功能
<RouterA>
system-view
[RouterA]
ospf
[RouterA-ospf-1]
area 0
[RouterA-ospf-1-area-0.0.0.0]
network 192.168.0.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0]
quit
[RouterA-ospf-1]
quit
[RouterA]
interface gigabitEthernet 3/1/1
[RouterA-GigabitEthernet3/1/1]
ospf bfd enable
#
配置各路由器接口及BFD参数
<RouterA>
system-view
[RouterA]
bfd session init-mode active
[RouterA]
interface gigabitEthernet 3/1/1
[RouterA-GigabitEthernet3/1/1]
ip address 192.168.0.102 24
[RouterA-GigabitEthernet3/1/1]
bfd min-transmit-interval 400
[RouterA-GigabitEthernet3/1/1]
bfd min-receive-interval 400
[RouterA-GigabitEthernet3/1/1]
bfd detect-multiplier 7
# 配置OSPF基本功能
<RouterB>
system-view
[RouterB]
ospf
[RouterB-ospf-1]
area 0
[RouterB-ospf-1-area-0.0.0.0]
network 192.168.0.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0]
quit
[RouterB-ospf-1]
quit
[RouterB]
interface gigabitEthernet 3/1/2
[RouterB-GigabitEthernet3/1/2]
ospf bfd enable
# 配置各路由器接口及BFD参数
<RouterB>
system-view
[RouterB]
bfd session init-mode active
[RouterB]
interface gigabitEthernet 3/1/2
[RouterB-GigabitEthernet3/1/2]
ip address 192.168.0.100 24
[RouterB-GigabitEthernet3/1/2]
bfd min-transmit-interval 400
[RouterB-GigabitEthernet3/1/2]
bfd min-receive-interval 400
[RouterB-GigabitEthernet3/1/2]
bfd detect-multiplier 7
可通过以下方式验证上述配置:
[RouterA]dis
bfd sess v
Total Session Num: 1
Init Mode: Active
Session Working Under Ctrl
Mode:
Local Discr: 2
Remote Discr: 3
Source IP:
192.168.0.102
Destination IP: 192.168.0.100
Session State: Up
Interface: GigabitEthernet3/1/1
Min Trans Inter: 400ms
Act Trans Inter: 400ms
Min Recv Inter: 400ms
Act Detect Inter: 2800ms
Establish Time: 272:15:44
Last Down Time: 272:15:44
Last Up Time: 272:15:45
Auth mode: None
Connect Type: Direct
Board Num: 3
Protocol: OSPF
Diag Info:
No Diagnostic
[RouterB]dis
bfd sess v
Total
Session Num: 1
Init Mode: Active
Session Working Under Ctrl
Mode:
Local Discr: 3
Remote Discr: 2
Source IP:
192.168.0.100
Destination IP: 192.168.0.102
Session State: Up
Interface: GigabitEthernet3/1/2
Min Trans Inter: 400ms
Act Trans Inter: 400ms
Min Recv Inter: 400ms
Act Detect Inter: 2400ms
Establish Time: 271:50:23
Last Down Time: 271:50:23
Last Up Time: 271:50:32
Auth mode: None
Connect Type: Direct
Board Num: 3
Protocol: OSPF
Diag Info:
No Diagnostic
配置文件
RouterA:
[RouterA]dis cur
#
version 5.20, Ess
3121
#
sysname RouterA
#
password-control
login-attempt 3 exceed lock-time 120
#
domain default enable
system
#
ipv6
#
telnet server
enable
#
xbar load-single
#
vlan
1
#
vlan
100
#
domain
system
access-limit
disable
state active
idle-cut disable
self-service-url
disable
#
interface
NULL0
#
interface
GigabitEthernet3/1/1
port link-mode
route
ip address 192.168.0.102
255.255.255.0
ospf bfd enable
bfd detect-multiplier
7
#
interface
GigabitEthernet3/1/5
port link-mode
route
shutdown
#
interface
GigabitEthernet3/1/8
port link-mode
route
#
interface
GigabitEthernet3/1/9
port link-mode
route
#
interface
GigabitEthernet3/1/10
port link-mode
route
shutdown
#
interface
GigabitEthernet3/1/2
port link-mode
bridge
shutdown
#
interface
GigabitEthernet3/1/3
port link-mode
bridge
#
interface
GigabitEthernet3/1/4
port link-mode
bridge
#
interface
GigabitEthernet3/1/6
port link-mode
bridge
#
interface
GigabitEthernet3/1/7
port link-mode
bridge
#
interface
M-Ethernet4/0/0
ip address 191.1.1.231
255.255.255.0
#
ospf
1
area 0.0.0.0
network 192.168.0.0
0.0.0.255
#
user-interface
con 0
user-interface
aux 0
authentication-mode
none
user privilege level
3
user-interface
vty 0 4
authentication-mode
none
user privilege level
3
#
return
RouterB:
[RouterB]dis cur
#
version 5.20, Ess
3121
#
sysname RouterB
#
password-control
login-attempt 3 exceed lock-time 120
#
domain default enable
system
#
ipv6
#
telnet server
enable
#
xbar load-single
#
bfd echo-source-ip
10.10.10.10
#
vlan
1
#
vlan
100
#
domain
system
access-limit
disable
state active
idle-cut disable
self-service-url
disable
#
interface
NULL0
#
interface
GigabitEthernet3/1/3
port link-mode
route
#
interface
GigabitEthernet3/1/4
port link-mode
route
#
interface
GigabitEthernet3/1/6
port link-mode
route
#
interface
GigabitEthernet3/1/2
port link-mode
route
ip address 192.168.0.100
255.255.255.0
ospf bfd enable
bfd detect-multiplier
7
#
interface
GigabitEthernet3/1/8
port link-mode
route
#
interface
GigabitEthernet3/1/9
port link-mode
route
#
interface
GigabitEthernet3/1/10
port link-mode
route
shutdown
#
interface
GigabitEthernet3/1/1
port link-mode
bridge
#
interface
GigabitEthernet3/1/2
port link-mode
bridge
#
interface
GigabitEthernet3/1/5
port link-mode
bridge
#
interface
M-Ethernet4/0/0
ip address 191.1.1.232
255.255.255.0
ospf trans-delay 23
#
ospf
1
area 0.0.0.0
network 192.168.0.0
0.0.0.255
#
user-interface
con 0
user-interface
aux 0
authentication-mode
none
user privilege level
3
user-interface
vty 0 4
authentication-mode
none
user privilege level
3
#
return