实验拓扑
实验需求:
采用静态方式部署VXLAN,实现同一子网内终端的互访
静态方式是先有数据,然后才去学习转发表(MAC)
1、部署Underlay网络,部署3层的OSPF(华为支持的Underlay只有OSPF)
Leaf1:
ospf 10 router-id 1.1.1.1
area 0.0.0.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 10 area 0.0.0.0
interface GE1/0/0
undo portswitch
undo shutdown
ip address 13.13.13.1 255.255.255.0
ospf enable 10 area 0.0.0.0
Spine:
ospf 10 router-id 3.3.3.3
area 0.0.0.0
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf enable 10 area 0.0.0.0
interface GE1/0/0
undo portswitch
undo shutdown
ip address 13.13.13.3 255.255.255.0
ospf enable 10 area 0.0.0.0
interface GE1/0/1
undo portswitch
undo shutdown
ip address 23.23.23.3 255.255.255.0
ospf enable 10 area 0.0.0.0
Leaf-2:
ospf 10 router-id 2.2.2.2
area 0.0.0.0interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf enable 10 area 0.0.0.0interface GE1/0/1
undo portswitch
undo shutdown
ip address 23.23.23.2 255.255.255.0
ospf enable 10 area 0.0.0.0
2、在Edge上配置业务接入点
在NVE设备上配置VAP,虚拟接入点,作为VXLAn业务接入的设备
Leaf1:
bridge-domain 10
vxlan vni 10 //VNI是2层的VNI,桥接域ID域VNI需要一一对应
[Leaf2-GE1/0/2]undo shutdown //子接口需要UP首先物理接口得开启
interface GE1/0/2.10 mode l2 //接口使能2层子接口
encapsulation dot1q vid 10 //封装VLAN
bridge-domain 10 //绑定桥接域ID
Leaf2:
bridge-domain 10
vxlan vni 10
[Leaf2-GE1/0/2]undo shutdown
interface GE1/0/2.10 mode l2
encapsulation dot1q vid 10
bridge-domain 10
3、配置NVE隧道
Leaf1:
interface Nve1 //创建NVE隧道(最多两个隧道)
source 1.1.1.1 //定义原VTEP地址
vni 10 head-end peer-list 2.2.2.2 //静态指目的VTEP地址
Leaf2:
interface Nve1
source 2.2.2.2
vni 10 head-end peer-list 1.1.1.1
查看状态
[Leaf1]dis vxlan tunnel //查看隧道建立状态
Number of vxlan tunnel : 1
Tunnel ID Source Destination State Type Uptime
4026531841 1.1.1.1 2.2.2.2 up static 00:02:47
[Leaf1]dis vxlan vni 10 verbose
BD ID : 10
State : up
NVE : 18
Source Address : 1.1.1.1
Source IPv6 Address : -
UDP Port : 4789
BUM Mode : head-end
Group Address : -
Peer List : 2.2.2.2
IPv6 Peer List : -
PING测试:
PC>ping 172.16.1.2
Ping 172.16.1.2: 32 data bytes, Press Ctrl_C to break
From 172.16.1.2: bytes=32 seq=1 ttl=128 time=94 ms
From 172.16.1.2: bytes=32 seq=2 ttl=128 time=46 ms
From 172.16.1.2: bytes=32 seq=3 ttl=128 time=47 ms
From 172.16.1.2: bytes=32 seq=4 ttl=128 time=78 ms
From 172.16.1.2: bytes=32 seq=5 ttl=128 time=79 ms