1. # Kubernetes CNI Flannel GuideLine
  2. # 时间:20210728-[20:00-22:00]
  3. # 主题:eNSP实现VxLAN
  4. # 文档:https://www.yuque.com/docs/share/2e8618a3-fefc-408c-b00a-852786a69d06?# 《20210728-Flannel VxLAN Mode(四)》
  5. # 作业:eNSP实现VxLAN
  1. # FAQ:

1.eNSP 实现VxLAN

image.png
1.VxLAN配置说明
12800-CloudEngine配置指南-VXLAN.pdf

2.环境说明

  1. # ENV 说明:
  2. eNSP:1.3.00.100 V100R003C00 SPC100
  3. CE: CE12800
  4. VirtualBox: VirtualBox Graphical User Interface
  5. Version 5.2.44 r139111 (Qt5.6.2)
  6. Wireshark: Version 2.6.0 (v2.6.0-0-gc7239f02)

3.配置原理介绍

  1. topo:
  2. # 地址信息
  3. 10.1.1.1/24 10.1.1.2/24
  4. G1/0/0 G1/0/0
  5. 1.1.1.1/32 CE1------------------------CE2 2.2.2.2/32
  6. G1/0/1 | OSPF |G1/0/1
  7. | |
  8. | G0/0/1 G0/0/1 |
  9. LSW1 LSW2
  10. G0/0/2 | | G0/0/2
  11. | |
  12. | |
  13. PC1 PC2
  14. 192.168.1.1 192.168.1.2
  15. vlan 10 vlan 10
  16. # 配置思路介绍:
  17. # 统一原则:由于该类型设备为超核心设备,所以每一个步骤都需要commit。包括修改名字。
  18. 1.PC1和LSW1之间为普通二层接入,并被划分到相应的VLAN中。配置为Access接口类型。
  19. 2.LSW1和CE1之间靠近LSW1侧配置为普通Trunk类型。为了接入更多的VLAN,这里只有VLAN10,但可以配置多VLAN。
  20. 3.LSW1和CE1之间靠近CE1侧配置为使用dot1q 来封装VxLAN的数据报文。由于涉及到子接口配置,所以这里需要父接口和子接口都需要undo shutdown.
  21. 4.underlay网络使用OSPF网络。
  22. 配置说明:
  23. ##############################################################
  24. # 左边Leg配置
  25. ##############################################################
  26. #1. PC1配置:
  27. PC>ipconfig
  28. Link local IPv6 address...........: fe80::5689:98ff:fe1f:7471
  29. IPv6 address......................: :: / 128
  30. IPv6 gateway......................: ::
  31. IPv4 address......................: 192.168.1.1 # 地址
  32. Subnet mask.......................: 255.255.255.0 # 掩码
  33. Gateway...........................: 0.0.0.0
  34. Physical address..................: 54-89-98-1F-74-71 # MAC
  35. DNS server........................:
  36. #2. LSW1配置:
  37. <LSW1>dis current-configuration
  38. #
  39. sysname LSW1 # 修改交换机名字为:LSW1
  40. #
  41. vlan batch 10 # 创建VLAN 10
  42. #
  43. cluster enable
  44. ntdp enable
  45. ndp enable
  46. #
  47. drop illegal-mac alarm
  48. #
  49. diffserv domain default
  50. #
  51. drop-profile default
  52. #
  53. aaa
  54. authentication-scheme default
  55. authorization-scheme default
  56. accounting-scheme default
  57. domain default
  58. domain default_admin
  59. local-user admin password simple admin
  60. local-user admin service-type http
  61. #
  62. interface Vlanif1
  63. #
  64. interface MEth0/0/1
  65. #
  66. interface GigabitEthernet0/0/1
  67. port link-type trunk # 配置LSW1和CE1之间靠近LSW1之间的接口为Trunk
  68. port trunk allow-pass vlan 2 to 4094 # 配置该Trunk允许相应的VLAN通过。这里是全放通
  69. #
  70. interface GigabitEthernet0/0/2
  71. port link-type access
  72. port default vlan 10
  73. #
  74. interface GigabitEthernet0/0/3
  75. #
  76. interface GigabitEthernet0/0/4
  77. #
  78. interface GigabitEthernet0/0/5
  79. #
  80. interface GigabitEthernet0/0/6
  81. #
  82. interface GigabitEthernet0/0/7
  83. #
  84. interface GigabitEthernet0/0/8
  85. #
  86. interface GigabitEthernet0/0/9
  87. #
  88. interface GigabitEthernet0/0/10
  89. #
  90. interface GigabitEthernet0/0/11
  91. #
  92. interface GigabitEthernet0/0/12
  93. #
  94. interface GigabitEthernet0/0/13
  95. #
  96. interface GigabitEthernet0/0/14
  97. #
  98. interface GigabitEthernet0/0/15
  99. #
  100. interface GigabitEthernet0/0/16
  101. #
  102. interface GigabitEthernet0/0/17
  103. #
  104. interface GigabitEthernet0/0/18
  105. #
  106. interface GigabitEthernet0/0/19
  107. #
  108. interface GigabitEthernet0/0/20
  109. #
  110. interface GigabitEthernet0/0/21
  111. #
  112. interface GigabitEthernet0/0/22
  113. #
  114. interface GigabitEthernet0/0/23
  115. #
  116. interface GigabitEthernet0/0/24
  117. #
  118. interface NULL0
  119. #
  120. user-interface con 0
  121. user-interface vty 0 4
  122. #
  123. return
  124. <LSW1>
  125. #3.CE1配置:
  126. [~CE1]dis cu
  127. [~CE1]dis current-configuration
  128. !Software Version V200R005C10SPC607B607
  129. !Last configuration was updated at 2021-07-26 21:16:32+00:00 by SYSTEM automatic
  130. ally
  131. !Last configuration was saved at 2020-11-08 14:25:28+00:00
  132. #
  133. sysname CE1
  134. #
  135. device board 17 board-type CE-MPUB
  136. device board 1 board-type CE-LPUE
  137. #
  138. bridge-domain 10 # 配置BD域,由于这里BD域中实际上为了配置VNI,所以如果哪里需要该VNI的VxLAN封装的话,就引用即可
  139. vxlan vni 10 # 配置VxLAN的VNI ID
  140. #
  141. aaa
  142. #
  143. authentication-scheme default
  144. #
  145. authorization-scheme default
  146. #
  147. accounting-scheme default
  148. #
  149. domain default
  150. #
  151. domain default_admin
  152. #
  153. interface MEth0/0/0
  154. undo shutdown
  155. #
  156. interface GE1/0/0 # 配置接口
  157. undo portswitch # 关闭portswitch,打开三层功能
  158. undo shutdown # 开启该接口
  159. ip address 10.1.1.1 255.255.255.0 # 配置underlay接口地址
  160. #
  161. interface GE1/0/1 # 配置父接口开启
  162. undo shutdown
  163. #
  164. interface GE1/0/1.10 mode l2 # 配置子接口,并设置为L2模式
  165. encapsulation dot1q vid 10 # 配置封装类型为dot1q,且VLAN ID为10
  166. bridge-domain 10 # 引用BD域,来打对应的VxLAN的VNI
  167. #
  168. interface GE1/0/2
  169. shutdown
  170. #
  171. interface GE1/0/3
  172. shutdown
  173. #
  174. interface GE1/0/4
  175. shutdown
  176. #
  177. interface GE1/0/5
  178. shutdown
  179. #
  180. interface GE1/0/6
  181. shutdown
  182. #
  183. interface GE1/0/7
  184. shutdown
  185. #
  186. interface GE1/0/8
  187. shutdown
  188. #
  189. interface GE1/0/9
  190. shutdown
  191. #
  192. interface LoopBack0
  193. ip address 1.1.1.1 255.255.255.255 # 配置VTEP的地址
  194. #
  195. interface Nve1 # 配置VTEP
  196. source 1.1.1.1 # 配置VTEP使用的源接口地址
  197. vni 10 head-end peer-list 2.2.2.2 # 配置VTEP 针对于VNI 10 的使用头端复制来转发,且peer为另一个VTEP地址为:2.2.2.2
  198. #
  199. interface NULL0
  200. #
  201. ospf 1 router-id 1.1.1.1 # 配置OSPF underlay网络互联互通
  202. area 0.0.0.0
  203. network 0.0.0.0 255.255.255.255 # 这里配置全放通,生产中切记需要精确放通
  204. #
  205. ssh authorization-type default aaa
  206. #
  207. ssh server cipher aes256_gcm aes128_gcm aes256_ctr aes192_ctr aes128_ctr aes256_
  208. cbc aes128_cbc 3des_cbc
  209. #
  210. ssh server dh-exchange min-len 1024
  211. #
  212. ssh client cipher aes256_gcm aes128_gcm aes256_ctr aes192_ctr aes128_ctr aes256_
  213. cbc aes128_cbc 3des_cbc
  214. #
  215. user-interface con 0
  216. #
  217. vm-manager
  218. #
  219. return
  220. [~CE1]
  221. ##############################################################
  222. # 右边边Leg配置
  223. ##############################################################
  224. # PC2配置:
  225. PC>ipconfig
  226. Link local IPv6 address...........: fe80::5689:98ff:fe46:4117
  227. IPv6 address......................: :: / 128
  228. IPv6 gateway......................: ::
  229. IPv4 address......................: 192.168.1.2
  230. Subnet mask.......................: 255.255.255.0
  231. Gateway...........................: 0.0.0.0
  232. Physical address..................: 54-89-98-46-41-17
  233. DNS server........................:
  234. # LSW2配置:
  235. <LSW2>dis current-configuration
  236. #
  237. sysname LSW2
  238. #
  239. vlan batch 10
  240. #
  241. stp disable
  242. #
  243. cluster enable
  244. ntdp enable
  245. ndp enable
  246. #
  247. drop illegal-mac alarm
  248. #
  249. diffserv domain default
  250. #
  251. drop-profile default
  252. #
  253. aaa
  254. authentication-scheme default
  255. authorization-scheme default
  256. accounting-scheme default
  257. domain default
  258. domain default_admin
  259. local-user admin password simple admin
  260. local-user admin service-type http
  261. #
  262. interface Vlanif1
  263. #
  264. interface MEth0/0/1
  265. #
  266. interface GigabitEthernet0/0/1
  267. port link-type trunk
  268. port trunk allow-pass vlan 2 to 4094
  269. #
  270. interface GigabitEthernet0/0/2
  271. port link-type access
  272. port default vlan 10
  273. #
  274. interface GigabitEthernet0/0/3
  275. #
  276. interface GigabitEthernet0/0/4
  277. #
  278. interface GigabitEthernet0/0/5
  279. #
  280. interface GigabitEthernet0/0/6
  281. #
  282. interface GigabitEthernet0/0/7
  283. #
  284. interface GigabitEthernet0/0/8
  285. #
  286. interface GigabitEthernet0/0/9
  287. #
  288. interface GigabitEthernet0/0/10
  289. #
  290. interface GigabitEthernet0/0/11
  291. #
  292. interface GigabitEthernet0/0/12
  293. #
  294. interface GigabitEthernet0/0/13
  295. #
  296. interface GigabitEthernet0/0/14
  297. #
  298. interface GigabitEthernet0/0/15
  299. #
  300. interface GigabitEthernet0/0/16
  301. #
  302. interface GigabitEthernet0/0/17
  303. #
  304. interface GigabitEthernet0/0/18
  305. #
  306. interface GigabitEthernet0/0/19
  307. #
  308. interface GigabitEthernet0/0/20
  309. #
  310. interface GigabitEthernet0/0/21
  311. #
  312. interface GigabitEthernet0/0/22
  313. #
  314. interface GigabitEthernet0/0/23
  315. #
  316. interface GigabitEthernet0/0/24
  317. #
  318. interface NULL0
  319. #
  320. user-interface con 0
  321. user-interface vty 0 4
  322. #
  323. return
  324. <LSW2>
  325. # CE2配置:
  326. <CE2>dis current-configuration
  327. !Software Version V200R005C10SPC607B607
  328. !Last configuration was updated at 2021-07-26 21:16:32+00:00 by SYSTEM automatic
  329. ally
  330. !Last configuration was saved at 2020-11-08 14:25:33+00:00
  331. #
  332. sysname CE2
  333. #
  334. device board 17 board-type CE-MPUB
  335. device board 1 board-type CE-LPUE
  336. #
  337. bridge-domain 10
  338. vxlan vni 10
  339. #
  340. aaa
  341. #
  342. authentication-scheme default
  343. #
  344. authorization-scheme default
  345. #
  346. accounting-scheme default
  347. #
  348. domain default
  349. #
  350. domain default_admin
  351. #
  352. interface MEth0/0/0
  353. undo shutdown
  354. #
  355. interface GE1/0/0
  356. undo portswitch
  357. undo shutdown
  358. ip address 10.1.1.2 255.255.255.0
  359. #
  360. interface GE1/0/1
  361. undo shutdown
  362. #
  363. interface GE1/0/1.10 mode l2
  364. encapsulation dot1q vid 10
  365. bridge-domain 10
  366. #
  367. interface GE1/0/2
  368. shutdown
  369. #
  370. interface GE1/0/3
  371. shutdown
  372. #
  373. interface GE1/0/4
  374. shutdown
  375. #
  376. interface GE1/0/5
  377. shutdown
  378. #
  379. interface GE1/0/6
  380. shutdown
  381. #
  382. interface GE1/0/7
  383. shutdown
  384. #
  385. interface GE1/0/8
  386. shutdown
  387. #
  388. interface GE1/0/9
  389. shutdown
  390. #
  391. interface LoopBack0
  392. ip address 2.2.2.2 255.255.255.255
  393. #
  394. interface Nve1
  395. source 2.2.2.2
  396. vni 10 head-end peer-list 1.1.1.1
  397. #
  398. interface NULL0
  399. #
  400. ospf 1 router-id 2.2.2.2
  401. area 0.0.0.0
  402. network 0.0.0.0 255.255.255.255
  403. #
  404. ssh authorization-type default aaa
  405. #
  406. ssh server cipher aes256_gcm aes128_gcm aes256_ctr aes192_ctr aes128_ctr aes256_
  407. cbc aes128_cbc 3des_cbc
  408. #
  409. ssh server dh-exchange min-len 1024
  410. #
  411. ssh client cipher aes256_gcm aes128_gcm aes256_ctr aes192_ctr aes128_ctr aes256_
  412. cbc aes128_cbc 3des_cbc
  413. #
  414. user-interface con 0
  415. #
  416. vm-manager
  417. #
  418. return

4.报文解析

# LSW1 G0/0/02抓包:
No.     Time           Source                Destination           Protocol Length Info
     19 39.594000      HuaweiTe_1f:74:71     Broadcast             ARP      60     Who has 192.168.1.2? Tell 192.168.1.1

Frame 19: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No.     Time           Source                Destination           Protocol Length Info
     20 39.703000      HuaweiTe_46:41:17     HuaweiTe_1f:74:71     ARP      60     192.168.1.2 is at 54:89:98:46:41:17

Frame 20: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
Address Resolution Protocol (reply)

No.     Time           Source                Destination           Protocol Length Info
     21 39.719000      192.168.1.1           192.168.1.2           ICMP     74     Echo (ping) request  id=0x1204, seq=1/256, ttl=128 (reply in 22)

Frame 21: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: HuaweiTe_46:41:17 (54:89:98:46:41:17)
Internet Protocol Version 4, Src: 192.168.1.1, Dst: 192.168.1.2
Internet Control Message Protocol

No.     Time           Source                Destination           Protocol Length Info
     22 39.766000      192.168.1.2           192.168.1.1           ICMP     74     Echo (ping) reply    id=0x1204, seq=1/256, ttl=128 (request in 21)

Frame 22: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.1
Internet Control Message Protocol

# CE1 G1/0/1:
No.     Time           Source                Destination           Protocol Length Info
     15 30.953000      HuaweiTe_1f:74:71     Broadcast             ARP      64     Who has 192.168.1.2? Tell 192.168.1.1

Frame 15: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) on interface 0
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 10
Address Resolution Protocol (request)

No.     Time           Source                Destination           Protocol Length Info
     16 31.000000      HuaweiTe_46:41:17     HuaweiTe_1f:74:71     ARP      64     192.168.1.2 is at 54:89:98:46:41:17

Frame 16: 64 bytes on wire (512 bits), 64 bytes captured (512 bits) on interface 0
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 10
Address Resolution Protocol (reply)

No.     Time           Source                Destination           Protocol Length Info
     17 31.047000      192.168.1.1           192.168.1.2           ICMP     78     Echo (ping) request  id=0x1204, seq=1/256, ttl=128 (reply in 19)

Frame 17: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface 0
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: HuaweiTe_46:41:17 (54:89:98:46:41:17)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 10
Internet Protocol Version 4, Src: 192.168.1.1, Dst: 192.168.1.2
Internet Control Message Protocol

No.     Time           Source                Destination           Protocol Length Info
     19 31.078000      192.168.1.2           192.168.1.1           ICMP     78     Echo (ping) reply    id=0x1204, seq=1/256, ttl=128 (request in 17)

Frame 19: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface 0
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 10
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.1
Internet Control Message Protocol



# CE1 G1/0/0:
No.     Time           Source                Destination           Protocol Length Info
      3 4.906000       HuaweiTe_1f:74:71     Broadcast             ARP      110    Who has 192.168.1.2? Tell 192.168.1.1

Frame 3: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface 0
Ethernet II, Src: 38:36:0a:01:01:00 (38:36:0a:01:01:00), Dst: 38:36:0a:02:01:00 (38:36:0a:02:01:00)
Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2
User Datagram Protocol, Src Port: 4789, Dst Port: 4789
Virtual eXtensible Local Area Network
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Address Resolution Protocol (request)

No.     Time           Source                Destination           Protocol Length Info
      4 4.938000       HuaweiTe_46:41:17     HuaweiTe_1f:74:71     ARP      110    192.168.1.2 is at 54:89:98:46:41:17

Frame 4: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface 0
Ethernet II, Src: 38:36:0a:02:01:00 (38:36:0a:02:01:00), Dst: 38:36:0a:01:01:00 (38:36:0a:01:01:00)
Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1
User Datagram Protocol, Src Port: 4789, Dst Port: 4789
Virtual eXtensible Local Area Network
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
Address Resolution Protocol (reply)

No.     Time           Source                Destination           Protocol Length Info
      5 4.985000       192.168.1.1           192.168.1.2           ICMP     124    Echo (ping) request  id=0x1204, seq=1/256, ttl=128 (reply in 6)

Frame 5: 124 bytes on wire (992 bits), 124 bytes captured (992 bits) on interface 0
Ethernet II, Src: 38:36:0a:01:01:00 (38:36:0a:01:01:00), Dst: 38:36:0a:02:01:00 (38:36:0a:02:01:00)
Internet Protocol Version 4, Src: 1.1.1.1, Dst: 2.2.2.2
User Datagram Protocol, Src Port: 4789, Dst Port: 4789
Virtual eXtensible Local Area Network
Ethernet II, Src: HuaweiTe_1f:74:71 (54:89:98:1f:74:71), Dst: HuaweiTe_46:41:17 (54:89:98:46:41:17)
Internet Protocol Version 4, Src: 192.168.1.1, Dst: 192.168.1.2
Internet Control Message Protocol

No.     Time           Source                Destination           Protocol Length Info
      6 5.016000       192.168.1.2           192.168.1.1           ICMP     124    Echo (ping) reply    id=0x1204, seq=1/256, ttl=128 (request in 5)

Frame 6: 124 bytes on wire (992 bits), 124 bytes captured (992 bits) on interface 0
Ethernet II, Src: 38:36:0a:02:01:00 (38:36:0a:02:01:00), Dst: 38:36:0a:01:01:00 (38:36:0a:01:01:00)
Internet Protocol Version 4, Src: 2.2.2.2, Dst: 1.1.1.1
User Datagram Protocol, Src Port: 4789, Dst Port: 4789
Virtual eXtensible Local Area Network
Ethernet II, Src: HuaweiTe_46:41:17 (54:89:98:46:41:17), Dst: HuaweiTe_1f:74:71 (54:89:98:1f:74:71)
Internet Protocol Version 4, Src: 192.168.1.2, Dst: 192.168.1.1
Internet Control Message Protocol

5.抓包报文

# 抓包可从这里获取:
# https://github.com/BurlyLuo/cni/tree/master/weiluo/ensp-vxlan