玩转华为ENSP模拟器系列 | 配置静态BFD检测VPWS PW示例

Posted COCOgsta

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转华为ENSP模拟器系列 | 配置静态BFD检测VPWS PW示例相关的知识,希望对你有一定的参考价值。

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_华为模拟器实验


目标

静态BFD检测PW,配置比较简单,报文交互比较少。

组网需求

在MPLS L2VPN组网方案中:

PE1和PE2之间建立PW1(主)。

PE1和PE3之间建立PW2(备)。

如图1,要求使用BFD检测主备PW的连通性,当主PW出现故障以后,能够在50ms内将业务切换到备用PW上。

配置思路

  • 配置MPLS网络。
  • 在PE1的AC接口配置PW1(PE1到PE2)、PW2(PE1到PE3),形成主备PW关系。
  • 配置BFD会话检测PW1和PW2。

操作步骤

  1. 配置CE上接入PE的接口的IP地址

配置CE1。

CE1:
interface Ethernet1/0/0
 ip address 10.1.1.1 255.255.255.252
 ip address 10.1.2.1 255.255.255.252 sub

配置CE2。

CE2:
interface Ethernet1/0/1
 ip address 10.1.1.2 255.255.255.252
interface Ethernet1/0/0
 ip address 10.1.2.2 255.255.255.252
  1. 在MPLS骨干网上配置IGP协议,实现骨干网PE和P的互通

配置PE1。

PE1:
interface LoopBack1
 ip address 1.1.1.1 255.255.255.255
interface Ethernet1/0/1
 ip address 10.2.1.1 255.255.255.252
interface Ethernet1/0/2
 ip address 10.4.1.1 255.255.255.252
ospf 1
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0
  network 10.2.1.0 0.0.0.3
  network 10.4.1.0 0.0.0.3

配置P1。

P1:
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255
interface Ethernet1/0/0
 ip address 10.3.1.1 255.255.255.252
interface Ethernet1/0/1
 ip address 10.2.1.2 255.255.255.252
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 10.2.1.0 0.0.0.3
  network 10.3.1.0 0.0.0.3

配置P2。

P2:
interface LoopBack1
 ip address 3.3.3.3 255.255.255.255
interface Ethernet1/0/0
 ip address 10.5.1.1 255.255.255.252
interface Ethernet1/0/1
 ip address 10.4.1.2 255.255.255.252
ospf 1
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 10.4.1.0 0.0.0.3
  network 10.5.1.0 0.0.0.3

配置PE2。

PE2:
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255
interface Ethernet1/0/0
 ip address 10.3.1.2 255.255.255.252
ospf 1
 area 0.0.0.0
  network 4.4.4.4 0.0.0.0
  network 10.3.1.0 0.0.0.3

配置PE3。

PE3:
interface LoopBack1
 ip address 5.5.5.5 255.255.255.255
interface Ethernet1/0/1
 ip address 10.5.1.2 255.255.255.252
ospf 1
 area 0.0.0.0
  network 5.5.5.5 0.0.0.0
  network 10.5.1.0 0.0.0.3

配置完成后,在PE上执行display ip routing-table命令,可以看到PE1与PE2之间、PE1与PE3之间互相学到到对方Loopback1接口的路由。

以PE1的显示为例:

[~PE1]dis ip routing-table 
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole
 route
------------------------------------------------------------------------------
Routing Table : _public_
         Destinations : 18       Routes : 18        
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
        1.1.1.1/32  Direct  0    0             D   127.0.0.1       LoopBack1
        2.2.2.2/32  OSPF    10   1             D   10.2.1.2        Ethernet1/0/1
        2.2.2.9/32  Direct  0    0             D   127.0.0.1       LoopBack0
        3.3.3.3/32  OSPF    10   1             D   10.4.1.2        Ethernet1/0/2
        4.4.4.4/32  OSPF    10   2             D   10.2.1.2        Ethernet1/0/1
        5.5.5.5/32  OSPF    10   2             D   10.4.1.2        Ethernet1/0/2
       10.2.1.0/30  Direct  0    0             D   10.2.1.1        Ethernet1/0/1
       10.2.1.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
       10.2.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
       10.3.1.0/30  OSPF    10   2             D   10.2.1.2        Ethernet1/0/1
       10.4.1.0/30  Direct  0    0             D   10.4.1.1        Ethernet1/0/2
       10.4.1.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/2
       10.4.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/2
       10.5.1.0/30  OSPF    10   2             D   10.4.1.2        Ethernet1/0/2
      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
[~PE1]
  1. 在MPLS骨干网上配置MPLS基本能力

使能MPLS,指定LSR-ID为Loopback1接口的IP地址。在骨干网接口上使能MPLS和MPLS LDP。

配置PE1。

PE1:
mpls lsr-id 1.1.1.1
mpls
mpls ldp
interface Ethernet1/0/1
 mpls
 mpls ldp
interface Ethernet1/0/2
 mpls
 mpls ldp

配置PE1。

P1:
mpls lsr-id 2.2.2.2
mpls
mpls ldp
interface Ethernet1/0/1
 mpls
 mpls ldp
interface Ethernet1/0/0
 mpls
 mpls ldp

配置P2。

P2:
mpls lsr-id 3.3.3.3
mpls
mpls ldp
interface Ethernet1/0/1
 mpls
 mpls ldp
interface Ethernet1/0/0
 mpls
 mpls ldp

配置PE2。

PE2:
mpls lsr-id 4.4.4.4
mpls
mpls ldp
interface Ethernet1/0/0
 mpls
 mpls ldp

配置PE3。

PE3:
mpls lsr-id 5.5.5.5
mpls
mpls ldp
interface Ethernet1/0/1
 mpls
 mpls ldp

上述配置完成后,在PE上执行display tunnel-info all命令,PE1与PE2之间、PE1与PE3之间存在MPLS LSP隧道。

以PE1的显示为例。

[~PE1]DIS tunnel-info all
Tunnel ID            Type                Destination                            
 Status
--------------------------------------------------------------------------------
--------
0x0000000001004c4b43 ldp                 2.2.2.2                                
 UP  
0x0000000001004c4b44 ldp                 3.3.3.3                                
 UP  
0x0000000001004c4b45 ldp                 4.4.4.4                                
 UP  
0x0000000001004c4b46 ldp                 5.5.5.5                                
 UP  
[~PE1]
[~PE1]

在PE上执行display mpls ldp session命令可以看到PE与相邻P的LDP对等体关系的Status为“Operational”。

以PE1的显示为例:

[~PE1]dis mpls ldp session 
 LDP Session(s) in Public Network
 Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
 An asterisk (*) before a session means the session is being deleted.
 --------------------------------------------------------------------------
 PeerID             Status      LAM  SsnRole  SsnAge       KASent/Rcv
 --------------------------------------------------------------------------
 2.2.2.2:0          Operational DU   Passive  0000:00:08   34/34
 3.3.3.3:0          Operational DU   Passive  0000:00:06   27/27
 --------------------------------------------------------------------------
 TOTAL: 2 Session(s) Found.
[~PE1] 
  1. 在PE之间建立远端LDP会话

在配置远端LDP会话,指定的IP地址通常为LDP远端对等体的Loopback接口地址。

配置PE1。

PE1:
mpls ldp remote-peer 4.4.4.4
 remote-ip 4.4.4.4
mpls ldp remote-peer 5.5.5.5
 remote-ip 5.5.5.5

配置PE2。

PE2:
mpls ldp remote-peer 1.1.1.1
 remote-ip 1.1.1.1

配置PE3。

PE3:
mpls ldp remote-peer 1.1.1.1
 remote-ip 1.1.1.1

配置完成后,在PE上执行display mpls ldp session命令可以看到PE之间的远端LDP对等体关系的Status为“Operational”,即远端对等体关系已建立。

以PE1的显示为例:

[~PE1-mpls-ldp-remote-5.5.5.5]DIS MPLS LDP session 
 LDP Session(s) in Public Network
 Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
 An asterisk (*) before a session means the session is being deleted.
 --------------------------------------------------------------------------
 PeerID             Status      LAM  SsnRole  SsnAge       KASent/Rcv
 --------------------------------------------------------------------------
 2.2.2.2:0          Operational DU   Passive  0000:00:11   46/46
 3.3.3.3:0          Operational DU   Passive  0000:00:09   39/39
 4.4.4.4:0          Operational DU   Passive  0000:00:01   6/6
 5.5.5.5:0          Operational DU   Passive  0000:00:00   4/4
 --------------------------------------------------------------------------
 TOTAL: 4 Session(s) Found.
[~PE1-mpls-ldp-remote-5.5.5.5]
  1. 在PE上使用PW模板配置PW

配置PE1。

PE1:
mpls l2vpn
pw-template 1to2  
 peer-address 4.4.4.4 
 control-word 
pw-template 1to3  
 peer-address 5.5.5.5 
 control-word 
interface Ethernet1/0/0
 mpls l2vc pw-template 1to2 100
 mpls l2vc pw-template 1to3 200 secondary

配置PE2。

PE2:
mpls l2vpn
pw-template 2to1  
 peer-address 1.1.1.1 
 control-word 
interface Ethernet1/0/1
 mpls l2vc pw-template 2to1 100

配置PE3。

PE3:
mpls l2vpn
pw-template 3to1  
 peer-address 1.1.1.1 
 control-word 
interface Ethernet1/0/0
 mpls l2vc pw-template 3to1 200

配置完成后,在PE上执行display pw-template命令可以看到PW模板的配置信息。

以PE1的显示为例。

[~PE1-Ethernet1/0/0]dis pw-template 
Total PW template number : 2
  PW Template Name : 1to2
  PeerIP           : 4.4.4.4
  Tnl Policy Name  : --
  CtrlWord         : Enable
  MTU              : 1500
  Max Atm Cells    : 28
  ATM Pack Overtime: 1000
  Seq-Number       : Disable
  Transmit ATM Cells      : --
  TDM Encapsulation Number: 8
  Jitter-Buffer           : 4
  Jitter-Buffer-Cep       : 1000
  payload-compression DBA : --
  Idle-Code               : ff
  Rtp-Header              : Disable
  VCCV Capability  : cw alert ttl lsp-ping bfd 
  Total PW         : 1, Static PW : 0, LDP PW : 1
  
  PW Template Name : 1to3
  PeerIP           : 5.5.5.5
  Tnl Policy Name  : --
  CtrlWord         : Enable
  MTU              : 1500
  Max Atm Cells    : 28
  ATM Pack Overtime: 1000
  Seq-Number       : Disable
  Transmit ATM Cells      : --
  TDM Encapsulation Number: 8
  Jitter-Buffer           : 4
  Jitter-Buffer-Cep       : 1000
  payload-compression DBA : --
  Idle-Code               : ff
  Rtp-Header              : Disable
  VCCV Capability  : cw alert ttl lsp-ping bfd 
  Total PW         : 1, Static PW : 0, LDP PW : 1
  
[~PE1-Ethernet1/0/0] 

在PE上查看L2VPN连接信息,执行display mpls l2vc interface命令可以看到PW建立成功,且为Active状态。并且主备PW都没有使能BFD for PW功能。

以PE1的显示为例。

[~PE1-Ethernet1/0/0] dis mpls l2vc interface ethe 1/0/0
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : up
  AC status              : up
  Ignore AC state        : disable
  VC state               : up
  Label state            : 0
  Token state            : 0
  VC ID                  : 100
  VC type                : Ethernet
  destination            : 4.4.4.4
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48125        remote VC label      : 48124
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : forwarding
  local status code      : 0x0 (forwarding)
  remote AC OAM state    : up
  remote PSN OAM state   : up
  remote forwarding state: forwarding
  remote status code     : 0x0 (forwarding)
  ignore standby state   : no
  BFD for PW             : unavailable
  VCCV State             : up
  manual fault           : not set
  active state           : active
  forwarding entry       : exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : up
  local VC MTU           : 1500         remote VC MTU        : 1500
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : cw alert ttl lsp-ping bfd 
  local control word     : enable       remote control word  : enable
  tunnel policy name     : --
  PW template name       : 1to2
  primary or secondary   : primary
  load balance type      : flow
  Access-port            : false
  Switchover Flag        : false
  VC tunnel info         : 1 tunnels
    NO.0  TNL type       : ldp            , TNL ID : 0x0000000001004c4b45
  create time            : 0 days, 0 hours, 4 minutes, 53 seconds
  up time                : 0 days, 0 hours, 3 minutes, 3 seconds
  last change time       : 0 days, 0 hours, 3 minutes, 3 seconds
  VC last up time        : 2020/01/09 16:21:36
  VC total up time       : 0 days, 0 hours, 3 minutes, 3 seconds
  CKey                   : 65
  NKey                   : 16777380
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send active, receive active
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : up
  AC status              : up
  Ignore AC state        : disable
  VC state               : up
  Label state            : 0
  Token state            : 0
  VC ID                  : 200
  VC type                : Ethernet
  destination            : 5.5.5.5
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48126        remote VC label      : 48125
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : forwarding
  local status code      : 0x0 (forwarding)
  remote AC OAM state    : up
  remote PSN OAM state   : up
  remote forwarding state: forwarding
  remote status code     : 0x0 (forwarding)
  ignore standby state   : no
  BFD for PW             : unavailable
  VCCV State             : up
  manual fault           : not set
  active state           : inactive
  forwarding entry       : exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : up
  local VC MTU           : 1500         remote VC MTU        : 1500
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : cw alert ttl lsp-ping bfd 
  local control word     : enable       remote control word  : enable
  tunnel policy name     : --
  PW template name       : 1to3
  primary or secondary   : secondary
  load balance type      : flow
  Access-port            : false
  VC tunnel info         : 1 tunnels
    NO.0  TNL type       : ldp            , TNL ID : 0x0000000001004c4b46
  create time            : 0 days, 0 hours, 4 minutes, 53 seconds
  up time                : 0 days, 0 hours, 1 minutes, 35 seconds
  last change time       : 0 days, 0 hours, 1 minutes, 35 seconds
  VC last up time        : 2020/01/09 16:23:03
  VC total up time       : 0 days, 0 hours, 1 minutes, 35 seconds
  CKey                   : 66
  NKey                   : 16777381
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send inactive, receive inactive
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 reroute policy          : delay 30 s, resume 10 s
 reason of last reroute  : --
 time of last reroute    : -- days, -- hours, -- minutes, -- seconds
 delay timer ID          : --           residual time :--
 resume timer ID         : --           residual time :--
      
[~PE1-Ethernet1/0/0]  
  1. 在PE之间配置静态BFD检测PW功能

配置PE1。

PE1:
bfd
bfd 1to2 bind pw interface Ethernet1/0/0
 discriminator local 12
 discriminator remote 21
bfd 1to3 bind pw interface Ethernet1/0/0 secondary
 discriminator local 13
 discriminator remote 31

配置PE2。

PE2:
bfd
bfd 2to1 bind pw interface Ethernet1/0/1
 discriminator local 21
 discriminator remote 12

配置PE3。

PE3:
bfd
bfd 3to1 bind pw interface Ethernet1/0/0
 discriminator local 31
 discriminator remote 13

配置完成后,PE1与PE2之间,PE1与PE3之间建立BFD会话。执行display bfd session all命令,可以看到State为Up。

以PE1的显示为例。

[~PE1]DIS BFD session all
(w): State in WTR
(*): State is invalid
--------------------------------------------------------------------------------
Local      Remote     PeerIpAddr      State     Type        InterfaceName 
--------------------------------------------------------------------------------
12         21         --.--.--.--     Up        S_PW(M)     Ethernet1/0/0
13         31         --.--.--.--     Up        S_PW(S)     Ethernet1/0/0
--------------------------------------------------------------------------------
    Total UP/DOWN Session Number : 2/0
[~PE1]
  1. 验证配置结果

当主PW正常工作时,CE1的主地址可以Ping通CE2的10.1.1.2地址。备用PW不工作,CE1的从地址无法Ping通CE2的10.1.2.2地址。

[~CE1]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=20 ms
    Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=11 ms
    Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=11 ms
    Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=11 ms
    Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=12 ms
  --- 10.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 11/13/20 ms
 
[~CE1]ping 10.1.2.2
  PING 10.1.2.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out
  --- 10.1.2.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss
[~CE1]

在PE上执行命令display mpls l2vc interface查看PW的状态。可以看到主备PW都使能了BFD for PW功能,且BFD state为up。

[~PE1]dis mpls l2vc interface ethe 1/0/0
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : up
  AC status              : up
  Ignore AC state        : disable
  VC state               : up
  Label state            : 0
  Token state            : 0
  VC ID                  : 100
  VC type                : Ethernet
  destination            : 4.4.4.4
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48125        remote VC label      : 48124
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : forwarding
  local status code      : 0x0 (forwarding)
  remote AC OAM state    : up
  remote PSN OAM state   : up
  remote forwarding state: forwarding
  remote status code     : 0x0 (forwarding)
  ignore standby state   : no
  BFD for PW             : available
    BFD sessionIndex     : 1            BFD state : up
  VCCV State             : up
  manual fault           : not set
  active state           : active
  forwarding entry       : exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : up
  local VC MTU           : 1500         remote VC MTU        : 1500
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : cw alert ttl lsp-ping bfd 
  local control word     : enable       remote control word  : enable
  tunnel policy name     : --
  PW template name       : 1to2
  primary or secondary   : primary
  load balance type      : flow
  Access-port            : false
  Switchover Flag        : false
  VC tunnel info         : 1 tunnels
    NO.0  TNL type       : ldp            , TNL ID : 0x0000000001004c4b45
  create time            : 0 days, 0 hours, 49 minutes, 31 seconds
  up time                : 0 days, 0 hours, 47 minutes, 41 seconds
  last change time       : 0 days, 0 hours, 47 minutes, 41 seconds
  VC last up time        : 2020/01/09 16:21:36
  VC total up time       : 0 days, 0 hours, 47 minutes, 41 seconds
  CKey                   : 65
  NKey                   : 16777380
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send active, receive active
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : up
  AC status              : up
  Ignore AC state        : disable
  VC state               : up
  Label state            : 0
  Token state            : 0
  VC ID                  : 200
  VC type                : Ethernet
  destination            : 5.5.5.5
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48126        remote VC label      : 48125
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : forwarding
  local status code      : 0x0 (forwarding)
  remote AC OAM state    : up
  remote PSN OAM state   : up
  remote forwarding state: forwarding
  remote status code     : 0x0 (forwarding)
  ignore standby state   : no
  BFD for PW             : available
    BFD sessionIndex     : 2            BFD state : up
  VCCV State             : up
  manual fault           : not set
  active state           : inactive
  forwarding entry       : exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : up
  local VC MTU           : 1500         remote VC MTU        : 1500
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : cw alert ttl lsp-ping bfd 
  local control word     : enable       remote control word  : enable
  tunnel policy name     : --
  PW template name       : 1to3
  primary or secondary   : secondary
  load balance type      : flow
  Access-port            : false
  VC tunnel info         : 1 tunnels
    NO.0  TNL type       : ldp            , TNL ID : 0x0000000001004c4b46
  create time            : 0 days, 0 hours, 49 minutes, 31 seconds
  up time                : 0 days, 0 hours, 46 minutes, 13 seconds
  last change time       : 0 days, 0 hours, 46 minutes, 13 seconds
  VC last up time        : 2020/01/09 16:23:03
  VC total up time       : 0 days, 0 hours, 46 minutes, 13 seconds
  CKey                   : 66
  NKey                   : 16777381
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send inactive, receive inactive
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 reroute policy          : delay 30 s, resume 10 s
 reason of last reroute  : --
 time of last reroute    : -- days, -- hours, -- minutes, -- seconds
 delay timer ID          : --           residual time :--
 resume timer ID         : --           residual time :--
      
[~PE1] 

shutdown掉PE1的GigabitEthernet0/1/1接口模拟主用PW发生故障,此时,CE1的主地址不可以Ping通CE2的10.1.1.2地址。备用PW工作,CE1的从地址可以Ping通CE2的10.1.2.2地址。

[~CE1]ping 10.1.1.2
  PING 10.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out
  --- 10.1.1.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss
[~CE1]ping 10.1.2.2
  PING 10.1.2.2: 56  data bytes, press CTRL_C to break
    Reply from 10.1.2.2: bytes=56 Sequence=1 ttl=255 time=19 ms
    Reply from 10.1.2.2: bytes=56 Sequence=2 ttl=255 time=9 ms
    Reply from 10.1.2.2: bytes=56 Sequence=3 ttl=255 time=12 ms
    Reply from 10.1.2.2: bytes=56 Sequence=4 ttl=255 time=11 ms
    Reply from 10.1.2.2: bytes=56 Sequence=5 ttl=255 time=10 ms
  --- 10.1.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 9/12/19 ms
 
[~CE1]

在PE上再次执行命令display mpls l2vc interface查看PW的状态。可以看到主用PW的VC状态是down,BFD for PW是available,但BFD state为down。备用PW的VC状态是up,BFD for PW是available,且BFD state为up。

[~PE1-Ethernet1/0/1]dis mpls l2vc int ethe 1/0/0
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : down
  AC status              : up
  Ignore AC state        : disable
  VC state               : down
  Label state            : 0
  Token state            : 0
  VC ID                  : 100
  VC type                : Ethernet
  destination            : 4.4.4.4
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48125        remote VC label      : 0
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : not forwarding
  local status code      : 0x1 (not-forwarding)
  BFD for PW             : available
    BFD sessionIndex     : 1            BFD state : down
  VCCV State             : up
  manual fault           : not set
  active state           : inactive
  forwarding entry       : not exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : down
  local VC MTU           : 1500         remote VC MTU        : 0
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : none
  local control word     : enable       remote control word  : none
  tunnel policy name     : --
  PW template name       : 1to2
  primary or secondary   : primary
  load balance type      : flow
  Access-port            : false
  Switchover Flag        : false
  VC tunnel info         : 0 tunnels
  create time            : 0 days, 0 hours, 55 minutes, 23 seconds
  up time                : 0 days, 0 hours, 0 minutes, 0 seconds
  last change time       : 0 days, 0 hours, 4 minutes, 23 seconds
  VC last up time        : 2020/01/09 16:21:36
  VC total up time       : 0 days, 0 hours, 49 minutes, 10 seconds
  CKey                   : 65
  NKey                   : 16777380
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send inactive, receive inactive
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 *client interface       : Ethernet1/0/0 is up
  Administrator PW       : no 
  session state          : up
  AC status              : up
  Ignore AC state        : disable
  VC state               : up
  Label state            : 0
  Token state            : 0
  VC ID                  : 200
  VC type                : Ethernet
  destination            : 5.5.5.5
  local group ID         : 0            remote group ID      : 0
  local VC label         : 48126        remote VC label      : 48125
  local AC OAM State     : up
  local PSN OAM State    : up
  local forwarding state : forwarding
  local status code      : 0x0 (forwarding)
  remote AC OAM state    : up
  remote PSN OAM state   : up
  remote forwarding state: forwarding
  remote status code     : 0x0 (forwarding)
  ignore standby state   : no
  BFD for PW             : available
    BFD sessionIndex     : 2            BFD state : up
  VCCV State             : up
  manual fault           : not set
  active state           : active
  forwarding entry       : exist
  OAM Protocol           : --
  OAM Status             : --
  OAM Fault Type         : --
  PW APS ID              : --
  PW APS Status          : --
  TTL Value              : 1
  link state             : up
  local VC MTU           : 1500         remote VC MTU        : 1500
  local VCCV             : cw alert ttl lsp-ping bfd 
  remote VCCV            : cw alert ttl lsp-ping bfd 
  local control word     : enable       remote control word  : enable
  tunnel policy name     : --
  PW template name       : 1to3
  primary or secondary   : secondary
  load balance type      : flow
  Access-port            : false
  VC tunnel info         : 1 tunnels
    NO.0  TNL type       : ldp            , TNL ID : 0x0000000001004c4b46
  create time            : 0 days, 0 hours, 55 minutes, 23 seconds
  up time                : 0 days, 0 hours, 52 minutes, 5 seconds
  last change time       : 0 days, 0 hours, 52 minutes, 5 seconds
  VC last up time        : 2020/01/09 16:23:03
  VC total up time       : 0 days, 0 hours, 52 minutes, 5 seconds
  CKey                   : 66
  NKey                   : 16777381
  PW redundancy mode     : frr
  AdminPw interface      : --
  AdminPw link state     : --
  Forward state          : send active, receive active
  Diffserv Mode          : uniform
  Service Class          : --
  Color                  : --
  DomainId               : --
  Domain Name            : --  
 reroute policy          : delay 30 s, resume 10 s
 reason of last reroute  : --
 time of last reroute    : -- days, -- hours, -- minutes, -- seconds
 delay timer ID          : --           residual time :--
 resume timer ID         : --           residual time :--
      
[~PE1-Ethernet1/0/1] 
[~PE1-Ethernet1/0/1]
[~PE1-Ethernet1/0/1]

 

以上是关于玩转华为ENSP模拟器系列 | 配置静态BFD检测VPWS PW示例的主要内容,如果未能解决你的问题,请参考以下文章

玩转华为ENSP模拟器系列 | 配置静态BFD检测三层IP链路

玩转华为ENSP模拟器系列 | 配置静态BFD检测VPWS PW示例

玩转华为ENSP模拟器系列 | 配置动态BFD检测LDP LSP示例

玩转华为ENSP模拟器系列 | 配置静态BFD for IS-IS特性示例

玩转华为ENSP模拟器系列 | 配置BFD会话进入AdminDown状态

玩转华为ENSP模拟器系列 | 配置BFD for OSPF特性示例