今天做了一個跨廠商vxlan evpn實驗,把位於兩個不同地方的虛擬機器,透過vxlan的方式實現配置相同網段的IP,達到互通,使用的裝置是兩臺華為CE6881-48T6CQ和一臺華三S6520X-54QC-EI。
實驗拓撲
SW01配置
[~SW01]disp current-configuration | section in vxlan
#
bridge-domain 20
vxlan vni 5020
#
evpn
route-distinguisher 12:1
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
[~SW01]disp current-configuration | section in bgp
#
interface Nve1
source 2.2.2.2
vni 5020 head-end peer-list protocol bgp
#
bgp 100
router-id 2.2.2.2
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
SW02配置(H3C交換機)
[SW02]disp current-configuration configuration bgp
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack0
#
address-family l2vpn evpn
undo policy vpn-target
peer 2.2.2.2 enable
peer 2.2.2.2 reflect-client
peer 4.4.4.4 enable
peer 4.4.4.4 reflect-client
SW03配置
[~SW03]disp current-configuration | section in vxlan
#
bridge-domain 20
vxlan vni 5020
#
evpn
route-distinguisher 31:2
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
[~SW03]disp current-configuration | section in bgp
#
interface Nve1
source 4.4.4.4
vni 5020 head-end peer-list protocol bgp
#
bgp 100
router-id 4.4.4.4
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
驗證:
vxlan還是比較好玩,後期我會出更多高階的交換機玩法,想學基礎交換機配置的話 ,可以關注一下我的專欄《交換機10天快速交換機配置》
透過簡單易懂的方式讓大家快速上手交換機配置,另外還提供遠端技術指導,不懂的地方都可以問老師。