配置CCC VC和LDP VC互保护示例(双归3PE场景)
部署CCC VC和LDP VC,在PE设备上使用主从模式,指定主备,可以实现CCC VC和LDP VC互保护。
组网需求
如图9-19所示,CE1和CE2通过Eth-trunk,确定CE侧链路的主备状态。CE1通过PE2访问CE2,当CE2和CE1主链路AC故障时,CE1无法通过认证。解决方法是PE1与PE3之间部署PW保护CE侧主链路。正常情况下,CE1通过PE2进行认证,当CE侧AC主链路,CE1切换到通过PE1和PE3进行认证,保证通过CE1接入的用户业务正常。
操作步骤
- 配置CE
# 配置CE1。
<HUAWEI> system-view
[~HUAWEI] sysname CE1
[*CE1] interface Eth-Trunk 10
[*CE1-Eth-Trunk10] mode lacp-static
[*CE1-Eth-Trunk10] quit
[*CE1] interface Eth-Trunk10.100
[*CE1-Eth-Trunk10.100] undo shutdown
[*CE1-Eth-Trunk10.100] vlan-type dot1q 100
[*CE1-Eth-Trunk10.100] ip address 10.1.1.1 255.255.255.0
[*CE1-Eth-Trunk10.100] quit
[*CE1] interface gigabitethernet1/0/1
[*CE1-Gigabitethernet1/0/1] undo shutdown
[*CE1-Gigabitethernet1/0/1] eth-trunk 10
[*CE1-Gigabitethernet1/0/1] quit
[*CE1] interface gigabitethernet1/0/0
[*CE1-Gigabitethernet1/0/0] undo shutdown
[*CE1-Gigabitethernet1/0/0] eth-trunk 10
[*CE1-Gigabitethernet1/0/0] quit
[*CE1] commit
# 配置CE2。
<HUAWEI> system-view
[~HUAWEI] sysname CE2
[*CE2] interface Eth-Trunk 20
[*CE2-Eth-Trunk20] mode lacp-static
[*CE2-Eth-Trunk20] quit
[*CE2] interface Eth-Trunk20.100
[*CE2-Eth-Trunk20.100] undo shutdown
[*CE2-Eth-Trunk20.100] vlan-type dot1q 100
[*CE2-Eth-Trunk20.100] ip address 10.1.1.2 255.255.255.0
[*CE2-Eth-Trunk20.100] quit
[*CE2] interface gigabitethernet1/0/1
[*CE2-Gigabitethernet1/0/1] undo shutdown
[*CE2-Gigabitethernet1/0/1] eth-trunk 20
[*CE2-Gigabitethernet1/0/1] quit
[*CE2] interface gigabitethernet1/0/0
[*CE2-Gigabitethernet1/0/0] undo shutdown
[*CE2-Gigabitethernet1/0/0] eth-trunk 20
[*CE2-Gigabitethernet1/0/0] quit
[*CE2] commit
- 配置骨干网设备各接口的IP地址
# 配置PE1。
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*PE1] interface loopback 1
[*PE1-LoopBack1] ip address 1.1.1.1 32
[*PE1-LoopBack1] quit
[*PE1] interface gigabitethernet1/0/1
[*PE1-Gigabitethernet1/0/1] ip address 192.168.1.1 24
[*PE1-Gigabitethernet1/0/1] undo shutdown
[*PE1-Gigabitethernet1/0/1] quit
[*PE1] interface gigabitethernet1/0/2
[*PE1-Gigabitethernet1/0/2] ip address 192.168.10.1 24
[*PE1-Gigabitethernet1/0/2] undo shutdown
[*PE1-Gigabitethernet1/0/2] quit
[*PE1] commit
# 配置PE2。
<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*PE2] interface loopback 1
[*PE2-LoopBack1] ip address 2.2.2.2 32
[*PE2-LoopBack1] quit
[*PE2] interface gigabitethernet1/0/1
[*PE2-Gigabitethernet1/0/1] ip address 192.168.1.2 24
[*PE2-Gigabitethernet1/0/1] undo shutdown
[*PE2-Gigabitethernet1/0/1] quit
[*PE2] interface gigabitethernet1/0/2
[*PE2-Gigabitethernet1/0/2] ip address 192.168.20.2 24
[*PE2-Gigabitethernet1/0/2] undo shutdown
[*PE2-Gigabitethernet1/0/2] quit
[*PE2] commit
# 配置PE3。
<HUAWEI> system-view
[~HUAWEI] sysname PE3
[*PE3] interface loopback 1
[*PE3-LoopBack1] ip address 3.3.3.3 32
[*PE3-LoopBack1] quit
[*PE3] interface gigabitethernet1/0/1
[*PE3-Gigabitethernet1/0/1] ip address 192.168.20.1 24
[*PE3-Gigabitethernet1/0/1] undo shutdown
[*PE3-Gigabitethernet1/0/1] quit
[*PE3] interface gigabitethernet1/0/2
[*PE3-Gigabitethernet1/0/2] ip address 192.168.10.2 24
[*PE3-Gigabitethernet1/0/2] undo shutdown
[*PE3-Gigabitethernet1/0/2] quit
[*PE3] commit
- 使能MPLS,建立LSP隧道。
# 配置PE1。
[~PE1] mpls lsr-id 1.1.1.1
[*PE1] mpls
[*PE1-mpls] quit
[*PE1] mpls ldp
[*PE1-mpls-ldp] quit
[*PE1] interface gigabitethernet1/0/1
[*PE1-Gigabitethernet1/0/1] mpls
[*PE1-Gigabitethernet1/0/1] mpls ldp
[*PE1-Gigabitethernet1/0/1] quit
[*PE1] interface gigabitethernet1/0/2
[*PE1-Gigabitethernet1/0/2] mpls
[*PE1-Gigabitethernet1/0/2] mpls ldp
[*PE1-Gigabitethernet1/0/2] quit
[*PE1] commit
# 配置PE2。
[~PE2] mpls lsr-id 2.2.2.2
[*PE2] mpls
[*PE2-mpls] quit
[*PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] interface gigabitethernet1/0/1
[*PE2-Gigabitethernet1/0/1] mpls
[*PE2-Gigabitethernet1/0/1] mpls ldp
[*PE2-Gigabitethernet1/0/1] quit
[*PE2] interface gigabitethernet1/0/2
[*PE2-Gigabitethernet1/0/2] mpls
[*PE2-Gigabitethernet1/0/2] mpls ldp
[*PE2-Gigabitethernet1/0/2] quit
[*PE2] commit
# 配置PE3。
[~PE3] mpls lsr-id 3.3.3.3
[*PE3] mpls
[*PE3-mpls] quit
[*PE3] mpls ldp
[*PE3-mpls-ldp] quit
[*PE3] interface gigabitethernet1/0/1
[*PE3-Gigabitethernet1/0/1] mpls
[*PE3-Gigabitethernet1/0/1] mpls ldp
[*PE3-Gigabitethernet1/0/1] quit
[*PE3] interface gigabitethernet1/0/2
[*PE3-Gigabitethernet1/0/2] mpls
[*PE3-Gigabitethernet1/0/2] mpls ldp
[*PE3-Gigabitethernet1/0/2] quit
[*PE2] commit
- 配置IGP,本示例使用OSPF
# 配置PE1。
[~PE1] ospf 1
[*PE1-ospf-1] area 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 192.168.1.1 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] network 192.168.10.1 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] quit
[*PE1-ospf-1] quit
[*PE1] commit
# 配置PE2。
[~PE2] ospf 1
[*PE2-ospf-1] area 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 192.168.1.2 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] network 192.168.20.2 0.0.0.255
[*PE2-ospf-1-area-0.0.0.0] quit
[*PE2-ospf-1] quit
[*PE2] commit
# 配置PE3。
[~PE3] ospf 1
[*PE3-ospf-1] area 0.0.0.0
[*PE3-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[*PE3-ospf-1-area-0.0.0.0] network 192.168.10.2 0.0.0.255
[*PE3-ospf-1-area-0.0.0.0] network 192.168.20.1 0.0.0.255
[*PE3-ospf-1-area-0.0.0.0] quit
[*PE3-ospf-1] quit
[*PE3] commit
- 在PE上使能MPLS L2VPN
# 配置PE1。
[~PE1] mpls l2vpn
[*PE1-l2vpn] quit
[*PE1] commit
# 配置PE2。
[~PE2] mpls l2vpn
[*PE2-l2vpn] quit
[*PE2] commit
# 配置PE3。
[~PE3] mpls l2vpn
[*PE3-l2vpn] quit
[*PE3] commit
- 配置E-Trunk,协商PW主备关系
- 在PE上创建CCC VC和LDP VC业务
# 配置PE1。
[~PE1] interface Eth-Trunk10.100
[*PE1-Eth-Trunk10.100] vlan-type dot1q 100
[*PE1-Eth-Trunk10.100] mpls l2vc 2.2.2.2 100
[*PE1-Eth-Trunk10.100] mpls l2vc 3.3.3.3 200 secondary
[*PE1-Eth-Trunk10.100] mpls l2vpn redundancy independent
[*PE1-Eth-Trunk10.100] quit
[*PE1] commit
# 配置PE2。
[~PE2] interface Eth-Trunk20.100
[*PE2-Eth-Trunk20.100] vlan-type dot1q 100
[*PE2-Eth-Trunk20.100] quit
[~PE2] interface Eth-Trunk10.100
[*PE2-Eth-Trunk10.100] vlan-type dot1q 100
[*PE2-Eth-Trunk10.100] mpls ccc out-interface Eth-Trunk20.100
[*PE2-Eth-Trunk10.100] mpls l2vc 3.3.3.3 300 secondary
[*PE2-Eth-Trunk10.100] mpls l2vpn redundancy independent
[*PE2-Eth-Trunk10.100] quit
[*PE2] interface Eth-Trunk20.100
[*PE2-Eth-Trunk20.100] mpls ccc out-interface Eth-Trunk10.100
[*PE2-Eth-Trunk20.100] mpls l2vc 1.1.1.1 100 secondary
[*PE2-Eth-Trunk20.100] mpls l2vpn redundancy independent
[*PE2-Eth-Trunk20.100] quit
[*PE2] commit
# 配置PE3。
[~PE3] interface Eth-Trunk20.100
[*PE3-Eth-Trunk20.100] vlan-type dot1q 100
[*PE3-Eth-Trunk20.100] mpls l2vc 1.1.1.1 200
[*PE3-Eth-Trunk20.100] mpls l2vc 2.2.2.2 300 secondary
[*PE3-Eth-Trunk20.100] mpls l2vpn redundancy independent
[*PE3-Eth-Trunk20.100] quit
[*PE3] commit
- 验证配置结果。
配置完成后,在PE2上查看VPWS状态信息,可以看到建立了CCC VC和LDP VC,状态为UP。CCC VC的角色为主,LDP VC的角色为secondary。
[PE2]display mpls l2vpn vpws
Pri : Primary Sec : Secondary Byp : Bypass PWb : PW-bypass ACb : AC-bypass Access Circuit Virtual Circuit States Active Role Eth-Trunk10.100 Eth-Trunk20.100 Up Active Pri 3.3.3.3:300 Up Inactive Sec Eth-Trunk20.100 Eth-Trunk10.100 Up Active Pri 1.1.1.1:100 Up Inactive Sec
配置文件
CE1的配置文件
# sysname CE1 #interface Eth-Trunk10 mode lacp-static # interface Eth-Trunk10.100 vlan-type dot1q 100 ip address 10.1.1.1 255.255.255.0 # interface Gigabitethernet1/0/0 undo shutdown eth-trunk 10 # interface Gigabitethernet1/0/1 undo shutdown eth-trunk 10 # #return
CE2的配置文件
# sysname CE2 # interface Eth-Trunk20 mode lacp-static # interface Eth-Trunk20.100 vlan-type dot1q 100 ip address 10.1.1.2 255.255.255.0 # interface Gigabitethernet1/0/0 undo shutdown eth-trunk 20 # interface Gigabitethernet1/0/1 undo shutdown eth-trunk 20 # return
PE1的配置文件
# sysname PE1 # lacp e-trunk system-id 00e0-fc00-0000 lacp e-trunk priority 100 # e-trunk 10 # bfd # mpls lsr-id 1.1.1.1 # mpls # mpls ldp # mpls l2vpn # interface Eth-Trunk10 mode lacp-static e-trunk 10 # interface Eth-Trunk10.100 vlan-type dot1q 100 mpls l2vc 2.2.2.2 100 mpls l2vc 3.3.3.3 200 secondary mpls l2vpn redundancy independent # interface GigabitEthernet1/0/0 undo shutdown eth-trunk 10 # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.10.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 192.168.1.1 0.0.0.255 network 192.168.10.1 0.0.0.255 # bfd hello bind peer-ip 2.2.2.2 source-ip 1.1.1.1 discriminator local 100 discriminator remote 101 # e-trunk 10 priority 10 peer-address 2.2.2.2 source-address 1.1.1.1 e-trunk track bfd-session session-name hello # return
PE2的配置文件
# sysname PE2 # lacp e-trunk system-id 00e0-fc00-0000 lacp e-trunk priority 100 # e-trunk 10 # e-trunk 20 # bfd # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # mpls l2vpn # interface Eth-Trunk10 mode lacp-static e-trunk 10 # interface Eth-Trunk10.100 vlan-type dot1q 100 mpls ccc out-interface Eth-Trunk20.100 mpls l2vc 3.3.3.3 300 secondary mpls l2vpn redundancy independent # interface Eth-Trunk20 mode lacp-static e-trunk 20 # interface Eth-Trunk20.100 vlan-type dot1q 100 mpls ccc out-interface Eth-Trunk10.100 mpls l2vc 1.1.1.1 100 secondary mpls l2vpn redundancy independent # interface GigabitEthernet1/0/0 undo shutdown eth-trunk 10 # interface GigabitEthernet1/0/3 undo shutdown eth-trunk 20 # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.20.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.1.2 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 192.168.1.2 0.0.0.255 network 192.168.20.2 0.0.0.255 # bfd hello bind peer-ip 1.1.1.1 source-ip 2.2.2.2 discriminator local 100 discriminator remote 101 # bfd hi bind peer-ip 3.3.3.3 source-ip 2.2.2.2 discriminator local 200 discriminator remote 201 # e-trunk 10 priority 10 peer-address 1.1.1.1 source-address 2.2.2.2 e-trunk track bfd-session session-name hello # e-trunk 20 priority 20 peer-address 1.1.1.1 source-address 2.2.2.2 e-trunk track bfd-session session-name hi # return
PE3的配置文件
# sysname PE3 # lacp e-trunk system-id 00e0-fc00-0000 lacp e-trunk priority 100 # e-trunk 20 # bfd # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # mpls l2vpn # interface Eth-Trunk20 mode lacp-static e-trunk 20 # interface Eth-Trunk20.100 vlan-type dot1q 100 mpls l2vc 1.1.1.1 200 mpls l2vc 2.2.2.2 300 secondary mpls l2vpn redundancy independent # interface GigabitEthernet1/0/0 undo shutdown eth-trunk 20 # # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.20.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.10.2 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 192.168.10.2 0.0.0.0 network 192.168.20.1 0.0.0.255 # bfd hi bind peer-ip 2.2.2.2 source-ip 3.3.3.3 discriminator local 201 discriminator remote 200 # e-trunk 20 priority 20 peer-address 2.2.2.2 source-address 3.3.3.3 e-trunk track bfd-session session-name hi # return