配置VXLAN EVPN拼接VPLS示例
配置VXLAN EVPN拼接VPLS示例,实现数据中心与企业之间的互联。
组网需求
如图12-53所示,PE3和TOR双归属接入PE1和PE2,PE3和PE1、PE2之间为基于MPLS的L2VPN网络,通过PW实现互联,数据中心内部为EVPN VXLAN网络,PE1和PE2为数据中心的出口设备。
设备 |
接口 |
IP地址 |
---|---|---|
PE1 |
GigabitEthernet 1/0/1 |
10.1.1.1/24 |
GigabitEthernet 1/0/2 |
192.168.14.1/24 |
|
Loopback 0 |
1.1.1.1/32 |
|
Loopback 100 |
1.1.1.100/32 |
|
PE2 |
GigabitEthernet 1/0/1 |
10.2.1.2/24 |
GigabitEthernet 1/0/2 |
192.168.24.1/24 |
|
Loopback 0 |
2.2.2.2/32 |
|
Loopback 100 |
2.2.2.100/32 |
|
PE3 |
GigabitEthernet 1/0/0 |
- |
GigabitEthernet 1/0/1 |
10.1.1.3/24 |
|
GigabitEthernet 1/0/2 |
10.2.1.3/24 |
|
Loopback 0 |
3.3.3.3/32 |
|
TOR |
10GE 1/0/0 |
- |
10GE 1/0/1 |
192.168.14.4/24 |
|
10GE 1/0/2 |
192.168.24.4/24 |
|
Loopback 100 |
4.4.4.100/32 |
配置思路
采用如下思路进行配置:
在各设备上配置IGP路由协议,保证网络二层互通。
在PE1、PE2和PE3上分别配置MPLS基本能力和MPLS LDP,建立LDP LSP。
在PE1、PE2和TOR上配置EVPN实例。
配置PE3与PE1、PE2之间MPLS VPLS互联。
配置TOR与PE1、PE2之间VXLAN互联。
在PE1和PE2上配置,EVPN实例与VSI实例绑定同一个BD实现VXLAN入VPLS功能。
数据准备
为完成此配置例,需准备如下的数据:
接口与IP地址。
PE上的MPLS LSR-ID。
PE1、PE2和TOR上创建的EVPN实例的名称、RD和VPN-Target。
PE上的VSI名称及VSI ID。
对等体的IP地址及建立对等体时使用的隧道策略。
操作步骤
- 配置PE和TOR设备的各接口地址,并配置IGP。本例中使用OSPF
具体配置过程请参见配置文件。
- 在PE1、PE2和PE3上分别配置MPLS基本能力和MPLS LDP,建立LDP LSP
具体配置过程请参见配置文件。
- 在PE1、PE2和TOR上配置EVPN实例
# 配置PE1。
[~PE1] evpn vpn-instance tor bd-mode
[*PE1-evpn-instance-tor] route-distinguisher 1.1.1.100:10
[*PE1-evpn-instance-tor] vpn-target 10:10 export-extcommunity
[*PE1-evpn-instance-tor] vpn-target 10:10 import-extcommunity
[*PE1-evpn-instance-tor] quit
[*PE1] commit
TOR、PE2与PE1配置类似,具体配置过程请参见配置文件。
- 配置TOR与PE1、PE2之间的BGP EVPN功能
# 配置PE1。
[~PE1] bgp 100
[*PE1-bgp] peer 4.4.4.100 as-number 65001
[*PE1-bgp] peer 4.4.4.100 ebgp-max-hop 255
[*PE1-bgp] peer 4.4.4.100 connect-interface LoopBack100
[*PE1-bgp] l2vpn-family evpn
[*PE1-bgp-af-evpn] policy vpn-target
[*PE1-bgp-af-evpn] peer 4.4.4.100 enable
[*PE1-bgp-af-evpn] peer 4.4.4.100 advertise encap-type vxlan
[*PE1-bgp-af-evpn] quit
[*PE1-bgp] quit
[*PE1] commit
TOR、PE2与PE1配置类似,具体配置过程请参见配置文件。
- 在PE1、PE2和PE3上配置VSI实例
# 配置PE1。
[~PE1] vsi cpe bd-mode
[*PE1-vsi-cpe] pwsignal ldp
[*PE1-vsi-cpe-ldp] vsi-id 10
[*PE1-vsi-cpe-ldp] peer 3.3.3.3
[*PE1-vsi-cpe-ldp] quit
[*PE1-vsi-cpe] quit
[*PE1] commit
# 配置PE2。
[~PE2] vsi cpe bd-mode
[*PE2-vsi-cpe] pwsignal ldp
[*PE2-vsi-cpe-ldp] vsi-id 10
[*PE2-vsi-cpe-ldp] peer 3.3.3.3
[*PE2-vsi-cpe-ldp] quit
[*PE2-vsi-cpe] quit
[*PE2] commit
# 配置PE3。
[~PE3] vsi cpe bd-mode
[*PE3-vsi-cpe] pw-redundancy mac-withdraw rfc-compatible
[*PE3-vsi-cpe] pwsignal ldp
[*PE3-vsi-cpe-ldp] vsi-id 10
[*PE3-vsi-cpe-ldp] peer 1.1.1.1
[*PE3-vsi-cpe-ldp] peer 2.2.2.2
[*PE3-vsi-cpe-ldp] protect-group 10
[*PE3-vsi-cpe-ldp-protect-group-10] protect-mode pw-redundancy master
[*PE3-vsi-cpe-ldp-protect-group-10] reroute delay 60
[*PE3-vsi-cpe-ldp-protect-group-10] peer 1.1.1.1 preference 1
[*PE3-vsi-cpe-ldp-protect-group-10] peer 2.2.2.2 preference 2
[*PE3-vsi-cpe-ldp-protect-group-10] quit
[*PE3-vsi-cpe-ldp] quit
[*PE3-vsi-cpe] quit
[*PE3] commit
- 在PE1和PE2上配置VSI实例和EVPN实例绑定同一个BD。
# 配置PE1。
[~PE1] bridge-domain 10
[*PE1-bd10] vxlan vni 10 split-horizon-mode
[*PE1-bd10] evpn binding vpn-instance tor
[*PE1-bd10] esi 0000.1111.1111.1111.2222
[*PE1-bd10] l2 binding vsi cpe
[*PE1-bd10] quit
[*PE1] commit
PE2与PE1配置类似,具体配置过程请参见配置文件。
- 检查配置结果
在PE上执行display vsi name cpe verbose命令可以查看VSI和PW状态为up。以PE1为例。
[~PE1] display vsi name cpe verbose
***VSI Name : cpe Work Mode : bd-mode Administrator VSI : no Isolate Spoken : disable VSI Index : 1 PW Signaling : ldp Member Discovery Style : -- Bridge-domain Mode : enable PW MAC Learn Style : qualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Service Class : -- Color : -- DomainId : 255 Domain Name : Ignore AcState : disable P2P VSI : disable Multicast Fast Switch : disable Create Time : 0 days, 3 hours, 24 minutes, 44 seconds VSI State : up Resource Status : -- VSI ID : 10 *Peer Router ID : 3.3.3.3 Negotiation-vc-id : 10 Encapsulation Type : vlan primary or secondary : primary ignore-standby-state : no VC Label : 48123 Peer Type : dynamic Session : up Tunnel ID : 0x0000000001004c4b44 Broadcast Tunnel ID : -- Broad BackupTunnel ID : -- CKey : 1 NKey : 16777348 Stp Enable : 0 PwIndex : 1 Control Word : disable BFD for PW : unavailable Access Bridge-domain : Bridge-domain 10 Vac State : down Last Up Time : 0000/00/00 00:00:00 Total Up Time : 0 days, 0 hours, 0 minutes, 0 seconds **PW Information: *Peer Ip Address : 3.3.3.3 PW State : up Local VC Label : 48123 Remote VC Label : 48124 Remote Control Word : disable PW Type : label Local VCCV : alert lsp-ping bfd Remote VCCV : alert lsp-ping bfd Tunnel ID : 0x0000000001004c4b44 Broadcast Tunnel ID : -- Broad BackupTunnel ID : -- Ckey : 1 Nkey : 16777348 Main PW Token : 0x0 Slave PW Token : 0x0 Tnl Type : ldp OutInterface : -- Backup OutInterface : -- Stp Enable : 0 Mac Flapping : 0 PW Last Up Time : 2018/08/29 08:11:47 PW Total Up Time : 0 days, 1 hours, 46 minutes, 33 seconds
在PE上执行display vxlan tunnel命令可以查看VXLAN的状态为up。以PE1为例。
[~PE1] display vxlan tunnel
Number of vxlan tunnel : 1 Tunnel ID Source Destination State Type Uptime ----------------------------------------------------------------------------------- 4026531841 1.1.1.100 4.4.4.100 up dynamic 00:18:05
配置文件
PE1的配置文件
# sysname PE1 # evpn vpn-instance tor bd-mode route-distinguisher 2.2.2.100:10 vpn-target 10:10 export-extcommunity vpn-target 10:10 import-extcommunity # mpls lsr-id 1.1.1.1 # mpls # mpls l2vpn # vsi cpe bd-mode pwsignal ldp vsi-id 10 peer 3.3.3.3 # bridge-domain 10 vxlan vni 10 split-horizon-mode evpn binding vpn-instance tor esi 0000.1111.1111.1111.2222 l2 binding vsi cpe # mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.14.1 255.255.255.0 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # interface LoopBack100 ip address 1.1.1.100 255.255.255.255 # interface Nve1 source 1.1.1.100 vni 10 head-end peer-list protocol bgp # bgp 100 peer 4.4.4.100 as-number 65001 peer 4.4.4.100 ebgp-max-hop 255 peer 4.4.4.100 connect-interface LoopBack100 # ipv4-family unicast undo synchronization peer 4.4.4.100 enable # l2vpn-family evpn policy vpn-target peer 4.4.4.100 enable peer 4.4.4.100 advertise encap-type vxlan # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 # ospf 100 area 0.0.0.1 network 1.1.1.100 0.0.0.0 network 192.168.14.0 0.0.0.255 # evpn source-address 1.1.1.1 # return
PE2的配置文件
# sysname PE2 # evpn vpn-instance tor bd-mode route-distinguisher 2.2.2.100:10 vpn-target 10:10 export-extcommunity vpn-target 10:10 import-extcommunity # mpls lsr-id 2.2.2.2 # mpls # mpls l2vpn # vsi cpe bd-mode pwsignal ldp vsi-id 10 peer 3.3.3.3 # bridge-domain 10 vxlan vni 10 split-horizon-mode evpn binding vpn-instance tor esi 0000.1111.1111.1111.3333 l2 binding vsi cpe # mpls ldp # interface GigabitEthernet1/0/1 undo shutdown ip address 10.2.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.24.1 255.255.255.0 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # interface LoopBack100 ip address 2.2.2.100 255.255.255.255 # interface Nve1 source 2.2.2.100 vni 10 head-end peer-list protocol bgp # bgp 100 peer 4.4.4.100 as-number 65001 peer 4.4.4.100 ebgp-max-hop 255 peer 4.4.4.100 connect-interface LoopBack100 # ipv4-family unicast undo synchronization peer 4.4.4.100 enable # l2vpn-family evpn policy vpn-target peer 4.4.4.100 enable peer 4.4.4.100 advertise encap-type vxlan # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.2.1.0 0.0.0.255 # ospf 100 area 0.0.0.1 network 2.2.2.100 0.0.0.0 network 192.168.24.0 0.0.0.255 # evpn source-address 2.2.2.2 # return
PE3的配置文件
# sysname PE3 # mpls lsr-id 3.3.3.3 # mpls # mpls l2vpn # vsi cpe bd-mode pw-redundancy mac-withdraw rfc-compatible pwsignal ldp vsi-id 10 peer 1.1.1.1 peer 2.2.2.2 protect-group 10 protect-mode pw-redundancy master reroute delay 60 peer 1.1.1.1 preference 1 peer 2.2.2.2 preference 2 # bridge-domain 10 l2 binding vsi cpe # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown # interface GigabitEthernet1/0/0.1 mode l2 bridge-domain 10 # interface GigabitEthernet1/0/1 undo shutdown ip address 10.1.1.3 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/2 undo shutdown ip address 10.2.1.3 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.1.0 0.0.0.255 # return
TOR的配置
# sysname TOR # evpn vpn-instance tor bd-mode route-distinguisher 4.4.4.100:10 vpn-target 10:10 export-extcommunity vpn-target 10:10 import-extcommunity # bridge-domain 10 vxlan vni 10 split-horizon-mode evpn binding vpn-instance tor esi 0000.1111.1111.1111.1111 # interface GigabitEthernet1/0/0 undo shutdown # interface GigabitEthernet1/0/0.1 mode l2 encapsulation dot1q vid 10 # interface GigabitEthernet1/0/1 undo shutdown ip address 192.168.14.4 255.255.255.0 # interface GigabitEthernet1/0/2 undo shutdown ip address 192.168.24.4 255.255.255.0 # interface LoopBack0 ip address 4.4.4.4 255.255.255.255 # interface LoopBack100 ip address 4.4.4.100 255.255.255.255 # interface Nve1 source 4.4.4.100 vni 10 head-end peer-list protocol bgp # interface NULL0 # bgp 65001 peer 1.1.1.100 as-number 100 peer 1.1.1.100 ebgp-max-hop 255 peer 1.1.1.100 connect-interface LoopBack100 peer 2.2.2.100 as-number 100 peer 2.2.2.100 ebgp-max-hop 255 peer 2.2.2.100 connect-interface LoopBack100 # ipv4-family unicast undo synchronization peer 1.1.1.100 enable peer 2.2.2.100 enable # l2vpn-family evpn policy vpn-target peer 1.1.1.100 enable peer 1.1.1.100 advertise encap-type vxlan peer 2.2.2.100 enable peer 2.2.2.100 advertise encap-type vxlan # ospf 100 area 0.0.0.1 network 4.4.4.100 0.0.0.0 network 192.168.14.0 0.0.0.255 network 192.168.24.0 0.0.0.255 # evpn source-address 4.4.4.4 # return