组网和配置思路
如图所示,根据用户需求,只有 Spine-1 部署 VXLAN,Leaf-1 和 Leaf-2 两台交换机模拟 PC,使得 VXLAN 像 VLAN 的工作一样实现三层互通。
配置Leaf-1 和 Leaf-2 的IP 地址
<HUAWEI> system-view
[~HUAWEI] sysname Leaf-1
[*Leaf-1] commit
[~Leaf-1] interface 10ge1/0/15
[*Leaf-1-10GE1/0/10] undo portswitch
[*Leaf-1-10GE1/0/10] ip address 192.168.10.2 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/14
[*Leaf-2-10GE1/0/10] undo portswitch
[*Leaf-2-10GE1/0/10] ip address 192.168.20.2 24
[*Leaf-2-10GE1/0/10] quit
[xLeaf-2] commit
配置 Spine-1 的 VXLAN 基本配置
<HUAWE I>system-view
[~HUAWEI] sysname Spine-1
[*Spine-1]commit
[~Spine-1]bridge-domain 10
[*Spine-1-bd10]vxlan vni 20
[*Spine-1-bd10]quit
[*Spine-1] commit
[~Spine-1] bridge-domain 20
[*Spine-1-bd10]vxlan vni 5000
[*Spine-1-bd10]quit
[*Spine-1] commit
[Spine-1]interface Vbdif10
[Spine-1-Vbdif10]ip address 192.168.10.1 24
[Spine-1-Vbdif10]quit
[Spine-1]interface Vbdif20
[Spine-1-Vbdif20]ip address 192.168.20.1 24
[Spine-1-Vbdif20]quit
配置 Spine-1 的业务接入点
[~Spine-1] bridge-domain 10
[*Spine-1-bd10] quit
[*Spine-1] interface 10ge 1/0/15.1 mode 12
[*Spine-1-10GE1/0/10.1]encapsulation untag
[*Spine-1-10GE1/0/10.1]bridge-domain 10
[*Spine-1-10GE1/0/10.1]quit
[*Spine-1] interface 10ge 1/0/14.1 mode 12
[*Spine-1-10GE1/0/14.1]encapsulation untag
[*Spine-1-10GE1/0/14.1]bridge-domain 10
[*Spine-1-10GE1/0/14.1]qU1t
[*Spine-1] commit
分布网关开启接口环回功能 (CE12800 不需要),由于网关下沉 TOR CE6850,需要设备开启接口环回功能,选择任何一个未使用接口加入 Eth-Trunk,否则网关不通。
[Spine-1] interface Eth-Trunk 1
[Spine-1] trunkport 10ge 1/0/6
[Spine-1-Eth-Trunk1] service type tunnel
配置路由
[Leaf-1]ip route-static 0.0.0.0 0 192.168.10.1
[Leaf-2]ip route-static 0.0.0.0 0 192.168.20.2
验证配置结果
通过命令 Ping 来测试网络连通性,以 Leaf-1 Ping Leaf-2 为例
<Leaf-1>ping 192.168.20.2
PING 192.168.20.2: 56 data bytes, press CTRL C to break
Reply from 192.168.20.2: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 192.168.20.2: bytes=56 Sequence=2 tt1=255 time=70 ms
Reply from 192.168.20.2: bytes=56 Sequence=3 tt1=255 time=50 ms
Reply from 192.168.20.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 192.168.20.2: bytes=56 Sequence=5 tt1=255 time=50 ms
----- 192.168.20.2 ping statistics------
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 50/56/70 ms