目录
CE1、CE2、CE3、CE4运行路由协议,使得VTEP地址互通
绿色配置为此次实验需要注意的地方(相比于普通的集中式网关的配置,主要是在Spine上做了修改)
LSW1
Vlan 10
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
LSW2
Vlan batch 10 20
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
为了实现Spine双活,CE2与CE4使用的VTEP地址必须一致
CE1(Leaf1)
interface GE1/0/1
undo portswitch
undo shutdown
ip address 172.16.12.1 255.255.255.0
interface GE1/0/2
undo portswitch
undo shutdown
ip address 172.16.14.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 172.16.12.0 0.0.0.255
network 172.16.14.0 0.0.0.255
CE2(Spine1)
interface GE1/0/0
undo portswitch
undo shutdown
ip address 172.16.12.2 255.255.255.0
interface GE1/0/1
undo portswitch
undo shutdown
ip address 172.16.23.2 255.255.255.0
interface LoopBack0 用于VTEP地址
ip address 2.2.2.2 255.255.255.255
interface LoopBack0 用于建立DFS服务组地址(实现多活网关)
ip address 2.2.2.1 255.255.255.255
ospf 1 router-id 2.2.2.1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 2.2.2.1 0.0.0.0
network 172.16.12.0 0.0.0.255
network 172.16.23.0 0.0.0.255
CE4(Spine2)
interface GE1/0/0
undo portswitch
undo shutdown
ip address 172.16.14.4 255.255.255.0
interface GE1/0/1
undo portswitch
undo shutdown
ip address 172.16.34.4 255.255.255.0
interface LoopBack0 用于VTEP地址
ip address 2.2.2.2 255.255.255.255
interface LoopBack0 用于建立DFS服务组地址(实现多活网关)
ip address 3.3.3.1 255.255.255.255
ospf 1 router-id 3.3.3.1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 3.3.3.1 0.0.0.0
network 172.16.14.0 0.0.0.255
network 172.16.34.0 0.0.0.255
CE3(Leaf2)
interface GE1/0/0
undo portswitch
undo shutdown
ip address 172.16.23.3 255.255.255.0
interface GE1/0/2
undo portswitch
undo shutdown
ip address 172.16.34.3 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 172.16.23.0 0.0.0.255
network 172.16.34.0 0.0.0.255
CE2(Spine1)
dfs-group 1
source ip 2.2.2.1
active-active-gateway
peer 3.3.3.1
CE4(Spine2)
dfs-group 1
source ip 3.3.3.1
active-active-gateway
peer 2.2.2.1
注意:BD域只在本地生效,VNI在全局生效(相同VNI为同一子网)
由于BD域只在本地生效,所以BD域的值不一定要与VNI相同(此处配置相同是为了便于理解)
CE1
bridge-domain 10
vxlan vni 10 子网1
CE2与CE4相同配置
bridge-domain 10
vxlan vni 10 子网1
bridge-domain 20
vxlan vni 20 子网2
CE3
bridge-domain 10
vxlan vni 10 子网1
bridge-domain 20
vxlan vni 20 子网2
CE1子网1
interface GE1/0/0
undo shutdown
interface GE1/0/0.10 mode l2 通过二层子接口接入Vxlan
encapsulation dot1q vid 10 采用Dot1q的封装模式(Vlan10报文进入Vxlan隧道)
bridge-domain 10 绑定BD域
CE3子网1
interface GE1/0/2
undo shutdown
interface GE1/0/2.10 mode l2 通过二层子接口接入Vxlan
encapsulation dot1q vid 10 采用Dot1q的封装模式(Vlan10报文进入Vxlan隧道)
bridge-domain 10 绑定BD域
CE3子网2
interface GE1/0/3
undo shutdown
interface GE1/0/3.10 mode l2 通过二层子接口接入Vxlan
encapsulation dot1q vid 20 采用Dot1q的封装模式(Vlan20报文进入Vxlan隧道)
bridge-domain 20 绑定BD域
CE1和CE3建立Vxlan隧道实现同子网互访
CE1和CE2/CE4建立Vxlan隧道、CE3和CE2/CE4建立Vxlan隧道实现跨子网互访
CE1二层网关
interface Nve1
source 1.1.1.1 配置VTEP地址为1.1.1.1
vni 10 head-end peer-list 3.3.3.3 此头端复制列表用于同子网互访(PC1→PC2)
vni 10 head-end peer-list 2.2.2.2
此头端复制列表用于跨子网互访(PC1→PC3 vni10→vni20)
CE2、CE4相同配置三层网关
interface Nve1
source 2.2.2.2 配置VTEP地址为2.2.2.2
vni 10 head-end peer-list 1.1.1.1 此头端复制列表用于跨子网互访(PC3→PC1)
vni 10 head-end peer-list 3.3.3.3 此头端复制列表用于跨子网互访(PC3→PC2)
vni 20 head-end peer-list 3.3.3.3 此头端复制列表用于跨子网互访(PC1/2→PC3)
CE3二层网关
interface Nve1
source 3.3.3.3 配置VTEP地址为3.3.3.3
vni 10 head-end peer-list 1.1.1.1 此头端复制列表用于同子网互访(PC2→PC1)
vni 10 head-end peer-list 2.2.2.2 此头端复制列表用于跨子网互访(PC2→PC3)
vni 20 head-end peer-list 2.2.2.2 此头端复制列表用于跨子网互访(PC3→PC1/2)
为了实现Spine双活,CE2、CE4的Vbdif接口IP地址必须相同,MAC地址也必须相同
CE2、CE4上配置Vbdif接口(CE2与CE4相同配置)
interface Vbdif10 创建Vdbif10接口(此数值要与本地BD域值相同)
ip address 192.168.1.254 255.255.255.0 BD域对应VNI子网的三层网关为192.168.1.254
mac-address 0000-5e00-0101 配置虚拟MAC地址
interface Vbdif20
ip address 192.168.2.254 255.255.255.0
mac-address 0000-5e00-0102
Vxlan集中式多活网关是指在典型的“Spine-Leaf”组网结构下,通过给Spine设备配置相同的VTEP地址,将多个Spine设备模拟成一个Vxlan隧道端点。然后在所有Spine设备上配置三层网关,使得无论流量发到哪一个Spine设备,该设备都可以提供网关服务,将报文正确转发给下一跳设备
配置DFS服务组用于同步网管设备的ARP和MAC转发表信息,实现双活
配置DFS服务组的设备间,VTEP IP地址要相同、BD域与VNI的关系要相同、VTEP地址和BD域的关系要相同、头端复制列表要相同,三层Vbdif接口的IP地址要相同、Vbdif接口对应的MAC地址要相同且为虚拟MAC