组网和配置思路
如图所示,根据用户需求,只有 Spine-1 部署 VXLAN,Leaf-1A 和 Leaf-1B 两台交换机模拟PC,使得 VXLAN 像 VLAN 的工作一样实现二层互通。
配置 Leaf-1 和 Leaf-2 的 IP 地址
<HUAWEI> system-view
[~HUAWEI] sysname Leaf-1
[*Leaf-1]commit
[~Leaf-1] interface 10ge1/0/5
[*Leaf-1-10GE1/0/10] undo portswitch
[*Leaf-1-10GE1/0/10] ip address 192.168.10.1 24
[*Leaf-1-10GE1/0/10] quit
[*Leaf-1] commit
<HUAWEI> system-view
[~HUAWEI] sysname Leaf-2
[*Leaf-2]commit
[~Leaf-2] interface 10ge1/0/6
[*Leaf-2-10GE1/0/10] undo portswitch
[*Leaf-2-10GE1/0/10] ip address 192.168.10.2 24
[*Leaf-2-10GE1/0/10] quit
[*Leaf-2] commit
配置 Spine-1 的 VXLAN 基本配置
<HUAWEI> system-view
[~HUAWEI] sysname Spine-1
[*Spine-1] commit
[~Spine-1] bridge-domain 10
[*Spine-1-bd10] vxlan vni 5000
[*Spine-1-bd10] quit
[*Spine-1] commit
配置 Spine-1 的业务接入点
[~Spine-1] bridge-domain 10
[*Spine-1-bd10] quit
[*Spine-1] interface 10ge 1/0/5.1 mode 12
[*Spine-1-10GE1/0/10.1]encapsulation dotla untaa
[*Spine-1-10GE1/0/10.1] bridge-domain 10
[*Spine-1-10GE1/0/10.1] quit
[*Spine-1] interface 10ge 1/0/6.1 mode 12
[*Spine-1-10GE1/0/10.1] encapsulation dotlq untag
[*Spine-1-10GE1/0/10.1] bridge-domain 10
[*Spine-1-10GE1/0/10.1] quit
[*Spine-1] commit
验证配置结果
通过命令 Ping 来测试网络连通性,以 Leaf-1 Ping Leaf-2 为例:
<Leaf-1>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=60 ms
Reply from 192.168.10.2: bytes=56 Sequence=2 ttl=255time=70 ms
Reply from 192.168.10.2: bytes=56 Sequence=3tt1=255time=50 ms
Reply from 192.168.10.2: bytes=56 Sequence=4 ttl=255time=50ms
Reply from 192.168.10.2: bytes=56 Sequence=5 ttl=255time=50 ms
192.168.10.2 ping statistics--
5 packet(s) transmitted
5 packet(s) received
0.00% packet lossround-trip min/avq/max = 50/56/70 ms