This section provides an example for configuring BFD to monitor VPN routes.
As shown in Figure 1:
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.
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.
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
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
# 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
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) : - 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 : -
PDT Index : FSM-0|RCV-0|IF-0|TOKEN-0
Session Description : -
------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
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/1/8 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/1/8 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/1/8 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