VXLAN(Virtual eXtensible LAN可扩展虚拟局域网)诞生了,基于IP网络之上,采用的是MAC in UDP技术
跨三层实现二层通信
总结为何需要Vxlan:
- 虚拟机规模受到网络规格的限制,大L2网络里,报文通过查询MAC地址转发,MAC表容量限制了虚拟机的数量。
- 网络隔离的限制,普通的vlan和VPN配置无法满足动态网络调整的需求,同时配置复杂
- 虚拟器搬迁受到限制,虚拟机启动后假如在业务不中断基础上将该虚拟机迁移到另外一台物理机上去,需要保持虚拟机的IP地址和MAC地址等参数保持不变,这就要求业务网络是一个二层的网络。
拓扑图:
交换机配置:
CE1

1 <HUAWEI>display cu 2 <HUAWEI>display current-configuration 3 !Software Version V800R013C00SPC560B560 4 !Last configuration was updated at 2019-05-11 16:01:45+00:00 by SYSTEM automatic 5 ally 6 !Last configuration was saved at 2019-04-24 16:54:42+00:00 7 # 8 sysname HUAWEI 9 # 10 device board 17 board-type CE-MPUB 11 device board 1 board-type CE-LPUE 12 # 13 aaa 14 # 15 authentication-scheme default 16 # 17 authorization-scheme default 18 # 19 accounting-scheme default 20 # 21 domain default 22 # 23 domain default_admin 24 # 25 interface MEth0/0/0 26 undo shutdown 27 # 28 interface GE1/0/0 29 undo portswitch 30 undo shutdown 31 ip address 10.12.0.1 255.255.255.0 32 # 33 interface GE1/0/1 34 undo portswitch 35 undo shutdown 36 ip address 10.13.0.1 255.255.255.0 37 # 38 interface GE1/0/2 39 shutdown 40 # 41 interface GE1/0/3 42 shutdown 43 # 44 interface GE1/0/4 45 shutdown 46 # 47 interface GE1/0/5 48 shutdown 49 # 50 interface GE1/0/6 51 shutdown 52 # 53 interface GE1/0/7 54 shutdown 55 # 56 interface GE1/0/8 57 shutdown 58 # 59 interface GE1/0/9 60 shutdown 61 # 62 interface NULL0 63 # 64 ospf 1 65 area 0.0.0.0 66 network 10.12.0.0 0.0.0.255 67 network 10.13.0.0 0.0.0.255 68 # 69 ssh authorization-type default aaa 70 # 71 user-interface con 0 72 # 73 vm-manager 74 # 75 return
CE2

1 <HUAWEI>display current-configuration 2 !Software Version V800R013C00SPC560B560 3 !Last configuration was updated at 2019-05-12 08:45:20+00:00 4 !Last configuration was saved at 2019-05-12 08:54:59+00:00 5 # 6 sysname HUAWEI 7 # 8 device board 17 board-type CE-MPUB 9 device board 1 board-type CE-LPUE 10 # 11 vlan batch 10 12 # 13 bridge-domain 10 14 vxlan vni 100 15 # 16 aaa 17 # 18 authentication-scheme default 19 # 20 authorization-scheme default 21 # 22 accounting-scheme default 23 # 24 domain default 25 # 26 domain default_admin 27 # 28 interface Vlanif10 29 ip address 1.1.1.254 255.255.255.0 30 # 31 interface MEth0/0/0 32 undo shutdown 33 # 34 interface GE1/0/0 35 undo shutdown 36 port link-type trunk 37 # 38 interface GE1/0/0.1 mode l2 39 encapsulation dot1q vid 10 40 bridge-domain 10 41 # 42 interface GE1/0/1 43 undo portswitch 44 undo shutdown 45 ip address 10.12.0.2 255.255.255.0 46 # 47 interface GE1/0/2 48 shutdown 49 # 50 interface GE1/0/3 51 shutdown 52 # 53 interface GE1/0/4 54 shutdown 55 # 56 interface GE1/0/5 57 shutdown 58 # 59 interface GE1/0/6 60 shutdown 61 # 62 interface GE1/0/7 63 shutdown 64 # 65 interface GE1/0/8 66 shutdown 67 # 68 interface GE1/0/9 69 shutdown 70 # 71 interface LoopBack0 72 ip address 10.2.2.2 255.255.255.255 73 # 74 interface Nve1 75 source 10.2.2.2 76 vni 100 head-end peer-list 10.3.3.3 77 # 78 interface NULL0 79 # 80 ospf 1 81 area 0.0.0.0 82 network 10.2.2.2 0.0.0.0 83 network 10.12.0.0 0.0.0.255 84 # 85 ssh authorization-type default aaa 86 # 87 user-interface con 0 88 # 89 vm-manager 90 # 91 return
CE3

1 <HUAWEI>display current-configuration 2 !Software Version V800R013C00SPC560B560 3 !Last configuration was updated at 2019-05-11 16:01:47+00:00 by SYSTEM automatic 4 ally 5 !Last configuration was saved at 2019-05-12 08:49:09+00:00 6 # 7 sysname HUAWEI 8 # 9 device board 17 board-type CE-MPUB 10 device board 1 board-type CE-LPUE 11 # 12 vlan batch 10 13 # 14 bridge-domain 10 15 vxlan vni 100 16 # 17 aaa 18 # 19 authentication-scheme default 20 # 21 authorization-scheme default 22 # 23 accounting-scheme default 24 # 25 domain default 26 # 27 domain default_admin 28 # 29 interface MEth0/0/0 30 undo shutdown 31 # 32 interface GE1/0/0 33 undo portswitch 34 undo shutdown 35 ip address 10.13.0.3 255.255.255.0 36 # 37 interface GE1/0/1 38 undo shutdown 39 port link-type trunk 40 # 41 interface GE1/0/1.1 mode l2 42 encapsulation dot1q vid 10 43 bridge-domain 10 44 # 45 interface GE1/0/2 46 shutdown 47 # 48 interface GE1/0/3 49 shutdown 50 # 51 interface GE1/0/4 52 shutdown 53 # 54 interface GE1/0/5 55 shutdown 56 # 57 interface GE1/0/6 58 shutdown 59 # 60 interface GE1/0/7 61 shutdown 62 # 63 interface GE1/0/8 64 shutdown 65 # 66 interface GE1/0/9 67 shutdown 68 # 69 interface LoopBack0 70 ip address 10.3.3.3 255.255.255.255 71 # 72 interface Nve1 73 source 10.3.3.3 74 vni 100 head-end peer-list 10.2.2.2 75 # 76 interface NULL0 77 # 78 ospf 1 79 area 0.0.0.0 80 network 10.3.3.3 0.0.0.0 81 network 10.13.0.0 0.0.0.255 82 # 83 ssh authorization-type default aaa 84 # 85 user-interface con 0 86 # 87 vm-manager 88 # 89 return
LSW1

1 # 2 vlan batch 10 3 # 4 interface GigabitEthernet0/0/1 5 port link-type trunk 6 port trunk allow-pass vlan 10 7 # 8 interface GigabitEthernet0/0/2 9 port link-type access 10 port default vlan 10 11 #
LSW2

1 # 2 vlan batch 10 3 # 4 interface GigabitEthernet0/0/1 5 port link-type trunk 6 port trunk allow-pass vlan 10 7 # 8 interface GigabitEthernet0/0/2 9 port link-type access 10 port default vlan 10
PC1 PING PC2 验证: