华为设备实现静态vxlan隧道

实验背景:
PC1和PC2,在物理网络中处于两个不同的三层子网
LSW1、LSW2、LSW3不支持VxLAN, CE1和CE2支持VxLan
实验需求
- PC1和PC2,从underlay网络看,处于不同的广播域
- 通过配置VxLAN静态隧道,实现PC1和PC2在overloay网络上在同一个广播域,可以相互通信
- PC1和PC2在VLAN 10, BD 10,分配VNI 100
基础网络配置
基础网络配置
LSW2
system-view
sysname LSW2
vlan 10
int g0/0/2
port link-type access
por de vlan 10
int g0/0/1
port link-type trunk
port trunk allow-pass vlan 10
LSW3
system-view
sysname LSW3
vlan 10
int g0/0/2
port link-type access
por de vlan 10
int g0/0/1
port link-type trunk
port trunk allow-pass vlan 10
CE1
system-view
sysname CE1
int g1/0/1
undo portswitch
ip add 10.0.12.1 24
undo shutdown
int loop 0
ip add 1.1.1.1 32
int g1/0/2
undo shutdown
commit
border
system-view
sysname border
vlan batch 100 200
int g0/0/23
port link-type acc
port def vlan 100
int g0/0/24
port link-type acc
port def vlan 200
int vlan 100
ip add 10.0.12.2 24
int vlan 200
ip add 10.0.23.2 24
CE2
system-view
sysname CE2
int g1/0/1
undo portsw
ip add 10.0.23.3 24
undo shutdown
int g1/0/2
undo shutdown
int loop 0
ip add 1.1.1.1 32
commit
开启ospf
CE1
ospf
area 0
net 0.0.0.0 0.0.0.0
commit
CE2
ospf
area 0
net 0.0.0.0 0.0.0.0
commit
border
ospf
area 0
net 0.0.0.0 0.0.0.0
dis ospf peer bri
VxLan接入配置
创建BD,CE1&CE2
bridge-domain 10
创建子接口,CE1&CE2
- 子接口和vlan10关联
- 子接口和BD关联
- g1/0/2收到vlan10的报文,就将报文关联到bd10
int g1/0/2
port link-type trunk
int g1/0/2.1 mode l2
enca dot1q vid 10
bridge-domain 10
commit
VxLAN隧道配置
CE1
- 将bd10 和 vni 100进行关联
- 创建vxlan隧道,编号为1
- 隧道的源目标ip地址配置
- 属于bd10的报文,将打上vni 100的vxlan标识,并且封装上源地址为1.1.1.1,目标地址为2.2.2.2的ip头部,发到对端nve
bridge-domain 10
vxlan vni 100
int nve 1
source 1.1.1.1
vni 100 head-end peer-list 2.2.2.2
dis vxlan tun
CE2
bridge-domain 10
vxlan vni 100
int nve 1
source 2.2.2.2
vni 100 head-end peer-list 1.1.1.1
dis vxlan tun
- 查看隧道
[~CE2]dis vxlan tun
Number of vxlan tunnel : 1
Tunnel ID Source Destination State Type Uptime
--------------------------------------------------------------------------------
4026531841 2.2.2.2 1.1.1.1 up static 00:03:20