You are on page 1of 63

Contents

6 BFD Configuration
6.1 BFD Overview
6.2 BFD Features Supported by the S9300
6.3 Configuring Single-hop BFD
6.3.1 Establishing the Configuration Task
6.3.2 Enabling BFD Globally
6.3.3 (Optional) Setting the Multicast IP Address of BFD
6.3.4 Creating a BFD Session
6.3.5 Checking the Configuration
6.4 Configuring the Multi-Hop BFD
6.4.1 Establishing the Configuration Task
6.4.2 Enabling BFD Globally
6.4.3 Creating a BFD Session
6.4.4 Checking the Configuration
6.5 Configuring a BFD Session with Automatically Negotiated Discriminators
6.5.1 Establishing the Configuration Task
6.5.2 Enabling BFD Globally
6.5.3 Configuring a Static BFD Session with Automatically Negotiated Discriminators
6.5.4 Checking the Configuration
6.6 Adjusting BFD Parameters
6.6.1 Establishing the Configuration Task
6.6.2 Adjusting the BFD Detection Time
6.6.3 Adding the Description of a BFD Session
6.6.4 Configuring the BFD WTR
6.6.5 Setting the Priority of BFD Packets
6.6.6 Checking the Configuration
6.7 Configuring the Delay of a BFD Session to Go Up
6.7.1 Establishing the Configuration Task
6.7.2 Configuring the Delay of a BFD Session to Go Up
6.7.3 Checking the Configuration
6.8 Configuring the TTL Globally
6.8.1 Establishing the Configuration Task
6.8.2 Configuring the TTL Globally
6.8.3 Checking the Configuration
6.9 Configuring the Interval at Which Trap Messages Are Sent
6.9.1 Establishing the Configuration Task
6.9.2 Configuring the Interval at Which Trap Messages Are Sent
6.9.3 Checking the Configuration
6.10 Configuring Association Between a BFD Session and an Interface (Triggering the Physical Status of the Interface
Associated with the BFD Session to Become Down)
6.10.1 Establishing the Configuration Task
6.10.2 Configuring Association Between a BFD Session and an Interface
6.10.3 Checking the Configuration
6.11 Configuring Association Between BFD Sessions
6.11.1 Establishing the Configuration Task
6.11.2 Configuring Association Between BFD sessions
6.11.3 Checking the Configuration
6.12 Maintaining BFD
6.12.1 Clearing BFD Statistics
6.12.2 Debugging BFD
6.13 Configuration Examples
6.13.1 Example for Configuring Single-Hop BFD on a Layer 2 Interface
6.13.2 Example for Configuring Single-Hop BFD on a VLANIF Interface
6.13.3 Example for Configuring Multi-Hop BFD
6.13.4 Example for Associating the BFD Status with the Interface Status
6.13.5 Example for Configuring Association Between a BFD Session and an Interface
6.13.6 Example for Configuring Association Between the Status of BFD Sessions

6 BFD Configuration

A BFD session rapidly detects a link fault on a network.

 6.1 BFD Overview


BFD, a uniform detection mechanism for an entire network, rapidly detects faults and monitors the forwarding
and connectivity of links or IP routes of the network.

 6.2 BFD Features Supported by the S9300


This section describes the BFD features supported by the S9300.

 6.3 Configuring Single-hop BFD


A single-hop BFD session rapidly detects faults in direct links over a network.

 6.4 Configuring the Multi-Hop BFD


By configuring a multi-hop BFD session, you can fast detect and monitor multi-hop links of a network.

 6.5 Configuring a BFD Session with Automatically Negotiated Discriminators


A static BFD session with automatically negotiated discriminators is configured to check the interworking
between a device and another device on which a BFD session is dynamically established. The static BFD session
with automatically negotiated discriminators is applicable to static routes.

 6.6 Adjusting BFD Parameters


Adjusting BFD parameters enables a BFD session to check links on a network effectively and quickly.
 6.7 Configuring the Delay of a BFD Session to Go Up
In special scenarios, the delay of a BFD session to go Up is configured to prevent traffic loss as a route protocol
becomes Up later than an interface.

 6.8 Configuring the TTL Globally


Configuring the TTL globally helps you connect the current device and a device running an early version.

 6.9 Configuring the Interval at Which Trap Messages Are Sent


The interval at which trap messages are sent is set, helping a device to suppress BFD trap messages.

 6.10 Configuring Association Between a BFD Session and an Interface (Triggering the Physical Status of
the Interface Associated with the BFD Session to Become Down)
Association between a BFD session and an interface is applicable to the scenario where a CE is directly
connected to a PE. BFD is enabled on PEs and a BFD session is associated with an interface. When the BFD
session detects a link fault, the BFD module notifies the OAM management module on the local PE of the fault.
This triggers the physical status of the interface to become Down.

 6.11 Configuring Association Between BFD Sessions


After the association between BFD sessions is configured, the local BFD session can detect a fault and then
notify the OAM management module of the fault. The OAM management module sends fault information to the
associated BFD session. The associated BFD session then sends BFD packets carrying the fault information to
the OAM management module on the remote device. In this manner, the fault is notified to the remote device.

 6.12 Maintaining BFD


This section describes how to maintain BFD by deleting BFD statistics, and monitoring BFD operation.

 6.13 Configuration Examples


This section provides several configuration examples of BFD.

6.1 BFD Overview


BFD, a uniform detection mechanism for an entire network, rapidly detects faults and monitors the forwarding and
connectivity of links or IP routes of the network.
On a network, a link fault is detected in either of the following methods:
 Hardware detection signals, such as in the Synchronous Digital Hierarchy (SDH) alarm function, are used to
detect a link fault rapidly.
 If the preceding method is unavailable, the Hello mechanism of a routing protocol is used to detect a fault.
The following problems exist in the preceding methods:
 Hardware is used by only part of mediums to detect faults.
 The routing protocol-specific Hello mechanism takes more than 1 second to detect a fault. If data is forwarded
at gigabit rates, a large amount of data is dropped.
 On a small-scale Layer 3 network, if no routing protocol is deployed, the routing protocol-specific Hello
mechanism does not detect a fault. This means that a fault between the interconnected systems is hard to
locate.
BFD is developed to resolve the preceding problems.
BFD provides the following functions:
 Detects faults rapidly in paths between neighboring forwarding engines, with light loads and high speeds.
 Uses a single mechanism to monitor any medium and protocol layer in real time. In addition, the detection time
and costs are variable.
6.2 BFD Features Supported by the S9300
This section describes the BFD features supported by the S9300.
The S9300s send BFD control packets based on the negotiated period. If an S9300 does not receive the packet of the
peer within the detection time, the S9300 sets the BFD session in Down state. The upper-layer application can take
actions according to the status of the BFD session.

BFD Session Establishment Supported by the S9300


BFD uses the local discriminator and remote discriminator to differentiate multiple BFD sessions between the same
pair of systems. According to the difference in the modes of creating the local discriminator and the remote
discriminator, the S9300 supports the following BFD session types:
 Static BFD sessions with manually specified discriminators
 Static BFD sessions with automatically negotiated discriminators
 Dynamic BFD sessions triggered by a protocol
A dynamic BFD session triggered by a protocol is implemented as follows:
 The local discriminator is allocated automatically.
 The remote discriminator is learned by the local end.

NOTE:
Currently, on the S9300, OSPF, BGP, IS-IS, MPLS, MPLS LDP, RSVP-TE, PWE3, and PIM can dynamically trigger the establishment of
BFD sessions.

When the two ends of a BFD session create discriminators in different modes:
 If the discriminators on the local end are specified manually, the discriminators on the remote end must also be
specified manually.
 If you configure a static BFD session with automatically negotiated discriminators on the local end, you can
configure a static BFD session with automatically negotiated discriminators or configure a dynamic BFD
session on the peer end.
 If a static BFD session with automatically negotiated discriminators and a dynamic BFD session are configured
at the local end, the following principles are applicable:
 If the dynamic BFD session and static BFD session with automatically negotiated discriminators share the
same configurations (the source address, destination address, outbound interface, and VPN index), the two
BFD sessions coexist.
 If the dynamic BFD session named DYN_local discriminator is configured earlier than the static BFD
session with automatically negotiated discriminators, the name of the dynamic BFD session is changed to
the name of the static BFD session.
 The two BFD sessions use the smaller values of BFD parameters.

Single-Hop BFD
Single-hop BFD detects connectivity of the forwarding link between two directly connected devices.
Between the two systems detected by the single-hop BFD session, only one BFD session can be set up on a specified
interface enabled with a specified data protocol. Therefore, each BFD session is bound to an interface. On the S9300,
BFD sessions are bound to Layer 2 interfaces.
The S9300 provides single-hop BFD for the link fault between IS-IS peer nodes. By detecting the link fault between
IS-IS peer nodes, the S9300 fast reports the fault to IS-IS, triggering IS-IS fast convergence.

Multi-Hop BFD
Multi-hop BFD detects IP connectivity of paths between two non-directly-connected devices. These paths may span
multiple hops or overlap. Multi-hop BFD is often used to detect reachable routes between two devices.
The S9300 provides multi-hop BFD for static routes. Generally, static routes do not have the detection mechanism.
When a network fails, the administrator needs to check the static routes manually. You can use multi-hop BFD to
check the status of static routes. The RM module determines whether a static route is available according to the status
of the BFD session.

Association Between the BFD Session Status and the Interface Status
When a transmission device exists on a directly connected link, BFD can detect a fault faster than the detection
mechanism of the link protocol on the interface. The link protocol status of the trunk interface or the VLAN interface
depends on the link protocol status of member interfaces.
Therefore, to notify the BFD detection result to the application rapidly, each interface is added with an attribute in the
interface management module of the S9300, that is, the BFD status. The BFD status indicates the status of the BFD
session that is bound to the interface. The system determines the interface status according to the link status, protocol
status, and BFD status, and then notifies the interface status to the application.
The association between the BFD session status and the interface status means that the BFD session status in the
IFNET module is modified when the BFD session status changes. This function is valid for the single-hop BFD session
that is bound to an outbound interface and uses the default multicast address.
 After the BFD session is bound to an interface,
 When the BFD session goes Down, the status of the interface that is bound to the BFD session also goes
Down. The application on the interface is notified of the interface status change.
 When the BFD session status goes Up, the status of the interface that is bound to the BFD session also goes
Up.
This function aims to fast report BFD detection results to the application.

BFD for Static Routes


Static routes do not have a detection mechanism. When the network fails, the administrator needs to check the static
routes manually.
Through BFD for static routes, the BFD session can be used to detect the status of IPv4 static routes on a public
network. The RM module determines whether the static route is available according to the BFD session status.

NOTE:
For details on how to configure BFD for static routes, see Configuring BFD for IPv4 Static Routes on a Public Network in the Quidway
S9300 Terabit Routing Switch Configuration Guide - IP Routing.

BFD for Routing Protocols


BFD uses the local discriminator and remote discriminator to differentiate multiple BFD sessions between the same
pair of systems. IS-IS supports dynamic and static BFD sessions; BGP and OSPF support dynamic setup of BFD
sessions.
The BFD session dynamically triggered by a routing protocol is implemented as follows:
 The local discriminator is allocated automatically.
 The remote discriminator is learned by the local end.
When the neighbor relationship of a routing protocol is set up successfully, the routing protocol requests BFD to
establish a BFD session through the RM module. The neighbor relationship of the routing protocol then can be rapidly
detected. The detection parameters of the BFD session are negotiated by both ends through the routing protocol.
When a BFD session detects a fault, the BFD session becomes Down. BFD triggers route convergence through the RM
module.
When the neighbor is unreachable, the routing protocol requests BFD to delete the session through the RM module.

BFD for FRR


 BFD for LDP FRR
The S9300 uses BFD to check the protected interfaces and to trigger the LDP FRR switching.
 BFD for IP FRR and BFD for VPN FRR
On the S9300, IP FRR and VPN FRR are triggered after BFD reports detection faults to the upper-layer
application.
 BFD can provide reliability for MPLS-based applications, such as VPN FRR, TE FRR, and VLL FRR, to
protect services.

BFD for LSPs


BFD can detect faults of the data plane on LSPs.
When BFD detects data plane faults on the MPLS LSP, it has the following advantages:
 BFD works if only the IP route is reachable in the reverse direction.
 BFD detects faults fast.
 BFD supports fault detection for large-scale LSPs.
Currently, the S9300 supports BFD for the following LSPs:
 Static LSPs
For details on how to configure BFD for static LSPs, see the Quidway S9300 Terabit Routing
Switch Configuration Guide - MPLS.
 LDP LSPs
For details on how to configure BFD for LDP LSPs, see the Quidway S9300 Terabit Routing
Switch Configuration Guide - MPLS.
 MPLS TE tunnels
BFD can detect TE tunnels that use CR-Static and RAVP-TE as signaling protocols, and detect the primary or
standby LSP bound to the TE tunnel.
For details on how to configure BFD for MPLS TE tunnels, see the Quidway S9300 Terabit Routing
Switch Configuration Guide - MPLS.
BFD for PIM
The S9300 can dynamically create a BFD session between PIM neighbors to detect the status of the link between them.
When a fault occurs on the link, BFD notifies PIM of the fault.

NOTE:
For details on how to configure BFD for PIM, see the Quidway S9300 Terabit Routing Switch Configuration Guide - Multicast.

BFD for VRRP


BFD detects and monitors the connectivity of links or IP routes on a network and triggers the fast VRRP switchover.

BFD for PW
BFD can quickly detect faults on the PW between the local and remote PEs to support FRR on the VLL and reduce the
impact of link faults on the services. The S9300 can set up a static BFD session with manually configured
discriminators or a dynamic BFD session to detect faults on a PW.
The S9300 combines BFD and VCCV ping to detect the connectivity of the PW dynamically. In this manner,
the S9300 triggers fast switchover of the upper-layer services to protect them.

NOTE:
For details on how to configure BFD for PWs, see the Quidway S9300 Terabit Routing Switch Configuration Guide - VPN.

BFD for VSI PWs


On the network where VPLS convergence is performed, you can establish multiple service VSI PWs and bind them to
an mVSI PW. In this manner, if a BFD session is bound to the mVSI PW, the S9300 can monitor the service VSI by
only monitoring the status of the mVSI PW.

NOTE:
For details on how to configure BFD for VSI PWs, see the Quidway S9300 Terabit Routing Switch Configuration Guide - VPN.

Dynamically Changing Values of BFD Parameters


After a BFD session is set up, you can change the values of related parameters, such as the expected interval for
sending BFD packets, the minimum interval for receiving BFD packets, and local detection multiplier, without
affecting the status of the session.

6.3 Configuring Single-hop BFD


A single-hop BFD session rapidly detects faults in direct links over a network.

6.3.1 Establishing the Configuration Task


Before configuring a single-hop BFD session, familiarize yourself with the applicable environment, complete the pre-
configuration tasks, and obtain the required data. This can help you complete the configuration task quickly and
accurately.

Applicable Environment
To fast check directly-connected links, configure single-hop BFD.

Pre-configuration Tasks
Before configuring single-hop BFD, complete the following tasks:
 Connecting each interface correctly
 Configuring IP addresses for Layer 3 interfaces

Data Preparation
To configure single-hop BFD, you need the following data.

No. Data

1 BFD configuration name

2 Peer IP address, local interface type and number for the directly-connected link detected by BFD, and default
multicast address used by BFD if it checks the physical layer status of the link

3 BFD session parameters: local and remote discriminators

6.3.2 Enabling BFD Globally


Context
Do as follows on S9300s at both ends of the link to be detected.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally and the BFD view is displayed.


By default, BFD is disabled globally. Before configuring the BFD functions, you must enable BFD globally;
otherwise, the configuration fails.

6.3.3 (Optional) Setting the Multicast IP Address of BFD


Context
Do as follows on S9300s at both ends of the link to be detected.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

The BFD view is displayed.


3. Run:
default-ip-address ip-address

The multicast IP address of BFD is set.


To implement single-hop BFD on a Layer 2 forwarding link, BFD needs to use a multicast IP address. By
default, BFD uses the multicast IP address 224.0.0.184.

NOTE:
 If this multicast IP address is used by other protocols on the network, you must change the multicast IP address. The S9300s at
both ends of the BFD session must use the same multicast IP address.
 If multiple BFD sessions exist on a path, for example, Layer 3 interfaces are connected through Layer 2 switching devices that
support BFD, you must configure different default multicast IP addresses for the devices where different BFD sessions are
established. In this manner, BFD packets can be correctly forwarded.

6.3.4 Creating a BFD Session


Context
Do as follows on S9300s at both ends of the link to be detected.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run the following command as required.
 If the VLANIF interface and POS interface have an IP address, run:
bfd cfg-name bind peer-ip peer-ip [ vpn-instance vpn-instance-name ] [interface interface-
type interface-number ] [ source-ip source-ip ]
 When creating a single-hop BFD session for the first time, you must bind the single-hop BFD session
to the peer IP address and the local address. In addition, the configuration of the single-hop BFD
session cannot be changed after being created.
 When BFD configuration items are created, the system checks only the format of the IP address rather
than the correctness. A BFD session cannot be established if an incorrect peer IP address or source IP
address is bound.
 When BFD and URPF are used together, URPF checks the source IP address of the received BFD
packets. In this case, you need to specify the correct source IP address of BFD packets by setting
the source-ip parameter when binding a BFD session to prevent BFD packets from being discarded
incorrectly.
 For a Layer 2 interface, run:
bfd cfg-name bind peer-ip default-ip { interface interface-type interface-number | vsi vsi-name }[ sourc
e-ip source-ip ]
3. Set the discriminators.
 Run:
discriminator local discr-value

The local discriminator is set.


 Run:
discriminator remote discr-value

The remote discriminator is set.


4. When you set the discriminators, ensure that the local discriminator at the local end is the same as the remote
discriminator at the peer end; otherwise, the BFD session fails to be set up. After local and remote
discriminators are set successfully, they cannot be modified.

5. NOTE:
6. For the BFD sessions that use the default multicast IP address, the local and remote discriminators must be different.

7. Run:
commit

The configuration is committed.

6.3.5 Checking the Configuration


Procedure
 Run the display bfd configuration { all | static } [ for-vsi-pw | for-ip | for-lsp | for-pw | for-te ] [ verbose ]
command to check the configuration of BFD.
 Run the display bfd interface [ interface-type interface-number ] command to check information about the
interface where BFD is enabled.
 Run the display bfd session { all | static } [ for-ip | for-lsp | for-pw | for-te | for-vsi-pw ] [ verbose ]
command to check information about a BFD session.
 Run the display bfd statistics session { all | static } [ for-ip | for-lsp | for-pw | for-te | for-vsi-pw ] command
to check the statistics on a BFD session.

Example
Run the display bfd configuration command, and you can view the configuration of a BFD session.
<Quidway> display bfd configuration static name bfd1 verbose
--------------------------------------------------------------------------------
BFD Session Configuration Name : bfd1
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
BFD Bind Type : Interface(Vlanif511)
Bind Session Type : Static
Bind Peer IP Address : 11.1.1.2
Bind Interface : Vlanif110
TOS-EXP : 7 Local Detect Multi : 3
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
WTR Interval (ms) : - Process PST : Disable
Proc Interface Status : Disable
Bind Application : No Application Bind
Session Description : -
--------------------------------------------------------------------------------

Run the display bfd interface command, and you can view information about the BFD session on a specified
interface.
<Quidway> display bfd interface gigabitethernet 3/0/1GigabitEthernet 0/0/1
--------------------------------------------------------------------------------
Interface Name MIndex Sess-Count BFD-State
--------------------------------------------------------------------------------
GigabitEthernet3/0/1 1025 1 up
Run the display bfd session command, and you can view information about a BFD session.
<Quidway> display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
20 10 224.0.0.184 UP S_IP_IF GigabitEthernet3/0/1
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 0/1

Run the display bfd statistics session command, and you can view the statistics on a BFD session.
<Quidway> display bfd statistics session static for-ip
--------------------------------------------------------------------------------
Session MIndex : 4097 (One Hop) State : Init Name : 9to6
--------------------------------------------------------------------------------
Session Type : Static
Bind Type : IP
Local/Remote Discriminator : 20/10
Received Packets : 97
Send Packets : 314
Received Bad Packets : 169
Send Bad Packets : 0
Down Count : 32
ShortBreak Count : 0
Send Lsp Ping Count : 0
Dynamic Session Delete Count : 0
Create Time : 2007/10/14 16:48:13
Last Down Time : 2007/10/14 17:09:11
Total Time From Last DOWN : ---D:--H:--M:--S
Total Time From Create : 000D:00H:20M:59S
--------------------------------------------------------------------------------

Total Session Number : 1

6.4 Configuring the Multi-Hop BFD


By configuring a multi-hop BFD session, you can fast detect and monitor multi-hop links of a network.

6.4.1 Establishing the Configuration Task


Before configuring a multi-hop BFD session, familiarize yourself with the applicable environment and data
preparation.

Applicable Environment
To rapidly detect the faults occur during IP switch forwarding, configure the multi-hop BFD.

Pre-configuration Tasks
Before configuring the multi-hop BFD, complete the following tasks:
 Correctly connecting each interface and configuring IP addresses for them
 Configuring the routing protocol to ensure that the network layer is reachable

Data Preparation
To configure the multi-hop BFD, you need the following data.
No. Data

1 Remote IP address

2 BFD configuration name

3 BFD session parameters: local discriminator and remote discriminator

6.4.2 Enabling BFD Globally


You can perform related BFD configurations only after enabling BFD globally.

Context
Do as follows on the switch:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally and the BFD view is displayed.

6.4.3 Creating a BFD Session


Context
If Unicast Reverse Path Forwarding (URPF) is enabled on a device on the transmission path of BFD packets, this
device checks the source IP address of the BFD packets. In this case, you can specify the correct source IP address of
BFD packets by setting the source-ip parameter when creating a BFD session to prevent BFD packets from being
discarded.
Do as follows on S9300s at both ends of the link to be detected.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd cfg-name bind peer-ip peer-ip [ vpn-instance vpn-instance-name ] [ source-ip
source-ip ]

A BFD session is created.


 When creating a BFD session for the first time, you must bind the BFD session to the peer IP address. In
addition, the configuration of the BFD session cannot be changed after being created.
 When the BFD configuration items are created, the system checks only the format of the IP address rather
than the correctness. A BFD session cannot be established if an incorrect peer IP address or source IP
address is bound.
 When BFD and URPF are used together, URPF checks the source IP address of the received BFD
packets. In this case, you need to specify the correct source IP address of BFD packets by setting
the source-ip parameter when creating a BFD session to prevent BFD packets from being discarded
incorrectly.
3. Set the identifiers.
 Run:
discriminator local discr-value

The local discriminator is set.


 Run:
discriminator remote discr-value

The remote discriminator is set.

4. NOTE:
5. When you set the discriminators, ensure that the local discriminator at the local end is the same as the remote discriminator at the
peer end; otherwise, the BFD session fails to be set up.

6.4.4 Checking the Configuration


Procedure
 Run the display bfd configuration { all | static } [ for-vsi-pw | for-ip | for-lsp | for-pw | for-te ] [ verbose ]
and display bfd configuration { static name cfg-name | discriminator local-discr-value | dynamic | peer-
ip peer-ip [ vpn-instance vpn-name ] | static-auto } [ verbose ] commands to check the configuration of
BFD.
 Run the display bfd session { all | static } [ for-ip | for-lsp | for-pw | for-te | for-vsi-pw ] [ verbose ]
and display bfd session { dynamic | discriminator discr-value | peer-ip peer-ip [ vpn-instance vpn-name ]
| static-auto } [ verbose ] commands to check information about a BFD session.
 Run the display bfd statistics session { all | static } [ for-ip | for-lsp | for-pw | for-te | for-vsi-pw ]
and display bfd statistics session { dynamic | discriminator discr-value | peer-ip peer-ip [ vpn-
instance vpn-name ] | static-auto } commands to check the statistics on a BFD session.

Example
Run the display bfd configuration command, and you can view the configuration of a BFD session.
<Quidway> display bfd configuration static name bfd1 verbose
--------------------------------------------------------------------------------
BFD Session Configuration Name : bfd1
--------------------------------------------------------------------------------
Local Discriminator : 22 Remote Discriminator : 11
BFD Bind Type : Interface(GigabitEthernet3/0/1)
Bind Session Type : Static
Bind Peer IP Address : 224.0.0.184
Bind Interface : GigabitEthernet3/0/1
TOS-EXP : 7 Local Detect Multi : 3
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
WTR Interval (ms) : - Process PST : Disable
Proc Interface Status : Disable
Local Demand Mode : Disable
Bind Application : No Application Bind
Session Description : -
--------------------------------------------------------------------------------
Run the display bfd session command, and you can view information about a BFD session.
<Quidway> display bfd session discriminator 22 verbose
--------------------------------------------------------------------------------
Session MIndex : 4096 (One Hop) State : Up Name : bfd1
--------------------------------------------------------------------------------
Local Discriminator : 22 Remote Discriminator : 11
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet3/0/1)
Bind Session Type : Static
Bind Peer IP Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet3/0/1
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : - Local Demand Mode : Disable
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : No Application Bind
Session TX TmrID : 16394 Session Detect TmrID : 16395
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Run the display bfd statistics session command, and you can view statistics a BFD session.
<Quidway> display bfd statistics session all
--------------------------------------------------------------------------------
Session MIndex : 4096 (One Hop) State : Up Name : bfd1
--------------------------------------------------------------------------------
Session Type : Static
Bind Type : IP
Local/Remote Discriminator : 22/11
Received Packets : 178
Send Packets : 177
Received Bad Packets : 0
Send Bad Packets : 0
Down Count : 0
ShortBreak Count : 0
Send Lsp Ping Count : 0
Dynamic Session Delete Count : 0
Create Time : 2007/10/14 22:26:53
Last Down Time : 0000/00/00 00:00:00
Total Time From Last DOWN : ---D:--H:--M:--S
Total Time From Create : 000D:00H:03M:03S
--------------------------------------------------------------------------------

Total Session Number : 1

6.5 Configuring a BFD Session with Automatically Negotiated


Discriminators
A static BFD session with automatically negotiated discriminators is configured to check the interworking between a
device and another device on which a BFD session is dynamically established. The static BFD session with
automatically negotiated discriminators is applicable to static routes.

6.5.1 Establishing the Configuration Task


Before configuring a static BFD session with automatically negotiated discriminators, familiarize yourself with the
applicable environment, complete the pre-configuration tasks, and obtain data required for the configuration. This will
help you complete the configuration task quickly and accurately.

Applicable Environment
If a dynamic BFD session is used by a remote device, a static BFD session with automatically negotiated
discriminators must be created on a local device to interwork with the remote device and support a static route to track
BFD.

Pre-configuration Tasks
Before configuring a BFD session with automatically negotiated discriminators, complete the following tasks:
 Correctly connecting interfaces
 Correctly configuring the IP address of a Layer 3 interface

Data Preparation
To complete the configuration, you need the following data.

No. Data

1 Name of a BFD session

2 IP addresses of local and remote ends of a link checked by BFD, and name and number of the local interface

6.5.2 Enabling BFD Globally


You can perform related BFD configurations only after enabling BFD globally.

Context
Do as follows on the switch on which a static BFD session with automatically negotiated discriminators is used to
detect faults in a link:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally and the BFD view is displayed.

6.5.3 Configuring a Static BFD Session with Automatically Negotiated


Discriminators
Context
Do as follows on the Switch where the static BFD session with automatically negotiated discriminators is used to
detect the link.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd cfg-name bind peer-ip ip-address [ vpn-instance vpn-name ] [ interface interface-
type interface-number] source-ip ip-address auto

A BFD session with different parameters is created according to the detected link type.
When creating a BFD session, you must:
 When creating a single-hop BFD session for the first time, you must bind the single-hop BFD session to
the peer IP address and the local address. In addition, the configuration of the single-hop BFD session
cannot be changed after being created.
 Specify the source IP address.
 Specify the peer IP address instead of the multicast IP address.

6.5.4 Checking the Configuration


Context
The configurations of creating a static BFD session with automatically negotiated discriminators are complete.

Procedure
1. Run the display bfd session { all | static | dynamic | discriminator discr-value | peer-ip peer-ip [ vpn-
instance vpn-name ] } [ verbose ] command to check information about a BFD session.

Example
# Display detailed information about all the BFD sessions.
<Quidway> display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 4098 (One Hop) State : Up Name : staticbfd
--------------------------------------------------------------------------------
Local Discriminator : 8192 Remote Discriminator : 8192
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(Vlanif3)
Bind Session Type : Static_Auto
Bind Peer IP Address : 10.10.10.119
NextHop Ip Address : 10.10.10.119
Bind Interface : Vlanif3
Bind Source IP Address : 10.10.10.116
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : AUTO
Session TX TmrID : 16396 Session Detect TmrID : 16397
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 | OAMF-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

You can view that a BFD session with the type as Static_Auto is established. The local discriminator and the remote
discriminator of this BFD session are 8192 and 8192 respectively, which are obtained through automatic negotiation.

6.6 Adjusting BFD Parameters


Adjusting BFD parameters enables a BFD session to check links on a network effectively and quickly.

6.6.1 Establishing the Configuration Task


Before adjusting BFD parameters, familiarize yourself with the applicable environment and complete pre-
configuration task for a BFD session, and obtain data required for configuring the BFD session.

Applicable Environment
After a BFD session is set up, the sending interval, the receiving interval, and the local detection multiplier are adjusted
on the basis of the network status and performance requirement.
The Wait to Recovery (WTR) time for a BFD session is set to prevent frequent master/slave switchovers caused by
BFD session flapping.
The description of a BFD session is added to describe a link monitored by a BFD session.
If none of the preceding parameters is set, the default configurations are used.

Pre-configuration Tasks
Before adjusting BFD parameters, you need to set up a BFD session.

Data Preparation
To adjust BFD parameters, you need the following data.

No Data

1 BFD configuration name

2 Local intervals at which BFD packets are sent and received


No Data

3 Local BFD detection multiplier

4 Priority of BFD packets

6.6.2 Adjusting the BFD Detection Time


Context
To reduce the usage of system resource, when detecting that the BFD session becomes Down, the system sets the
intervals for sending and receiving BFD packets at the local end to a random value between 1000 and 3000
milliseconds. When the BFD session recovers, the intervals set by the user are used.
Do as follows on the S9300.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd configuration-name

The BFD session view is displayed.


3. Run:
min-tx-interval interval

The expected interval for sending BFD packets is set.


By default, if the Flexible Service Unit (FSU) is used, the interval for sending BFD control packets is 10 ms;
if the FSU is not used, the interval for sending BFD control packets is 1000 ms

NOTE:
If the FSU is installed, the interval for sending packets can be set to 0 ms, 20 ms, 50 ms, 100 ms, or 1000 ms. If your switch has an
FSU installed, use one of the preceding rates as required. If you set the packet transmission rate to another value, the switch still
sends BFD packets at one of the preceding rates. In this case, the switch will sends more packets or fewer packets than configured.
If the switch sends fewer packets than configured, the BFD session state may flap, affecting the BFD function. If the FSU is not
installed, the interval can only be set to 100 ms or 1000 ms.

4. Run:
min-rx-interval interval

The minimum interval for receiving BFD packets is set.


By default, if the FSU is used, the interval for receiving BFD control packets is 10 ms; if the FSU is not
used, the interval for receiving BFD control packets is 1000 ms

NOTE:
If the FSU is installed, the interval for sending packets can be set to 0 ms, 20 ms, 50 ms, 100 ms, or 1000 ms. If the FSU is not
installed, the interval can only be set to 100 ms or 1000 ms.

5. Run:
detect-multiplier multiplier

The local detection time multiplier is set.


By default, the local detection multiplier is 3.
6. Run:
commit

The configuration takes effect.

6.6.3 Adding the Description of a BFD Session


Descriptions of BFD sessions help you distinguish between various BFD sessions.

Context
NOTE:
The description command takes effect only on statically configured BFD sessions not on BFD sessions that are dynamically configured or
BFD sessions that are created by using automatically-negotiated discriminators.

Do as follows on the switch:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd cfg-name

The BFD session view is displayed.


3. Run:
description description

The description of a BFD session is added.


description is a string of 1 to 51 characters.
By default, the description of the BFD session is Null.
You can run the undo description command to delete the description of a BFD session.

6.6.4 Configuring the BFD WTR


The Wait to Recovery (WTR) time for a BFD session is used to prevent frequent master/slave switchovers triggered by
BFD session flapping.

Context
The WTR time for a BFD session is used to prevent frequent master/slave switchovers caused by BFD session
flapping. If a BFD session changes from Down to Up, BFD reports the change to an upper-layer application after the
WTR time expires.
Do as follows on the switch:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd cfg-name

The BFD session view is displayed.


3. Run:
wtr wtr-value

The WTR is configured.


By default, the WTR is 0.
4. Run:
commit

The configuration takes effect.

6.6.5 Setting the Priority of BFD Packets


Context
You can change the priority of BFD packets to:
 Check whether packets of different priorities on the same link can be forwarded.
 Ensure that BFD packets with a higher priority are forwarded first.
Do as follows on the S9300.

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd configuration-name

The BFD session view is displayed.


3. Run:
tos-exp tos

The priority of BFD packets is set.


By default, the priority of BFD packets is 7, which is the highest priority. The value 0 is the lowest priority.
4. Run:
commit

The configuration takes effect.

6.6.6 Checking the Configuration


Procedure
1. Run the display bfd configuration { all | static } [ for-vsi-pw | for-ip | for-lsp | for-pw | for-te ] [ verbose ]
and display bfd configuration { static name cfg-name | discriminator local-discr-value | dynamic | peer-
ip peer-ip [ vpn-instance vpn-name ] | static-auto } [ verbose ] commands to check the configuration of
BFD.
2. Run the display bfd session { all | static } [ for-ip | for-lsp | for-pw | for-te | for-vsi-pw ] [ verbose ]
and display bfd session { dynamic | discriminator discr-value | peer-ip peer-ip [ vpn-instance vpn-name ]
| static-auto } [ verbose ] command to check information about a BFD session.

Example
# Run the display bfd configuration command, and you can view the configuration of BFD.
<Quidway> display bfd configuration static for-ip verbose
--------------------------------------------------------------------------------
BFD Session Configuration Name : multi
--------------------------------------------------------------------------------
Local Discriminator : 321 Remote Discriminator : 123
BFD Bind Type : Peer IP Address
Bind Session Type : Static
Bind Peer IP Address : 10.111.111.2
TOS-EXP : 6 Local Detect Multi : 3
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
WTR Interval (ms) : 1800000 Process PST : Disable
Proc Interface Status : Disable
Local Demand Mode : Disable
Bind Application : No Application Bind
Session Description : -
--------------------------------------------------------------------------------

Total Commit/Uncommit CFG Number : 1/0

Run the display bfd session command, and you can view information about a BFD session.
<Quidway> display bfd session all for-ip verbose
--------------------------------------------------------------------------------
Session MIndex : 4096 (Multi Hop) State : Up Name : multi
--------------------------------------------------------------------------------
Local Discriminator : 321 Remote Discriminator : 123
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Peer IP Address
Bind Session Type : Static
Bind Peer IP Address : 10.111.111.2
Bind Interface : -
FSM Board Id : 0 TOS-EXP : 6
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : No Application Bind
Session TX TmrID : 16434 Session Detect TmrID : 16435
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0


6.7 Configuring the Delay of a BFD Session to Go Up
In special scenarios, the delay of a BFD session to go Up is configured to prevent traffic loss as a route protocol
becomes Up later than an interface.

6.7.1 Establishing the Configuration Task


Before configuring the delay of a BFD session to go Up, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This will help you complete
the configuration task quickly and accurately.

Applicable Environment
If BFD is Up on a network, the interface bound to BFD goes Up, allowing traffic to switch back to the interface. As a
routing protocol goes Up later than the interface status, no route is available for traffic to switch back. As a result,
traffic is dropped. The time when the routing protocol goes Up and the time when the interface goes Up must be
synchronous.

Pre-configuration Tasks
Before configuring the delay of a BFD session to go Up, ensure that the switch runs normally.

Data Preparation
To complete the configuration, you need the following data.

No. Data

1 Delay time

6.7.2 Configuring the Delay of a BFD Session to Go Up


The delay of a BFD session to go Up is configured to prevent traffic loss in special scenarios.

Context
Do as follows on the switchs on which the setup of the BFD session needs to be delayed:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally and the BFD view is displayed.


3. Run:
delay-up seconds

The time the BFD session is delayed to go Up is set.


By default, the delay time is 0 seconds.

6.7.3 Checking the Configuration


By viewing the delay of a BFD session to go Up, you can check whether the configurations are successful.

Prerequisites
The configurations of the delay of a BFD session to go Up are complete.

Procedure
1. Run the display bfd statistics [ slot slot-id ] command to check statistics about global BFD.

Example
# After the configuration, restart the switch. After the restart, run the display bfd statistics command.
The System Session Delay Up Timer field in the command output. This field displays the status of the current system
delay Up time. OFF indicates that the system is in the normal state; Xs indicates that after X seconds, the system
recovers, and the BFD session goes Up.
<Quidway> display bfd statistics
Current Display Board Number : Main ; Current Product Register Type:
IP Multihop Destination Port : 3784
Total Up/Down Session Number : 0/1
Current Session Number :
Static session : 0 Dynamic session : 0
E_Dynamic session : 0 STATIC_AUTO session : 1
LDP_LSP session : 0 STATIC_LSP session : 0
TE_TUNNEL session : 0 TE_LSP session : 0
PW session : 0 IP session : 1
VSI PW session : 0
--------------------------------------------------------------------------------
PAF/LCS Name Maxnum Minnum Create
--------------------------------------------------------------------------------
BFD_CFG_NUM 8192 1 1
BFD_IF_NUM 512 1 1
BFD_SESSION_NUM 8192 1 1
BFD_IO_SESSION_NUM 512 1 0
BFD_PER_TUNNEL_CFG_NUM 16 1 0
--------------------------------------------------------------------------------
IO Board Current Created Session Statistics Information :(slot/number)
--------------------------------------------------------------------------------
0/1 1/0 2/0 3/0
4/0 5/0 6/0 7/0
8/0 9/0 10/0 11/0
12/0 13/0 14/0 15/0
16/0
--------------------------------------------------------------------------------
Current Total Used Discriminator Num : 1
--------------------------------------------------------------------------------
IO Board Reserved Sessions Number Information :(slot/number)
--------------------------------------------------------------------------------
0/0 1/0 2/0 3/0
4/0 5/0 6/0 7/0
8/0 9/0 10/0 11/0
12/0 13/0 14/0 15/0
16/0
--------------------------------------------------------------------------------
BFD HA Information :
--------------------------------------------------------------------------------
Core Current HA Status : Normal
Shell Current HA Status : Normal
--------------------------------------------------------------------------------
BFD for LSP Information :
--------------------------------------------------------------------------------
Ability of auto creating BFD session on egress : Disable
Period of LSP Ping : 60
System Session Delay Up Timer : OFF
--------------------------------------------------------------------------------

6.8 Configuring the TTL Globally


Configuring the TTL globally helps you connect the current device and a device running an early version.

6.8.1 Establishing the Configuration Task


Before configuring the TTL globally, familiarize yourself with the applicable environment, complete the pre-
configuration tasks, and obtain the required data. This helps you complete the configuration task quickly and
accurately.

Applicable Environment
If devices running different versions interwork with each other, the TTL values and detection modes on both ends of a
BFD session are different, resulting in BFD packet loss. The TTL is set globally to enable Huawei devices to interwork
with Huawei devices running different S9300 versions and non-Huawei devices.

Pre-configuration Tasks
Before configuring the TTL globally, complete the following tasks:
 Connecting interfaces correctly
 Configuring the IP address of each Layer 3 interface correctly

Data Preparation
To configure the TTL globally, you need the following data.

No. Data

1 Name and number of each interface

6.8.2 Configuring the TTL Globally


The TTLs help you distinguish between a single-hop BFD session and a multi-hop BFD session when a device
interworks with a device running an early version.

Context
Do as follows on each device:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally on the local device and the BFD view is displayed.
3. Run:
peer-ip peer-ip mask-length ttl { single-hop | multi-hop } ttl-value

The TTL in BFD control packets is set.

NOTE:
By default, in a static BFD session, the TTL for single-hop BFD packets is 255, and the TTL for multi-hop BFD packets is 254; in
a dynamic BFD session, the TTL for single-hop BFD packets is 255 and the TTL for multi-hop BFD packets is 253.

6.8.3 Checking the Configuration


By viewing the global TTL in BFD control packets, you can check whether the configurations are successful.

Prerequisites
The configurations of the global TTL are completed.

Procedure
 Run the display bfd session { all | discriminator discr-value | dynamic | peer-ip peer-ip [ vpn-instance vpn-
instance-name ] | static } [ verbose ] command to view information about the BFD session.
 Run the display bfd ttl command to view information about the globally configured TTL.

Example
After the configurations are successful, run the display bfd ttl command, and you can view information about the
global TTL.
<Quidway> display bfd ttl
--------------------------------------------------------------------------
Peer IP Mask Type Value
---------------------------------------------------------------------------
1.1.1.0 24 Single-hop 255
---------------------------------------------------------------------------

6.9 Configuring the Interval at Which Trap Messages Are Sent


The interval at which trap messages are sent is set, helping a device to suppress BFD trap messages.

6.9.1 Establishing the Configuration Task


Before configuring the interval at which trap messages are sent, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This will help you complete
the configuration task quickly and accurately.

Applicable Environment
If BFD is enabled with the SNMP trap function, the NMS receives messages indicating that the BFD session is Up or
Down. If the BFD session flaps, the NMS will receive a large number of trap messages. In this case, BFD trap
messages need to be suppressed. Setting the interval at which trap messages are sent prevents overflow of trap
messages.

Pre-configuration Tasks
Before configuring the interval at which trap messages are sent, enable BFD globally.

Data Preparation
To configure the interval at which trap messages are sent, you need the following data.

No. Data

1 Interval at which trap messages are sent

6.9.2 Configuring the Interval at Which Trap Messages Are Sent


When BFD sessions flap, the NMS receives a great number of trap messages. The interval at which trap messages are
sent is set, helping a device suppress trap messages.

Context
Do as follows on the switch that needs to be configured with the interval at which trap messages are sent:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
bfd

BFD is enabled globally, and the global BFD view is displayed.


3. Run:
snmp-agent bfd trap-interval interval

The interval at which trap messages are sent is set.


By default, the interval at which trap messages are sent is 120 seconds.

6.9.3 Checking the Configuration


By viewing the interval at which trap messages are sent, you can check whether the configurations are successful.

Prerequisites
The configurations of the interval at which trap messages are sent are complete.

Procedure
 Run the display current-configuration configuration bfd command to view the configuration of the BFD trap
function.

Example
Run the display current-configuration configuration bfd command, and you can view that the interval at which trap
messages are sent is 300 seconds.
<Quidway> display current-configuration configuration bfd
#
bfd
snmp-agent bfd trap-interval 300
#
return

6.10 Configuring Association Between a BFD Session and an


Interface (Triggering the Physical Status of the Interface Associated
with the BFD Session to Become Down)
Association between a BFD session and an interface is applicable to the scenario where a CE is directly connected to a
PE. BFD is enabled on PEs and a BFD session is associated with an interface. When the BFD session detects a link
fault, the BFD module notifies the OAM management module on the local PE of the fault. This triggers the physical
status of the interface to become Down.

6.10.1 Establishing the Configuration Task


Before configuring the association between a BFD session and an interface, you must create a BFD session in static
mode.

Applicable Environment
You can configure the association between a BFD session and an interface to enable the BFD session or the interface
to send messages to each other in case of failure. As shown in Figure 6-1, CE1 is directly connected to PE1 and PE3,
and CE2 is directly connected to PE2 and PE4. BFD sessions are created between PE1 and PE2 and between PE3 and
PE4. When a fault occurs on a link between PEs, a CE needs to detect the fault to ensure reliable service transmission.
In this case, the associations between BFD sessions and interfaces can be configured. When the BFD session between
PE1 and PE2 detects a link fault, the BFD module on a PE notifies the OAM management module of the fault. This
triggers the physical status of GE 1/0/1 on a PE directly connected to a CE to become Down. The CE can then detect
the fault and switch traffic to a backup path, which ensures reliable service transmission.
Figure 6-1 Networking diagram of the association between a BFD session and an interface

Assume that the bidirectional association between a BFD session and an interface is configured on each PE. When GE
1/0/1 on PE1 connected to CE1 becomes Down, PE1 notifies the OAM management module of the fault, and then the
OAM management module forwards fault information to the BFD session associated with GE 1/0/1. The fault
information is sent to the OAM management module on PE2 through BFD, which triggers the physical status of GE
1/0/1 to become Down. In this manner, CE2 can detect the fault and switch traffic to a backup path, which ensures
reliable service transmission.
NOTE:
Currently, the association between a BFD session and an interface is inapplicable to links detected by the BFD session for PWs.
The BFD session can be associated with the interface connecting a PE to a CE but not the interface connecting two PEs (that is, the outbound
interface of the BFD session).

Pre-configuration Tasks
Before configuring the association between a BFD session and an interface, complete the following task:
 Creating a BFD session

Data Preparation
To configure the association between a BFD session and an interface, you need the following data.

No. Data

1 ID of a BFD session, namely, local discriminator of a BFD session

2 Type and number of each interface associated with a BFD session

6.10.2 Configuring Association Between a BFD Session and an Interface


One BFD session is associated with only one interface. For example, when an interface is associated with a BFD
session, the interface cannot be associated with another BFD session. In addition, when a BFD session is associated
with an interface, the BFD session cannot be associated with another interface.

Context
Do as follows on the device that needs the association:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
oam-mgr

The OAM management view is displayed.


3. Run the following command as required:
 Run:
oam-bind ingress bfd-session bfd-session-id trigger if-down egress interface
interface-type interface-number

The unidirectional transmission of fault information from a BFD session to an interface is configured.
When the BFD session detects a fault, the physical status of the interface associated with the BFD session
becomes Down.
 Run:
oam-bind ingress interface interface-type interface-number egress bfd-session bfd-
session-id trigger if-down

The unidirectional transmission of fault information from an interface to a BFD session is configured.
When an interface goes Down, the OAM management module can send fault information to the BFD
session associated with the interface, and then the BFD session sends the fault information to the remote
device.
 Run:
oam-bind bfd-session bfd-session-id trigger if-down interface interface-type
interface-number

The bidirectional transmission of fault information between a BFD session and an interface is configured.

NOTE:
If oam-bind bfd-session bfd-session-id trigger if-down interface interface-type interface-number command is performed,
both the oam-bind ingress bfd-session bfd-session-id trigger if-downegress interface interface-type interface-
number command and the oam-bind ingress interface interface-type interface-number egress bfd-session bfd-session-
id trigger if-down command are displayed in the configuration file, indicating fault notification in opposite directions.

6.10.3 Checking the Configuration


After the association between a BFD session and an interface is successfully configured, you can view the association
configuration in the OAM management view.

Prerequisites
All configurations of the association between a BFD session and an interface is complete.

Procedure
1. Run the display this command in the OAM management view to check whether a BFD session and an
interface are successfully associated.

Example
Run the display this command. You can view all associations between BFD sessions and interfaces.
[Quidway-oam-mgr] display this
#
oam-mgr
oam-bind ingress interface GigabitEthernet1/0/1 egress bfd-session 1 trigger if-down
oam-bind ingress bfd-session 1 trigger if-down egress interface GigabitEthernet1/0/1
#
return

6.11 Configuring Association Between BFD Sessions


After the association between BFD sessions is configured, the local BFD session can detect a fault and then notify the
OAM management module of the fault. The OAM management module sends fault information to the associated BFD
session. The associated BFD session then sends BFD packets carrying the fault information to the OAM management
module on the remote device. In this manner, the fault is notified to the remote device.

6.11.1 Establishing the Configuration Task


Before configuring the association between BFD sessions, you must create the two BFD sessions in static mode.

Application Environment
As shown in Figure 6-2, BFD sessions are created between CE1 and PE1, between CE2 and PE2, and between PE1
and PE2. When a fault occurs on a link between CE1 and PE1, CE2 needs to detect the fault to ensure reliable service
transmission. In this case, the association between BFD sessions needs to be configured. When the BFD session
between CE1 and PE1 detects a fault, the BFD session on PE1 notifies the OAM management module of the fault. The
OAM management module notifies the associated BFD session on PE2. The BFD session sends the fault information
to the OAM management module on PE2. Then, the OAM management module on PE2 notifies CE2 through BFD of
the fault. CE2 can then detect the fault.
Figure 6-2 Networking diagram of the association between BFD sessions

Pre-configuration Tasks
Before configuring the association between BFD sessions, complete the following task:
 Creating BFD sessions

Data Preparation
To configure the association between BFD sessions, you need the following data.

No. Data

1 ID of each BFD session, namely, local discriminator of a BFD session

6.11.2 Configuring Association Between BFD sessions


Two BFD sessions can be associated with each other only. That is, after BFD session 1 is associated with BFD session
2, neither of them can be associated with another BFD session.

Context
Do as follows on the device that needs the association:

Procedure
1. Run:
system-view

The system view is displayed.


2. Run:
oam-mgr

The OAM management view is displayed.


3. Run the following command as required:
 Run:
oam-bind ingress bfd-session bfd-session-id egress bfd-session bfd-sessionid

The unidirectional transmission of fault information from one BFD session to the other BFD session is
configured.
After the configuration, when detecting a fault, BFD session bfd-session-id1 can send fault messages to
BFD session bfd-session-id2.
 Run:
oam-bind bfd-session bfd-session-id bfd-session bfd-session-id
The bidirectional transmission of fault information between two BFD sessions is configured.

NOTE:
If Step 4 is performed, two oam-bind ingress bfd-session bfd-session-id egress bfd-session bfd-sessionid commands are
displayed in the configuration file, indicating fault notification in opposite directions.

6.11.3 Checking the Configuration


After the association between BFD sessions is successfully configured, you can view the association configuration in
the OAM management view.

Prerequisites
All configurations of the association between BFD sessions are complete.

Procedure
1. Run the display this command in the OAM management view to check whether two BFD sessions are
successfully associated.

Example
Run the display this command. You can view all associations between BFD sessions.
[Quidway-oam-mgr] display this
#
oam-mgr
oam-bind ingress bfd-session 1 egress bfd-session 2
oam-bind ingress bfd-session 2 egress bfd-session 1
#
return

6.12 Maintaining BFD


This section describes how to maintain BFD by deleting BFD statistics, and monitoring BFD operation.

6.12.1 Clearing BFD Statistics


Deleting previous BFD statistics is recommended before BFD statistics within a specified period of time are collected.

Context

CAUTION:
BFD statistics cannot be restored after being deleted. Exercise caution when using the command.

Procedure
1. Run the reset bfd statistics { all | discriminator discr-value } command in the user view to delete BFD
statistics.

6.12.2 Debugging BFD


Debugging is used to troubleshoot BFD performance problems.

Context
CAUTION:
Debugging affects system performance. After debugging is complete, run undo debugging all command to disable
debugging immediately.
If a BFD fault occurs, run the following debugging command in the user view to locate the fault.

Procedure
1. Run the debugging bfd { all | defect-detect | error | event | fsm | ha | packet | process | product-
interface | session-management | timer } command in the user view to enable the debugging of the BFD
module.

6.13 Configuration Examples


This section provides several configuration examples of BFD.

Context
For configuration examples of BFD for static LDP, see Example for Configuring Static BFD for Static LSPs in
the Quidway S9300 Terabit Routing Switch Configuration Guide - MPLS.
For configuration examples of BFD for LDP LSPs, see Example for Configuring Static BFD for LDP LSPs and
Example for Configuring Dynamic BFD for LDP LSPs in the Quidway S9300 Terabit Routing Switch Configuration
Guide - MPLS.
For configuration examples of BFD for MPLS TE tunnels, see Example for Configuring Static BFD for CR-LSPs,
Example for Configuring Static BFD for TE Tunnels, Example for Configuring Dynamic BFD for CR-LSPs, and
Example for Configuring Dynamic BFD for RSVP in the Quidway S9300 Terabit Routing Switch Configuration
Guide - MPLS.

6.13.1 Example for Configuring Single-Hop BFD on a Layer 2 Interface


Networking Requirements
Interfaces of the S9300 are Layer 2 interfaces. If you need to detect the connectivity of the Layer 2 forwarding link
between two directly connected S9300s, configure single-hop BFD, and bind the BFD session to a multicast IP address
and local interface.
As shown in Figure 6-3, a BFD session is created to detect the connectivity of the Layer 2 link between Switch A
and Switch B.
Figure 6-3 Networking diagram of single-hop BFD (for Layer 2 forwarding link)

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a BFD session on Switch A to detect the direct link from Switch A to Switch B.
2. Configure a BFD session on Switch B to detect the direct link from Switch B to Switch A.

Data Preparation
To complete the configuration, you need the following data:
 Type and number of the interface bound to the BFD session
 Local and remote identifiers of the BFD session
Use the default values of the minimum sending interval, the minimum receiving interval, and the local detection
multiplier of BFD control packets.

Procedure
1. Configure single-hop BFD on Switch A.
# Enable BFD on Switch A.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] bfd
[SwitchA-bfd] quit

# Create a BFD session on Switch A.


[SwitchA] bfd atob bind peer-ip default-ip interface gigabitethernet 1/0/1
[SwitchA-bfd-session-atob] discriminator local 1
[SwitchA-bfd-session-atob] discriminator remote 2
[SwitchA-bfd-session-atob] quit

2. Configure single-hop BFD on Switch B.


# Enable BFD on Switch B.
<Quidway> system-view
[Quidway] sysname SwitchB
[SwitchB] bfd
[SwitchB-bfd] quit

# Create a BFD session on Switch B.


[SwitchB] bfd btoa bind peer-ip default-ip interface gigabitethernet 1/0/1
[SwitchB-bfd-session-btoa] discriminator local 2
[SwitchB-bfd-session-btoa] discriminator remote 1
[SwitchB-bfd-session-btoa] quit

3. Verify the configuration.


After the configuration, run the display bfd session command on Switch A and Switch B, and you can find
that a single-hop BFD session is set up and is in Up state.
Take Switch A for example. The display is as follows:
<SwitchA> display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 4097 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 1 Remote Discriminator : 2
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/1)
Bind Session Type : Static
Bind Peer IP Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/1
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 13000 Actual Rx Interval (ms): 13000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : No Application Bind
Session TX TmrID : - Session Detect TmrID : -
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

Configuration Files
 Configuration file of Switch A
 #
 sysname SwitchA
 #
 bfd
 #
 bfd atob bind peer-ip default-ip interface GigabitEthernet1/0/1
 discriminator local 1
 discriminator remote 2
 #
return

 Configuration file of Switch B


 #
 sysname SwitchB
 #
 bfd
 #
 bfd btoa bind peer-ip default-ip interface GigabitEthernet1/0/1
 discriminator local 2
 discriminator remote 1
 #
return

6.13.2 Example for Configuring Single-Hop BFD on a VLANIF Interface


Networking Requirements
The S9300s are connected through the VLANIF interface at Layer 3. To detect the connectivity of the link between
two directly connected S9300s, you can configure single-hop BFD to bind the BFD session to the VLANIF interface
and its IP address.
As shown in Figure 6-4, a BFD session is created to detect the connectivity of the link between Switch A
and Switch B.
Figure 6-4 Networking diagram for configuring single-hop BFD on a VLANIF interface

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLAN 13 on Switch A and Switch B.
2. Configure GE 1/0/1 interfaces on Switch A and Switch B as hybrid interfaces.
3. Create VLANIF 13 on Switch A and Switch B and set their IP address.
4. Create a BFD session on Switch A to detect the link between Switch A and Switch B.
5. Create a BFD session on Switch B to detect the link between Switch B and Switch A.

Data Preparation
To complete the configuration, you need the following data:
 Numbers of VLANIF interfaces bound to BFD sessions
 IP addresses of VLANIF interfaces
 Local and remote discriminators of BFD sessions
Default values of minimum intervals for sending BFD control packets, minimum intervals for receiving BFD control
packets, and local detection multipliers

Procedure
1. On Switch A and Switch B, create VLAN 13, configure GE 1/0/1 interfaces as hybrid interfaces, and add GE
1/0/1 interfaces to VLAN 13.
# Configure Switch A.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan 13
[SwitchA-vlan13] quit
[SwitchA] interface gigabitethernet1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 13
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 13
[SwitchA-GigabitEthernet1/0/1] quit

# Configure Switch B.
<Quidway> system-view
[Quidway] sysname SwitchB
[SwitchB] vlan 13
[SwitchB-vlan13] quit
[SwitchB] interface gigabitethernet1/0/1
[SwitchB-GigabitEthernet1/0/1] port hybrid pvid vlan 13
[SwitchB-GigabitEthernet1/0/1] port hybrid untagged vlan 13
[SwitchB-GigabitEthernet1/0/1] quit

2. Set IP addresses of VLANIF 13 interfaces so that Switch A can communicate with Switch B at Layer 3.
# Configure Switch A.
[SwitchA] interface vlanif13
[SwitchA-Vlanif13] ip address 10.1.1.5 24
[SwitchA-Vlanif13] quit

# Configure Switch B.
[SwitchB] interface vlanif13
[SwitchB-Vlanif13] ip address 10.1.1.6 24
[SwitchB-Vlanif13] quit

After the configuration, run the display interface vlanif command on Switch A or Switch B. You can view
that the status of VLANIF 13 is Up.
[SwitchA] display interface vlanif 13
Vlanif13 current state : UP
Line protocol current state : UP
Last line protocol up time : 2007-10-19 11:46:42 UTC-08:00
Description:HUAWEI, Quidway Series, Vlanif13 Interface
Route Port,The Maximum Frame Length is 1500
Internet Address is 10.1.1.5/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0022-0033-0044
Input bandwidth utilization : --
Output bandwidth utilization : --

3. Configure single-hop BFD on Switch A.


# Enable BFD on Switch A.
[SwitchA] bfd
[SwitchA-bfd] quit

# Create a BFD session on Switch A.


[SwitchA] bfd atob bind peer-ip 10.1.1.6 interface vlanif 13
[SwitchA-bfd-session-atob] discriminator local 1
[SwitchA-bfd-session-atob] discriminator remote 2
[SwitchA-bfd-session-atob] quit

4. Configure single-hop BFD on Switch B.


# Enable BFD on Switch B.
[SwitchB] bfd
[SwitchB-bfd] quit

# Create a BFD session on Switch B.


[SwitchB] bfd btoa bind peer-ip 10.1.1.5 interface vlanif 13
[SwitchB-bfd-session-btoa] discriminator local 2
[SwitchB-bfd-session-btoa] discriminator remote 1
[SwitchB-bfd-session-btoa] quit

5. Verify the configuration.


After the configuration, run the display bfd session command on Switch A and Switch B. You can view that
the single-hop BFD session is set up and the status is Up.
Take the display on Switch A as an example.
<SwitchA> display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 4097 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 1 Remote Discriminator : 2
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(Vlanif13)
Bind Session Type : Static
Bind Peer IP Address : 10.1.1.6
NextHop Ip Address : 10.1.1.6
Bind Interface : Vlanif13
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 13000 Actual Rx Interval (ms): 13000
Local Detect Multi : 3 Detect Interval (ms) : 39000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : Control Detection Time Expired
Bind Application : No Application Bind
Session TX TmrID : 16897 Session Detect TmrID : -
Session Init TmrID : 16898 Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

Configuration Files
 Configuration file of Switch A
 #
 sysname SwitchA
 #
 vlan batch 13
 #
 bfd
 #
 interface Vlanif13
 ip address 10.1.1.5 255.255.255.0
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 13
 port hybrid untagged vlan 13
 #
 bfd atob bind peer-ip 10.1.1.6 interface Vlanif13
 discriminator local 1
 discriminator remote 2
 #
return

 Configuration file of Switch B


 #
 sysname SwitchB
 #
 vlan batch 13
 #
 bfd
 #
 interface Vlanif13
 ip address 10.1.1.6 255.255.255.0
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 13
 port hybrid untagged vlan 13
 #
 bfd atob bind peer-ip 10.1.1.5 interface Vlanif13
 discriminator local 2
 discriminator remote 1
 #
return

6.13.3 Example for Configuring Multi-Hop BFD


Networking Requirements
As shown in Figure 6-5, a BFD session is used to test the multi-hop path between Switch A and Switch C.
Interfaces of the S9300 are Layer 2 interfaces. To configure multi-hop BFD, you need to add an interface to a VLAN,
create a VLANIF interface, and assign an IP address to the VLANIF interface.
Figure 6-5 Networking diagram of multi-hop BFD

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a BFD session on Switch A to detect the multi-hop path from Switch A to Switch C.
2. Configure a BFD session on Switch C to detect the multi-hop path from Switch C to Switch A.

Data Preparation
To complete the configuration, you need the following data:
 Peer IP address bound to the BFD session
 Local and remote identifiers of the BFD session
 IP address of VLANIF 10 on Switch A: 10.1.1.1/16
 IP address of VLANIF 10 on Switch B: 10.1.1.2/16
 IP address of VLANIF 20 on Switch B: 10.2.1.1/16
 IP address of VLANIF 20 on Switch C: 10.2.1.2/16
Use the default values of the minimum sending interval, the minimum receiving interval, and the local detection
multiplier of a BFD control packet.

Procedure
1. Add interfaces to VLANs, create VLANIF interfaces, and assign an IP address to each VLANIF interface.
# Create a VLAN on Switch A and add the interface to the VLAN.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 10
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 10
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 10
[SwitchA-GigabitEthernet1/0/1] quit

# Create a VLANIF interface and assign an IP address to the VLANIF interface.


[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.1.1 16
[SwitchA-Vlanif10] quit

The configurations of Switch B and Switch C are the same as the configuration of Switch A, and are not
mentioned here.
2. Configure a reachable static route between Switch A and Switch C.
[SwitchA] ip route-static 10.2.0.0 16 10.1.1.2

The configuration of Switch C is the same as the configuration of Switch A, and is not mentioned here.
3. Configure multi-hop BFD on Switch A and Switch C.
# Create a BFD session with Switch C on Switch A.
[SwitchA] bfd
[SwitchA-bfd] quit
[SwitchA] bfd atoc bind peer-ip 10.2.1.2
[SwitchA-bfd-session-atoc] discriminator local 10
[SwitchA-bfd-session-atoc] discriminator remote 20
[SwitchA-bfd-session-atoc] quit

# Create a BFD session with Switch A on Switch C.


[SwitchC] bfd
[SwitchC-bfd] quit
[SwitchC] bfd ctoa bind peer-ip 10.1.1.1
[SwitchC-bfd-session-ctoa] discriminator local 20
[SwitchC-bfd-session-ctoa] discriminator remote 10
[SwitchC-bfd-session-ctoa] quit

4. Verify the configuration.


After the configuration is complete, run the display bfd session command on Switch A and Switch C, and
you can find that a BFD session is set up and is in Up state.
Take Switch A for example. The display is as follows:
<SwitchA> display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 4097 (One Hop) State : Up Name : atoc
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(Vlanif10)
Bind Session Type : Static
Bind Peer IP Address : 10.2.1.2
NextHop Ip Address : 10.1.1.2
Bind Interface : Vlanif10
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 13000 Actual Rx Interval (ms): 13000
Local Detect Multi : 3 Detect Interval (ms) : 39000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : Control Detection Time Expired
Bind Application : No Application Bind
Session TX TmrID : 16897 Session Detect TmrID : -
Session Init TmrID : 16898 Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

Configuration Files
 Configuration file of Switch A
 #
 sysname SwitchA
 #
 vlan batch 10
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.1 255.255.0.0
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 bfd atoc bind peer-ip 10.2.1.2
 discriminator local 10
 discriminator remote 20
 #
 ip route-static 10.2.0.0 255.255.0.0 10.1.1.2
 #
return

 Configuration file of Switch B


 #
 sysname SwitchB
 #
 vlan batch 10 20
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.0.0
 #
 interface Vlanif20
 ip address 10.2.1.1 255.255.0.0
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
return

 Configuration file of Switch C


 #
 sysname SwitchC
 #
 bfd
 #
 vlan batch 20
 #
 interface Vlanif20
 ip address 10.2.1.2 255.255.0.0
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
 bfd ctoa bind peer-ip 10.1.1.1
 discriminator local 20
 discriminator remote 10
 #
 ip route-static 10.1.0.0 255.255.0.0 10.2.1.1
 #
return

6.13.4 Example for Associating the BFD Status with the Interface Status
Networking Requirements
As shown in Figure 6-6, transmission devices exist on the link. After the BFD status is associated with the interface
status, the status change of the BFD session between GE 1/0/0 of Switch A and GE 1/0/0 of Switch B affects the
protocol status of the interfaces when the link between transmission devices fails. Fast convergence of routes is
triggered.
Figure 6-6 Networking diagram for associating the BFD session status with the interface status

Configuration Roadmap
The configuration roadmap is as follows:
1. Create a BFD session on Switch A.
2. Create a BFD session on Switch B.
3. Associate the BFD status with the interface status on Switch A when the BFD session is Up.
4. Associate the BFD status with the interface status on Switch B when the BFD session is Up.

Data Preparation
To complete the configuration, you need the following data:
 Peer IP address bound to the BFD session
 Local interface that sends and receives BFD control packets
 Local discriminator and remote discriminator of the BFD session
Use the default values of the minimum sending interval, the minimum receiving interval, and the local detection
multiplier of a BFD control packet.

Procedure
1. Set the IP addresses of the interfaces through which Switch A and Switch B are directly connected.
# Assign an IP address to the interface of Switch A.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan 10
[SwitchA-vlan10] quit
[SwitchA] interface gigabitethernet 1/0/0
[SwitchA-GigabitEthernet1/0/0] port hybrid pvid vlan 10
[SwitchA-GigabitEthernet1/0/0] port hybrid untagged vlan 10
[SwitchA-GigabitEthernet1/0/0] quit
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.1.1 24
[SwitchA-Vlanif10] quit

# Assign an IP address to the interface of Switch B.


<Quidway> system-view
[Quidway] sysname SwitchB
[SwitchB] vlan 10
[SwitchB-vlan10] quit
[SwitchB] interface gigabitethernet 1/0/0
[SwitchB-GigabitEthernet1/0/0] port hybrid pvid vlan 10
[SwitchB-GigabitEthernet1/0/0] port hybrid untagged vlan 10
[SwitchB-GigabitEthernet1/0/0] quit
[SwitchB] interface vlanif 10
[SwitchB-Vlanif10] ip address 10.1.1.2 24
[SwitchB-Vlanif10] quit

2. Configure single-hop BFD.


# On Switch A, enable BFD and create a BFD session with Switch B.
[SwitchA] bfd
[SwitchA-bfd] quit
[SwitchA] bfd atob bind peer-ip default-ip interface gigabitethernet 1/0/0
[SwitchA-bfd-session-atob] discriminator local 10
[SwitchA-bfd-session-atob] discriminator remote 20
[SwitchA-bfd-session-atob] quit

# On Switch B, create a BFD session with Switch A.


[SwitchB] bfd
[SwitchB-bfd] quit
[SwitchB] bfd btoa bind peer-ip default-ip interface gigabitethernet 1/0/0
[SwitchB-bfd-session-btoa] discriminator local 20
[SwitchB-bfd-session-btoa] discriminator remote 10
[SwitchB-bfd-session-btoa] quit

# Run the display bfd session all verbose command on Switch A and Switch B, and you can find that a
single-hop BFD session is set up and is in Up state. Take Switch A for example. The display is as follows:
[SwitchA] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 16384 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 13000 Actual Rx Interval (ms): 13000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Enable Process PST : Disable
WTR Interval (ms) : --
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : No Application Bind
Session TX TmrID : -- Session Detect TmrID : --
Session Init TmrID : -- Session WTR TmrID : --
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : --
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

3. Associate the BFD session status with the interface status.


# Associate the BFD status with the interface status on Switch A.
[SwitchA] bfd
[SwitchA-bfd] quit
[SwitchA] bfd atob
[SwitchA-bfd-session-atob] process-interface-status
[SwitchA-bfd-session-atob] quit

# Associate the BFD status with the interface status on Switch B.


[SwitchB] bfd
[SwitchB-bfd] quit
[SwitchB] bfd btoa
[SwitchB-bfd-session-btoa] process-interface-status
[SwitchB-bfd-session-btoa] quit

4. Verify the configuration.


After the configuration is complete, run the display bfd session all verbose command on Switch A
and Switch B, and you can find that the Proc interface status displaysfield is Enable.
Take Switch A for example. The display is as follows:
[SwitchA] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 16384 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Enable Process PST : Disable
WTR Interval (ms) : --
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : IFNET
Session TX TmrID : -- Session Detect TmrID : --
Session Init TmrID : -- Session WTR TmrID : --
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : --
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

Run the shutdown command on GE 1/0/0 of Switch B so that the BFD session is Down.
[SwitchB] interface gigabitethernet 1/0/0
[SwitchB-GigabitEthernet1/0/0] shutdown
[SwitchB-GigabitEthernet1/0/0] quit

Run the display bfd session all verbose and display interface gigabitethernet 1/0/0 commands
on Switch A, and you can find that the status of the BFD session is Down, and the status of GE 1/0/0 is Up
(BFD status down).
[SwitchA] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 16384 (One Hop) State : Down Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Enable Process PST : Disable
WTR Interval (ms) : --
Active Multi : 3
Last Local Diagnostic : Neighbor Signaled Session Down
Bind Application : IFNET
Session TX TmrID : -- Session Detect TmrID : --
Session Init TmrID : -- Session WTR TmrID : --
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : --
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0


[SwitchA] display interface gigabitethernet 1/0/0
GigabitEthernet1/0/0 current state : UP
Line protocol current state : UP(BFD status down)
Description:HUAWEI, Quidway Series, GigabitEthernet1/0/0 Interface
Switch Port,PVID : 230,The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0022-0033-0044
QoS max-bandwidth : 1000000 Kbps
Output queue : (Urgent queue : Size/Length/Discards) 0/50/0
Output queue : (Protocol queue : Size/Length/Discards) 0/1000/0
Output queue : (FIFO queue : Size/Length/Discards) 0/256/0

Last physical up time : -


Last physical down time : 2007-10-18 12:02:27 UTC-08:00
Port Mode: COMMON FIBER
Speed : 1000, Loopback: NONE
Duplex: FULL, Negotiation: ENABLE
Mdi : NORMAL
Last 300 seconds input rate 656 bits/sec, 1 packets/sec
Last 300 seconds output rate 763369936 bits/sec, 1490956 packets/sec
Input peak rate 27725312 bits/sec,Record time: 2007-10-18 12:15:22
Output peak rate 914311728 bits/sec,Record time: 2007-10-18 13:28:10
Input: 31218673 packets, 1998023440 bytes
Unicast : 731, Multicast : 2537
Broadcast : 31215405, Jumbo : 0
CRC : 0, Giants : 0
Jabbers : 0, Throttles : 0
Runts : 0, DropEvents : 0
Alignments : 0, Symbols : 0
Ignoreds : 0, Frames : 0
Discard : 31215393, Total Error : 0
Output: 8462849788 packets, 541622420480 bytes
Unicast : 1453, Multicast : 2597
Broadcast : 8462845739, Jumbo : 0
Collisions : 0, Deferreds : 0
Late Collisions: 0, ExcessiveCollisions: 0
Buffers Purged : 0
Discard : 0, Total Error : 0
Input bandwidth utilization threshold : 100.00%
Output bandwidth utilization threshold: 100.00%
Input bandwidth utilization : 0.01%
Output bandwidth utilization : 85.24%

Configuration Files
 Configuration file of Switch A
 #
 sysname SwitchA
 #
 vlan batch 10
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.1 255.255.255.0
 #
 interface GigabitEthernet1/0/0
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 bfd atob bind peer-ip default-ip interface GigabitEthernet1/0/0
 discriminator local 10
 discriminator remote 20
 process-interface-status
 #
return

 Configuration file of Switch B


 #
 sysname SwitchB
 #
 vlan batch 10
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.255.0
 #
 interface GigabitEthernet1/0/0
 port hybrid pvid vlan 10
 port hybrid untagged vlan10
 #
 bfd btoa bind peer-ip default-ip interface GigabitEthernet1/0/0
 discriminator local 20
 discriminator remote 10
 process-interface-status
 #
return

6.13.5 Example for Configuring Association Between a BFD Session and an


Interface
Networking Requirements
As shown in Figure 6-7, BFD can be configured on CEs and PEs; BFD sessions are created between PEs; CE1 is
connected to PE1 and PE2 and CE2 is connected to PE3 and PE4 in dual-homing mode. Normally, the traffic is
forwarded through the primary path CE1 -> PE1 -> PE3 -> CE2. If the BFD session between the PEs detects a fault on
the link, a fault notification message is encapsulated into a BFD packet and then sent to the OAM management
module. After receiving the BFD packet, the OAM management module triggers the physical status of the interface
bound to the BFD session to go Down.
NOTE:
The CEs must be directly connected to the PEs and no Layer 2 devices are deployed between CE and PE.

Figure 6-7 Networking diagram for configuring association between a BFD session and an interface

Configuration Roadmap
The configuration roadmap is as follows:
1. Set IP addresses of interfaces according to Figure 6-7.
2. Advertise routes through OSPF and set the OSPF cost of VLANIF40 on CE1 and VLANIF60 on CE2 to 10
so that traffic is transmitted through the primary path CE1 -> PE1 -> PE3 -> CE2.
3. Create a BFD session on PE1 to detect the directly connected link between PE1 and PE2.
4. Create a BFD session on PE3 to detect the directly connected link between PE2 and PE1.
5. Associate the BFD session with GE 1/0/1 on PE1 and associate the BFD session with GE 1/0/2 on PE3.

Data Preparation
To complete the configuration, you need the following data:
 VLANs allowed by interfaces
 Peer IP addresses to be detected by BFD sessions
 Local interface that sends and receives BFD control packets
 Local discriminators and remote discriminators of BFD sessions
Default values of the minimum interval for sending packets, the minimum interval for receiving packets, and the local
detection multiplier

Procedure
1. Set IP addresses.
Configure VLANs allowed by interfaces and assign IP addresses to VLANIF interfaces. For details,
see Figure 6-7.
The configuration details are not mentioned here.
2. Configure a routing protocol.
In this example, OSPF is used.
Run OSPF on CEs and PEs. To ensure that traffic is transmitted through the path CE1 -> PE1 -> PE3 ->
CE2, increase the OSPF cost of VLANIF 40 on CE1 and VLANIF 60 on CE2. For example, change the cost
to 10.
# Configure PE1.
[PE1] ospf 1
[PE1-ospf-1] area 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit

The configurations of PE2, PE3, and PE4 are similar to the configuration of PE1, and are not mentioned
here.
# Configure CE1.
[CE1] ospf 1
[CE1-ospf-1] area 0.0.0.0
[CE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] quit
[CE1-ospf-1] quit
[CE1] interface vlanif 40
[CE1-Vlanif40] ospf cost 10
[CE1-Vlanif40] quit

# Configure CE2.
[CE2] ospf 1
[CE2-ospf-1] area 0.0.0.0
[CE2-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] network 60.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] network 110.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] quit
[CE2-ospf-1] quit
[CE2] interface vlanif 60
[CE2-Vlanif60] ospf cost 10
[CE2-Vlanif60] quit

Run the display ip routing-table command on CE1, and you can view that the outbound interface for the
route from CE1 to 110.1.1.0/24 is VLANIF 10. That is, traffic is transmitted along the primary path.
[CE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15

Destination/Mask Proto Pre Cost Flags NextHop Interface


10.1.1.0/24 Direct 0 0 D 10.1.1.2 Vlanif10
10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
20.1.1.0/24 OSPF 10 2 D 10.1.1.2 Vlanif10
30.1.1.0/24 OSPF 10 3 D 110.1.1.2 Vlanif10
40.1.1.0/24 Direct 0 0 D 40.1.1.2 Vlanif40
40.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
40.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
50.1.1.0/24 OSPF 10 2 D 40.1.1.2 Vlanif40
60.1.1.0/24 OSPF 10 3 D 40.1.1.2 Vlanif40
110.1.1.0/24 OSPF 10 4 D 10.1.1.2 Vlanif10
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

3. Create BFD sessions.


# Configure PE1.
[PE1] bfd
[PE1-bfd] quit
[PE1] bfd pe1tope3 bind peer-ip 20.1.1.2 interface Vlanif20
[PE1-bfd-session-pe1tope3] discriminator local 1
[PE1-bfd-session-pe1tope3] discriminator remote 2
[PE1-bfd-session-pe1tope3] commit
[PE1-bfd-session-pe1tope3] quit

# Configure PE3.
[PE3] bfd
[PE3-bfd] quit
[PE3] bfd pe3tope1 bind peer-ip 20.1.1.1 interface Vlanif20
[PE3-bfd-session-pe3tope1] discriminator local 2
[PE3-bfd-session-pe3tope1] discriminator remote 1
[PE3-bfd-session-pe3tope1] commit
[PE3-bfd-session-pe3tope1] quit

4. Associate BFD sessions with interfaces.


Associate the BFD session with GE 1/0/1.
# Configure PE1.
[PE1] oam-mgr
[PE1-oam-mgr] oam-bind bfd-session 1 trigger if-down interface gigabitethernet 1/0/1
[PE1-oam-mgr] quit

# Configure PE3.
[PE3] oam-mgr
[PE3-oam-mgr] oam-bind bfd-session 2 trigger if-down interface gigabitethernet 1/0/2
[PE3-oam-mgr] quit

5. Verify the configuration.


Run the shutdown command on GE 1/0/1 of PE3 to simulate the link fault. After receiving the fault
notification message encapsulated into a BFD packet that is sent by the OAM management module, CE1 can
detect the link fault between PE1 and PE3.
Run the display bfd session all verbose command on PE1, and you can view that the BFD session becomes
Down and the value of Bind Application is ETHOAM.
[PE1] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 258 (Multi Hop) State : Down Name : pe1tope3
--------------------------------------------------------------------------------
Local Discriminator : 1 Remote Discriminator : 2
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Peer IP Address
Bind Session Type : Static
Bind Peer IP Address : 20.1.1.2
NextHop Ip Address : 20.1.1.2
Bind Interface : Vlanif20
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 254
Proc Interface Status : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : ETHOAM
Session TX TmrID : 1068 Session Detect TmrID : 1069
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 1/0

Run the display ip routing table command on CE1 to check the route from CE1 to CE2. The next hop
of 110.1.1.0/24 is 40.1.1.2. That is, the traffic is forwarded through the backup path.
[CE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.1.0/24 Direct 0 0 D 10.1.1.2 Vlanif10


10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
20.1.1.0/24 OSPF 10 2 D 10.1.1.2 Vlanif10
30.1.1.0/24 OSPF 10 3 D 110.1.1.2 Vlanif10
40.1.1.0/24 Direct 0 0 D 40.1.1.2 Vlanif40
40.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
40.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
50.1.1.0/24 OSPF 10 2 D 40.1.1.2 Vlanif40
60.1.1.0/24 OSPF 10 3 D 40.1.1.2 Vlanif40
110.1.1.0/24 OSPF 10 13 D 40.1.1.2 Vlanif40
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Configuration Files
 Configuration file of CE1
 #
 sysname CE1
 #
 vlan batch 10 40 100
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.1 255.255.255.252
 #
 interface Vlanif40
 ip address 40.1.1.1 255.255.255.252
 ospf cost 10
 #
 interface Vlanif100
 ip address 100.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 40
 port hybrid untagged vlan 40
 #
 interface GigabitEthernet1/0/3
 port hybrid pvid vlan 100
 port hybrid untagged vlan 100
 #
 ospf 1
 area 0.0.0.0
 network 10.1.1.0 0.0.0.255
 network 40.1.1.0 0.0.0.255
 network 100.1.1.0 0.0.0.255
 #
return

 Configuration file of CE2


 #
 sysname CE2
 #
 vlan batch 30 60 110
 #
 bfd
 #
 interface Vlanif30
 ip address 30.1.1.2 255.255.255.252
 #
 interface Vlanif60
 ip address 60.1.1.1 255.255.255.252
 ospf cost 10
 #
 interface Vlanif110
 ip address 110.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 30
 port hybrid untagged vlan 30
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 60
 port hybrid untagged vlan 60
 #
 interface GigabitEthernet1/0/3
 port hybrid pvid vlan 110
 port hybrid untagged vlan 110
 #
 ospf 1
 area 0.0.0.0
 network 30.1.1.0 0.0.0.255
 network 60.1.1.0 0.0.0.255
 network 110.1.1.0 0.0.0.255
 #
return

 Configuration file of PE1


 #
 sysname PE1
 #
 vlan batch 10 20
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.255.252
 #
 interface Vlanif20
 ip address 20.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
 bfd pe1tope3 bind peer-ip 20.1.1.2 interface Vlanif20
 discriminator local 1
 discriminator remote 2
 commit
 #
 ospf 1
 area 0.0.0.0
 network 10.1.1.0 0.0.0.255
 network 20.1.1.0 0.0.0.255
 #
 oam-mgr
 oam-bind ingress interface GigabitEthernet1/0/1 egress bfd-session 1 trigger if-down
 oam-bind ingress bfd-session 1 trigger if-down egress interface GigabitEthernet1/0/1
 #
return

 Configuration file of PE3


 #
 sysname PE3
 #
 vlan batch 20 30
 #
 bfd
 #
 interface Vlanif20
 ip address 20.1.1.2 255.255.255.252
 #
 interface Vlanif30
 ip address 30.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 30
 port hybrid untagged vlan 30
 #
 bfd pe3tope1 bind peer-ip 20.1.1.1 interface Vlanif20
 discriminator local 2
 discriminator remote 1
 commit
 #
 ospf 1
 area 0.0.0.0
 network 20.1.1.0 0.0.0.255
 network 30.1.1.0 0.0.0.255
 #
 oam-mgr
 oam-bind ingress interface GigabitEthernet1/0/2 egress bfd-session 1 trigger if-down
 oam-bind ingress bfd-session 1 trigger if-down egress interface GigabitEthernet1/0/2
 #
return

6.13.6 Example for Configuring Association Between the Status of BFD


Sessions
Networking Requirements
As shown in Figure 6-8, BFD runs between PEs and between PEs and CEs. CE1 is connected to PE1 and PE2, and
CE2 is connected to PE3 and PE4 in dual-homing mode. Normally, the traffic is forwarded through the primary path
CE1 -> PE1 -> PE3 -> CE2. When a fault occurs on the link between PE1 and PE3, a fault notification message is
transmitted to CE1 and CE2 through association between the status of BFD sessions on PE1 and PE3. Then, the traffic
is switched to the standby path CE1 -> PE2 -> PE4 -> CE2.
In this case, you can deploy association between the status of BFD sessions. When the BFD session between the PEs
detects a fault, a fault notification message is encapsulated into a BFD packet and sent to the remote CE through the
OAM management module. Then the CE detects the fault and switches the traffic to the backup link.
Figure 6-8 Networking diagram for configuring association between the status of BFD sessions

Configuration Roadmap
The configuration roadmap is as follows:
1. Create BFD sessions between CE1 and PE1, between PE1 and PE3, and between PE3 and CE2.
2. On PE1, configure bidirectional transmission of fault notification messages between CE1 and PE1 and
between PE1 and PE3.
3. On PE3, configure bidirectional transmission of fault notification messages between PE1 and PE3 and
between PE3 and CE2.

NOTE:
In this example, PEs and CEs are Switches.

Data Preparation
To complete the configuration, you need the following data:
 VLAN IDs of frames that are allowed on the interfaces
 Peer IP address bound to the BFD session
 Local interface that sends and receives BFD control packets
 Local discriminator and remote discriminator of the BFD session
Default values of the minimum interval for sending packets, the minimum interval for receiving packets, and the local
detection multiplier
Procedure
1. Set IP addresses.
Configure the VLAN IDs of frames allowed by interfaces and assign IP addresses to VLANIF interfaces. For
details, see Figure 6-8.
The configuration details are not mentioned here.
2. Configure the routing protocol.
In this example, OSPF is used.
Run OSPF on CE and PE devices. To ensure that traffic is transmitted through the path CE1 -> PE1 -> PE3 -
> CE2, increase the OSPF cost on VLANIF 40 of CE1 and VLANIF 60 of CE2. For example, change the
cost to 10.
# Configure PE1.
[PE1] ospf 1
[PE1-ospf-1] area 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit

The configurations of PE2, PE3, and PE4 are similar to the configuration of PE1, and are not mentioned
here.
# Configure CE1.
[CE1] ospf 1
[CE1-ospf-1] area 0.0.0.0
[CE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] quit
[CE1-ospf-1] quit
[CE1] interface vlanif 40
[CE1-Vlanif40] ospf cost 10
[CE1-Vlanif40] quit

# Configure CE2.
[CE2] ospf 1
[CE2-ospf-1] area 0.0.0.0
[CE2-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] network 60.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] network 110.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] quit
[CE2-ospf-1] quit
[CE2] interface vlanif 60
[CE2-Vlanif60] ospf cost 10
[CE2-Vlanif60] quit

Run the display ip routing-table command on CE1, and you can view that the outgoing interface for the
route from CE1 to 110.1.1.0/24 is VLANIF 10. That is, the traffic is transmitted through the primary path.
[CE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15

Destination/Mask Proto Pre Cost Flags NextHop Interface


10.1.1.0/24 Direct 0 0 D 10.1.1.2 Vlanif10
10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
20.1.1.0/24 OSPF 10 2 D 10.1.1.2 Vlanif10
30.1.1.0/24 OSPF 10 3 D 110.1.1.2 Vlanif10
40.1.1.0/24 Direct 0 0 D 40.1.1.2 Vlanif40
40.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
40.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
50.1.1.0/24 OSPF 10 2 D 40.1.1.2 Vlanif40
60.1.1.0/24 OSPF 10 3 D 40.1.1.2 Vlanif40
110.1.1.0/24 OSPF 10 4 D 10.1.1.2 Vlanif10
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

3. Create BFD sessions.


# Configure CE1.
[CE1] bfd
[CE1-bfd] quit
[CE1] bfd ce1tope1 peer-ip 10.1.1.2 interface vlanif 10
[CE1-bfd-session-ce1tope1] discriminator local 10
[CE1-bfd-session-ce1tope1] discriminator remote 11
[CE1-bfd-session-ce1tope1] quit

# Configure PE1.
[PE1] bfd
[PE1-bfd] quit
[PE1] bfd pe1toce1 peer-ip 10.1.1.1 interface vlanif 10
[PE1-bfd-session-pe1toce1] discriminator local 11
[PE1-bfd-session-pe1toce1] discriminator remote 10
[PE1-bfd-session-pe1toce1] quit
[PE1] bfd pe1tope3 peer-ip 20.1.1.2 interface vlanif 20
[PE1-bfd-session-pe1tope3] discriminator local 13
[PE1-bfd-session-pe1tope3] discriminator remote 31
[PE1-bfd-session-pe1tope3] quit

# Configure PE3.
[PE3] bfd
[PE3-bfd] quit
[PE3] bfd pe3toce2 peer-ip 30.1.1.2 interface vlanif 30
[PE3-bfd-session-pe3toce2] discriminator local 32
[PE3-bfd-session-pe3toce2] discriminator remote 23
[PE3-bfd-session-pe3toce2] quit
[PE3] bfd pe3tope1 peer-ip 20.1.1.1 interface vlanif 20
[PE3-bfd-session-pe3tope1] discriminator local 31
[PE3-bfd-session-pe3tope1] discriminator remote 13
[PE3-bfd-session-pe3tope1] quit

# Configure CE2.
[CE2] bfd
[CE2-bfd] quit
[CE2] bfd ce2tope3 peer-ip 30.1.1.1 interface vlanif 10
[CE2-bfd-session-ce2tope3] discriminator local 23
[CE2-bfd-session-ce2tope3] discriminator remote 32
[CE2-bfd-session-ce2tope3] quit
After the configuration, run the display bfd session all command on PEs and CEs, and you can view that the
status of the BFD sessions is Up. Take the display on PE1 as an example.
[PE1] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
11 10 10.1.1.1 Up S_IP_IF Vlanif10
13 31 20.1.1.2 Up S_IP_IF Vlanif20
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0

4. Associate the status between BFD sessions.


Associate the status between BFD sessions on PE1 and PE3.
# Configure PE1.
[PE1] oam-mgr
[PE1-oam-mgr] oam-bind bfd-session 11 bfd-session 13
[PE1-oam-mgr] quit

# Configure PE3.
[PE1] oam-mgr
[PE1-oam-mgr] oam-bind bfd-session 31 bfd-session 32
[PE1-oam-mgr] quit

5. Verify the configuration.


# Run the shutdown command on GE 1/0/2 of PE1 to simulate the fault on the link.
Run the display bfd session peer-ip command on PE1 or PE3 to check the status of the BFD session created
with the peer. Take the display on PE1 as an example:
[PE1] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
13 31 20.1.1.2 Down S_IP_IF Vlanif20
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0

Run the display bfd session all verbose command on CE1 or CE3, and you can view that the status of the
BFD session is Down. Take the display on CE1 as an example:
[CE1]display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 4096 (One Hop) State : Down Name : ce1tope1
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 11
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(Vlanif10)
Bind Session Type : Static
Bind Peer IP Address : 10.1.1.2
NextHop Ip Address : 10.1.1.2
Bind Interface : Vlanif10
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 1000 Actual Rx Interval (ms): 1000
Local Detect Multi : 3 Detect Interval (ms) : -
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Last Local Diagnostic : No Diagnostic
Bind Application : ETHOAM
Session TX TmrID : 16392 Session Detect TmrID : -
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 | OAMF-1
Session Description : -
--------------------------------------------------------------------------------

Total UP/DOWN Session Number : 0/1

Run the display ip routing table command on CE1 to check the route from CE1 to CE2. The next hop
of 110.1.1.0/24 is 40.1.1.2. That is, the traffic is forwarded through the standby path.
[CE1] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.1.0/24 Direct 0 0 D 10.1.1.2 Vlanif10


10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
20.1.1.0/24 OSPF 10 2 D 10.1.1.2 Vlanif10
30.1.1.0/24 OSPF 10 3 D 110.1.1.2 Vlanif10
40.1.1.0/24 Direct 0 0 D 40.1.1.2 Vlanif40
40.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
40.1.1.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
50.1.1.0/24 OSPF 10 2 D 40.1.1.2 Vlanif40
60.1.1.0/24 OSPF 10 3 D 40.1.1.2 Vlanif40
110.1.1.0/24 OSPF 10 13 D 40.1.1.2 Vlanif40
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Configuration Files
 Configuration file of CE1
 #
 sysname CE1
 #
 vlan batch 10 40 100
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.1 255.255.255.252
 #
 interface Vlanif40
 ip address 40.1.1.1 255.255.255.252
 ospf cost 10
 #
 interface Vlanif100
 ip address 100.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 40
 port hybrid untagged vlan 40
 #
 interface GigabitEthernet1/0/3
 port hybrid pvid vlan 100
 port hybrid untagged vlan 100
 #
 bfd ce1tope1 bind peer-ip 10.1.1.2 interface Vlanif10
 discriminator local 10
 discriminator remote 11
 commit
 #
 ospf 1
 area 0.0.0.0
 network 10.1.1.0 0.0.0.255
 network 40.1.1.0 0.0.0.255
 network 100.1.1.0 0.0.0.255
 #
return

 Configuration file of CE2


 #
 sysname CE2
 #
 vlan batch 30 60 110
 #
 bfd
 #
 interface Vlanif30
 ip address 30.1.1.2 255.255.255.252
 #
 interface Vlanif60
 ip address 60.1.1.1 255.255.255.252
 ospf cost 10
 #
 interface Vlanif110
 ip address 110.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 30
 port hybrid untagged vlan 30
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 60
 port hybrid untagged vlan 60
 #
 interface GigabitEthernet1/0/3
 port hybrid pvid vlan 110
 port hybrid untagged vlan 110
 #
 bfd ce2tope3 bind peer-ip 30.1.1.1 interface Vlanif30
 discriminator local 23
 discriminator remote 32
 #
 ospf 1
 area 0.0.0.0
 network 30.1.1.0 0.0.0.255
 network 60.1.1.0 0.0.0.255
 network 110.1.1.0 0.0.0.255
 #
return

 Configuration file of PE1


 #
 sysname PE1
 #
 vlan batch 10 20
 #
 bfd
 #
 interface Vlanif10
 ip address 10.1.1.2 255.255.255.252
 #
 interface Vlanif20
 ip address 20.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
 bfd pe1toce1 bind peer-ip 10.1.1.1 interface Vlanif10
 discriminator local 11
 discriminator remote 10
 #
 bfd pe1tope3 bind peer-ip 20.1.1.2 interface Vlanif20
 discriminator local 13
 discriminator remote 31
 #
 ospf 1
 area 0.0.0.0
 network 10.1.1.0 0.0.0.255
 network 20.1.1.0 0.0.0.255
 #
 oam-mgr
 oam-bind ingress bfd-session 11 egress bfd-session 13
 oam-bind ingress bfd-session 13 egress bfd-session 11
 #
return

 Configuration file of PE3


 #
 sysname PE3
 #
 vlan batch 20 30
 #
 bfd
 #
 interface Vlanif20
 ip address 20.1.1.2 255.255.255.252
 #
 interface Vlanif30
 ip address 30.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 20
 port hybrid untagged vlan 20
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 30
 port hybrid untagged vlan 30
 #
 bfd pe3tope1 bind peer-ip 20.1.1.1 interface Vlanif20
 discriminator local 31
 discriminator remote 13
 commit
 #
 bfd pe3toce2 bind peer-ip 30.1.1.2 interface Vlanif30
 discriminator local 32
 discriminator remote 23
 commit
 #
 ospf 1
 area 0.0.0.0
 network 20.1.1.0 0.0.0.255
 network 30.1.1.0 0.0.0.255
 #
 oam-mgr
 oam-bind ingress bfd-session 31 egress bfd-session 32
 oam-bind ingress bfd-session 32 egress bfd-session 31
 #
return

 Configuration file of PE2


 #
 sysname PE2
 #
 vlan batch 40 50
 #
 bfd
 #
 interface Vlanif40
 ip address 40.1.1.2 255.255.255.252
 #
 interface Vlanif50
 ip address 50.1.1.1 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 40
 port hybrid untagged vlan 40
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 50
 port hybrid untagged vlan 50
 #
 ospf 1
 area 0.0.0.0
 network 40.1.1.0 0.0.0.255
 network 50.1.1.0 0.0.0.255
 #
return

 Configuration file of PE4


 #
 sysname PE4
 #
 vlan batch 50 60
 #
 bfd
 #
 interface Vlanif50
 ip address 50.1.1.2 255.255.255.252
 #
 interface Vlanif60
 ip address 60.1.1.2 255.255.255.252
 #
 interface GigabitEthernet1/0/1
 port hybrid pvid vlan 50
 port hybrid untagged vlan 50
 #
 interface GigabitEthernet1/0/2
 port hybrid pvid vlan 60
 port hybrid untagged vlan 60
 #
 ospf 1
 area 0.0.0.0
 network 50.1.1.0 0.0.0.255
 network 60.1.1.0 0.0.0.255
 #
return

You might also like