配置LDP VPLS以PW Redundancy方式接入BGP AD VPLS的示例
本例描述了LDP VPLS以PW Redundancy方式接入BGP AD VPLS的配置过程。
组网需求
如图10-42所示,PE2、PE3、PE4是已经部署的网络,它们之间通过BGP AD方式建立全连接的VPLS网络。PE1只支持LDP方式的VPLS,PE2、PE3支持LDP和BGP AD方式的VPLS。现在要求CE1与CE2能互访,PE1以PW Redundancy方式接入BGP AD VPLS网络。
- PE1与PE2、PE3之间建立LDP方式的Hub PW,并且通过Master/Slave模式的PW Redundancy形成保护关系
- PE2与PE1之间建立LDP方式的Spoke PW,与PE3、PE4之间建立BGP AD方式的Hub PW
- PE3与PE1之间建立LDP方式的Spoke PW,与PE2、PE4之间建立BGP AD方式的Hub PW
- PE4与PE2、PE3之间建立BGP AD方式的Hub PW
设备 |
接口 |
IP地址 |
---|---|---|
PE1 |
GE 1/0/0 |
192.168.1.1/24 |
GE 1/0/1 |
192.168.2.1/24 |
|
GE 1/0/2 |
- |
|
Loopback 0 |
1.1.1.1/32 |
|
PE2 |
GE 1/0/0 |
192.168.1.2/24 |
GE 1/0/1 |
192.168.4.1/24 |
|
GE 1/0/2 |
192.168.3.2/24 |
|
Loopback 0 |
2.2.2.2/32 |
|
PE3 |
GE 1/0/0 |
192.168.5.1/24 |
GE 1/0/1 |
192.168.2.2/24 |
|
GE 1/0/2 |
192.168.3.1/24 |
|
Loopback 0 |
3.3.3.3/32 |
|
PE4 |
GE 1/0/0 |
192.168.5.2/24 |
GE 1/0/1 |
192.168.4.2/24 |
|
GE 1/0/2 |
- |
|
Loopback 0 |
4.4.4.4/32 |
|
CE1 |
GE 1/0/2 |
- |
GE 1/0/2.1 |
192.168.10.1/24 |
|
CE2 |
GE 1/0/2 |
- |
GE 1/0/2.1 |
192.168.10.2/24 |
配置思路
采用如下的思路配置LDP VPLS以PW Redundancy方式接入BGP AD VPLS:
- 配置网络中设备各接口的IP地址和路由协议,实现PE设备之间网络层互通。本示例配置OSPF路由协议。
配置MPLS和公网隧道,用来承载PW。在本示例中,PE之间使用LDP LSP隧道。
在PE1、PE2、PE3之间配置Martini方式的VPLS。
在PE2、PE3、PE4之间配置BGP AD方式的VPLS。
在PE1上配置Master/Slave模式的PW Redundancy。
配置MAC Withdraw。
数据准备
为完成此配置例,需准备如下的数据:
各接口的IP地址、各节点的LSR ID、OSPF进程号1、接口所属的区域编号0。
VSI实例的名称、VSI ID、VPLS ID、VPN-Target、BGP AS编号。
VSI绑定的接口编号及VLAN ID。
PW Redundancy保护组的名称、回切模式、延迟时间、PW的优先级。
操作步骤
- 配置骨干网各接口的IP地址和路由协议,实现PE设备之间网络层互通
本示例中配置OSPF协议,具体配置请参见后面的配置文件。
配置完成后,在PE上执行display ip routing-table命令可以看到PE已学到彼此的Loopback接口地址。
- 配置MPLS和公网隧道
本示例中配置LDP LSP隧道,具体配置请参见后面的配置文件。
配置完成后,在PE上执行display mpls ldp session命令可以看到PE之间的对等体Status项为“Operational”,即对等体关系已建立。执行display mpls lsp命令可以看到LSP的建立情况。
- 在PE1、PE2、PE3之间配置Martini方式的VPLS
# 配置PE1
<PE1> system-view
[~PE1] mpls l2vpn
[*PE1-l2vpn] quit
[*PE1] vsi vsi1 static
[*PE1-vsi-vsi1] pwsignal ldp
[*PE1-vsi-vsi1-ldp] vsi-id 1
[*PE1-vsi-vsi1-ldp] peer 2.2.2.2
[*PE1-vsi-vsi1-ldp] peer 3.3.3.3
[*PE1-vsi-vsi1-ldp] quit
[*PE1-vsi-vsi1] quit
[*PE1] commit
# 配置PE2
<PE2> system-view
[~PE2] mpls l2vpn
[*PE2-l2vpn] quit
[*PE2] vsi vsi1
[*PE2-vsi-vsi1] pwsignal ldp
[*PE2-vsi-vsi1-ldp] vsi-id 1
[*PE2-vsi-vsi1-ldp] peer 1.1.1.1 upe
[*PE2-vsi-vsi1-ldp] quit
[*PE2-vsi-vsi1] quit
[*PE2] commit
# 配置PE3
<PE3> system-view
[~PE3] mpls l2vpn
[*PE3-l2vpn] quit
[*PE3] vsi vsi1
[*PE3-vsi-vsi1] pwsignal ldp
[*PE3-vsi-vsi1-ldp] vsi-id 1
[*PE3-vsi-vsi1-ldp] peer 1.1.1.1 upe
[*PE3-vsi-vsi1-ldp] quit
[*PE3-vsi-vsi1] quit
[*PE3] commit
# 在PE1上配置VSI绑定AC接口
[~PE1] interface gigabitethernet1/0/2.1
[*PE1-GigabitEthernet1/0/2.1] vlan-type dot1q 10
[*PE1-GigabitEthernet1/0/2.1] l2 binding vsi vsi1
[*PE1-GigabitEthernet1/0/2.1] quit
[*PE1] commit
- 在PE2、PE3、PE4之间配置BGP AD方式的VPLS
使能BGP对等体交换VPLS成员信息的能力
# 配置PE2
<PE2> system-view
[~PE2] bgp 100
[*PE2-bgp] peer 3.3.3.3 as-number 100
[*PE2-bgp] peer 3.3.3.3 connect-interface loopback0
[*PE2-bgp] peer 4.4.4.4 as-number 100
[*PE2-bgp] peer 4.4.4.4 connect-interface loopback0
[*PE2-bgp] l2vpn-ad-family
[*PE2-bgp-af-l2vpn-ad] peer 3.3.3.3 enable
[*PE2-bgp-af-l2vpn-ad] peer 4.4.4.4 enable
[*PE2-bgp-af-l2vpn-ad] quit
[*PE2-bgp] quit
[*PE2] commit
# 配置PE3
[~PE3] bgp 100
[*PE3-bgp] peer 2.2.2.2 as-number 100
[*PE3-bgp] peer 2.2.2.2 connect-interface loopback0
[*PE3-bgp] peer 4.4.4.4 as-number 100
[*PE3-bgp] peer 4.4.4.4 connect-interface loopback0
[*PE3-bgp] l2vpn-ad-family
[*PE3-bgp-af-l2vpn-ad] peer 2.2.2.2 enable
[*PE3-bgp-af-l2vpn-ad] peer 4.4.4.4 enable
[*PE3-bgp-af-l2vpn-ad] quit
[*PE3-bgp] quit
[*PE3] commit
# 配置PE4
<PE4> system-view
[~PE4] bgp 100
[*PE4-bgp] peer 2.2.2.2 as-number 100
[*PE4-bgp] peer 2.2.2.2 connect-interface loopback0
[*PE4-bgp] peer 3.3.3.3 as-number 100
[*PE4-bgp] peer 3.3.3.3 connect-interface loopback0
[*PE4-bgp] l2vpn-ad-family
[*PE4-bgp-af-l2vpn-ad] peer 2.2.2.2 enable
[*PE4-bgp-af-l2vpn-ad] peer 3.3.3.3 enable
[*PE4-bgp-af-l2vpn-ad] quit
[*PE4-bgp] quit
[*PE4] commit
创建VSI并配置BGP AD信令
# 配置PE2
[~PE2] vsi vsi1
[*PE2-vsi-vsi1] bgp-ad
[*PE2-vsi-vsi1--bgpad] vpls-id 192.168.0.0:1
[*PE2-vsi-vsi1--bgpad] vpn-target 100:1 import-extcommunity
[*PE2-vsi-vsi1--bgpad] vpn-target 100:1 export-extcommunity
[*PE2-vsi-vsi1--bgpad] quit
[*PE2-vsi-vsi1] quit
[*PE2] commit
在PE2上,LDP PW和BGP AD PW需要在同一个VSI下创建。
# 配置PE3
[~PE3] vsi vsi1
[*PE3-vsi-vsi1] bgp-ad
[*PE3-vsi-vsi1--bgpad] vpls-id 192.168.0.0:1
[*PE3-vsi-vsi1--bgpad] vpn-target 100:1 import-extcommunity
[*PE3-vsi-vsi1--bgpad] vpn-target 100:1 export-extcommunity
[*PE3-vsi-vsi1--bgpad] quit
[*PE3-vsi-vsi1] quit
[*PE3] commit
在PE3上,LDP PW和BGP AD PW需要在同一个VSI下创建。
# 配置PE4
[~PE4] mpls l2vpn
[*PE4-l2vpn] quit
[*PE4] vsi vsi1
[*PE4-vsi-vsi1] bgp-ad
[*PE4-vsi-vsi1--bgpad] vpls-id 192.168.0.0:1
[*PE4-vsi-vsi1--bgpad] vpn-target 100:1 import-extcommunity
[*PE4-vsi-vsi1--bgpad] vpn-target 100:1 export-extcommunity
[*PE4-vsi-vsi1--bgpad] quit
[*PE4-vsi-vsi1] quit
[*PE4] commit
在PE4上配置VSI绑定AC接口。
[~PE4] interface gigabitethernet1/0/2.1
[*PE4-GigabitEthernet1/0/2.1] vlan-type dot1q 10
[*PE4-GigabitEthernet1/0/2.1] l2 binding vsi vsi1
[*PE4-GigabitEthernet1/0/2.1] quit
[*PE4] commit
- 在PE1上配置Master/Slave模式的PW Redundancy
配置PW加入PW冗余保护组。在PE1上创建PW冗余保护组,配置其模式为Master/Slave。将指定的PW加入保护组并为其指定优先级。同时配置延迟回切时间为60s。
[~PE1] vsi vsi1
[*PE1-vsi-vsi1] pwsignal ldp
[*PE1-vsi-vsi1-ldp] protect-group vsi1
[*PE1-vsi-vsi1-ldp-protect-group-vsi1] protect-mode pw-redundancy master
[*PE1-vsi-vsi1-ldp-protect-group-vsi1] peer 2.2.2.2 preference 1
[*PE1-vsi-vsi1-ldp-protect-group-vsi1] peer 3.3.3.3 preference 2
[*PE1-vsi-vsi1-ldp-protect-group-vsi1] reroute delay 60
[*PE1-vsi-vsi1-ldp-protect-group-vsi1] quit
[*PE1-vsi-vsi1-ldp] quit
[*PE1-vsi-vsi1] quit
[*PE1] commit
配置BFD检测主PW。
# 配置PE1
[~PE1] bfd
[*PE1-bfd] quit
[*PE1] bfd p1 bind pw vsi vsi1 peer 2.2.2.2 remote-peer 2.2.2.2 pw-ttl auto-calculate
[*PE1-bfd-lsp-session-p1] discriminator local 104
[*PE1-bfd-lsp-session-p1] discriminator remote 401
[*PE1-bfd-lsp-session-p1] commit
[~PE1-bfd-lsp-session-p1] quit
# 配置PE2
[~PE2] bfd
[*PE2-bfd] quit
[*PE2] bfd p1 bind pw vsi vsi1 peer 1.1.1.1 remote-peer 1.1.1.1 pw-ttl auto-calculate
[*PE2-bfd-lsp-session-p1] discriminator local 401
[*PE2-bfd-lsp-session-p1] discriminator remote 104
[*PE2-bfd-lsp-session-p1] commit
[~PE2-bfd-lsp-session-p1] quit
查看PW的主备状态。
# 查看PE1上PW的主备状态
[~PE1] display vsi verbose
***VSI Name : vsi1 Administrator VSI : no Isolate Spoken : disable VSI Index : 0 PW Signaling : ldp Member Discovery Style : static Bridge-domain Mode : disable PW MAC Learn Style : unqualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Service Class : -- Color : -- DomainId : 255 Domain Name : Ignore AcState : disable P2P VSI : disable Create Time : 0 days, 1 hours, 12 minutes, 47 seconds VSI State : up VSI ID : 1 *Peer Router ID : 2.2.2.2 primary or secondary : primary ignore-standby-state : no VC Label : 1028 Peer Type : dynamic Session : up Tunnel ID : 0x800808 Broadcast Tunnel ID : 0x800808 Broad BackupTunnel ID : 0x0 CKey : 2 NKey : 1 Stp Enable : 0 PwIndex : 0 Control Word : disable *Peer Router ID : 3.3.3.3 primary or secondary : primary ignore-standby-state : no VC Label : 1029 Peer Type : dynamic Session : up Tunnel ID : 0x800809 Broadcast Tunnel ID : 0x800809 Broad BackupTunnel ID : 0x0 CKey : 4 NKey : 3 Stp Enable : 0 PwIndex : 0 Control Word : disable Interface Name : GigabitEthernet1/0/2.1 State : up Access Port : false Last Up Time : 2012/12/24 19:06:41 Total Up Time : 0 days, 1 hours, 3 minutes, 5 seconds **PW Information: *Peer Ip Address : 3.3.3.3 PW State : backup Local VC Label : 1029 Remote VC Label : 1028 Remote Control Word : disable PW Type : label Tunnel ID : 0x800809 Broadcast Tunnel ID : 0x800809 Broad BackupTunnel ID : 0x0 Ckey : 0x4 Nkey : 0x3 Main PW Token : 0x800809 Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/1 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 19:06:41 PW Total Up Time : 0 days, 1 hours, 3 minutes, 5 seconds *Peer Ip Address : 2.2.2.2 PW State : up Local VC Label : 1028 Remote VC Label : 1032 Remote Control Word : disable PW Type : label Tunnel ID : 0x800808 Broadcast Tunnel ID : 0x800808 Broad BackupTunnel ID : 0x0 Ckey : 0x2 Nkey : 0x1 Main PW Token : 0x800808 Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/0 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 19:52:15 PW Total Up Time : 0 days, 0 hours, 17 minutes, 33 seconds
# 查看PE2上PW的主备状态
[~PE2] display vsi verbose
***VSI Name : vsi1 Administrator VSI : no Isolate Spoken : disable VSI Index : 0 PW Signaling : ldp bgpad Member Discovery Style : -- Bridge-domain Mode : disable PW MAC Learn Style : unqualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Service Class : -- Color : -- DomainId : 255 Domain Name : Ignore AcState : disable P2P VSI : disable Create Time : 0 days, 1 hours, 15 minutes, 29 seconds VSI State : up VPLS ID : 192.168.0.0:1 RD : 192.168.0.0:1 Import vpn target : 100:1 Export vpn target : 100:1 BGPAD VSI ID : 2.2.2.2 *Peer Router ID : 4.4.4.4 VPLS ID : 192.168.0.0:1 SAII : 2.2.2.2 TAII : 4.4.4.4 VC Label : 1034 Peer Type : dynamic Session : up Tunnel ID : 0x80081a Broadcast Tunnel ID : 0x80081a CKey : 10 NKey : 9 *Peer Router ID : 3.3.3.3 VPLS ID : 192.168.0.0:1 SAII : 2.2.2.2 TAII : 3.3.3.3 VC Label : 1035 Peer Type : dynamic Session : up Tunnel ID : 0x80081b Broadcast Tunnel ID : 0x80081b CKey : 11 NKey : 7 VSI ID : 1 *Peer Router ID : 1.1.1.1 primary or secondary : primary ignore-standby-state : no VC Label : 1032 Peer Type : dynamic Session : up Tunnel ID : 0x800818 Broadcast Tunnel ID : 0x800818 Broad BackupTunnel ID : 0x0 CKey : 6 NKey : 5 Stp Enable : 0 PwIndex : 0 Control Word : disable *Peer Router ID : 3.3.3.3 primary or secondary : primary ignore-standby-state : no VC Label : 1033 Peer Type : dynamic Session : up Tunnel ID : 0x800819 Broadcast Tunnel ID : 0x800819 Broad BackupTunnel ID : 0x0 CKey : 8 NKey : 7 Stp Enable : 0 PwIndex : 0 Control Word : disable **PW Information: *Peer Ip Address : 1.1.1.1 PW State : up Local VC Label : 1032 Remote VC Label : 1028 Remote Control Word : disable PW Type : MEHVPLS Tunnel ID : 0x800818 Broadcast Tunnel ID : 0x800818 Broad BackupTunnel ID : 0x0 Ckey : 0x6 Nkey : 0x5 Main PW Token : 0x800818 Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/0 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 19:52:15 PW Total Up Time : 0 days, 0 hours, 20 minutes, 34 seconds *Peer Ip Address : 3.3.3.3 PW State : up Local VC Label : 1033 Remote VC Label : 1037 Remote Control Word : disable PW Type : label Tunnel ID : 0x800819 Broadcast Tunnel ID : 0x800819 Broad BackupTunnel ID : 0x0 Ckey : 0x8 Nkey : 0x7 Main PW Token : 0x800819 Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/2 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 19:52:59 PW Total Up Time : 0 days, 0 hours, 20 minutes, 18 seconds *Peer Ip Address : 3.3.3.3 PW State : up Local VC Label : 1035 Remote VC Label : 1038 Remote Control Word : disable PW Type : label Tunnel ID : 0x80081b Broadcast Tunnel ID : 0x80081b Broad BackupTunnel ID : 0x0 Ckey : 0xb Nkey : 0x7 Main PW Token : 0x80081b Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/2 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 19:59:01 PW Total Up Time : 0 days, 0 hours, 13 minutes, 50 seconds *Peer Ip Address : 4.4.4.4 PW State : up Local VC Label : 1034 Remote VC Label : 1037 Remote Control Word : disable PW Type : label Tunnel ID : 0x80081a Broadcast Tunnel ID : 0x80081a Broad BackupTunnel ID : 0x0 Ckey : 0xa Nkey : 0x9 Main PW Token : 0x80081a Slave PW Token : 0x0 Tnl Type : LSP OutInterface : GigabitEthernet1/0/1 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/12/24 20:00:19 PW Total Up Time : 0 days, 0 hours, 12 minutes, 33 seconds
- 配置MAC Withdraw
# 配置PE1
[~PE1] vsi vsi1
[*PE1-vsi-vsi1] mac-withdraw enable
[*PE1-vsi-vsi1] quit
[*PE1] commit
# 配置PE2
[~PE2] vsi vsi1
[*PE2-vsi-vsi1] mac-withdraw enable
[*PE2-vsi-vsi1] mac-withdraw propagate enable
[*PE2-vsi-vsi1] quit
[*PE2] commit
# 配置PE3
[~PE3] vsi vsi1
[*PE3-vsi-vsi1] mac-withdraw enable
[*PE3-vsi-vsi1] mac-withdraw propagate enable
[*PE3-vsi-vsi1] quit
[*PE3] commit
- 配置CE
# 配置CE1
<CE1> system-view
[~CE1] interface gigabitethernet1/0/2
[*CE1-GigabitEthernet1/0/2] undo shutdown
[*CE1-GigabitEthernet1/0/2] quit
[*CE1] interface gigabitethernet1/0/2.1
[*CE1-GigabitEthernet1/0/2.1] vlan-type dot1q 10
[*CE1-GigabitEthernet1/0/2.1] ip address 192.168.10.1 255.255.255.0
[*CE1-GigabitEthernet1/0/2.1] quit
[*CE1] commit
# 配置CE2
<CE2> system-view
[~CE2] interface gigabitethernet1/0/2
[*CE2-GigabitEthernet1/0/2] undo shutdown
[*CE2-GigabitEthernet1/0/2] quit
[*CE2] interface gigabitethernet1/0/2.1
[*CE2-GigabitEthernet1/0/2.1] vlan-type dot1q 10
[*CE2-GigabitEthernet1/0/2.1] ip address 192.168.10.2 255.255.255.0
[*CE2-GigabitEthernet1/0/2.1] quit
[*CE2] commit
- 检验配置结果
CE1可以ping通CE2
[~CE1] ping 192.168.10.2
PING 192.168.10.2: 56 data bytes, press CTRL_C to break Reply from 192.168.10.2: bytes=56 Sequence=1 ttl=255 time=140 ms Reply from 192.168.10.2: bytes=56 Sequence=2 ttl=255 time=140 ms Reply from 192.168.10.2: bytes=56 Sequence=3 ttl=255 time=140 ms Reply from 192.168.10.2: bytes=56 Sequence=4 ttl=255 time=110 ms Reply from 192.168.10.2: bytes=56 Sequence=5 ttl=255 time=180 ms --- 192.168.10.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 110/142/180 ms
配置文件
PE1的配置文件
# sysname PE1 # bfd # mpls lsr-id 1.1.1.1 mpls # mpls l2vpn # vsi vsi1 static pwsignal ldp vsi-id 1 peer 2.2.2.2 peer 3.3.3.3 protect-group vsi1 protect-mode pw-redundancy master reroute delay 60 peer 2.2.2.2 preference 1 peer 3.3.3.3 preference 2 mac-withdraw enable # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.2.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown # interface GigabitEthernet1/0/2.1 vlan-type dot1q 10 l2 binding vsi vsi1 # interface LoopBack0 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.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # bfd p1 bind pw vsi vsi1 peer 2.2.2.2 remote-peer 2.2.2.2 pw-ttl auto-calculate discriminator local 104 discriminator remote 401 commit # return
PE2的配置文件
# sysname PE2 # bfd # mpls lsr-id 2.2.2.2 mpls # mpls l2vpn # vsi vsi1 pwsignal ldp vsi-id 1 peer 1.1.1.1 upe bgp-ad vpls-id 192.168.0.0:1 vpn-target 100:1 import-extcommunity vpn-target 100:1 export-extcommunity mac-withdraw enable mac-withdraw propagate enable # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.4.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.3.2 255.255.255.0 mpls mpls ldp # interface LoopBack0 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 LoopBack0 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack0 # ipv4-family unicast peer 3.3.3.3 enable peer 4.4.4.4 enable # l2vpn-ad-family policy vpn-target peer 3.3.3.3 enable peer 4.4.4.4 enable # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 # bfd p1 bind pw vsi vsi1 peer 1.1.1.1 remote-peer 1.1.1.1 pw-ttl auto-calculate discriminator local 401 discriminator remote 104 commit # return
PE3的配置文件
# sysname PE3 # mpls lsr-id 3.3.3.3 mpls # mpls l2vpn # vsi vsi1 pwsignal ldp vsi-id 1 peer 1.1.1.1 upe bgp-ad vpls-id 192.168.0.0:1 vpn-target 100:1 import-extcommunity vpn-target 100:1 export-extcommunity mac-withdraw enable mac-withdraw propagate enable # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.5.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.2.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.3.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 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 LoopBack0 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack0 # ipv4-family unicast peer 2.2.2.2 enable peer 4.4.4.4 enable # l2vpn-ad-family policy vpn-target peer 2.2.2.2 enable peer 4.4.4.4 enable # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 192.168.5.0 0.0.0.255 # return
PE4的配置文件
# sysname PE4 # mpls lsr-id 4.4.4.4 mpls # mpls l2vpn # vsi vsi1 bgp-ad vpls-id 192.168.0.0:1 vpn-target 100:1 import-extcommunity vpn-target 100:1 export-extcommunity # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 192.168.5.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.4.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown # interface GigabitEthernet1/0/2.1 vlan-type dot1q 10 l2 binding vsi vsi1 # interface LoopBack0 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 LoopBack0 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast peer 2.2.2.2 enable peer 3.3.3.3 enable # l2vpn-ad-family policy vpn-target peer 2.2.2.2 enable peer 3.3.3.3 enable # ospf 1 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 192.168.4.0 0.0.0.255 network 192.168.5.0 0.0.0.255 network 192.168.6.0 0.0.0.255 # return
CE1的配置文件
# sysname CE1 # interface GigabitEthernet1/0/2 undo shutdown # interface GigabitEthernet1/0/2.1 vlan-type dot1q 10 ip address 192.168.10.1 255.255.255.0 # return
CE2的配置文件
# sysname CE2 # interface GigabitEthernet1/0/2 undo shutdown # interface GigabitEthernet1/0/2.1 vlan-type dot1q 10 ip address 192.168.10.2 255.255.255.0 # return