配置通过VLAN hand-off实现DCI互联示例
组网需求
如图1所示,分别在数据中心A、数据中心B内配置BGP EVPN协议创建VXLAN隧道,实现各数据中心内部VM之间的通信,Leaf2和Leaf3通过二层子接口方式接入DCI-VTEP1和DCI-VTEP2,DCI-VTEP1和DCI-VTEP2之间配置EVPN协议创建VXLAN隧道,实现数据中心之间的通信。Leaf2/Leaf3将收到的数据中心侧的VXLAN报文进行解封装,然后发送到DCI-VTEP,DCI-VTEP将收到的VLAN报文重新封装成VXLAN报文后发送给对端DCI-VTEP,实现VXLAN隧道对跨数据中心的报文端到端的承载,保证跨数据中心VM之间的通信。
本例中interface1、interface2和interface3分别代表100GE1/0/1、100GE1/0/2、100GE1/0/3。

|
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
|---|---|---|---|---|---|
|
Device1 |
100GE1/0/1 |
192.168.50.1/24 |
Device2 |
100GE1/0/1 |
192.168.60.1/24 |
|
100GE1/0/2 |
192.168.1.1/24 |
100GE1/0/2 |
192.168.1.2/24 |
||
|
LoopBack0 |
1.1.1.1/32 |
LoopBack0 |
2.2.2.2/32 |
||
|
DCI-VTEP1
|
100GE1/0/1 |
192.168.50.2/24 |
DCI-VTEP2
|
100GE1/0/1 |
192.168.60.2/24 |
|
100GE1/0/2 |
- |
100GE1/0/2 |
- |
||
|
LoopBack0 |
9.9.9.9/32 |
LoopBack0 |
10.10.10.10/32 |
||
|
Spine1 |
100GE1/0/1 |
192.168.10.1/24 |
Spine2 |
100GE1/0/1 |
192.168.30.1/24 |
|
100GE1/0/2 |
192.168.20.1/24 |
100GE1/0/2 |
192.168.40.1/24 |
||
|
LoopBack0 |
3.3.3.3/32 |
LoopBack0 |
4.4.4.4/32 |
||
|
Leaf1 |
100GE1/0/1 |
192.168.10.2/24 |
Leaf4 |
100GE1/0/1 |
192.168.40.2/24 |
|
100GE1/0/2 |
- |
100GE1/0/2 |
- |
||
|
LoopBack0 |
5.5.5.5/32 |
LoopBack0 |
8.8.8.8/32 |
||
|
Leaf2 |
100GE1/0/1 |
192.168.20.2/24 |
Leaf3 |
100GE1/0/1 |
192.168.30.2/24 |
|
100GE1/0/2 |
- |
100GE1/0/2 |
- |
||
|
100GE1/0/3 |
- |
100GE1/0/3 |
- |
||
|
LoopBack0 |
6.6.6.6/32 |
LoopBack0 |
7.7.7.7/32 |
操作步骤
- 配置各节点接口的IP地址。
# 配置Device1。其他设备的配置过程与Device1类似,在此不再赘述,具体请参考配置脚本。
<HUAWEI> system-view [~HUAWEI] sysname Device1 [*HUAWEI] commit [~Device1] interface loopback 0 [*Device1-LoopBack0] ip address 1.1.1.1 32 [*Device1-LoopBack0] quit [*Device1] interface 100ge 1/0/1 [*Device1-100GE1/0/1] undo portswitch [*Device1-100GE1/0/1] ip address 192.168.50.1 24 [*Device1-100GE1/0/1] quit [*Device1] interface 100ge 1/0/2 [*Device1-100GE1/0/2] undo portswitch [*Device1-100GE1/0/2] ip address 192.168.1.1 24 [*Device1-100GE1/0/2] quit [*Device1] commit
- 配置路由协议,实现路由互通。
# 配置Spine1。Spine2、Device1、Device2的配置过程与Spine1类似,在此不再赘述,具体请参考配置脚本。
<HUAWEI> system-view [~HUAWEI] sysname Spine1 [*HUAWEI] commit [~Spine1] ospf 1 [*Spine1-ospf-1] area 0 [*Spine1-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0 [*Spine1-ospf-1-area-0.0.0.0] network 192.168.10.0 0.0.0.255 [*Spine1-ospf-1-area-0.0.0.0] network 192.168.20.0 0.0.0.255 [*Spine1-ospf-1-area-0.0.0.0] quit [*Spine1-ospf-1] quit [*Spine1] commit
# 配置Leaf1。Leaf2、Leaf3、Leaf4、DCI-VTEP1、DCI-VTEP2的配置过程与Leaf1类似,在此不再赘述,具体请参考配置脚本。
<HUAWEI> system-view [~HUAWEI] sysname Leaf1 [*HUAWEI] commit [~Leaf1] ospf 1 [*Leaf1-ospf-1] area 0 [*Leaf1-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0 [*Leaf1-ospf-1-area-0.0.0.0] network 192.168.10.0 0.0.0.255 [*Leaf1-ospf-1-area-0.0.0.0] quit [*Leaf1-ospf-1] quit [*Leaf1] bgp 100 [*Leaf1-bgp] ipv4-family unicast [*Leaf1-bgp-af-ipv4] peer 6.6.6.6 enable [*Leaf1-bgp-af-ipv4] quit [*Leaf1-bgp] quit [*Leaf1] commit
- 在数据中心A和数据中心B内配置BGP EVPN协议,创建VXLAN隧道。
- 在DCI-VTEP之间配置BGP EVPN协议,创建VXLAN隧道。
- 配置VLAN接入VXLAN隧道
# 配置Leaf2。
[~Leaf2] interface 100GE 1/0/3.1 mode l2 [*Leaf2-100GE1/0/3.1] encapsulation dot1q vid 10 [*Leaf2-100GE1/0/3.1] bridge-domain 10 [*Leaf2-100GE1/0/3.1] quit [*Leaf2] commit
Leaf3、DCI-VTEP1、DCI-VTEP2的配置过程与Leaf2类似,在此不再赘述,具体请参考配置脚本。
检查配置结果
[~Leaf1] display vxlan tunnel
Number of vxlan tunnel : 1
Tunnel ID Source Destination State Type Uptime
-----------------------------------------------------------------------------------
4026531842 5.5.5.5 8.8.8.8 up dynamic 00:10:16
配置完成后,VMa1和VMb2之间可以互相通信。
配置脚本
-
# sysname Spine1 # interface 100GE1/0/1 undo portswitch ip address 192.168.10.1 255.255.255.0 # interface 100GE1/0/2 undo portswitch ip address 192.168.20.1 255.255.255.0 # 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 192.168.10.0 0.0.0.255 network 192.168.20.0 0.0.0.255 # return
-
# sysname Leaf1 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 10:1 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.10.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 5.5.5.5 255.255.255.255 # interface Nve1 source 5.5.5.5 vni 10 head-end peer-list protocol bgp # bgp 100 peer 6.6.6.6 as-number 100 peer 6.6.6.6 connect-interface LoopBack0 # ipv4-family unicast peer 6.6.6.6 enable # l2vpn-family evpn policy vpn-target peer 6.6.6.6 enable peer 6.6.6.6 advertise irb # ospf 1 area 0.0.0.0 network 5.5.5.5 0.0.0.0 network 192.168.10.0 0.0.0.255 # return
-
# sysname Leaf2 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 10:2 vpn-target 11:1 export-extcommunity vpn-target 11:1 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.20.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface 100GE1/0/3.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 6.6.6.6 255.255.255.255 # interface Nve1 source 6.6.6.6 vni 10 head-end peer-list protocol bgp # bgp 100 peer 5.5.5.5 as-number 100 peer 5.5.5.5 connect-interface LoopBack0 # ipv4-family unicast peer 5.5.5.5 enable # l2vpn-family evpn policy vpn-target peer 5.5.5.5 enable peer 5.5.5.5 advertise irb # ospf 1 area 0.0.0.0 network 6.6.6.6 0.0.0.0 network 192.168.20.0 0.0.0.255 # return
-
# sysname Spine2 # interface 100GE1/0/1 undo portswitch ip address 192.168.30.1 255.255.255.0 # interface 100GE1/0/2 undo portswitch ip address 192.168.40.1 255.255.255.0 # interface LoopBack0 ip address 4.4.4.4 255.255.255.255 # ospf 1 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 192.168.30.0 0.0.0.255 network 192.168.40.0 0.0.0.255 # return
-
# sysname Leaf3 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 10:3 vpn-target 22:2 export-extcommunity vpn-target 22:2 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.30.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface 100GE1/0/3.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 7.7.7.7 255.255.255.255 # interface Nve1 source 7.7.7.7 vni 10 head-end peer-list protocol bgp # bgp 200 peer 8.8.8.8 as-number 200 peer 8.8.8.8 connect-interface LoopBack0 # ipv4-family unicast peer 8.8.8.8 enable # l2vpn-family evpn policy vpn-target peer 8.8.8.8 enable peer 8.8.8.8 advertise irb # ospf 1 area 0.0.0.0 network 7.7.7.7 0.0.0.0 network 192.168.30.0 0.0.0.255 # return
-
# sysname Leaf4 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 10:4 vpn-target 22:2 export-extcommunity vpn-target 22:2 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.40.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 8.8.8.8 255.255.255.255 # interface Nve1 source 8.8.8.8 vni 10 head-end peer-list protocol bgp # bgp 200 peer 7.7.7.7 as-number 200 peer 7.7.7.7 connect-interface LoopBack0 # ipv4-family unicast peer 7.7.7.7 enable # l2vpn-family evpn policy vpn-target peer 7.7.7.7 enable peer 7.7.7.7 advertise irb # ospf 1 area 0.0.0.0 network 8.8.8.8 0.0.0.0 network 192.168.40.0 0.0.0.255 # return
- DCI-VTEP1的配置文件
# sysname DCI-VTEP1 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 10:5 vpn-target 33:3 export-extcommunity vpn-target 33:3 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.50.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 9.9.9.9 255.255.255.255 # interface Nve1 source 9.9.9.9 vni 10 head-end peer-list protocol bgp # bgp 100 peer 10.10.10.10 as-number 200 peer 10.10.10.10 connect-interface LoopBack0 peer 10.10.10.10 ebgp-max-hop 255 # ipv4-family unicast peer 10.10.10.10 enable # l2vpn-family evpn policy vpn-target peer 10.10.10.10 enable peer 10.10.10.10 advertise irb # ospf 1 area 0.0.0.0 network 9.9.9.9 0.0.0.0 network 192.168.50.0 0.0.0.255 # return
- DCI-VTEP2的配置文件
# sysname DCI-VTEP2 # evpn-overlay enable # bridge-domain 10 vxlan vni 10 # evpn route-distinguisher 11:6 vpn-target 33:3 export-extcommunity vpn-target 33:3 import-extcommunity # interface 100GE1/0/1 undo portswitch ip address 192.168.60.2 255.255.255.0 # interface 100GE1/0/2.1 mode l2 encapsulation dot1q vid 10 bridge-domain 10 # interface LoopBack0 ip address 10.10.10.10 255.255.255.255 # interface Nve1 source 10.10.10.10 vni 10 head-end peer-list protocol bgp # bgp 200 peer 9.9.9.9 as-number 100 peer 9.9.9.9 connect-interface LoopBack0 peer 9.9.9.9 ebgp-max-hop 255 # ipv4-family unicast peer 9.9.9.9 enable # l2vpn-family evpn policy vpn-target peer 9.9.9.9 enable peer 9.9.9.9 advertise irb # ospf 1 area 0.0.0.0 network 10.10.10.10 0.0.0.0 network 192.168.60.0 0.0.0.255 # return
-
# sysname Device1 # interface 100GE1/0/1 undo portswitch ip address 192.168.50.1 255.255.255.0 # interface 100GE1/0/2 undo portswitch ip address 192.168.1.1 255.255.255.0 # 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.50.0 0.0.0.255 # return
-
# sysname Device2 # interface 100GE1/0/1 undo portswitch ip address 192.168.60.1 255.255.255.0 # interface 100GE1/0/2 undo portswitch ip address 192.168.1.2 255.255.255.0 # interface LoopBack0 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.0 0.0.0.255 network 192.168.60.0 0.0.0.255 # return