Configuration Examples for BFD
This section provides BFD configuration examples.
- Example for Configuring Single-Hop BFD for a Layer 3 Eth-Trunk
- Example for Configuring BFD to Monitor VPN Routes
- Example for Configuring BFD for Static VPN Routes
- Example for Configuring Multi-hop BFD
- Example for Configuring Single-hop BFD for IPv6
- Example for Configuring Multi-hop BFD for IPv6
- Example for Configuring Sub-Interfaces for QinQ VLAN Tag Termination to Support BFD
- Example for Configuring Sub-Interfaces for Dot1q VLAN Tag Termination to Support BFD
- Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults
- Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults (IPv6)
- Example for Configuring a One-Arm BFD Echo Session
- Example for Configuring the Delay of a BFD Session to Go Up
- Example for Associating a BFD Session with an Interface
- Example for Associating a BFD Session and a Sub-interface
- Example for Enabling BFD to Modify the PST
- Example for Configuring Static BFD for TE with Automatically Negotiated Discriminators
Example for Configuring Single-Hop BFD for a Layer 3 Eth-Trunk
This section provides an example for establishing single-hop BFD sessions on Eth-Trunk interfaces to monitor the directly connected link between the Eth-Trunk interfaces.
Networking Requirements
Eth-Trunks enhance link reliability. BFD sessions are established to rapidly monitor Eth-Trunks. As shown in Figure 3-5, the Eth-Trunk connecting Device A and Device B consists of two GE links.
This example requires BFD to be performed over the Eth-Trunk.
Precautions
BFD sessions must be established on the Eth-Trunk interface of both the local and remote devices.
Configuration Roadmap
The configuration roadmap is as follows:
Create an Eth-Trunk interface on both the local and remote devices.
Configure single-hop BFD for the Eth-Trunk.
Data Preparation
To complete the configuration, you need the following data:
Local Eth-Trunk interface that sends and receives BFD control packets
Peer IP address monitored by BFD (the IP address of the Eth-Trunk interface)
Names of the BFD sessions for monitoring the Eth-Trunk
Local and remote discriminators of BFD sessions
Procedure
- Configure an Eth-Trunk interface.
# Create an Eth-Trunk interface on Device A and set the lower threshold of the Eth-Trunk in the Up state to 1.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface eth-trunk 1
[*DeviceA-Eth-Trunk1] undo shutdown
[*DeviceA-Eth-Trunk1] ip address 10.1.1.1 24
[*DeviceA-Eth-Trunk1] least active-linknumber 1
[*DeviceA-Eth-Trunk1] commit
[~DeviceA-Eth-Trunk1] quit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-Gigabitethernet0/1/0] undo shutdown
[*DeviceA-Gigabitethernet0/1/0] eth-trunk 1
[*DeviceA-Gigabitethernet0/1/0] commit
[~DeviceA-Gigabitethernet0/1/0] quit
[~DeviceA] interface gigabitethernet 0/2/0
[~DeviceA-Gigabitethernet0/2/0] undo shutdown
[*DeviceA-Gigabitethernet0/2/0] eth-trunk 1
[*DeviceA-Gigabitethernet0/2/0] commit
[~DeviceA-Gigabitethernet0/2/0] quit
# Create an Eth-Trunk interface on Device B and set the lower threshold of the Eth-Trunk in the Up state to 1.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface eth-trunk 1
[*DeviceB-Eth-Trunk1] undo shutdown
[*DeviceB-Eth-Trunk1] ip address 10.1.1.2 24
[*DeviceB-Eth-Trunk1] least active-linknumber 1
[*DeviceB-Eth-Trunk1] commit
[~DeviceB-Eth-Trunk1] quit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-Gigabitethernet0/1/0] undo shutdown
[*DeviceB-Gigabitethernet0/1/0] eth-trunk 1
[*DeviceB-Gigabitethernet0/1/0] commit
[~DeviceB-Gigabitethernet0/1/0] quit
[~DeviceB] interface gigabitethernet 0/2/0
[~DeviceB-Gigabitethernet0/2/0] undo shutdown
[*DeviceB-Gigabitethernet0/2/0] eth-trunk 1
[*DeviceB-Gigabitethernet0/2/0] commit
[~DeviceB-Gigabitethernet0/2/0] quit
After completing the configurations, run the display interface eth-trunk command on Device A or Device B. The command output shows that the interface status is Up.
The following example uses the command output on Device A.
[~DeviceA] display interface eth-trunk 1
Eth-Trunk1 current state : UP (ifindex: 19) Line protocol current state : UP Last line protocol up time : 2010-08-04 08:34:41 Description: HUAWEI, Quidway Series, Eth-Trunk1 Interface Route Port,Hash arithmetic : According to flow,Maximal BW: 100M, Current BW: 100 M, The Maximum Transmit Unit is 1500 Internet Address is 10.1.1.1/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 38db-1520-0100 Current system time: 2010-08-04 08:35:02 Physical is ETH_TRUNK Last 300 seconds input rate 0 bits/sec, 0 packets/sec Last 300 seconds output rate 0 bits/sec, 0 packets/sec Realtime 0 seconds input rate 0 bits/sec, 0 packets/sec Realtime 0 seconds output rate 0 bits/sec, 0 packets/sec Input: 0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops, Output:0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops Last 300 seconds input utility rate: 0.00% Last 300 seconds output utility rate: 0.00% ----------------------------------------------------- PortName Status Weight ----------------------------------------------------- Gigabitethernet0/1/0 UP 1 Gigabitethernet0/2/0 UP 1 ----------------------------------------------------- The Number of Ports in Trunk : 2 The Number of UP Ports in Trunk : 2
The Eth-Trunk interfaces on Device A and Device B can ping each other.
The following example uses the command output on Device A.
[~DeviceA] ping -a 10.1.1.1 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=31 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=31 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=62 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=62 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=62 ms
--- 10.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/49/62 ms
- Configure single-hop BFD for the Eth-Trunk.
# Enable BFD on Device A and establish a BFD session to monitor the link from Device A to Device B. Bind the BFD session to the Eth-Trunk interface.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind peer-ip 10.1.1.2 interface eth-trunk 1
[*DeviceA-bfd-session-atob] discriminator local 10
[*DeviceA-bfd-session-atob] discriminator remote 20
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Enable BFD on Device B and establish a BFD session to monitor the link from Device B to Device A. Bind the BFD session to the Eth-Trunk interface.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd btoa bind peer-ip 10.1.1.1 interface eth-trunk 1
[*DeviceB-bfd-session-btoa] discriminator local 20
[*DeviceB-bfd-session-btoa] discriminator remote 10
[*DeviceB-bfd-session-btoa] commit
[~DeviceB-bfd-session-btoa] quit
- Verify the configuration.
After completing the configurations, run the display bfd session all verbose command on Device A and Device B. The command output shows that a single-hop BFD session has been established and its status is Up.
The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : atob ------------------------------------------------------------------------------ Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(Eth-Trunk1) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : Eth-Trunk1 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 2584985432 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
# Run the shutdown command on GE 0/1/0 of Device A to simulate a link fault.
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-Gigabitethernet0/1/0] shutdown
[*DeviceA-Gigabitethernet0/1/0] commit
[~DeviceA-Gigabitethernet0/1/0] quit
Run the display bfd session all verbose and display interface eth-trunk commands on Device A and Device B. The command output shows that the statuses of the BFD session and Eth-Trunk interface are still Up.
The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : Up Name : atob ------------------------------------------------------------------------------ Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(Eth-Trunk1) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : Eth-Trunk1 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : Control Detection Time Expired Bind Application : No Application Bind Session TX TmrID : 2584985432 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
[~DeviceA] display interface eth-trunk 1
Eth-Trunk1 current state : UP Line protocol current state : UP Description : HUAWEI, Quidway Series, Eth-Trunk1 Interface, Route Port Hash arithmetic : According to flow,Maximal BW: 200M, Current BW: 0M The Maximum Transmit Unit is 1500 bytes Internet Address is 10.1.1.1/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc12-7890 Physical is ETH_TRUNK Last 300 seconds input rate 0 bits/sec, 0 packets/sec Last 300 seconds output rate 0 bits/sec, 0 packets/sec Realtime 0 seconds input rate 0 bits/sec, 0 packets/sec Realtime 0 seconds output rate 0 bits/sec, 0 packets/sec Input: 0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops,0 unknownprotocol Output:0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops ----------------------------------------------------- PortName Status Weight ----------------------------------------------------- Gigabitethernet0/1/0 DOWN 1 Gigabitethernet0/2/0 UP 1 ----------------------------------------------------- The Number of Ports in Trunk : 2 The Number of UP Ports in Trunk : 1
Run the shutdown command on GE 0/2/0 of Device A to simulate a link fault.
[~DeviceA] interface gigabitethernet 0/2/0
[~DeviceA-Gigabitethernet0/2/0] shutdown
[*DeviceA-Gigabitethernet0/2/0] commit
[~DeviceA-Gigabitethernet0/2/0] quit
Run the display bfd session all verbose and display interface eth-trunk commands on Device A and Device B. The command output shows that the statuses of the BFD session and Eth-Trunk interface are both Down.
The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Down Name : atob ------------------------------------------------------------------------------ Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(Eth-Trunk1) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : Eth-Trunk1 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 2584985432 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 0/1
[~DeviceA] display interface eth-trunk 1
Eth-Trunk1 current state : DOWN Line protocol current state : DOWN Description : HUAWEI, Quidway Series, Eth-Trunk1 Interface, Route Port Hash arithmetic : According to flow,Maximal BW: 200M, Current BW: 0M The Maximum Transmit Unit is 1500 bytes Internet Address is 10.1.1.1/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-4b0c-f700 Physical is ETH_TRUNK Last 300 seconds input rate 0 bits/sec, 0 packets/sec Last 300 seconds output rate 0 bits/sec, 0 packets/sec Realtime 0 seconds input rate 0 bits/sec, 0 packets/sec Realtime 0 seconds output rate 0 bits/sec, 0 packets/sec Input: 0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops,0 unknownprotocol Output:0 packets,0 bytes, 0 unicast,0 broadcast,0 multicast 0 errors,0 drops ----------------------------------------------------- PortName Status Weight ----------------------------------------------------- Gigabitethernet0/1/0 DOWN 1 Gigabitethernet0/2/0 DOWN 1 ----------------------------------------------------- The Number of Ports in Trunk : 2 The Number of UP Ports in Trunk : 0
Configuration Files
Device A configuration file
#
sysname DeviceA
#
bfd
#
interface Eth-Trunk1
ip address 10.1.1.1 255.255.255.0
#
interface Gigabitethernet0/1/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/2/0
undo shutdown
eth-trunk 1
#
bfd atob bind peer-ip 10.1.1.2 interface Eth-Trunk 1
discriminator local 10
discriminator remote 20
return
Device B configuration file
#
sysname DeviceB
#
bfd
#
interface Eth-Trunk1
ip address 10.1.1.2 255.255.255.0
#
interface Gigabitethernet0/1/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/2/0
undo shutdown
eth-trunk 1
#
bfd btoa bind peer-ip 10.1.1.1 interface Eth-Trunk 1
discriminator local 20
discriminator remote 10
return
Example for Configuring BFD to Monitor VPN Routes
This section provides an example for configuring BFD to monitor VPN routes.
Networking Requirements
As shown in Figure 3-6:
CE1 and CE2 belong to VPN-A and access the MPLS backbone network through PE1 and PE2, respectively.
GE 0/1/0 of PE1 and GE 0/1/0 of PE2 are bound to VPN-A.
BFD in asynchronous mode is used to monitor the VPN route between PE1 and PE2.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on PE1 to monitor the multi-hop path from PE1 to PE2.
Configure a BFD session on PE2 to monitor the multi-hop path from PE2 to PE1.
Data Preparation
To complete the configuration, you need the following data:
Peer IP address monitored by BFD
BFD session names
Local and remote discriminators of BFD sessions
Procedure
- Assign an IP address to each interface. For configuration details, see Configuration Files in this section.
- Configure the MPLS backbone network to interconnect PE1 and PE2. For configuration details, see Configuration Files in this section.
- Configure a VPN instance. For configuration details, see Configuration Files in this section.
- Configure the route between PE1 and PE2 to be reachable. For configuration details, see Configuration Files in this section.
After the configurations are complete, PE1 can ping the IP address of GE 0/1/0 on PE2.
<PE1> ping -vpn-instance vpna 10.2.1.2
PING 10.2.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.2.1.2: bytes=56 Sequence=1 ttl=254 time=60 ms
Reply from 10.2.1.2: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 10.2.1.2: bytes=56 Sequence=3 ttl=254 time=50 ms
Reply from 10.2.1.2: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 10.2.1.2: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 10.2.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 50/54/60 ms
- Configure BFD to monitor the VPN route between PE1 and PE2.
# Enable BFD on PE1, establish a BFD session with PE2, and bind the session to the VPN instance.
[~PE1] bfd
[*PE1-bfd] quit
[*PE1] bfd 1to2_vpn bind peer-ip 10.2.1.2 vpn-instance vpna
[*PE1-bfd-session-1to2_vpn] discriminator local 12
[*PE1-bfd-session-1to2_vpn] discriminator remote 21
[*PE1-bfd-session-1to2_vpn] commit
[~PE1-bfd-session-1to2_vpn] quit
# Enable BFD on PE2, establish a BFD session with PE1, and bind the session to the VPN instance.
[~PE2] bfd
[*PE2-bfd] quit
[*PE2] bfd 2to1_vpn bind peer-ip 10.1.1.2 vpn-instance vpna
[*PE2-bfd-session-2to1_vpn] discriminator local 21
[*PE2-bfd-session-2to1_vpn] discriminator remote 12
[*PE2-bfd-session-2to1_vpn] commit
[~PE2-bfd-session-2to1_vpn] quit
- Verify the configuration.
After completing the configurations, run the display bfd session peer-ip vpn-instance vpn-name verbose command on PE1 and PE2. The command output shows that a multi-hop BFD session has been established and its status is Up.
The following example uses the command output on PE1.
<PE1> display bfd session peer-ip 10.2.1.2 vpn-instance vpna verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (Multi Hop) State : Up Name : 1to2_vpn ------------------------------------------------------------------------------ Local Discriminator : 12 Remote Discriminator : 21 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer Ip Address Bind Session Type : Static Bind Peer IP Address : 10.2.1.2 Bind Interface : - Vpn Instance Name : vpna FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 4784 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 : - 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
Configuration Files
PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
route-distinguisher 100:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
bfd
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface gigabitethernet0/1/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 172.16.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
#
ipv4-family vpn-instance vpna
peer 10.1.1.1 as-number 65410
import-route direct
#
ospf 100
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 172.16.1.0 0.0.0.255
#
bfd 1to2_vpn bind peer-ip 10.2.1.2 vpn-instance vpna
discriminator local 12
discriminator remote 21
return
PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
route-distinguisher 200:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
bfd
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 172.16.2.2 255.255.255.0
mpls
mpls ldp
#
interface gigabitethernet0/1/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpna
peer 10.2.1.1 as-number 65420
import-route direct
#
ospf 100
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 172.16.2.0 0.0.0.255
#
bfd 2to1_vpn bind peer-ip 10.1.1.2 vpn-instance vpna
discriminator local 21
discriminator remote 12
return
P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 172.16.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 172.16.2.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 100
area 0.0.0.0
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
network 2.2.2.2 0.0.0.0
return
CE1 configuration file
#
sysname CE1
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
import-route direct
peer 10.1.1.2 enable
return
CE2 configuration file
#
sysname CE2
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
import-route direct
peer 10.2.1.2 enable
return
Example for Configuring BFD for Static VPN Routes
In CE dual-homing networking, after a static route on a CE is bound to a BFD session, the static route can detect link faults or refresh itself based on the BFD session status. This implementation ensures quick VPN traffic convergence.
Networking Requirements
On the network shown in Figure 3-7, CE1 and CE2 belong to VPN A. Two default routes with the next hops as PE1 and PE2 respectively are configured on CE1. The two routes work in load-balancing mode. The static routes bound to VPN A are configured on PE1 and PE2 separately and are imported to BGP.
BFD sessions are established between PE1 and CE1, and between PE2 and CE1. It is required that BFD be configured on PE1 and PE2 to detect the link faults of static VPN routes. In normal situations, the traffic from CE1 to the public network can be forwarded through PE1 and PE2 in load balancing mode. If the link between CE1 and PE1 or PE2 fails, CE1 detects the link fault by tracking BFD session status and updates the route. Then, CE1 switches traffic to the other link for transmission.
Configuration Notes
When configuring BFD for static VPN routes, ensure that the CE is dual-homed to two PEs configured with VPN instances of different RDs.
Configuration Roadmap
The configuration roadmap is as follows:
Configure OSPF for PEs on the MPLS backbone network to communicate.
Establish MPLS LSPs between PEs.
Configure VPN instances on PEs and bind each interface that connects a PE to a CE to the VPN instance on that PE.
Configure MP-IBGP on the PEs to exchange VPN routing information.
Configure two default routes with the next hops as PE1 and PE2 respectively on CE1 to implement load balancing between PE1 and PE2.
Configure a static route bound to VPN A on PE1 and PE2 and import the static route into BGP.
Configure an MP-EBGP peer relationship between PE3 and CE2.
Configure static BFD sessions with automatically negotiated discriminators between PE1 and CE1, and between PE2 and CE1.
Configure BFD for VPN static routes on PE1 and PE2.
Data Preparation
To complete the configuration, you need the following data:
- MPLS LSR IDs of the PEs
- Names, RDs, and VPN targets of the VPN instances on the PEs
- Local and peer IP addresses of the BFD session
Procedure
- Configure an IGP for PEs on the MPLS backbone network to communicate. This example uses OSPF as the IGP.
# Configure PE1.
<HUAWEI> system-view [~HUAWEI] sysname PE1 [*HUAWEI] commit [~PE1] interface loopback 1 [*PE1-LoopBack1] ip address 2.2.2.2 32 [*PE1-LoopBack1] commit [*PE1-LoopBack1] quit [*PE1] interface gigabitethernet 0/1/0 [*PE1-GigabitEthernet0/1/0] ip address 11.11.11.1 24 [*PE1-GigabitEthernet0/1/0] commit [*PE1-GigabitEthernet0/1/0] quit [*PE1] interface gigabitethernet 0/2/0 [*PE1-GigabitEthernet0/2/0] ip address 33.33.33.1 24 [*PE1-GigabitEthernet0/2/0] commit [*PE1-GigabitEthernet0/2/0] quit [*PE1] ospf [*PE1-ospf-1] area 0 [*PE1-ospf-1-area-0.0.0.0] network 11.11.11.0 0.0.0.255 [*PE1-ospf-1-area-0.0.0.0] network 33.33.33.0 0.0.0.255 [*PE1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0 [*PE1-ospf-1-area-0.0.0.0] commit [~PE1-ospf-1-area-0.0.0.0] quit [~PE1-ospf-1] quit
Configure PE2.
<HUAWEI> system-view [~HUAWEI] sysname PE2 [*HUAWEI] commit [~PE2] interface loopback 1 [*PE2-LoopBack1] ip address 3.3.3.3 32 [*PE2-LoopBack1] commit [*PE2-LoopBack1] quit [*PE2] interface gigabitethernet 0/1/0 [*PE2-GigabitEthernet0/1/0] ip address 22.22.22.1 24 [*PE2-GigabitEthernet0/1/0] commit [*PE2-GigabitEthernet0/1/0] quit [*PE2] interface gigabitethernet 0/2/0 [*PE2-GigabitEthernet0/2/0] ip address 33.33.33.2 24 [*PE2-GigabitEthernet0/2/0] commit [*PE2-GigabitEthernet0/2/0] quit [*PE2] ospf [*PE2-ospf-1] area 0 [*PE2-ospf-1-area-0.0.0.0] network 22.22.22.0 0.0.0.255 [*PE2-ospf-1-area-0.0.0.0] network 33.33.33.0 0.0.0.255 [*PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0 [*PE2-ospf-1-area-0.0.0.0] commit [~PE2-ospf-1-area-0.0.0.0] quit [~PE2-ospf-1] quit
Configure PE3.<HUAWEI> system-view [~HUAWEI] sysname PE3 [*HUAWEI] commit [~PE3] interface loopback 1 [*PE3-LoopBack1] ip address 4.4.4.4 32 [*PE3-LoopBack1] [*PE3-LoopBack1] quit [*PE3-LoopBack1] [*PE3-LoopBack1] quit [*PE3-LoopBack1] quit [*PE3] interface gigabitethernet 0/1/0 [*PE3-GigabitEthernet0/1/0] ip address 11.11.11.2 24 [*PE3-GigabitEthernet0/1/0] commit [*PE3-GigabitEthernet0/1/0] quit [*PE3] interface gigabitethernet 0/2/0 [*PE3-GigabitEthernet0/2/0] ip address 22.22.22.2 24 [*PE3-GigabitEthernet0/2/0] commit [*PE3-GigabitEthernet0/2/0] quit [*PE3] ospf [*PE3-ospf-1] area 0 [*PE3-ospf-1-area-0.0.0.0] network 11.11.11.0 0.0.0.255 [*PE3-ospf-1-area-0.0.0.0] network 22.22.22.0 0.0.0.255 [*PE3-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0 [*PE3-ospf-1-area-0.0.0.0] commit [~PE3-ospf-1-area-0.0.0.0] quit [~PE3-ospf-1] quit
After the configurations are complete, OSPF neighbor relationships can be set up between PE1, PE2, and PE3. Run the display ip routing-table command. The command output shows that the PEs have learned the routes to each other's Loopback 1 interface.
The following example uses the command output on PE1.
<PE1> display ip routing-table
<keyword conref="../commonterms/commonterms.xml#commonterms/route-flags"></keyword> ------------------------------------------------------------------------------ Routing Tables: _public_ Destinations : 14 Routes : 15 Destination/Mask Proto Pre Cost Flags NextHop Interface 2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack1 3.3.3.3/32 OSPF 10 2 D 33.33.33.2 GigabitEthernet0/2/0 4.4.4.4/32 OSPF 10 2 D 11.11.11.2 GigabitEthernet0/1/0 11.11.11.0/24 Direct 0 0 D 11.11.11.1 GigabitEthernet0/1/0 11.11.11.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/1/0 11.11.11.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/1/0 22.22.22.0/24 OSPF 10 2 D 11.11.11.2 GigabitEthernet0/1/0 OSPF 10 2 D 33.33.33.2 GigabitEthernet0/2/0 33.33.33.0/24 Direct 0 0 D 33.33.33.1 GigabitEthernet0/2/0 33.33.33.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/2/0 33.33.33.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/2/0 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
- Configure MPLS and MPLS LDP both globally and per interface on each node of the backbone network and set up LDP LSPs.
# Configure PE1.
[~PE1] mpls lsr-id 2.2.2.2 [*PE1] mpls [*PE1-mpls] quit [*PE1] mpls ldp [*PE1-mpls-ldp] quit [*PE1] interface gigabitethernet 0/1/0 [*PE1-GigabitEthernet0/1/0] mpls [*PE1-GigabitEthernet0/1/0] mpls ldp [*PE1-GigabitEthernet0/1/0] commit [*PE1-GigabitEthernet0/1/0] quit [*PE1] interface gigabitethernet 0/2/0 [*PE1-GigabitEthernet0/2/0] mpls [*PE1-GigabitEthernet0/2/0] mpls ldp [*PE1-GigabitEthernet0/2/0] commit [~PE1-GigabitEthernet0/2/0] quit
# Configure PE2.
[~PE2] mpls lsr-id 3.3.3.3 [*PE2] mpls [*PE2-mpls] quit [*PE2] mpls ldp [*PE2-mpls-ldp] quit [*PE2] interface gigabitethernet 0/1/0 [*PE2-GigabitEthernet0/1/0] mpls [*PE2-GigabitEthernet0/1/0] mpls ldp [*PE2-GigabitEthernet0/1/0] commit [*PE2-GigabitEthernet0/1/0] quit [*PE2] interface gigabitethernet 0/2/0 [*PE2-GigabitEthernet0/2/0] mpls [*PE2-GigabitEthernet0/2/0] mpls ldp [*PE2-GigabitEthernet0/2/0] commit [~PE2-GigabitEthernet0/2/0] quit
Configure PE3.
[~PE3] mpls lsr-id 4.4.4.4 [*PE3] mpls [*PE3-mpls] quit [*PE3] mpls ldp [*PE3-mpls-ldp] quit [*PE3] interface gigabitethernet 0/1/0 [*PE3-GigabitEthernet0/1/0] mpls [*PE3-GigabitEthernet0/1/0] mpls ldp [*PE3-GigabitEthernet0/1/0] commit [*PE3-GigabitEthernet0/1/0] quit [*PE3] interfacegigabitethernet 0/2/0 [*PE3-GigabitEthernet0/2/0] mpls [*PE3-GigabitEthernet0/2/0] mpls ldp [*PE3-GigabitEthernet0/2/0] commit [~PE3-GigabitEthernet0/2/0] quit
After the configurations are complete, LDP sessions can be set up between PEs. Run the display mpls ldp session command. The command output shows that the Status field is Operational.
The following example uses the command output on PE1.
<PE1> display mpls ldp session LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDD:HH:MM) An asterisk (*) before a session means the session is being deleted. ------------------------------------------------------------------------------ Peer-ID Status LAM SsnRole SsnAge KA-Sent/Rcv ------------------------------------------------------------------------------ 3.3.3.3:0 Operational DU Passive 000:02:22 572/572 4.4.4.4:0 Operational DU Passive 000:02:21 566/566 ------------------------------------------------------------------------------ TOTAL: 2 session(s) Found. LAM : Label Advertisement Mode SsnAge Unit : DDD:HH:MM
- Configure VPN instances on PEs and bind each interface that connects a PE to a CE to the VPN instance on that PE.
# Configure PE1.
[~PE1] ip vpn-instance VPNA [*PE1-vpn-instance-VPNA] ipv4-family [*PE1-vpn-instance-VPNA-af-ipv4] route-distinguisher 100:1 [*PE1-vpn-instance-VPNA-af-ipv4] vpn-target 111:1 both [*PE1-vpn-instance-VPNA-af-ipv4] quit [*PE1-vpn-instance-VPNA] quit [*PE1] interface gigabitethernet 0/3/0 [*PE1-GigabitEthernet0/3/0] ip binding vpn-instance VPNA [*PE1-GigabitEthernet0/3/0] ip address 10.1.1.2 24 [*PE1-GigabitEthernet0/3/0] commit [~PE1-GigabitEthernet0/3/0] quit
# Configure PE2.
[~PE2] ip vpn-instance VPNA [*PE2-vpn-instance-VPNA] ipv4-family [*PE2-vpn-instance-VPNA-af-ipv4] route-distinguisher 100:2 [*PE2-vpn-instance-VPNA-af-ipv4] vpn-target 111:1 both [*PE2-vpn-instance-VPNA-af-ipv4] quit [*PE2-vpn-instance-VPNA] quit [*PE2] interface gigabitethernet 0/3/0 [*PE2-GigabitEthernet0/3/0] ip binding vpn-instance VPNA [*PE2-GigabitEthernet0/3/0] ip address 10.2.1.2 24 [*PE2-GigabitEthernet0/3/0] commit [~PE2-GigabitEthernet0/3/0] quit
# Configure PE3.
[~PE3] ip vpn-instance VPNA [*PE3-vpn-instance-VPNA] ipv4-family [*PE3-vpn-instance-VPNA-af-ipv4] route-distinguisher 100:3 [*PE3-vpn-instance-VPNA-af-ipv4] vpn-target 111:1 both [*PE3-vpn-instance-VPNA-af-ipv4] quit [*PE3-vpn-instance-VPNA] quit [*PE3] interface gigabitethernet 0/3/0 [*PE3-GigabitEthernet0/3/0] ip binding vpn-instance VPNA [*PE3-GigabitEthernet0/3/0] ip address 10.3.1.1 24 [*PE3-GigabitEthernet0/3/0] commit [~PE3-GigabitEthernet0/3/0] quit
Configure CE1.
[~CE1] interface gigabitethernet 0/1/0 [~CE1-GigabitEthernet0/1/0] ip address 10.1.1.1 24 [*CE1-GigabitEthernet0/1/0] commit [*CE1-GigabitEthernet0/1/0] quit [*CE1] interface gigabitethernet 0/2/0 [*CE1-GigabitEthernet0/2/0] ip address 10.2.1.1 24 [*CE1-GigabitEthernet0/2/0] commit [~CE1-GigabitEthernet0/2/0] quit
# Configure CE2.
[*CE2] interface gigabitethernet 0/1/0 [*CE2-GigabitEthernet0/1/0] ip address 10.3.1.2 24 [*CE2-GigabitEthernet0/1/0] commit [~CE2-GigabitEthernet0/1/0] quit
After completing the configurations, run the display ip vpn-instance verbose command on PEs to view the configurations of VPN instances. Each PE can ping its connected CE.
The following example uses the command output on PE1.
<PE1> display ip vpn-instance verbose Total VPN-Instances configured : 1 Total IPv4 VPN-Instances configured : 1 Total IPv6 VPN-Instances configured : 0 VPN-Instance Name and ID : VPNA, 1 Interfaces : GigabitEthernet0/3/0 Address family ipv4 Create date : 2008/09/21 12:18:46 Up time : 0 days, 02 hours, 35 minutes and 58 seconds Vrf Status : UP Route Distinguisher : 100:1 Export VPN Targets : 111:1 Import VPN Targets : 111:1 Label policy : label per route The diffserv-mode Information is : uniform The ttl-mode Information is : pipe
[*PE1] ping -vpn-instance VPNA 10.1.1.1 PING 10.1.1.1: 56 data bytes, press CTRL_C to break Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=130 ms Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=60 ms Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=40 ms Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms --- 10.1.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/58/130 ms
- Import the VPN routes between PE1, PE2, and CE1.
Configure two default routes with the next hops as PE1 and PE2 respectively on CE1 to implement load balancing between PE1 and PE2. Configure the static routes to be bound to the VPN instances on PE1 and PE2 and import the static routes into BGP.
# Configure CE1.
[~CE1] load-balance packet all [*CE1] ip route-static 0.0.0.0 0 10.1.1.2 [*CE1] ip route-static 0.0.0.0 0 10.2.1.2 [*CE1] commit
# Configure PE1.
[~PE1] ip route-static vpn-instance VPNA 1.1.1.1 32 10.1.1.1 [*PE1] bgp 100 [*PE1-bgp] ipv4-family vpn-instance VPNA [*PE1-bgp-VPNA] import-route direct [*PE1-bgp-VPNA] import-route static [*PE1-bgp-VPNA] commit [~PE1-bgp-VPNA] quit
# Configure PE2.
[~PE2] ip route-static vpn-instance VPNA 1.1.1.1 32 10.2.1.1 [*PE2] bgp 100 [*PE2-bgp] ipv4-family vpn-instance VPNA [*PE2-bgp-VPNA] import-route direct [*PE2-bgp-VPNA] import-route static [*PE2-bgp-VPNA] commit [~PE2-bgp-VPNA] quit
- Set up an EBGP peer relationship between PE3 and CE2, and import VPN routes to EBGP.
# Configure CE2.
[~CE2] bgp 65410 [*CE2-bgp] peer 10.3.1.1 as-number 100 [*CE2-bgp] import-route direct [*CE2-bgp] commit [~CE2] quit
# Configure PE3 and specify the number of routes carrying out load balancing to 2 on PE3.
[~PE3] bgp 100 [*PE3-bgp] ipv4-family vpn-instance VPNA [*PE3-bgp-VPNA] peer 10.3.1.2 as-number 65410 [*PE3-bgp-VPNA] import-route direct [*PE3-bgp-VPNA] maximum load-balancing 2 [*PE3-bgp-VPNA] commit [~PE3-bgp-VPNA] quit
- Set up an MP-IBGP peer relationship between PEs.
# Configure PE1.
[~PE1] bgp 100 [~PE1-bgp] peer 3.3.3.3 as-number 100 [*PE1-bgp] peer 3.3.3.3 connect-interface loopback 1 [*PE1-bgp] peer 4.4.4.4 as-number 100 [*PE1-bgp] peer 4.4.4.4 connect-interface loopback 1 [*PE1-bgp] ipv4-family vpnv4 [*PE1-bgp-af-vpnv4] peer 3.3.3.3 enable [*PE1-bgp-af-vpnv4] peer 4.4.4.4 enable [*PE1-bgp-af-vpnv4] commit [~PE1-bgp-af-vpnv4] quit [~PE1-bgp] quit
# Configure PE2.
[*PE2] bgp 100 [*PE2-bgp] peer 2.2.2.2 as-number 100 [*PE2-bgp] peer 2.2.2.2 connect-interface loopback 1 [*PE2-bgp] peer 4.4.4.4 as-number 100 [*PE2-bgp] peer 4.4.4.4 connect-interface loopback 1 [*PE2-bgp] ipv4-family vpnv4 [*PE2-bgp-af-vpnv4] peer 2.2.2.2 enable [*PE2-bgp-af-vpnv4] peer 4.4.4.4 enable [*PE2-bgp-af-vpnv4] commit [~PE2-bgp-af-vpnv4] quit [~PE2-bgp] quit
# Configure PE3.
[~PE3] bgp 100 [*PE3-bgp] peer 2.2.2.2 as-number 100 [*PE3-bgp] peer 2.2.2.2 connect-interface loopback 1 [*PE3-bgp] peer 3.3.3.3 as-number 100 [*PE3-bgp] peer 3.3.3.3 connect-interface loopback 1 [*PE3-bgp] ipv4-family vpnv4 [*PE3-bgp-af-vpnv4] peer 2.2.2.2 enable [*PE3-bgp-af-vpnv4] peer 3.3.3.3 enable [*PE3-bgp-af-vpnv4] commit [~PE3-bgp-af-vpnv4] quit [~PE3-bgp] quit
After completing the configurations, run the display bgp vpnv4 all peer command on PEs. The command output shows that BGP peer relationships have been established between PEs.
<PE1> display bgp vpnv4 all peer BGP local router ID : 2.2.2.2 Local AS number : 100 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 4.4.4.4 4 100 205 202 0 03:05:25 Established 0 3.3.3.3 4 100 197 254 0 03:06:54 Established 0
- Configure BFD sessions with automatically negotiated discriminators.
Set up BFD sessions between CE1 and PE1, and between CE1 and PE2.
# Configure PE1.
[~PE1] bfd [*PE1-bfd] quit [*PE1] bfd pe1_to_ce1 bind peer-ip 10.1.1.1 vpn-instance VPNA interface gigabitethernet 0/3/0 source-ip 10.1.1.2 auto [*PE1-bfd-session-pe1_to_ce1] commit [~PE1-bfd-session-pe1_to_ce1] quit
# Configure PE2.
[~PE2] bfd [*PE2-bfd] quit [*PE2] bfd pe2_to_ce1 bind peer-ip 10.2.1.1 vpn-instance VPNA interface gigabitethernet 0/3/0 source-ip 10.2.1.2 auto [*PE2-bfd-session-pe2_to_ce1] commit [~PE2-bfd-session-pe2_to_ce1] quit
# Configure CE1.
[~CE1] bfd [*CE1-bfd] quit [*CE1] bfd ce1_to_pe1 bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0 source-ip 10.1.1.1 auto [*CE1-bfd-session-ce1_to_pe1] commit [*CE1-bfd-session-ce1_to_pe1] quit [*CE1] bfd ce1_to_pe2 bind peer-ip 10.2.1.2 interface gigabitethernet 0/2/0 source -ip 10.2.1.1 auto [*CE1-bfd-session-ce1_to_pe2] commit [~CE1-bfd-session-ce1_to_pe2] quit
After completing the configurations, run the display bfd session all verbose command on each PE and CE. The command output shows that a one-hop static auto-negotiation BFD session is established, and the session status is Up. The local and remote IDs of the BFD session are obtained through auto-negotiation. Use PE1 and CE1 as an example.
The following example uses the command output on PE1 and CE1.
<PE1> display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : Up Name : pe1_to_ce1 ------------------------------------------------------------------------------ Local Discriminator : 8192 Remote Discriminator : 8192 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/3/0) Bind Session Type : Static_Auto Bind Peer IP Address : 10.1.1.1 Bind Interface : GigabitEthernet0/3/0 FSM Board Id : 3 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): - Actual Rx Interval (ms): - Local Detect Multi : 3 Detect Interval (ms) : - Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 254 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Config PST : Enable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : AUTO Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Not Up Reason : In negotiation Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
<CE1> display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : Up Name : ce1_to_pe1 -------------------------------------------------------------------------------- Local Discriminator : 8192 Remote Discriminator : 8192 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static_Auto Bind Peer IP Address : 10.1.1.2 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 3 TOS-EXP : 6 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): - Actual Rx Interval (ms): - 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) : - Config PST : Enable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : AUTO Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-5020000 | RCV-0 | IF-5020000 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- (One Hop) State : Up Name : ce1_to_pe2 -------------------------------------------------------------------------------- Local Discriminator : 8193 Remote Discriminator : 8193 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/2/0) Bind Session Type : Static_Auto Bind Peer IP Address : 10.2.1.2 Bind Interface : GigabitEthernet0/2/0 FSM Board Id : 3 TOS-EXP : 6 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): - Actual Rx Interval (ms): - 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) : - Config PST : Enable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : AUTO Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-5020000 | RCV-0 | IF-5020000 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 2/0
- Configure BFD for VPN static routes on the PEs.
# Configure PE1.
[~PE1] ip route-static vpn-instance VPNA 1.1.1.1 255.255.255.255 10.1.1.1 track bfd-session pe1_to_ce1
[*PE1] commit
# Configure PE2.
[~PE2] ip route-static vpn-instance VPNA 1.1.1.1 255.255.255.255 10.2.1.1 track bfd-session pe2_to_ce1
[*PE2] commit
- Verify the configuration.
# After completing the configurations, run the display ip routing-table command on PE1 to check the VPN routing table information on PE1. The command output shows that a static route exists in the routing table.
<PE1> display ip routing-table vpn-instance VPNA Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: VPNA Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 Static 60 0 RD 10.1.1.1 GigabitEthernet0/3/0 10.1.1.0/24 Direct 0 0 D 10.1.1.2 GigabitEthernet0/3/0 10.1.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 10.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.3.1.0/24 IBGP 255 0 RD 4.4.4.4 GigabitEthernet0/1/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
# On CE1, run the tracert command to ping the gateway through which the packets destined for CE2 pass. The command output shows that load balancing is implemented between PE1 and PE2 at the first hop.
<CE1> tracert 10.3.1.2 traceroute to 10.3.1.2(10.3.1.2), max hops: 30 ,packet length: 40 1 10.1.1.2 20 ms 10.2.1.2 1 ms 10.1.1.2 40 ms 2 10.3.1.1 40 ms 30 ms 50 ms 3 10.3.1.2 80 ms 80 ms 60 ms
# Run the display ip routing-table command on PE3 to check the routing table information on PE3. The command output shows that there are two routes to PE1 (1.1.1.1), with the next hops being 3.3.3.3 and 2.2.2.2 respectively. The two routes work in load-balancing mode.
<PE3> display ip routing-table vpn-instance VPNA Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: VPNA Destinations : 7 Routes : 8 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 IBGP 255 0 RD 2.2.2.2 GigabitEthernet0/1/0 10.1.1.0/24 IBGP 255 0 RD 2.2.2.2 GigabitEthernet0/1/0 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.3.1.0/24 Direct 0 0 D 10.3.1.1 GigabitEthernet0/3/0 10.3.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 10.3.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
# Run the tracert command on CE2 to check the traffic destined for CE1. The command output shows that load balancing is performed when the traffic leaves PE3.
[~CE2] tracert 1.1.1.1 traceroute to 1.1.1.1(1.1.1.1), max hops: 30 ,packet length: 40 1 10.3.1.1 9 ms 2 ms 2 ms 2 10.2.1.2 < AS=100 > 6 ms 5 ms 2 ms 3 10.2.1.1 < AS=100 > 6 ms 6 ms 5 ms
# Run the shutdown command on GE 0/1/0 of CE1 to simulate a link fault.
[~CE1-GigabitEthernet0/1/0] shutdown
# Run the display bfd session all verbose command on PE1. The command output shows that the status of the BFD session is Down.
<PE1> display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : Down Name : pe1_to_ce1 ------------------------------------------------------------------------------ Local Discriminator : 8192 Remote Discriminator : 8192 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/3/0) Bind Session Type : Static_Auto Bind Peer IP Address : 10.1.1.1 Bind Interface : GigabitEthernet0/3/0 FSM Board Id : 3 TOS-EXP : 6 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): - Actual Rx Interval (ms): - 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) : - Config PST : Enable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : AUTO Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Not Up Reason : In negotiation Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
# Run the display ip routing-table vpn-instance command on PE1 to check the VPN routing table. The command output shows that the next hop of the route destined for CE1 is only PE2.
<PE1> display ip routing-table vpn-instance VPNA Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: VPNA Destinations : 4 Routes : 4 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 EBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.3.1.0/24 IBGP 255 0 RD 4.4.4.4 GigabitEthernet0/1/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
# On CE1, check the gateway through which the packets destined for CE2 pass. The command output shows that load balancing is not carried out between PE1 and PE2 at the first hop, and the traffic flows only through PE2.
<CE3> tracert 10.3.1.2 traceroute to 10.3.1.2(10.3.1.2), max hops: 30 ,packet length: 40 1 10.2.1.2 50 ms 30 ms 10 ms 2 10.3.1.1 110 ms 70 ms 90 ms 3 10.3.1.2 60 ms 70 ms 80 ms
# Run the display ip routing-table vpn-instance command on PE3 to check the routing table. The command output shows that there is only one route to CE1 (1.1.1.1) with the next hop as PE1 (3.3.3.3).
<PE3> display ip routing-table vpn-instance VPNA Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: VPNA Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.2.1.0/24 IBGP 255 0 RD 3.3.3.3 GigabitEthernet0/2/0 10.3.1.0/24 Direct 0 0 D 10.3.1.1 GigabitEthernet0/3/0 10.3.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 10.3.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/3/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
# On CE2, check the traffic destined for CE1. The command output shows that the traffic is forwarded through GE 0/2/0 (10.2.1.2) after the traffic leaves PE3.
[~CE2] tracert 1.1.1.1 traceroute to 1.1.1.1(1.1.1.1), max hops: 30 ,packet length: 40 1 10.3.1.1 9 ms 2 ms 2 ms 2 10.2.1.2 < AS=100 > 6 ms 5 ms 5 ms 3 10.2.1.1 < AS=100 > 6 ms 5 ms 5 ms
Use a tester to generate traffic, and the traffic is forwarded in load balancing mode. After a link between CE1 and PE1 or a link between CE1 and PE2 fails, you can find that the traffic is switched in less than 50 ms.
Configuration Files
PE1 configuration file
# sysname PE1 # ip vpn-instance VPNA ipv4-family route-distinguisher 100:1 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # bfd # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # interface GigabitEthernet0/1/0 undo shutdown ip address 11.11.11.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/2/0 undo shutdown ip address 33.33.33.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/3/0 undo shutdown ip binding vpn-instance VPNA ip address 10.1.1.2 255.255.255.0 # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # bgp 100 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 4.4.4.4 enable # ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable peer 4.4.4.4 enable # ipv4-family vpn-instance VPNA import-route direct import-route static # ospf 1 area 0.0.0.0 network 11.11.11.0 0.0.0.255 network 33.33.33.0 0.0.0.255 network 2.2.2.2 0.0.0.0 # ip route-static vpn-instance VPNA 1.1.1.1 255.255.255.255 10.1.1.1 track bfd-session pe1_to_ce1 # bfd pe1_to_ce1 bind peer-ip 10.1.1.1 vpn-instance VPNA interface GigabitEthernet0/3/0 source-ip 10.1.1.2 auto # return
PE2 configuration file
# sysname PE2 # ip vpn-instance VPNA ipv4-family route-distinguisher 100:2 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # bfd # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # interface GigabitEthernet0/1/0 undo shutdown ip address 22.22.22.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/2/0 undo shutdown ip address 33.33.33.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/3/0 undo shutdown ip binding vpn-instance VPNA ip address 10.2.1.2 255.255.255.0 # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 4.4.4.4 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable peer 4.4.4.4 enable # ipv4-family vpn-instance VPNA import-route direct import-route static # ospf 1 area 0.0.0.0 network 33.33.33.0 0.0.0.255 network 22.22.22.0 0.0.0.255 network 3.3.3.3 0.0.0.0 # ip route-static vpn-instance VPNA 1.1.1.1 255.255.255.255 10.2.1.1 track bfd-session pe2_to_ce1 # bfd pe2_to_ce1 bind peer-ip 10.2.1.1 vpn-instance VPNA interface GigabitEthernet0/3/0 source-ip 10.2.1.2 auto # return
PE3 configuration file
# sysname PE3 # ip vpn-instance VPNA ipv4-family route-distinguisher 100:3 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # mpls lsr-id 4.4.4.4 # mpls # mpls ldp # interface GigabitEthernet0/1/0 undo shutdown ip address 11.11.11.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/2/0 undo shutdown ip address 22.22.22.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/3/0 undo shutdown ip binding vpn-instance VPNA ip address 10.3.1.1 255.255.255.0 # interface LoopBack1 ip address 4.4.4.4 255.255.255.255 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 3.3.3.3 enable # ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable peer 3.3.3.3 enable # ipv4-family vpn-instance VPNA peer 10.3.1.2 as-number 65410 import-route direct maximum load-balancing 2 # ospf 1 area 0.0.0.0 network 11.11.11.0 0.0.0.255 network 22.22.22.0 0.0.0.255 network 4.4.4.4 0.0.0.0 # return
CE1 configuration file
# sysname CE1 # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/2/0 undo shutdown ip address 10.2.1.1 255.255.255.0 # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # load-balance packet all # ip route-static 0.0.0.0 0.0.0.0 10.1.1.2 ip route-static 0.0.0.0 0.0.0.0 10.2.1.2 # bfd ce1_to_pe1 bind peer-ip 10.1.1.2 interface GigabitEthernet0/1/0 source-ip 10.1.1.1 auto # bfd ce1_to_pe2 bind peer-ip 10.2.1.2 interface GigabitEthernet0/2/0 source-ip 10.2.1.1 auto # return
CE2 configuration file
# sysname CE2 # interface GigabitEthernet0/1/0 undo shutdown ip address 10.3.1.2 255.255.255.0 # bgp 65410 peer 10.3.1.1 as-number 100 # ipv4-family unicast undo synchronization import-route direct peer 10.3.1.1 enable # return
Example for Configuring Multi-hop BFD
This section provides an example for configuring multi-hop BFD to rapidly monitor a multi-hop link on a network.
Networking Requirements
BFD sessions can be established to rapidly monitor multi-hop links. As shown in Figure 3-8, BFD in asynchronous mode is configured to monitor the multi-hop link between Device A and Device C.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on Device A to monitor the multi-hop link from Device A to Device C.
Configure a BFD session on Device C to monitor the multi-hop link from Device C to Device A.
Data Preparation
To complete the configuration, you need the following data:
Peer IP address monitored by BFD
Names of the BFD sessions for detecting the multi-hop link
Local and remote discriminators of BFD sessions
Procedure
- Configure Device A, Device B, and Device C to be routable.
# Assign an IP address to the interface on Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface GigabitEthernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Assign IP addresses to the interfaces on Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface GigabitEthernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
[~DeviceB] interface GigabitEthernet 0/2/0
[~DeviceB-GigabitEthernet0/2/0] undo shutdown
[*DeviceB-GigabitEthernet0/2/0] ip address 10.2.1.1 24
[*DeviceB-GigabitEthernet0/2/0] commit
[~DeviceB-GigabitEthernet0/2/0] quit
# Assign an IP address to the interface on Device C.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] interface GigabitEthernet 0/1/0
[~DeviceC-GigabitEthernet0/1/0] undo shutdown
[*DeviceC-GigabitEthernet0/1/0] ip address 10.2.1.2 24
[*DeviceC-GigabitEthernet0/1/0] commit
[~DeviceC-GigabitEthernet0/1/0] quit
# Configure static routes.
[~DeviceA] ip route-static 10.2.1.0 255.255.255.0 10.1.1.2
[*DeviceA] commit
[~DeviceC] ip route-static 10.1.1.0 255.255.255.0 10.2.1.1
[*DeviceC] commit
- Configure BFD to monitor the multi-hop link between Device A and Device C.
# Enable BFD on Device A and establish a BFD session to monitor the link from Device A to Device C. You do not need to bind the BFD session to an interface.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atoc bind peer-ip 10.2.1.2
[*DeviceA-bfd-session-atoc] discriminator local 10
[*DeviceA-bfd-session-atoc] discriminator remote 20
[*DeviceA-bfd-session-atoc] commit
[~DeviceA-bfd-session-atoc] quit
# Enable BFD on Device C and establish a BFD session to monitor the link from Device C to Device A. You do not need to bind the BFD session to an interface.
[~DeviceC] bfd
[*DeviceC-bfd] quit
[*DeviceC] bfd ctoa bind peer-ip 10.1.1.1
[*DeviceC-bfd-session-ctoa] discriminator local 20
[*DeviceC-bfd-session-ctoa] discriminator remote 10
[*DeviceC-bfd-session-ctoa] commit
[~DeviceC-bfd-session-ctoa] quit
- Verify the configuration.
After completing the configurations, run the display bfd session all verbose command on Device A and Device C. The command output shows that a multi-hop BFD session has been established and its status is Up.
The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (Multi Hop) State : Up Name : atoc ------------------------------------------------------------------------------ Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer Ip Address Bind Session Type : Static Bind Peer IP Address : 10.2.1.2 Bind Interface : - FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 4784 TTL : 254 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 2584985432 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
# Run the shutdown command on GE 0/1/0 of Device A to simulate a link fault.
[~DeviceA] interface GigabitEthernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] shutdown
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
Run the display bfd session all verbose command on Router A. The command output shows that the status of the BFD session is Down.
The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (Multi Hop) State : Down Name : atoc ------------------------------------------------------------------------------ Local Discriminator : 10 Remote Discriminator : 20 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Peer Ip Address Bind Session Type : Static Bind Peer IP Address : 10.2.1.2 Bind Interface : - FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 4784 TTL : 254 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 2584985432 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 0/1
Configuration Files
Device A configuration file
#
sysname DeviceA
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
# ip route-static 10.2.1.0 255.255.255.0 10.1.1.2
#
bfd atoc bind peer-ip 10.2.1.2
discriminator local 10
discriminator remote 20
return
Device B configuration file
#
sysname DeviceB
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 10.2.1.1 255.255.255.0
return
Device C configuration file
#
sysname DeviceC
#
bfd
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.2.1.2 255.255.255.0
# ip route-static 10.1.1.0 255.255.255.0 10.2.1.1
#
bfd ctoa bind peer-ip 10.1.1.1
discriminator local 20
discriminator remote 10
return
Example for Configuring Single-hop BFD for IPv6
This section provides an example for configuring single-hop BFD for IPv6 to detect faults in an IPv6 link on a network.
Networking Requirements
To rapidly detect faults in an IPv6 link on a network, establish a single-hop BFD session for IPv6. On the network shown in Figure 3-9, a single-hop BFD session in asynchronous mode is established to detect faults in the link between Device A and Device B.
Configuration Roadmap
Enable BFD globally on Device A and Device B.
Create single-hop BFD sessions for IPv6 and bind them to the outbound interfaces on Device A and Device B.
Data Preparation
Peer IPv6 address monitored by BFD
Local and remote discriminators of BFD sessions
BFD session names
Procedure
- Assign IPv6 addresses to interfaces connecting Device A and Device B.
# Assign an IPv6 address to the interface on Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ipv6 enable
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8::1 32
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Assign an IPv6 address to the interface on Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ipv6 enable
[*DeviceB-GigabitEthernet0/1/0] ipv6 address 2001:db8::2 32
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
After the configuration is complete, Device A and Device B can ping each other. The following example uses the command output on Device A.
[~DeviceA] ping ipv6 2001:db8::2
PING 2001:db8::2 : 56 data bytes, press CTRL_C to break Reply from 2001:db8::2 bytes=56 Sequence=1 hop limit=64 time=3 ms Reply from 2001:db8::2 bytes=56 Sequence=2 hop limit=64 time=1 ms Reply from 2001:db8::2 bytes=56 Sequence=3 hop limit=64 time=1 ms Reply from 2001:db8::2 bytes=56 Sequence=4 hop limit=64 time=1 ms Reply from 2001:db8::2 bytes=56 Sequence=5 hop limit=64 time=1 ms ---2001:db8::2 ping statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max=1/1/3 ms
- Configure single-hop BFD for IPv6.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd ipv6session bind peer-ipv6 2001:db8::2 interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-ipv6session] discriminator local 1
[*DeviceA-bfd-session-ipv6session] discriminator remote 2
[*DeviceA-bfd-session-ipv6session] commit
[~DeviceA-bfd-session-ipv6session] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd ipv6session bind peer-ipv6 2001:db8::1 interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-ipv6session] discriminator local 2
[*DeviceB-bfd-session-ipv6session] discriminator remote 1
[*DeviceB-bfd-session-ipv6session] commit
[~DeviceB-bfd-session-ipv6session] quit
- Verify the configuration.
After completing the configurations, run the display bfd session all verbose command on Device A or Device B. The command output shows that a single-hop BFD session for IPv6 has been established and its status is Up. The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : ipv6session ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 2001:db8::2 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8::1/32 # bfd ipv6session bind peer-ipv6 2001:db8::2 interface GigabitEthernet0/1/0 discriminator local 1 discriminator remote 2 # return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8::2/32 # bfd ipv6session bind peer-ipv6 2001:db8::1 interface GigabitEthernet0/1/0 discriminator local 2 discriminator remote 1 # return
Example for Configuring Multi-hop BFD for IPv6
This section provides an example for configuring multi-hop BFD for IPv6 to detect faults in an IPv6 link on a network.
Networking Requirements
To rapidly detect faults in an IPv6 link on a network, establish a multi-hop BFD session for IPv6. On the network shown in Figure 3-10, a multi-hop BFD session in asynchronous mode is established to detect faults in the link between Device A and Device C.
Configuration Roadmap
Enable BFD globally on Device A and Device C.
Configure multi-hop BFD for IPv6 on Device A to detect faults in the link from Device A to Device C.
Configure multi-hop BFD for IPv6 on Device C to detect faults in the link from Device C to Device A.
Data Preparation
Peer IPv6 address monitored by BFD
Local and remote discriminators of BFD sessions
BFD session names
Procedure
- Assign an IPv6 address to each interface on Device A, Device B, and Device C, and configure Open Shortest Path First version 3 (OSPFv3) to ensure that these devices communicate with each other.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] ospfv3 1
[*DeviceA-ospfv3-1] router-id 1.1.1.1
[*DeviceA-ospfv3-1] area 0
[*DeviceA-ospfv3-1-area-0.0.0.0] quit
[*DeviceA-ospfv3-1] quit
[DeviceA] interface gigabitethernet 0/1/0
[*DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ipv6 enable
[*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8:1::1 64
[*DeviceA-GigabitEthernet0/1/0] ospfv3 1 area 0
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] ospfv3 1
[*DeviceB-ospfv3-1] router-id 2.2.2.2
[*DeviceB-ospfv3-1] area 0
[*DeviceB-ospfv3-1-area-0.0.0.0] quit
[*DeviceB-ospfv3-1] quit
[~DeviceB] interface gigabitethernet 0/1/0
[*DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ipv6 enable
[*DeviceB-GigabitEthernet0/1/0] ipv6 address 2001:db8:1::2 64
[*DeviceB-GigabitEthernet0/1/0] ospfv3 1
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
[~DeviceB] interface gigabitethernet 0/2/0
[~DeviceB-GigabitEthernet0/2/0] undo shutdown
[*DeviceB-GigabitEthernet0/2/0] ipv6 enable
[*DeviceB-GigabitEthernet0/2/0] ipv6 address 2001:db8:2::1 64
[*DeviceB-GigabitEthernet0/2/0] ospfv3 1 area 0
[*DeviceB-GigabitEthernet0/2/0] commit
[~DeviceB-GigabitEthernet0/2/0] quit
# Configure Device C.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] ospfv3 1
[*DeviceC-ospfv3-1] router-id 3.3.3.3
[*DeviceC-ospfv3-1] area 0
[*DeviceC-ospfv3-1-area-0.0.0.0] quit
[*DeviceC-ospfv3-1] quit
[~DeviceC] interface gigabitethernet 0/2/0
[*DeviceC-GigabitEthernet0/2/0] undo shutdown
[*DeviceC-GigabitEthernet0/2/0] ipv6 enable
[*DeviceC-GigabitEthernet0/2/0] ipv6 address 2001:db8:2::2 64
[*DeviceC-GigabitEthernet0/2/0] ospfv3 1 area 0
[*DeviceC-GigabitEthernet0/2/0] commit
[~DeviceC-GigabitEthernet0/2/0] quit
After the configuration is complete, Device A and Device C can ping each other. The following example uses the command output on Device A.
[~DeviceA] ping ipv6 2001:db8:2::2
PING 2001:db8:2::2 : 56 data bytes, press CTRL_C to break Reply from 2001:db8:2::2 bytes=56 Sequence=1 hop limit=64 time=22 ms Reply from 2001:db8:2::2 bytes=56 Sequence=2 hop limit=64 time=1 ms Reply from 2001:db8:2::2 bytes=56 Sequence=3 hop limit=64 time=1 ms Reply from 2001:db8:2::2 bytes=56 Sequence=4 hop limit=64 time=1 ms Reply from 2001:db8:2::2 bytes=56 Sequence=5 hop limit=64 time=1 ms ---2001:db8:2::2 ping statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max=1/5/22 ms
- Configure multi-hop BFD for IPv6 on Device A and Device C.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd ipv6session bind peer-ipv6 2001:db8:2::2
[*DeviceA-bfd-session-ipv6session] discriminator local 1
[*DeviceA-bfd-session-ipv6session] discriminator remote 2
[*DeviceA-bfd-session-ipv6session] commit
[~DeviceA-bfd-session-ipv6session] quit
# Configure Device C.
[~DeviceC] bfd
[*DeviceC-bfd] quit
[*DeviceC] bfd ipv6session bind peer-ipv6 2001:db8:1::1
[*DeviceC-bfd-session-ipv6session] discriminator local 2
[*DeviceC-bfd-session-ipv6session] discriminator remote 1
[*DeviceC-bfd-session-ipv6session] commit
[~DeviceC-bfd-session-ipv6session] quit
- Verify the configuration.
After completing the configurations, run the display bfd session all verbose command on Device A or Device C. The command output shows that a multi-hop BFD session for IPv6 has been established and its status is Up. The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (Multi Hop) State : UP Name : ipv6session ------------------------------------------------------------------------------ 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 : 2001:db8:2::2 Bind Interface : - FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 4784 TTL : 254 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 2720409460 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # ospfv3 1 router-id 1.1.1.1 area 0.0.0.0 # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:1::1/64 ospfv3 1 area 0.0.0.0 # bfd ipv6session bind peer-ipv6 2001:db8:2::2 discriminator local 1 discriminator remote 2 return
Device B configuration file
# sysname DeviceB # ospfv3 1 router-id 2.2.2.2 area 0.0.0.0 # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:db8:1::2/64 ospfv3 1 area 0.0.0.0 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8:2::1/64 ospfv3 1 area 0.0.0.0 return
Device C configuration file
# sysname DeviceC # bfd # ospfv3 1 router-id 3.3.3.3 area 0.0.0.0 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:db8:2::2/64 ospfv3 1 area 0.0.0.0 # bfd ipv6session bind peer-ipv6 2001:db8:1::1 discriminator local 2 discriminator remote 1 return
Example for Configuring Sub-Interfaces for QinQ VLAN Tag Termination to Support BFD
Sub-interfaces for QinQ VLAN tag termination are configured to support BFD on a typical network. In this manner, user packets with double tags can be reliably and stably sent over the network.
Networking Requirements
On the network shown in Figure 3-11, users of VLAN 10 access an ISP network through a default gateway. GE 0/2/0.1 is a sub-interface for QinQ VLAN tag termination on Device A, and GE 0/2/0.1 is a sub-interface for QinQ VLAN tag termination on Device B.
A BFD session is configured on Device A and Device B to monitor the link between Device A and Device B.
VRRP group 1 is configured on Device A and Device B. Device A functions as the master device and Device B functions as the backup device.
VRRP group 1 on Device A and Device B is configured to track the status of the BFD session.
Configuration Roadmap
The configuration roadmap is as follows:
Configure an IGP to implement connectivity between Device A, Device B, and Device C.
Configure the Layer 2 forwarding function on switch 2.
Configure the QinQ function on switch 1.
Configure sub-interfaces for QinQ VLAN tag termination on Device A and Device B.
Configure a BFD session on Device A and Device B to monitor the link between Device A and Device B.
Configure VRRP group 1 on GE 0/2/0.1 of Device A and GE 0/2/0.1 of Device B. Ensure that Device A functions as the master device and Device B functions as the backup device.
Data Preparation
To complete the configuration, you need the following data:
Name of a BFD session
ID and virtual IP address of a VRRP group
VLAN IDs of sub-interfaces for QinQ VLAN tag termination
Procedure
- Configure an IGP to implement connectivity between devices.
Assign IP addresses to interfaces as shown in Figure 3-11. Configure an IGP on Device A, Device B, and Device C. OSPF is used in this example.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 192.168.2.1 24
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceA-GigabitEthernet0/2/0.1] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/2/0.1] quit
[*DeviceA] ospf 1
[*DeviceA-ospf-1] area 0
[*DeviceA-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] commit
[~DeviceA-ospf-1-area-0.0.0.0] quit
[~DeviceA-ospf-1] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 192.168.1.1 24
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceB-GigabitEthernet0/2/0.1] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/2/0.1] quit
[*DeviceB] ospf 1
[*DeviceB-ospf-1] area 0
[*DeviceB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] commit
[~DeviceB-ospf-1-area-0.0.0.0] quit
[~DeviceB-ospf-1] quit
# Configure Device C.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] interface gigabitethernet 0/1/0
[~DeviceC-GigabitEthernet0/1/0] undo shutdown
[*DeviceC-GigabitEthernet0/1/0] ip address 192.168.2.2 24
[*DeviceC-GigabitEthernet0/1/0] quit
[*DeviceC] interface gigabitethernet 0/2/0
[*DeviceC-GigabitEthernet0/2/0] undo shutdown
[*DeviceC-GigabitEthernet0/2/0] ip address 192.168.1.2 24
[*DeviceC-GigabitEthernet0/2/0] quit
[*DeviceC] ospf 1
[*DeviceC-ospf-1] area 0
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] commit
[~DeviceC-ospf-1-area-0.0.0.0] quit
[~DeviceC-ospf-1] quit
After completing the preceding configuration, run the display ip routing-table command on each Device. The command output shows that OSPF correctly calculates routes between Device A and Device B. Device A and Device B can ping each other.
The command output on Device A is used as an example.
<DeviceA> display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.2.0/24 Direct 0 0 D 192.168.2.1 GigabitEthernet0/1/0 192.168.2.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.0/24 OSPF 10 2 D 192.168.2.2 GigabitEthernet0/1/0 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet0/2/0.1 10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 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
[~DeviceA] ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=7 ms Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=5 ms Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=8 ms --- 192.168.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/4/8 ms
- Configure the Layer 2 forwarding function on switch 2.
<HUAWEI> system-view
[~HUAWEI] sysname Switch2
[*HUAWEI] commit
[~Switch2] vlan 10
[*Switch2-vlan10] port gigabitethernet 0/2/0
[*Switch2-vlan10] quit
[*Switch2] interface gigabitethernet 0/1/0
[*Switch2-GigabitEthernet0/1/0] undo shutdown
[*Switch2-GigabitEthernet0/1/0] port trunk allow-pass vlan 10
[*Switch2-GigabitEthernet0/1/0] commit
[~Switch2-GigabitEthernet0/1/0] quit
- Configure the QinQ function to allow switch 1 to send packets with double tags to Device A and Device B.
<HUAWEI> system-view
[~HUAWEI] sysname Switch1
[*HUAWEI] commit
[~Switch1] vlan 100
[*Switch1-vlan100] quit
[*Switch1] interface gigabitethernet 0/1/0
[*Switch1-GigabitEthernet0/1/0] port vlan-stacking vlan 10 stack-vlan 100
[*Switch1-GigabitEthernet0/1/0] undo shutdown
[*Switch1-GigabitEthernet0/1/0] quit
[*Switch1] interface gigabitethernet 0/1/1
[*Switch1-GigabitEthernet0/1/1] port trunk allow-pass vlan 100
[*Switch1-GigabitEthernet0/1/1] undo shutdown
[*Switch1-GigabitEthernet0/1/1] quit
[*Switch1] interface gigabitethernet 0/1/2
[*Switch1-GigabitEthernet0/1/2] port trunk allow-pass vlan 100
[*Switch1-GigabitEthernet0/1/2] undo shutdown
[*Switch1-GigabitEthernet0/1/2] commit
[~Switch1-GigabitEthernet0/1/2] quit
- Configure a sub-interface for QinQ VLAN tag termination on each Device.
# Configure Device A.
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] control-vid 1 qinq-termination
[*DeviceA-GigabitEthernet0/2/0.1] qinq termination pe-vid 100 ce-vid 10
[*DeviceA-GigabitEthernet0/2/0.1] commit
# Configure Device B.
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] control-vid 1 qinq-termination
[*DeviceB-GigabitEthernet0/2/0.1] qinq termination pe-vid 100 ce-vid 10
[*DeviceB-GigabitEthernet0/2/0.1] commit
- Configure a BFD session.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceA-bfd-session-atob] discriminator local 1
[*DeviceA-bfd-session-atob] discriminator remote 2
[*DeviceA-bfd-session-atob] qinq pe-vid 100 ce-vid 10
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceB-bfd-session-atob] discriminator local 2
[*DeviceB-bfd-session-atob] discriminator remote 1
[*DeviceB-bfd-session-atob] qinq pe-vid 100 ce-vid 10
[*DeviceB-bfd-session-atob] commit
[~DeviceB-bfd-session-atob] quit
After completing the preceding configuration, run the display bfd session all verbose command on each Device. The command output shows that the BFD session is UP. The command output on Device A is used as an example.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : UP Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(0/2/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : 0/2/0 Pe-vid : 100 Ce-vid : 10 FSM Board Id : 6 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 50 Detect Interval (ms) : 500 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Config PST : Disable Active Multi : 50 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 : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
- Configure VRRP group 1 to track the status of the BFD session.
# Configure Device A.
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] qinq vrrp pe-vid 100 ce-vid 10
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual-ip 10.1.1.100
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 priority 160
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 1
[*DeviceA-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceA-GigabitEthernet0/2/0.1] commit
[~DeviceA-GigabitEthernet0/2/0.1] quit
# Configure Device B.
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] qinq vrrp pe-vid 100 ce-vid 10
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual-ip 10.1.1.100
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 2
[*DeviceB-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceB-GigabitEthernet0/2/0.1] commit
[~DeviceB-GigabitEthernet0/2/0.1] quit
- Verify the configuration.
After completing the preceding configuration, run the display vrrp command on each Device. The command output shows that the status of the BFD session tracked by VRRP group 1 is UP. The command output on Device A is used as an example.
[~DeviceA] display vrrp
GigabitEthernet0/1/0 | Virtual Device 1 State : Master Virtual IP : 10.1.1.100 Master IP : 192.168.2.1 Local IP : 192.168.2.1 PriorityRun : 160 PriorityConfig : 160 MasterPriority : 160 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Track IF : GigabitEthernet0/1/0Priority Reduced :20 IF State : DOWN Track BFD : 0 Priority Reduced :10 BFD-Session State : UP Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.1 24 # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation qinq-termination qinq termination pe-vid 100 ce-vid 10 qinq vrrp pe-vid 100 ce-vid 10 ip address 10.1.1.1 24 vrrp vrid 1 virtual-ip 10.1.1.100 vrrp vrid 1 priority 160 vrrp vrid 1 track bfd-session 1 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 1 discriminator remote 2 qinq pe-vid 100 ce-vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.1.1 24 # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation qinq-termination qinq termination pe-vid 100 ce-vid 10 qinq vrrp pe-vid 100 ce-vid 10 ip address 10.1.1.2 24 vrrp vrid 1 virtual-ip 10.1.1.100 vrrp vrid 1 track bfd-session 2 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 2 discriminator remote 1 qinq pe-vid 100 ce-vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device C configuration file
# sysname DeviceC # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.2 24 # interface GigabitEthernet 0/2/0 undo shutdown ip address 192.168.1.2 24 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # return
Switch 1 configuration file
# sysname Switch1 # vlan batch 100 # interface GigabitEthernet0/1/0 undo shutdown port vlan-stacking vlan 10 stack-vlan 100 # interface GigabitEthernet0/1/1 undo shutdown port trunk allow-pass vlan 100 # interface GigabitEthernet0/1/2 undo shutdown port trunk allow-pass vlan 100 # return
Switch 2 configuration file
# sysname Switch2 # vlan batch 10 # interface GigabitEthernet0/2/0 undo shutdown port default vlan 10 # interface GigabitEthernet0/1/0 undo shutdown port trunk allow-pass vlan 10 # return
Example for Configuring Sub-Interfaces for Dot1q VLAN Tag Termination to Support BFD
Sub-interfaces for dot1q VLAN tag termination are configured to support BFD on a typical network. In this manner, user packets with one tag can be reliably and stably sent over the network.
Networking Requirements
On the network shown in Figure 3-12, users of VLAN 10 access an ISP network through a default gateway. GE 0/2/0.1 is a sub-interface for dot1q VLAN tag termination on Device A, and GE 0/2/0.1 is a sub-interface for dot1q VLAN tag termination on Device B.
A BFD session is configured on Device A and Device B to monitor the link between Device A and Device B.
VRRP group 1 is configured on Device A and Device B. Device A functions as the master device and Device B functions as the backup device.
VRRP group 1 on Device A and Device B to track the status of the BFD session.
Configuration Roadmap
The configuration roadmap is as follows:
Configure an IGP to implement connectivity between Device A, Device B, and Device C.
Configure the Layer 2 forwarding function on the switch.
Configure sub-interfaces for dot1q VLAN tag termination on Device A and Device B.
Configure a BFD session on Device A and Device B to monitor the link between Device A and Device B.
Configure VRRP group 1 on GE 0/2/0.1 of Device A and GE 0/2/0.1 of Device B. Device A functions as the master device and Device B functions as the backup device.
Data Preparation
To complete the configuration, you need the following data:
VLAN ID of a dot1q VLAN tag termination sub-interface
Name of a BFD session
ID and virtual IP address of a VRRP group
Procedure
- Configure an IGP to implement connectivity between devices.
Assign IP addresses to interfaces as shown in Figure 3-12. Configure an IGP on Device A, Device B, and Device C. OSPF is used in this example.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 192.168.2.1 24
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceA-GigabitEthernet0/2/0.1] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/2/0.1] quit
[*DeviceA] ospf 1
[*DeviceA-ospf-1] area 0
[*DeviceA-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] commit
[~DeviceA-ospf-1-area-0.0.0.0] quit
[~DeviceA-ospf-1] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[*DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 192.168.1.1 24
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceB-GigabitEthernet0/2/0.1] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/2/0.1] quit
[*DeviceB] ospf 1
[*DeviceB-ospf-1] area 0
[*DeviceB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] commit
[~DeviceB-ospf-1-area-0.0.0.0] quit
[~DeviceB-ospf-1] quit
# Configure Device C.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] interface gigabitethernet 0/1/0
[~DeviceC-GigabitEthernet0/1/0] undo shutdown
[*DeviceC-GigabitEthernet0/1/0] ip address 192.168.2.2 24
[*DeviceC-GigabitEthernet0/1/0] quit
[*DeviceC] interface gigabitethernet 0/2/0
[*DeviceC-GigabitEthernet0/2/0] undo shutdown
[*DeviceC-GigabitEthernet0/2/0] ip address 192.168.1.2 24
[*DeviceC-GigabitEthernet0/2/0] quit
[*DeviceC] ospf 1
[*DeviceC-ospf-1] area 0
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] commit
[~DeviceC-ospf-1-area-0.0.0.0] quit
[~DeviceC-ospf-1] quit
After completing the preceding configuration, run the display ip routing-table command on each Device. The command output shows that OSPF correctly calculates routes between Device A and Device B. Device A and Device B can ping each other.
The command output on Device A is used as an example.
<DeviceA> display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.2.0/24 Direct 0 0 D 192.168.2.1 GigabitEthernet0/1/0 192.168.2.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.0/24 OSPF 10 2 D 192.168.2.2 GigabitEthernet0/1/0 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet0/2/0.1 10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 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
[~DeviceA] ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=7 ms Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=5 ms Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=8 ms --- 192.168.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/4/8 ms
- Configure the Layer 2 forwarding function on the switch.
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan 10
[*Switch-vlan10] port gigabitethernet 0/1/0
[*Switch-vlan10] quit
[*Switch] interface gigabitethernet 0/1/1
[*Switch-GigabitEthernet0/1/1] undo shutdown
[*Switch-GigabitEthernet0/1/1] port trunk allow-pass vlan 10
[*Switch-GigabitEthernet0/1/1] quit
[*Switch] interface gigabitethernet 0/1/2
[*Switch-GigabitEthernet0/1/2] undo shutdown
[*Switch-GigabitEthernet0/1/2] port trunk allow-pass vlan 10
[*Switch-GigabitEthernet0/1/2] commit
[~Switch-GigabitEthernet0/1/2] quit
- Configure a sub-interface for dot1q VLAN tag termination on each Device.
# Configure Device A.
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] control-vid 1 dot1q-termination
[*DeviceA-GigabitEthernet0/2/0.1] dot1q termination vid 10
[*DeviceA-GigabitEthernet0/2/0.1] commit
# Configure Device B.
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] control-vid 1 dot1q-termination
[*DeviceB-GigabitEthernet0/2/0.1] dot1q termination vid 10
[*DeviceB-GigabitEthernet0/2/0.1] commit
- Configure a BFD session.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceA-bfd-session-atob] discriminator local 1
[*DeviceA-bfd-session-atob] discriminator remote 2
[*DeviceA-bfd-session-atob] dot1q vid 10
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceB-bfd-session-atob] discriminator local 2
[*DeviceB-bfd-session-atob] discriminator remote 1
[*DeviceB-bfd-session-atob] dot1q vid 10
[*DeviceB-bfd-session-atob] commit
[~DeviceB-bfd-session-atob] quit
After completing the configuration, run the display bfd session all verbose command. The command output shows that the BFD session is UP. The command output on Device A is used as an example.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : UP Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(0/2/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : 0/2/0 Vid : 10 FSM Board Id : 6 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 50 Detect Interval (ms) : 500 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Config PST : Disable Active Multi : 50 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 : - Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
- Configure VRRP group 1 to track the status of the BFD session.
# Configure Device A.
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] dot1q vrrp vid 10
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual 10.1.1.100
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 priority 160
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 1
[*DeviceA-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceA-GigabitEthernet0/2/0.1] commit
[~DeviceA-GigabitEthernet0/2/0.1] quit
# Configure Device B.
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] dot1q vrrp vid 10
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual 10.1.1.100
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 2
[*DeviceB-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceB-GigabitEthernet0/2/0.1] commit
[~DeviceB-GigabitEthernet0/2/0.1] quit
- Verify the configuration.
After completing the preceding configuration, run the display vrrp command on each Device. The command output shows that the status of the BFD session tracked by VRRP group 1 is UP. The command output on Device A is used as an example.
[~DeviceA] display vrrp
GigabitEthernet0/1/0 | Virtual Device 1 State : Master Virtual IP : 10.1.1.100 Master IP : 192.168.2.1 Local IP : 192.168.2.1 PriorityRun : 160 PriorityConfig : 160 MasterPriority : 160 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Track IF : GigabitEthernet0/1/0Priority Reduced :20 IF State : DOWN Track BFD : 0 Priority Reduced :10 BFD-Session State : UP Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.1 24 # interface GigabitEthernet0/2/0 undo shutdown # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation dot1q-termination dot1q termination vid 10 dot1q vrrp vid 10 ip address 10.1.1.1 24 vrrp vrid 1 virtual 10.1.1.100 vrrp vrid 1 priority 160 vrrp vrid 1 track bfd-session 1 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 1 discriminator remote 2 dot1q vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.1.1 24 # interface GigabitEthernet0/2/0 undo shutdown # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation dot1q-termination dot1q termination vid 10 dot1q vrrp vid 10 ip address 10.1.1.2 24 vrrp vrid 1 virtual 10.1.1.100 vrrp vrid 1 track bfd-session 2 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 2 discriminator remote 1 dot1q vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device C configuration file
# sysname DeviceC # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.2 24 # interface GigabitEthernet 0/2/0 undo shutdown ip address 192.168.1.2 24 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # return
Switch configuration file
# sysname Switch # vlan batch 10 # interface GigabitEthernet0/1/0 undo shutdown port default vlan 10 # interface GigabitEthernet0/1/1 undo shutdown port trunk allow-pass vlan 10 # interface GigabitEthernet0/1/2 undo shutdown port trunk allow-pass vlan 10 # return
Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults
This section provides an example for configuring a BFD for link-bundle session to monitor Layer 3 Eth-Trunk member links and rapidly detect link faults.
Networking Requirements
On the network shown in Figure 3-13, Device A and Device B are directly connected through Layer 3 Eth-Trunk interfaces. BFD sessions can be bound to Eth-Trunk interfaces to detect the connectivity of the Eth-Trunk between Device A and Device B. If single-hop BFD sessions are used, BFD selects one of the member links of the Eth-Trunk to monitor the status of the Eth-Trunk. Once BFD detects that the selected member link is Down, it considers the Eth-Trunk to be Down even if other member links of the Eth-Trunk are Up. To prevent BFD from incorrectly detecting the Eth-Trunk state, you can deploy BFD for link-bundle sessions instead of single-hop BFD sessions.
Configuration Roadmap
The configuration roadmap is as follows:
Create an Eth-Trunk interface on Device A and Device B, and add Ethernet physical interfaces to the Eth-Trunk interface.
- Assign IP addresses to the Eth-Trunk interfaces on Device A and Device B so that Device A and Device B can interwork with each other through the Eth-Trunk interfaces.
Configure a BFD for link-bundle session on Device A and Device B to monitor the Eth-Trunk member links between Device A and Device B.
Data Preparation
To complete the configuration, you need the following data:
Numbers of the physical interfaces connecting Device A and Device B
IP addresses of the Eth-Trunk interfaces
Minimum interval at which BFD for link-bundle session packets are received
Procedure
- Create an Eth-Trunk interface on Device A and Device B, and add Ethernet physical interfaces to the Eth-Trunk interface.
# Configure Device A. The configuration on Device B is the same as that on Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface Eth-Trunk 1
[*DeviceA-Eth-Trunk1] commit
[~DeviceA-Eth-Trunk1] quit
[~DeviceA] interface gigabitethernet0/3/0
[~DeviceA-Gigabitethernet0/3/0] undo shutdown
[*DeviceA-Gigabitethernet0/3/0] eth-trunk 1
[*DeviceA-Gigabitethernet0/3/0] commit
[~DeviceA-Gigabitethernet0/3/0] quit
[~DeviceA] interface gigabitethernet0/3/1
[~DeviceA-Gigabitethernet0/3/1] undo shutdown
[*DeviceA-Gigabitethernet0/3/1] eth-trunk 1
[*DeviceA-Gigabitethernet0/3/1] commit
[~DeviceA-Gigabitethernet0/3/1] quit
- Assign IP addresses to the Eth-Trunk interfaces on Device A and Device B so that Device A and Device B can interwork with each other through the Eth-Trunk interfaces.
# Configure Device A. The configuration on Device B is the same as that on Device A.
[~DeviceA] interface Eth-Trunk 1
[~DeviceA-Eth-Trunk1] ip address 10.1.1.1 24
[*DeviceA-Eth-Trunk1] commit
[~DeviceA-Eth-Trunk1] quit
After the configuration is complete, the Eth-Trunk 1 interfaces on Device A and Device B can ping each other.
The following example uses the command output on Device B.
[~DeviceB] ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/3/10 ms
- Configure a BFD for link-bundle session on Device A and Device B to monitor the Eth-Trunk member links between Device A and Device B.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind link-bundle peer-ip 10.1.1.2 interface Eth-Trunk 1 source-ip 10.1.1.1
[*DeviceA-bfd-session-atob] min-rx-interval 10
[*DeviceA-bfd-session-atob] min-tx-interval 10
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd btoa bind link-bundle peer-ip 10.1.1.1 interface Eth-Trunk 1 source-ip 10.1.1.2
[*DeviceB-bfd-session-btoa] min-rx-interval 10
[*DeviceB-bfd-session-btoa] min-tx-interval 10
[*DeviceB-bfd-session-btoa] commit
[~DeviceB-bfd-session-btoa] quit
- Verify the configuration.
After completing the configuration, run the display bfd link-bundle session command on Device A. The command output shows that three BFD sessions have been established and their statuses are Up. The discriminators of the three BFD sessions are dynamically allocated by the system. The BFD session bound to Eth-Trunk 1 is the main session, and the other two are BFD sub-sessions and bound to GE 0/3/0 and GE 0/3/1.
<DeviceA> display bfd link-bundle session
Total Up/Down Main Session Number : 1/0 Total Up/Down Sub Session Number : 2/0 -------------------------------------------------------------------------------- Name : a State : Up Local Discriminator : 1048576 Remote Discriminator : - Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(Eth-Trunk1) Bind Session Type : Static_Auto(Bundle_Main | Compatible) Bind Peer IP Address : 10.1.1.2 Bind Source IP Address : 10.1.1.1 FSM Board Id : - TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 WTR Interval (ms) : - Last Local Diagnostic : Control Detection Time Expired Bind Application : AUTO Sub Session Count : 2 -------------------------------------------------------------------------------- Sub Session Number : 1 State : Up Local Discriminator : 16385 Remote Discriminator : 16385 BFD Bind Type : Interface(GigabitEthernet0/3/0) Bind Session Type : Dynamic(Bundle_Sub | Compatible) FSM Board Id : 9 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Active Multi : 3 Detect Interval (ms) : 30 Destination Port : 3784 Last Local Diagnostic : Control Detection Time Expired -------------------------------------------------------------------------------- Sub Session Number : 2 State : Up Local Discriminator : 16386 Remote Discriminator : 16386 BFD Bind Type : Interface(GigabitEthernet0/3/1) Bind Session Type : Dynamic(Bundle_Sub | Compatible) FSM Board Id : 9 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Active Multi : 3 Detect Interval (ms) : 30 Destination Port : 3784 Last Local Diagnostic : Control Detection Time Expired --------------------------------------------------------------------------------
# Shut down GE 0/3/0 on Device A.
[~DeviceA] interface gigabitethernet0/3/0
[~DeviceA-Gigabitethernet0/3/0] shutdown
[*DeviceA-Gigabitethernet0/3/0] quit
# Run the display bfd session all command on Device A to view the statuses of the BFD sessions. The command output shows that the status of the BFD sub-session bound to GE 0/3/0 is Down and that the status of the main session bound to Eth-Trunk 1 is still Up.
<DeviceA> display bfd session all
S: Static session D: Dynamic session IP: IP session IF: Single-hop session PEER: Multi-hop session AUTO: Automatically negotiated session (w): State in WTR (*): State is invalid Total UP/DOWN Session Number : 2/1 -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1048576 - 10.1.1.2 Up S/AUTO-IF Eth-Trunk1 16386 0 10.1.1.2 Down D/IP-IF Gigabitethernet0/3/0 16387 16387 10.1.1.2 Up D/IP-IF Gigabitethernet0/3/1 --------------------------------------------------------------------------------
# Shut down GE 0/3/1, and run the display bfd session all command on Device A. The command output shows that the statuses of the BFD sessions are all Down.
<DeviceA> display bfd session all
S: Static session D: Dynamic session IP: IP session IF: Single-hop session PEER: Multi-hop session AUTO: Automatically negotiated session (w): State in WTR (*): State is invalid Total UP/DOWN Session Number : 0/3 -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1048576 - 10.1.1.2 Down S/AUTO-IF Eth-Trunk1 16386 0 10.1.1.2 Down D/IP-IF Gigabitethernet0/3/0 16387 0 10.1.1.2 Down D/IP-IF Gigabitethernet0/3/1 --------------------------------------------------------------------------------
Configuration Files
Device A configuration file
#
sysname DeviceA
#
bfd
#
interface Eth-Trunk1
ip address 10.1.1.1 255.255.255.0
#
interface Gigabitethernet0/3/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/3/1
undo shutdown
eth-trunk 1
#
bfd atob bind link-bundle peer-ip 10.1.1.2 interface Eth-Trunk1 source-ip 10.1.1.1
min-tx-interval 10
min-rx-interval 10
#
return
Device B configuration file
#
sysname DeviceB
#
bfd
#
interface Eth-Trunk1
ip address 10.1.1.2 255.255.255.0
#
interface Gigabitethernet0/3/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/3/1
undo shutdown
eth-trunk 1
#
bfd btoa bind link-bundle peer-ip 10.1.1.1 interface Eth-Trunk1 source-ip 10.1.1.2
min-tx-interval 10
min-rx-interval 10
#
return
Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults (IPv6)
This section provides an example for configuring a BFD for link-bundle session to monitor Layer 3 Eth-Trunk member links and rapidly detect link faults in an IPv6 scenario.
Networking Requirements
On the network shown in Figure 3-14, DeviceA and DeviceB are directly connected through Layer 3 Eth-Trunk interfaces. BFD sessions can be bound to Eth-Trunk interfaces to detect the connectivity of the Eth-Trunk between DeviceA and DeviceB. If single-hop BFD sessions are used, BFD selects one of the Eth-Trunk member links to monitor the state of the Eth-Trunk. Once BFD detects that the selected member link is down, it assumes the Eth-Trunk is down even if the other member links of the Eth-Trunk are up. To prevent BFD from incorrectly identifying the Eth-Trunk state, deploy BFD for link-bundle sessions instead of single-hop BFD sessions.
Configuration Roadmap
The configuration roadmap is as follows:
Create an Eth-Trunk interface on DeviceA and DeviceB, and then add Ethernet physical interfaces to each Eth-Trunk interface.
- Assign IPv6 addresses to the Eth-Trunk interfaces on DeviceA and DeviceB to enable the devices to interwork with each other through the Eth-Trunk interfaces.
Configure a BFD for link-bundle session on DeviceA and DeviceB to monitor the Eth-Trunk member links between them.
The IPv6 addresses configured for Eth-Trunk interfaces can be global or link-local addresses. If global addresses are used, BFD for link-bundle cannot share a session with BFD for IGP. However, if link-local addresses are used, BFD for link-bundle can share a session with BFD for IGP. In this example, global addresses are used.
Data Preparation
To complete the configuration, you need the following data:
IDs of the physical interfaces connecting DeviceA and DeviceB
IPv6 addresses of the Eth-Trunk interfaces
The minimum interval at which BFD for link-bundle session packets are received
Procedure
- Create an Eth-Trunk interface on DeviceA and DeviceB, and then add Ethernet physical interfaces to each Eth-Trunk interface.
# Configure DeviceA. The configuration of DeviceB is similar to the configuration of DeviceA. For configuration details, see Configuration Files in this section.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface Eth-Trunk 1
[*DeviceA-Eth-Trunk1] commit
[~DeviceA-Eth-Trunk1] quit
[~DeviceA] interface gigabitethernet0/3/0
[~DeviceA-Gigabitethernet0/3/0] undo shutdown
[*DeviceA-Gigabitethernet0/3/0] eth-trunk 1
[*DeviceA-Gigabitethernet0/3/0] commit
[~DeviceA-Gigabitethernet0/3/0] quit
[~DeviceA] interface gigabitethernet0/3/1
[~DeviceA-Gigabitethernet0/3/1] undo shutdown
[*DeviceA-Gigabitethernet0/3/1] eth-trunk 1
[*DeviceA-Gigabitethernet0/3/1] commit
[~DeviceA-Gigabitethernet0/3/1] quit
- Assign IPv6 addresses to the Eth-Trunk interfaces on DeviceA and DeviceB to enable the devices to interwork with each other through the Eth-Trunk interfaces.
# Configure DeviceA. The configuration of DeviceB is similar to the configuration of DeviceA. For configuration details, see Configuration Files in this section.
[~DeviceA] interface Eth-Trunk 1
[~DeviceA-Eth-Trunk1] ipv6 enable
[~DeviceA-Eth-Trunk1] ipv6 address 2001:DB8:1::1 64
[*DeviceA-Eth-Trunk1] commit
[~DeviceA-Eth-Trunk1] quit
After the configuration is complete, Eth-Trunk 1 on DeviceA and DeviceB can ping each other.
The following example uses the command output on DeviceB.
[~DeviceB] ping ipv6 2001:DB8:1::1
PING 2001:DB8:1::1 56 data bytes, press CTRL_C to break
Reply from 2001:DB8:1::1: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 2001:DB8:1::1: bytes=56 Sequence=2 ttl=255 time=2 ms
Reply from 2001:DB8:1::1: bytes=56 Sequence=3 ttl=255 time=2 ms
Reply from 2001:DB8:1::1: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 2001:DB8:1::1: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 2001:DB8:1::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/3/10 ms
- Configure a BFD for link-bundle session on DeviceA and DeviceB to monitor the Eth-Trunk member links between them.
# Configure DeviceA.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind link-bundle peer-ipv6 2001:DB8:1::2 interface Eth-Trunk 1 source-ipv6 2001:DB8:1::1
[*DeviceA-bfd-session-atob] min-rx-interval 10
[*DeviceA-bfd-session-atob] min-tx-interval 10
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Configure DeviceB.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd btoa bind link-bundle peer-ipv6 2001:DB8:1::1 interface Eth-Trunk 1 source-ipv6 2001:DB8:1::2
[*DeviceB-bfd-session-btoa] min-rx-interval 10
[*DeviceB-bfd-session-btoa] min-tx-interval 10
[*DeviceB-bfd-session-btoa] commit
[~DeviceB-bfd-session-btoa] quit
- Verify the configuration.
# After completing the configuration, run the display bfd link-bundle session command on DeviceA. The command output shows that three BFD sessions have been established and are in the Up state. The discriminators of the three BFD sessions are dynamically allocated by the system. The BFD session bound to Eth-Trunk 1 is the main session, and the other two are BFD sub-sessions bound to GE 0/3/0 and GE 0/3/1, respectively.
[DeviceA] display bfd link-bundle session
Total Up/Down Main Session Number : 1/0 Total Up/Down Sub Session Number : 2/0 -------------------------------------------------------------------------------- Name : atob State : Up Local Discriminator : 1048576 Remote Discriminator : - Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(Eth-Trunk1) Bind Session Type : Static_Auto(Bundle_Main | Compatible) Bind Peer IP Address : 2001:DB8:1::2 Bind Source IP Address : 2001:DB8:1::1 FSM Board Id : - TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 WTR Interval (ms) : - Last Local Diagnostic : Control Detection Time Expired Bind Application : AUTO Sub Session Count : 2 -------------------------------------------------------------------------------- Sub Session Number : 1 State : Up Local Discriminator : 16385 Remote Discriminator : 16385 BFD Bind Type : Interface(GigabitEthernet0/3/0) Bind Session Type : Dynamic(Bundle_Sub | Compatible) FSM Board Id : 9 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Active Multi : 3 Detect Interval (ms) : 30 Destination Port : 6784 Last Local Diagnostic : Control Detection Time Expired -------------------------------------------------------------------------------- Sub Session Number : 2 State : Up Local Discriminator : 16386 Remote Discriminator : 16386 BFD Bind Type : Interface(GigabitEthernet0/3/1) Bind Session Type : Dynamic(Bundle_Sub | Compatible) FSM Board Id : 9 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Local Detect Multi : 3 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Active Multi : 3 Detect Interval (ms) : 30 Destination Port : 3784 Last Local Diagnostic : Control Detection Time Expired --------------------------------------------------------------------------------
# Shut down GE 0/3/0 on DeviceA.
[~DeviceA] interface gigabitethernet0/3/0
[~DeviceA-Gigabitethernet0/3/0] shutdown
[*A-Gigabitethernet0/3/0] commit
[~DeviceA-Gigabitethernet0/3/0] quit
# Run the display bfd session all command on DeviceA to view the states of the BFD sessions. The command output shows that the BFD sub-session bound to GE 0/3/0 is in the Down state and the BFD main session bound to Eth-Trunk 1 is still in the Up state.
[DeviceA] display bfd session all
S: Static session D: Dynamic session IP: IP session IF: Single-hop session PEER: Multi-hop session AUTO: Automatically negotiated session (w): State in WTR (*): State is invalid Total UP/DOWN Session Number : 2/1 -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1048576 - 2001:DB8:1::1 Up S/AUTO-IF Eth-Trunk1 16386 0 2001:DB8:1::1 Down D/IP-IF Gigabitethernet0/3/0 16387 16387 2001:DB8:1::1 Up D/IP-IF Gigabitethernet0/3/1 --------------------------------------------------------------------------------
# Shut down GE 0/3/1, and run the display bfd session all command on DeviceA. The command output shows that all three BFD sessions are in the Down state.
[DeviceA] display bfd session all
S: Static session D: Dynamic session IP: IP session IF: Single-hop session PEER: Multi-hop session AUTO: Automatically negotiated session (w): State in WTR (*): State is invalid Total UP/DOWN Session Number : 0/3 -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1048576 2001:DB8:1::2 Down D/AUTO-IF Eth-Trunk1 16386 0 2001:DB8:1::2 Down D/IP-IF Gigabitethernet0/3/0 16387 - 2001:DB8:1::2 Down A/IP-IF Gigabitethernet0/3/1 --------------------------------------------------------------------------------
Configuration Files
DeviceA configuration file
#
sysname DeviceA
#
interface Eth-Trunk1
ipv6 enable
ipv6 address 2001:DB8:1::1 64
#
interface Gigabitethernet0/3/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/3/1
undo shutdown
eth-trunk 1
#
bfd
#
bfd atob bind link-bundle peer-ipv6 2001:DB8:1::2 interface Eth-Trunk1 source-ipv6 2001:DB8:1::1
min-tx-interval 10
min-rx-interval 10
#
return
DeviceB configuration file
#
sysname DeviceB
#
interface Eth-Trunk1
ipv6 enable
ipv6 address 2001:DB8:1::2 64
#
interface Gigabitethernet0/3/0
undo shutdown
eth-trunk 1
#
interface Gigabitethernet0/3/1
undo shutdown
eth-trunk 1
#
bfd
#
bfd btoa bind link-bundle peer-ipv6 2001:DB8:1::1 interface Eth-Trunk1 source-ipv6 2001:DB8:1::2
min-tx-interval 10
min-rx-interval 10
#
return
Example for Configuring a One-Arm BFD Echo Session
This section provides an example for configuring a one-arm BFD echo session on a device that supports BFD.
Networking Requirements
As shown in Figure 3-15, Device A supports BFD, whereas Device B does not. To rapidly detect faults in the direct link between Device A and Device B, configure a one-arm BFD echo session on Device A. After receiving a one-arm BFD echo session packet from Device A, Device B immediately loops back the packet, implementing rapid link fault detection.
Configuration Roadmap
The configuration roadmap is as follows:
Assign IP addresses to the interfaces through which Device A and Device B are directly connected.
Configure a one-arm BFD echo session on Device A.
Data Preparation
To complete the configuration, you need the following data:
Peer IP address monitored by a one-arm BFD echo session
Local discriminator of a one-arm BFD echo session
Minimum interval at which one-arm BFD echo session packets are received
Procedure
- Assign IP addresses to the interfaces through which Device A and Device B are directly connected.
# Assign an IP address to Device A's interface through which Device A is directly connected to Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Assign an IP address to Device B's interface through which Device B is directly connected to Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
- Configure a one-arm BFD echo session on Device A.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind peer-ip 10.1.1.2 interface gigabitEthernet0/1/0 one-arm-echo
[*DeviceA-bfd-session-atob] discriminator local 1
[*DeviceA-bfd-session-atob] min-echo-rx-interval 100
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
[~DeviceA] quit
- Verify the configuration.
After completing the configuration, run the display bfd session all verbose command on Device A. The command output shows that a one-arm BFD echo session has been established and its status is Up.
<DeviceA> display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : - Session Detect Mode : Asynchronous One-arm-echo Mode BFD Bind Type : Interface(gigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : GigabitEthernet0/1/0 Track Interface : - FSM Board Id : 10 TOS-EXP : 7 Echo Rx Interval (ms) : 100 Actual Tx Interval (ms): 100 Actual Rx Interval (ms): 100 Local Detect Multi : 3 Detect Interval (ms) : 300 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Config PST : Disable 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 : - Session Not Up Reason : - 050928 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
Configuration Files
Device A configuration file
#
sysname DeviceA
#
bfd
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bfd atob bind peer-ip 10.1.1.2 interface gigabitEthernet0/1/0 one-arm-echo
discriminator local 1
min-echo-rx-interval 100
commit
#
return
Device B configuration file
#
sysname DeviceB
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
return
Example for Configuring the Delay of a BFD Session to Go Up
This section provides an example for configuring the delay of a BFD session to go Up. This configuration prevents traffic loss because a routing protocol goes Up later than an interface.
Networking Requirements
Some devices switch traffic according to whether a BFD session is Up. When a routing protocol goes Up later than an interface, no route can be found during traffic switchbacks. As a result, traffic is discarded. To resolve this issue, configure a delay to compensate for the time difference caused when the routing protocol goes Up later than the interface.
As shown in Figure 3-16, BFD in asynchronous mode is used to monitor the direct link between Device A and Device B.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on Device A to monitor the direct link from Device A to Device B.
Configure a BFD session on Device B to monitor the direct link from Device B to Device A.
Data Preparation
To complete the configuration, you need the following data:
Peer IP address monitored by BFD
IP address of a local interface that sends and receives BFD control packets
BFD session names
Local and remote discriminators of BFD sessions
Delay of the BFD session to go Up
Procedure
- Assign IP addresses to the interfaces connecting Device A and Device B.
# Assign an IP address to the interface on Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Assign an IP address to the interface on Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
- Configure the delay of the BFD session to go Up.
# Enable BFD on Device A and set the delay of the BFD session to go Up to 120s in the BFD view.
To configure the delay of a BFD session to go Up, run the delay-up command only in the BFD view. This command takes effect only for BFD sessions to be established.
[~DeviceA] bfd
[*DeviceA-bfd] delay-up 120
[*DeviceA-bfd] commit
[~DeviceA-bfd] quit
# Configure BFD on Device A. The following example uses the configuration of single-hop BFD.
[~DeviceA] bfd atob bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-atob] discriminator local 10
[*DeviceA-bfd-session-atob] discriminator remote 20
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# Enable BFD on Device B and set the delay of the BFD session to go Up to 120s in the BFD view.
[~DeviceB]bfd
[*DeviceB-bfd] delay-up 120
[*DeviceB-bfd] commit
[~DeviceB-bfd] quit
# Configure BFD on Device B. The following example uses the configuration of single-hop BFD.
[~DeviceB] bfd btoa bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-btoa] discriminator local 10
[*DeviceB-bfd-session-btoa] discriminator remote 20
[*DeviceB-bfd-session-btoa] commit
[~DeviceB-bfd-session-btoa] quit
- Verify the configuration.
After completing the configurations, run the display bfd statistics command on Device A and Device B. The command output shows that System Session Delay Up Timer is 120, indicating that the BFD session goes Up after a delay of 120s.
The following example uses the command output on Device A.
[~DeviceA] display bfd statistics
Current Display Board Number : Main ; Current Product Register Type: Total Up/Down Session Number : 1/0 Current Session Number : Static session : 1 Dynamic session : 0 E_Dynamic session : 0 STATIC_AUTO session : 0 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 16384 1 1 BFD_IO_SESSION_NUM 2048 1 0 BFD_PER_TUNNEL_CFG_NUM 16 1 0 ------------------------------------------------------------------------------ Current Total Used Discriminator Num : 1 ------------------------------------------------------------------------------ BFD HAF Information : ------------------------------------------------------------------------------ Current HAF Status : Work ------------------------------------------------------------------------------ BFD for LSP Information : ------------------------------------------------------------------------------ Ability of auto creating BFD session on egress : Disable Period of LSP Ping : 60 ------------------------------------------------------------------------------ BFD other Information : ------------------------------------------------------------------------------ System Session Delay Up Timer : 120 ------------------------------------------------------------------------------
Configuration Files
Device A configuration file
#
sysname DeviceA
#
bfd
delay-up 120
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bfd atob bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0
discriminator local 10
discriminator remote 20
#
return
Device B configuration file
#
sysname DeviceB
#
bfd
delay-up 120
#
interface gigabitethernet0/1/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
bfd btoa bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0
discriminator local 20
discriminator remote 10
#
return
Example for Associating a BFD Session with an Interface
This section provides an example for associating a BFD session with an interface to trigger rapid route convergence if a fault occurs.
Networking Requirements
On the network shown in Figure 3-17, transmission devices exist on the link between Device A and Device B. A BFD session is associated with an interface on the Devices. If the link between GE 0/1/0 on Device A and GE 0/1/0 on Device B fails, associate a BFD session with an interface to detect the fault. The BFD session status change affects the interface protocol status change, triggering rapid route convergence.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on Device A.
Configure a BFD session on Device B.
Associate the BFD session and an interface on Device A.
Associate the BFD session and an interface on Device B.
Data Preparation
To complete the configuration, you need the following data:
Peer IP address monitored by BFD
IP address of a local interface that sends and receives BFD control packets
Local and remote discriminators of BFD sessions
Procedure
- Assign IP addresses to the interfaces connecting Device A and Device B.
# Assign an IP address to the interface on Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Assign an IP address to the interface on Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
After the configuration is complete, Device A and Device B can ping each other. The following example uses the command output on Device A.
[~DeviceA] ping 10.1.1.2
PING 10.1.1.2 : 56 data bytes, press CTRL_C to break Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=3 ms Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms --- 10.1.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/3 ms
- Configure single-hop BFD.
# Enable BFD on Device A, and configure a BFD session with Device B.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd pis bind peer-ip default-ip interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-pis] discriminator local 1
[*DeviceA-bfd-session-pis] discriminator remote 2
[*DeviceA-bfd-session-pis] commit
[~DeviceA-bfd-session-pis] quit
# Enable BFD on Device B, and configure a BFD session with Device A.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd pis bind peer-ip default-ip interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-pis] discriminator local 2
[*DeviceB-bfd-session-pis] discriminator remote 1
[*DeviceB-bfd-session-pis] commit
[~DeviceB-bfd-session-pis] quit
After completing the preceding configurations, run the display bfd session all verbose command on Device A or Device B. The command output shows that a single-hop BFD session has been established and its status is Up. The following example uses the command output Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pis ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
- Associate the BFD sessions with the interfaces.
# Configure Device A.
[~DeviceA] bfd pis
[*DeviceA-bfd-session-pis] process-interface-status
[*DeviceA-bfd-session-pis] commit
[~DeviceA-bfd-session-pis] quit
# Configure Device B.
[~DeviceB] bfd pis
[*DeviceB-bfd-session-pis] process-interface-status
[*DeviceB-bfd-session-pis] commit
[~DeviceB-bfd-session-pis] quit
- Verify the configuration.
After completing the configuration, run the display bfd session all verbose command on Device A or Device B. The command output shows that Proc Interface Status is Enable. The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pis ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Enable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
Run the shutdown command on GE 0/1/0 of Device B.
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] shutdown
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
Run the display bfd session all verbose and display interface commands on Device A. The command output shows that the BFD session is Down and GE 0/1/0 is Up.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Down Name : pis ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 2100 Actual Rx Interval (ms): 2100 Local Detect Multi : 3 Detect Interval (ms) : 0 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Enable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : Control Detection Time Expired Bind Application : No Application Bind Session TX TmrID : 2725402068 Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 0/1
[~DeviceA] display interface gigabitethernet 0/1/0
GigabitEthernet0/1/0 current state : UP (ifindex: 20) Line protocol current state : DOWN (BFD status down) EDescription: HUAWEI, Quidway Series, GigabitEthernet0/1/0 Interface Route Port,The Maximum Transmit Unit is 1500 Internet Address is 10.1.1.2/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc12-7890 Current BW: 100 Mbits Last physical up time : 2010-07-31 09:35:03 Last physical down time : 2010-08-03 02:58:22 Current system time: 2010-08-03 03:02:48 Statistics last cleared:never Last 300 seconds input rate 0 bits/sec, 4 packets/sec Last 300 seconds output rate 0 bits/sec, 4 packets/sec Input: 0 bytes, 662126 packets Output: 0 bytes, 661789 packets Input: Unicast: 662111 packets, Multicast: 12 packets Broadcast: 3 packets, JumboOctets: 0 packets CRC: 0 packets, Symbol: 0 packets Overrun: 0 packets, InRangeLength: 0 packets LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets Fragment: 0 packets, Undersized Frame: 0 packets RxPause: 0 packets Output: Unicast: 661784 packets, Multicast: 3 packets Broadcast: 2 packets, JumboOctets: 0 packets Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets System: 0 packets, Overruns: 0 packets TxPause: 0 packets Last 300 seconds input utility rate: 0.00% Last 300 seconds output utility rate: 0.00%
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 # bfd pis bind peer-ip default-ip interface GigabitEthernet0/1/0 discriminator local 1 discriminator remote 2 process-interface-status return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 # bfd pis bind peer-ip default-ip interface GigabitEthernet0/1/0 discriminator local 2 discriminator remote 1 process-interface-status return
Example for Associating a BFD Session and a Sub-interface
This section provides an example for associating a BFD session with a sub-interface to improve service reliability on the sub-interface.
Networking Requirements
On the large metro Ethernet network shown in Figure 3-18, large numbers of VLAN services are configured on an interface's sub-interface and high reliability is required. Establish a BFD session to monitor the interface's link continuity, and associate the BFD session with the sub-interface. This configuration improves service reliability on the sub-interface and saves BFD session resources.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on Device A.
Configure a BFD session on Device B.
Associate the BFD session and a sub-interface on Device A.
Associate the BFD session and a sub-interface on Device B.
Data Preparation
To complete the configuration, you need the following data:
IP address of the peer interface on a link to be monitored by BFD
IP address of a local interface that sends and receives BFD control packets
Local and remote discriminators of BFD sessions
Procedure
- Assign IP addresses to interfaces on Device A and Device B, and create sub-interfaces.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] interface gigabitethernet 0/1/0.1
[*DeviceA-GigabitEthernet0/1/0.1] undo shutdown
[*DeviceA-GigabitEthernet0/1/0.1] ip address 10.2.1.1 24
[*DeviceA-GigabitEthernet0/1/0.1] commit
[~DeviceA-GigabitEthernet0/1/0.1] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] interface gigabitethernet 0/1/0.1
[*DeviceB-GigabitEthernet0/1/0.1] undo shutdown
[*DeviceB-GigabitEthernet0/1/0.1] ip address 10.2.1.2 24
[*DeviceB-GigabitEthernet0/1/0.1] commit
[~DeviceB-GigabitEthernet0/1/0.1] quit
- Configure single-hop BFD.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd pissub bind peer-ip default-ip interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-pissub] discriminator local 1
[*DeviceA-bfd-session-pissub] discriminator remote 2
[*DeviceA-bfd-session-pissub] commit
[~DeviceA-bfd-session-pissub] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd pissub bind peer-ip default-ip interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-pissub] discriminator local 2
[*DeviceB-bfd-session-pissub] discriminator remote 1
[*DeviceB-bfd-session-pissub] commit
[~DeviceB-bfd-session-pissub] quit
# After completing the configurations, run the display bfd session all verbose command on Device A or Device B. The command output shows that a single-hop BFD session has been established and its status is Up. The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pissub --------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
- Associate the BFD sessions with the sub-interfaces.
# Configure Device A.
[~DeviceA] bfd pissub
[*DeviceA-bfd-session-pissub] process-interface-status sub-if
[*DeviceA-bfd-session-pissub] commit
[~DeviceA-bfd-session-pissub] quit
# Configure Device B.
[*DeviceB] bfd pissub
[*DeviceB-bfd-session-pissub] process-interface-status sub-if
[*DeviceB-bfd-session-pissub] commit
[~DeviceB-bfd-session-pissub] quit
- Verify the configuration.
# After completing the configuration, run the display bfd session all verbose command on Device A or Device B. The command output shows that Proc Interface Status is Enable (Sub-If). The following example uses the command output on Device A.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pissub ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Enable (Sub-If) Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : Control Detection Time Expired Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
# Run the shutdown command on GE 0/1/0 of Device B.
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] shutdown
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
# Run the display bfd session all verbose and display interface commands on Device A. The command output shows that the BFD session is Down and GE 0/1/0.1 is Up.
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Down Name : pissub ------------------------------------------------------------------------------ Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 224.0.0.184 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Enable (Sub-If) Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : Control Detection Time Expired Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 0/1
[~DeviceA] display interface gigabitethernet 0/1/0.1
GigabitEthernet0/1/0.1 current state : DOWN (ifindex: 33) Line protocol current state : DOWN (Main BFD status down) Last line protocol up time : 2013-07-29 15:39:29 Description: HUAWEI, GigabitEthernet0/1/0.1 Interface Route Port,The Maximum Transmit Unit is 9600 Internet Address is 10.2.1.1/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc12-7890 Last physical up time : 2013-07-29 15:39:23 Last physical down time : 2013-07-29 15:38:41 Current system time: 2013-07-30 09:15:33 Statistics last cleared:never Last 600 seconds input rate: 23513 bits/sec, 2 packets/sec Last 600 seconds output rate: 64319 bits/sec, 3 packets/sec Input peak rate 26099 bits/sec, Record time: 2013-07-29 15:40:58 Output peak rate 64809 bits/sec, Record time: 2013-07-30 03:59:41 Input: 183126871 bytes, 182525 packets Output: 509287017 bytes, 244628 packets Input: Unicast: 55 packets, Multicast: 160762 packets Broadcast: 21708 packets, JumboOctets: 31031 packets CRC: 0 packets, Symbol: 0 packets Overrun: 0 packets, InRangeLength: 0 packets LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets Fragment: 0 packets, Undersized Frame: 0 packets RxPause: 0 packets Output: Unicast: 53 packets, Multicast: 243990 packets Broadcast: 585 packets, JumboOctets: 0 packets Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets System: 0 packets, Overruns: 0 packets TxPause: 0 packets
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet0/1/0.1 undo shutdown ip address 10.2.1.1 255.255.255.0 # bfd pissub bind peer-ip default-ip interface GigabitEthernet0/1/0 discriminator local 1 discriminator remote 2 process-interface-status sub-if return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet0/1/0.1 undo shutdown ip address 10.2.1.2 255.255.255.0 # bfd pissub bind peer-ip default-ip interface GigabitEthernet0/1/0 discriminator local 2 discriminator remote 1 process-interface-status sub-if return
Example for Enabling BFD to Modify the PST
This section provides an example for enabling BFD to modify the PST. After the configuration is complete, an upper-layer protocol switches traffic to a backup link if a link fault occurs.
Networking Requirements
If BFD is enabled to modify the PST, BFD can modify the PST after detecting that an interface goes Down. This function allows the lower layer to detect the fault based on the PST change.
LDP FRR and IP FRR obtain a BFD detection result based on a PST change.
On the network shown in Figure 3-19, a BFD session in asynchronous mode is set up to detect faults in the link between Device A and Device B.
Configuration Roadmap
Enable BFD globally on Device A and Device B.
Create single-hop BFD sessions and bind them to the outbound interfaces on Device A and Device B, respectively.
Enable BFD to modify the PST.
Data Preparation
Peer IP address monitored by BFD
Local and remote discriminators of BFD sessions
BFD session names
Procedure
- Assign IP addresses to the interfaces connecting Device A and Device B.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
[~DeviceA] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
[~DeviceB] quit
After the configuration is complete, Device A and Device B can ping each other. The following example uses the command output on Device A.
<DeviceA> ping 10.1.1.2
PING 10.1.1.2 : 56 data bytes, press CTRL_C to break Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=3 ms Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms --- 10.1.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/3 ms
- Configure single-hop BFD.
# Configure Device A.
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd pst bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-pst] discriminator local 1
[*DeviceA-bfd-session-pst] discriminator remote 2
[*DeviceA-bfd-session-pst] commit
[~DeviceA-bfd-session-pst] quit
# Configure Device B.
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd pst bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-pst] discriminator local 2
[*DeviceB-bfd-session-pst] discriminator remote 1
[*DeviceB-bfd-session-pst] commit
[~DeviceB-bfd-session-pst] quit
After completing the configurations, run the display bfd session all verbose command on Device A or Device B. The command output shows that a single-hop BFD session has been established and its status is Up. The following example uses the command output on Device B.
[~DeviceB] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pst ------------------------------------------------------------------------------ Local Discriminator : 2 Remote Discriminator : 1 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.1 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
- Enable BFD to modify the PST on Device A and Device B.
# Configure Device A.
[~DeviceA] bfd pst
[*DeviceA-bfd-session-pst] process-pst
[*DeviceA-bfd-session-pst] commit
[~DeviceA-bfd-session-pst] quit
# Configure Device B.
[~DeviceB] bfd pst
[*DeviceB-bfd-session-pst] process-pst
[*DeviceB-bfd-session-pst] commit
[~DeviceB-bfd-session-pst] quit
- Verify the configuration.
After completing the configurations, run the display bfd session all verbose command on Device A or Device B. The command output shows that Process PST is Enable. The following example uses the command output on Device B.
[~DeviceB] display bfd session all verbose
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ (One Hop) State : Up Name : pst ------------------------------------------------------------------------------ Local Discriminator : 2 Remote Discriminator : 1 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet0/1/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.1 Bind Interface : GigabitEthernet0/1/0 FSM Board Id : 1 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 3 Detect Interval (ms) : 30 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Enable WTR Interval (ms) : 0 Local Demand Mode : Disable Active Multi : 3 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : 0 Session Detect TmrID : 0 Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 # bfd pst bind peer-ip 10.1.1.2 interface GigabitEthernet0/1/0 discriminator local 1 discriminator remote 2 process-pst return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 # bfd pst bind peer-ip 10.1.1.1 interface GigabitEthernet0/1/0 discriminator local 2 discriminator remote 1 process-pst return
Example for Configuring Static BFD for TE with Automatically Negotiated Discriminators
Static BFD for TE is configured to rapidly detect tunnel faults and perform a traffic switchover.
Networking Requirements
On the MPLS network shown in Figure 3-20, MPLS TE tunnels are established between PE1 and PE2. The tunnels are detected using static BFD sessions with automatically negotiated discriminators.
Configuration Roadmap
The configuration roadmap is as follows:
Configure an MPLS network and establish bidirectional TE tunnels between PE1 and PE2.
Enable BFD globally on PE1 and PE2.
Configure static BFD with automatically negotiated discriminators on PE1 and PE2 to monitor TE tunnels.
Data Preparation
To complete the configuration, you need the following data:
MPLS LSR IDs
Interface number of and bandwidth consumed by each tunnel, and name of an explicit path over which each tunnel is established
Name of a BFD session
Procedure
- Assign an IP address to each interface.
Assign an IP address to each interface according to Figure 3-20, create loopback interfaces on routers, and configure the IP addresses of the loopback interfaces as MPLS LSR IDs. For configuration details, see Configuration Files in this section.
- Configure an IGP.
Configure OSPF or IS-IS on each router to ensure interworking between PE1 and PE2. OSPF is used in the example. For configuration details, see Configuration Files in this section.
- Configure basic MPLS TE functions.
On each router, configure an LSR ID and enable MPLS in the system and interface views. For configuration details, see Configuration Files in this section.
- Configure basic MPLS TE functions.
On each router, enable MPLS-TE in the MPLS and interface views. For configuration details, see Configuration Files in this section.
- Enable OSPF TE and configure CSPF.
Enable OSPF TE on each router and configure CSPF on PE1. For configuration details, see Configuration Files in this section.
- Configure a tunnel interface on each PE.
# Configure PE1.
[*PE1] interface tunnel 1
[*PE1-Tunnel1] ip address unnumbered interface loopback 0
[*PE1-Tunnel1] tunnel-protocol mpls te
[*PE1-Tunnel1] destination 2.2.2.2
[*PE1-Tunnel1] mpls te tunnel-id 1
[*PE1-Tunnel1] commit
[~PE1-Tunnel1] quit
# Configure PE2.
[~PE2] interface tunnel 2
[*PE2-Tunnel2] ip address unnumbered interface loopback 0
[*PE2-Tunnel2] tunnel-protocol mpls te
[*PE2-Tunnel2] destination 1.1.1.1
[*PE2-Tunnel2] mpls te tunnel-id 2
[*PE2-Tunnel2] commit
[~PE2-Tunnel2] quit
- Configure static BFD with automatically negotiated discriminators to detect TE tunnel faults.
# Configure PE1.
[*PE1] bfd aaa bind mpls-te interface Tunnel0/0/1 reverse-te lsr-id 2.2.2.2 tunnel-id 1 auto
# Configure PE2.
[*PE2] bfd bbb bind mpls-te interface Tunnel0/0/2 reverse-te lsr-id 1.1.1.1 tunnel-id 1 auto
- Verify the configuration.
After completing the preceding configuration, run the display bfd session all command on PE2 to view information about the configured BFD session.
[*PE2]display bfd session all (w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 16385 16385 1.1.1.1 UP AUTO_TE_TNL Tunnel0/0/2 --------------------------------------------------------------------------------
Configuration Files
PE1 configuration file
#
sysname PE1
#
bfd
#
mpls lsr-id 1.1.1.1
mpls
mpls te
mpls rsvp-te
mpls te cspf
#
interface gigabitethernet0/1/1
undo shutdown
ip address 10.1.1.1 255.255.255.0
mpls
mpls te
mpls rsvp-te
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Tunnel0/0/1
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 2.2.2.2
mpls te tunnel-id 1
#
ospf 1 opaque-capability enable area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 mpls-te enable # bfd aaa bind mpls-te interface Tunnel0/0/1 reverse-te lsr-id 2.2.2.2 tunnel-id 2 auto # return
PE2 configuration file
#
sysname PE2
#
bfd
#
mpls lsr-id 3.3.3.3
mpls
mpls te
mpls rsvp-te
mpls te cspf
#
interface gigabitethernet0/1/1
undo shutdown
ip address 10.2.1.2 255.255.255.0
mpls
mpls te
mpls rsvp-te
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface Tunnel0/0/2
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 1.1.1.1
mpls te tunnel-id 2
#
ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.1.1.0 0.0.0.255 mpls-te enable # bfd bbb bind mpls-te interface Tunnel0/0/2 reverse-te lsr-id 1.1.1.1 tunnel-id 1 auto
#
return
- Example for Configuring Single-Hop BFD for a Layer 3 Eth-Trunk
- Example for Configuring BFD to Monitor VPN Routes
- Example for Configuring BFD for Static VPN Routes
- Example for Configuring Multi-hop BFD
- Example for Configuring Single-hop BFD for IPv6
- Example for Configuring Multi-hop BFD for IPv6
- Example for Configuring Sub-Interfaces for QinQ VLAN Tag Termination to Support BFD
- Example for Configuring Sub-Interfaces for Dot1q VLAN Tag Termination to Support BFD
- Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults
- Example for Configuring a BFD for Link-Bundle Session to Detect Layer 3 Eth-Trunk Member Link Faults (IPv6)
- Example for Configuring a One-Arm BFD Echo Session
- Example for Configuring the Delay of a BFD Session to Go Up
- Example for Associating a BFD Session with an Interface
- Example for Associating a BFD Session and a Sub-interface
- Example for Enabling BFD to Modify the PST
- Example for Configuring Static BFD for TE with Automatically Negotiated Discriminators