配置动态BFD检测单跳PW示例
组网需求
如图5-25所示,设备PE1、P和PE2同属于一个MPLS域。组网中P设备有多台(由于P设备配置几乎一致,组网中简化为一台P设备),PE1和PE2之间建立了单跳PW,要求使用BFD会话检测PW的连通性,以保护链路上的业务。
缺省情况下,设备上全局使能链路类型自协商功能,若L2VPN使用Vlanif接口作为AC接口,则与该功能相冲突,需要先在系统视图下执行lnp disable命令去使能链路类型自协商功能。
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
配置思路
配置动态BFD检测LDP LSP,不需要指定BFD参数,能够提高链路故障检测速度、减少配置工作量。这种方式适用于大型网络。采用如下的思路配置动态BFD检测单跳PW的基本功能。
在CE1和CE2之间建立单跳PW。
在PE1和PE2上使能MPLS L2VPN,并创建VC连接。
配置BFD基本能力,在PE上触发创建动态BFD for PW。
操作步骤
- 按图5-25配置各接口所属的VLAN及对应VLANIF接口的IP地址
# 配置CE1。PE1、PE2、P和CE2的配置与CE1类似,不再赘述。
<HUAWEI> system-view [HUAWEI] sysname CE1 [CE1] vlan batch 10 [CE1] interface vlanif 10 [CE1-Vlanif10] ip address 10.1.1.1 255.255.255.0 [CE1-Vlanif10] quit [CE1] interface gigabitethernet 1/0/0 [CE1-GigabitEthernet1/0/0] port link-type trunk [CE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10 [CE1-GigabitEthernet1/0/0] quit
- 配置MPLS骨干网的IGP
在MPLS骨干网上配置IGP,本示例中使用OSPF。
# 配置PE1。
[PE1] interface loopback 0 [PE1-LoopBack0] ip address 1.1.1.9 32 [PE1-LoopBack0] quit [PE1] interface vlanif 20 [PE1-Vlanif20] ip address 100.1.1.1 30 [PE1-Vlanif20] quit [PE1] ospf 1 [PE1-ospf-1] area 0 [PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.3 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
# 配置P。
[P] interface loopback 0 [P-LoopBack0] ip address 2.2.2.9 32 [P-LoopBack0] quit [P] interface vlanif 20 [P-Vlanif20] ip address 100.1.1.2 30 [P-Vlanif20] quit [P] interface vlanif 40 [P-Vlanif40] ip address 100.2.1.1 30 [P-Vlanif40] quit [P] ospf 1 [P-ospf-1] area 0 [P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0 [P-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.3 [P-ospf-1-area-0.0.0.0] network 100.2.1.0 0.0.0.3 [P-ospf-1-area-0.0.0.0] quit [P-ospf-1] quit
# 配置PE2。
[PE2] interface loopback 0 [PE2-LoopBack0] ip address 3.3.3.9 32 [PE2-LoopBack0] quit [PE2] interface vlanif 40 [PE2-Vlanif40] ip address 100.2.1.2 30 [PE2-Vlanif40] quit [PE2] ospf 1 [PE2-ospf-1] area 0 [PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0 [PE2-ospf-1-area-0.0.0.0] network 100.2.1.0 0.0.0.3 [PE2-ospf-1-area-0.0.0.0] quit [PE2-ospf-1] quit
配置完成后,在PE上执行display ip routing-table命令,可以看到PE1与PE2之间互相学到到对方Loopback0接口的路由。
- 在MPLS骨干网上配置MPLS基本能力
# 使能MPLS,指定LSR-ID为Loopback0接口的IP地址。在骨干网接口上使能MPLS和MPLS LDP。
# 配置PE1。
[PE1] mpls lsr-id 1.1.1.9 [PE1] mpls [PE1-mpls] quit [PE1] mpls ldp [PE1-mpls-ldp] quit [PE1] interface vlanif 20 [PE1-Vlanif20] mpls [PE1-Vlanif20] mpls ldp [PE1-Vlanif20] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9 [P] mpls [P-mpls] quit [P] mpls ldp [P-mpls-ldp] quit [P] interface vlanif 20 [P-Vlanif20] mpls [P-Vlanif20] mpls ldp [P-Vlanif20] quit [P] interface vlanif 40 [P-Vlanif40] mpls [P-Vlanif40] mpls ldp [P-Vlanif40] quit
# 配置PE2。
[PE2] mpls lsr-id 3.3.3.9 [PE2] mpls [PE2-mpls] quit [PE2] mpls ldp [PE2-mpls-ldp] quit [PE2] interface vlanif 40 [PE2-Vlanif40] mpls [PE2-Vlanif40] mpls ldp [PE2-Vlanif40] quit
上述配置完成后,在PE上执行display tunnel-info all命令,PE1与PE2之间存在MPLS LSP隧道。
以PE1的显示为例。
[PE1] display tunnel-info all * -> Allocated VC Token Tunnel ID Type Destination Token ---------------------------------------------------------------------- 0x89 lsp 2.2.2.9 137 0x8a lsp 2.2.2.9 138 0x8b lsp 3.3.3.9 139 0x8c lsp 3.3.3.9 140
在PE上执行display mpls ldp session命令可以看到PE与P的LDP对等体关系的Status为“Operational”。
以PE1的显示为例:
[PE1] display mpls ldp session LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) A '*' before a session means the session is being deleted. ------------------------------------------------------------------------------ PeerID Status LAM SsnRole SsnAge KASent/Rcv ------------------------------------------------------------------------------ 2.2.2.9:0 Operational DU Passive 0000:00:02 10/10 ------------------------------------------------------------------------------ TOTAL: 1 session(s) Found.
- 在PE之间建立远端LDP会话
# 在配置远端LDP会话,指定的IP地址通常为LDP远端对等体的Loopback接口地址。
如果PE直连,则无需手工配置它们之间的远端LDP会话。
# 配置PE1。
[PE1] mpls ldp remote-peer 3.3.3.9 [PE1-mpls-ldp-remote-3.3.3.9] remote-ip 3.3.3.9 [PE1-mpls-ldp-remote-3.3.3.9] quit
# 配置PE2。
[PE2] mpls ldp remote-peer 1.1.1.9 [PE2-mpls-ldp-remote-1.1.1.9] remote-ip 1.1.1.9 [PE2-mpls-ldp-remote-1.1.1.9] quit
配置完成后,在PE上执行display mpls ldp session命令可以看到PE之间的远端LDP对等体关系的Status为“Operational”,即远端对等体关系已建立。
以PE1的显示为例。
[PE1] display mpls ldp session LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) A '*' before a session means the session is being deleted. ------------------------------------------------------------------------------ PeerID Status LAM SsnRole SsnAge KASent/Rcv ------------------------------------------------------------------------------ 2.2.2.9:0 Operational DU Passive 0000:00:03 16/16 3.3.3.9:0 Operational DU Passive 0000:00:00 2/2 ------------------------------------------------------------------------------ TOTAL: 2 session(s) Found.
- 在PE上使用PW模板配置PW
# 配置PE1。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE1] mpls l2vpn [PE1-l2vpn] quit [PE1] pw-template 1to2 [PE1-pw-template-1to2] peer-address 3.3.3.9 [PE1-pw-template-1to2] control-word [PE1-pw-template-1to2] quit [PE1] interface vlanif 10 [PE1-Vlanif10] mpls l2vc pw-template 1to2 100 [PE1-Vlanif10] quit
# 配置PE2。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE2] mpls l2vpn [PE2-l2vpn] quit [PE2] pw-template 2to1 [PE2-pw-template-2to1] peer 1.1.1.9 [PE2-pw-template-2to1] control-word [PE2-pw-template-2to1] quit [PE2] interface vlanif 30 [PE2-Vlanif30] mpls l2vc pw-template 2to1 100 [PE2-Vlanif30] quit
在PE上查看L2VPN连接信息,执行display mpls l2vc interface命令可以看到PW建立成功,且为Active状态。并且PW没有使能BFD for PW功能。
以PE1的显示为例。
[PE1] display mpls l2vc interface vlanif 10 *client interface : Vlanif10 is up Administrator PW : no session state : up AC status : up VC state : up Label state : 0 Token state : 0 VC ID : 100 VC type : VLAN destination : 3.3.3.9 local group ID : 0 remote group ID : 0 local VC label : 23552 remote VC label : 23552 local AC OAM State : up local PSN OAM State : up local forwarding state : forwarding local status code : 0x0 remote AC OAM state : up remote PSN OAM state : up remote forwarding state: forwarding remote status code : 0x0 ignore standby state : no BFD for PW : unavailable VCCV State : up manual fault : not set active state : active forwarding entry : exist 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/token info : 1 tunnels/tokens NO.0 TNL type : lsp , TNL ID : 0x8b Backup TNL type : lsp , TNL ID : 0x0 create time : 0 days, 0 hours, 2 minutes, 9 seconds up time : 0 days, 0 hours, 1 minutes, 9 seconds last change time : 0 days, 0 hours, 1 minutes, 9 seconds VC last up time : 2010/11/24 14:31:31 VC total up time : 0 days, 2 hours, 12 minutes, 51 seconds CKey : 16 NKey : 15 PW redundancy mode : -- AdminPw interface : -- AdminPw link state : -- Diffserv Mode : uniform Service Class : -- Color : -- DomainId : -- Domain Name : --
- 在PE之间配置动态BFD检测单跳PW功能
# 配置PE1。
[PE1] bfd [PE1-bfd] quit [PE1] bfd for pw enable [PE1] interface vlanif 10 [PE1-Vlanif10] mpls l2vpn pw bfd min-rx-interval 100 min-tx-interval 100 [PE1-Vlanif10] quit
# 配置PE2。
[PE2] bfd [PE2-bfd] quit [PE2] bfd for pw enable [PE2] interface vlanif 30 [PE2-Vlanif30] mpls l2vpn pw bfd min-rx-interval 100 min-tx-interval 100 [PE2-Vlanif30] quit
- 验证配置结果
# CE1和CE2能够相互Ping通。
<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=360 ms Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=60 ms Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=160 ms Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=90 ms Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=160 ms --- 10.1.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 60/166/360 ms
# 在PE上执行命令display mpls l2vc interface查看PW的状态。可以看到使能了BFD for PW功能,且BFD state为up。
以PE1的显示为例。
[PE1] display mpls l2vc interface vlanif 10 *client interface : Vlanif10 is up Administrator PW : no session state : up AC status : up VC state : up Label state : 0 Token state : 0 VC ID : 100 VC type : VLAN destination : 3.3.3.9 local group ID : 0 remote group ID : 0 local VC label : 23552 remote VC label : 23552 local AC OAM State : up local PSN OAM State : up local forwarding state : forwarding local status code : 0x0 remote AC OAM state : up remote PSN OAM state : up remote forwarding state: forwarding remote status code : 0x0 ignore standby state : no Dynamic BFD for PW : enable Detect Multipier : 3 Min Transit Interval : 100 Max Receive Interval : 100 Dynamic BFD Session : built BFD for PW : available BFD sessionIndex : 256 BFD state : up VCCV State : up manual fault : not set active state : active forwarding entry : exist link state : up local VC MTU : 4470 remote VC MTU : 4470 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/token info : 1 tunnels/tokens NO.0 TNL type : lsp , TNL ID : 0x8b Backup TNL type : lsp , TNL ID : 0x0 create time : 0 days, 0 hours, 6 minutes, 43 seconds up time : 0 days, 0 hours, 5 minutes, 43 seconds last change time : 0 days, 0 hours, 5 minutes, 43 seconds VC last up time : 2010-11-24 14:33:31 VC total up time : 0 days, 2 hours, 11 minutes, 55 seconds CKey : 16 NKey : 15 PW redundancy mode : -- AdminPw interface : -- AdminPw link state : -- Diffserv Mode : uniform Service Class : -- Color : -- DomainId : -- Domain Name : --
# 在PE上执行命令display bfd session all verbose查看BFD的状态。可以看到BFD会话状态为up,BFD绑定类型为PW,并且BFD会话类型为动态。
以PE1的显示为例。
[PE1] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 256 State : Up Name : dyn_8192 -------------------------------------------------------------------------------- Local Discriminator : 8192 Remote Discriminator : 8192 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : PW(Master) Bind Session Type : Dynamic Bind Peer IP Address : -.-.-.- NextHop Ip Address : -.-.-.- Bind Interface : Vlanif10 PW TTL Mode : - PW TTL : - Node : UPE Encapsulation Type : - Vc Id : - Track Interface : - Local Vc Label : 1026 Remote Vc Label : 1026 Swap Vc Label : - FSM Board Id : 0 TOS-EXP : 7 Min Tx Interval (ms) : 100 Min 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 : 1 Proc Interface Status : Disable Process PST : Enable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : No Diagnostic Bind Application : L2VPN | OAM_MANAGER | MPLSFW Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0 Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
配置文件
CE1的配置文件
# sysname CE1 # vlan batch 10 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 10 # return
PE1的配置文件
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
# sysname PE1 # vlan batch 10 20 # lnp disable # bfd for pw enable # bfd # mpls lsr-id 1.1.1.9 mpls # mpls l2vpn # pw-template 1to2 peer-address 3.3.3.9 control-word # mpls ldp # mpls ldp remote-peer 3.3.3.9 remote-ip 3.3.3.9 # interface Vlanif10 mpls l2vc pw-template 1to2 100 mpls l2vpn pw bfd min-rx-interval 100 min-tx-interval 100 # interface Vlanif20 ip address 100.1.1.1 255.255.255.252 mpls mpls ldp # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 10 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface LoopBack0 ip address 1.1.1.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 100.1.1.0 0.0.0.3 # return
P的配置文件
# sysname P # vlan batch 20 40 # mpls lsr-id 2.2.2.9 mpls # mpls ldp # interface Vlanif20 ip address 100.1.1.2 255.255.255.252 mpls mpls ldp # interface Vlanif40 ip address 100.2.1.1 255.255.255.252 mpls mpls ldp # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 40 # interface LoopBack0 ip address 2.2.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 100.1.1.0 0.0.0.3 network 100.2.1.0 0.0.0.3 # return
PE2的配置文件
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
# sysname PE2 # vlan batch 30 40 # lnp disable # bfd for pw enable # bfd # mpls lsr-id 3.3.3.9 mpls # mpls l2vpn # pw-template 2to1 peer-address 1.1.1.9 control-word # mpls ldp # mpls ldp remote-peer 1.1.1.9 remote-ip 1.1.1.9 # interface Vlanif30 mpls l2vc pw-template 2to1 100 mpls l2vpn pw bfd min-rx-interval 100 min-tx-interval 100 # interface Vlanif40 ip address 100.2.1.2 255.255.255.252 mpls mpls ldp # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 30 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 40 # interface LoopBack0 ip address 3.3.3.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 100.2.1.0 0.0.0.3 # return
CE2的配置文件
# sysname CE2 # vlan batch 30 # interface Vlanif30 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 30 # return