一、实验拓扑:
二、实验目的:
通过CE1与CE2建立静态VXLAN隧道,实现VPC7、VPC6与VPC8之间二层通信
三、静态VXLAN配置步骤:
- 创建BD,配置VNI
- 指定需要封装的报文
a:基于子接口指定
b:基于VLAN指定 - 建立VXLAN隧道
四、实验配置命令 :
CE1
interface GE1/0/0
undo portswitch
undo shutdown
ip address 12.1.1.1 255.255.255.0
#
interface GE1/0/1
undo portswitch
undo shutdown
ip address 13.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
interface NULL0
#
ospf 1 router-id 1.1.1.1 //配置OSPF打通ce之间的路由
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 13.1.1.1 0.0.0.0
#
CE2
interface GE1/0/0
undo portswitch
undo shutdown
ip address 12.1.1.2 255.255.255.0
#
interface GE1/0/1
undo shutdown //需要手动开启
#
interface GE1/0/1.10 mode l2 //配置二层模式的子接口
encapsulation dot1q vid 10 to 20 //对vlan10~20进行封装
bridge-domain 10 //加入到BD10
#
interface LoopBack2
ip address 2.2.2.2 255.255.255.255
#
interface Nve1 //建立VXLAN隧道
source 2.2.2.2 //配置封装的源IP
vni 10 head-end peer-list 3.3.3.3 //指定VNI和对端的IP
#
interface NULL0
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
#
CE3
interface GE1/0/0
undo portswitch
undo shutdown
ip address 13.1.1.3 255.255.255.0
#
interface GE1/0/1
undo shutdown
#
interface GE1/0/1.10 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
interface Nve1
source 3.3.3.3
vni 10 head-end peer-list 2.2.2.2
#
interface NULL0
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 13.1.1.3 0.0.0.0
#
L2-SW1
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Ethernet0/1
switchport access vlan 10
switchport mode access
!
interface Ethernet0/2
switchport access vlan 20
switchport mode access
!
L2-SW2
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Ethernet0/1
switchport access vlan 10
switchport mode access
!
五、实验结果
1、VPC7pingVPC8在CE2的G1/0/0抓包:
1、VPC6pingVPC8在CE2的G1/0/0抓包: