03-EVPN數據中心互聯配置
本章節下載: 03-EVPN數據中心互聯配置 (762.80 KB)
目 錄
1.6.2 配置ED修改EVPN路由的RD、L3VNI和RT
1.9 配置BGP EVPN和BGP VPNv4/VPNv6路由相互引入
1.9.2 配置允許BGP VPNv4或VPNv6路由通過EVPN地址族發布給鄰居
1.9.3 配置允許BGP EVPN路由通過VPNv4或VPNv6地址族發布給鄰居
EVPN數據中心互聯技術通過在數據中心之間建立VXLAN-DCI(VXLAN Data Center Interconnect,VXLAN數據中心互聯)隧道,實現不同數據中心之間虛擬機的互通。
如圖1-1所示,數據中心的邊緣設備為ED(Edge Device,邊緣設備)。ED之間建立VXLAN-DCI隧道,該隧道采用VXLAN封裝格式。ED與數據中心內部的VTEP建立VXLAN隧道。ED從VXLAN隧道或VXLAN-DCI隧道上接收到報文後,解除VXLAN封裝,根據目的IP地址重新對報文進行VXLAN封裝,並將其轉發到VXLAN-DCI隧道或VXLAN隧道,從而實現跨數據中心之間的互通。
圖1-1 VXLAN數據中心互聯典型組網圖
EVPN數據中心互聯組網中,ED之間、ED與VTEP之間建立BGP EVPN鄰居。ED從本數據中心的VTEP或其他ED接收到BGP EVPN路由後,將路由的下一跳、Router MAC分別修改為自身的IP地址、Router MAC地址,並將該路由發布給其他ED或本數據中心的VTEP。
ED、VTEP均學習到BGP EVPN路由後,根據路由信息轉發報文的過程為:
(1) VTEP接收到VM發送的報文後,通過VXLAN隧道將報文轉發給ED。
(2) ED解除VXLAN封裝後,重新對報文進行VXLAN封裝,通過VXLAN-DCI隧道將報文發送給遠端ED。
(3) 遠端ED解除VXLAN封裝後,重新封裝報文,通過VXLAN隧道將報文轉發給VTEP。
(4) VTEP解除VXLAN封裝後,將報文發送給目的VM。
如圖1-2所示,在EVPN數據中心互聯場景中,為了提高ED的可靠性,避免單點故障,在數據中心的邊緣可以部署兩台ED設備與其他數據中心互聯。這兩台ED設備使用相同的虛擬IP地址,虛擬成一台ED設備,采用虛擬IP地址與VTEP、遠端ED建立隧道,以實現冗餘保護和負載分擔。
圖1-2 EVPN數據中心互聯支持雙ED組網圖
兩台ED使用不同的地址作為BGP對等體地址,分別與VTEP、遠端ED建立BGP EVPN鄰居。利用Underlay網絡的等價路由機製,VTEP、遠端ED可以將發往ED虛擬IP地址的流量同時發送到兩台ED,從而實現冗餘備份和負載分擔。
在連接不同數據中心ED的DCI網絡側,兩台ED均通過Underlay網絡與對端數據中心ED建立連接。當一台ED的DCI側Underlay網絡出現故障時,數據中心內部網絡無法感知該故障,仍通過該ED轉發數據中心間的流量。通過配置Monitor Link組,將DCI側的物理接口與ED設備的LoopBack接口(用於建立BGP EVPN鄰居的接口和ED設備虛擬IP地址所在的接口)關聯,可以確保其中一台ED設備的DCI側Underlay網絡斷開時,將該ED的LoopBack接口鏈路狀態置為down,使流量通過另外一台ED設備轉發。Monitor Link的詳細介紹,請參見“可靠性配置指導”中的“Monitor Link”。
為了實現鏈路備份,數據中心網絡內部中,建議在Spine層部署多台RR;在DCI網絡側,建議ED通過雙鏈路接入Underlay網絡。
目前,本功能僅支持站點網絡和Underlay網絡同為IPv4網絡,或站點網絡和Underlay網絡同為IPv6網絡。
如圖1-3所示,EVPN數據中心互聯組網中,利用M-LAG功能(Multichassis link aggregation,跨設備鏈路聚合)將兩台物理設備連接起來虛擬成一台設備,使用該虛擬設備作為ED,可以避免ED單點故障對網絡造成影響,從而提高EVPN網絡的可靠性。M-LAG的詳細介紹,請參見“二層技術-以太網交換配置指導”中的“M-LAG”。
圖1-3 EVPN數據中心互聯支持M-LAG示意圖
EVPN數據中心互聯支持M-LAG功能的工作機製包括:
· 同步MAC地址、ARP和ND信息
作為M-LAG設備的兩台ED通過peer-link鏈路連接,在peer-link鏈路上同步MAC地址、ARP和ND信息,以確保兩台VTEP上的MAC地址、ARP和ND信息保持一致。peer-link鏈路隻能是以太網聚合鏈路。
· 共用虛擬ED地址
作為M-LAG設備的兩台ED具有相同的虛擬ED地址,對外表現為一台虛擬ED設備。其他VTEP或ED使用該地址與這台虛擬設備自動建立VXLAN隧道或VXLAN-DCI隧道。
· 使用不同的BGP對等體地址
兩台ED使用不同的地址作為BGP對等體地址,分別與其他VTEP或ED建立BGP EVPN鄰居。
利用Underlay網絡的等價路由機製,其他VTEP或ED可以將發往虛擬ED地址的流量同時發送到兩台ED,從而實現負載分擔和冗餘備份。
在連接不同數據中心ED的DCI網絡側,兩台ED均通過Underlay網絡與對端數據中心ED建立連接。當一台ED的DCI側Underlay網絡出現故障時,數據中心內部網絡無法感知該故障,仍通過該ED轉發數據中心間的流量。通過配置Monitor Link組,將DCI側的物理接口與ED設備的LoopBack接口(用於建立BGP EVPN鄰居的接口和ED設備虛擬IP地址所在的接口)關聯,可以確保其中一台ED設備的DCI側Underlay網絡斷開時,將該ED的LoopBack接口鏈路狀態置為down,使流量通過另外一台ED設備轉發。Monitor Link的詳細介紹,請參見“可靠性配置指導”中的“Monitor Link”。
在ED設備上,如果通過mac-address命令修改了某一關聯L3VNI的VSI虛接口的MAC地址,則必須通過該命令將所有與L3VNI關聯的VSI虛接口的MAC地址修改為相同的值,否則可能會導致報文轉發失敗。
EVPN數據中心互聯配置均在ED設備上執行,配置任務如下:
(1) 開啟DCI功能
(2) 配置ED修改EVPN路由
b. (可選)配置ED修改EVPN路由的RD、L3VNI和RT
如果不同的數據中心使用的L3VNI不同或用戶不希望泄露本地數據中心所使用的L3VNI時,可執行本配置在ED上替換L3VNI。
(3) (可選)配置抑製發送指定類型的路由
在數據中心互聯組網中,可通過執行本配置抑製ED向對等體/對等體組發送指定類型的路由,從而減少ED上的路由條目。
(4) (可選)配置VXLAN映射
如果在不同的數據中心中,同一租戶的相同子網使用了不同的VXLAN,要保證相同子網之間的流量進行二層轉發,則需要執行本配置。
(5) 配置BGP EVPN和BGP VPNv4/VPNv6路由相互引入
不同的數據中心之間通過MPLS L3VPN網絡互聯時,需要執行本配置。
(6) (可選)配置EVPN數據中心互聯支持雙ED
(7) (可選)配置EVPN數據中心互聯支持
(8) (可選)配置EVPN數據中心互聯支持跨VXLAN二層組播
(9) (可選)配置水平分割組
配置EVPN數據中心互聯前,需要先完成各個數據中心的EVPN部署,詳細配置方法請參見“EVPN配置指導”中的“EVPN VXLAN”。
EVPN數據中心互聯組網中,ED間互連的三層接口上必須開啟DCI功能,以便在ED之間建立VXLAN-DCI隧道。
ED根據EVPN路由自動建立隧道時,如果路由下一跳對應的出接口上開啟了DCI功能,則建立VXLAN-DCI隧道;否則,建立VXLAN隧道。
ED根據EVPN路由自動建立隧道時,本端ED和對端ED之間需要交互EVPN 2類路由或EVPN 5類路由後,才能建立VXLAN-DCI隧道。
(1) 進入係統視圖。
system-view
(2) 進入接口視圖。
interface interface-type interface-number
隻能在主接口上開啟DCI功能,子接口繼承主接口上的配置。
(3) 開啟DCI功能。
dci enable
缺省情況下,DCI功能處於關閉狀態。
(1) 進入係統視圖。
system-view
(2) 配置全局Router ID。
router id router-id
缺省情況下,未配置全局Router ID。
(3) 啟動BGP實例,並進入BGP實例視圖。
bgp as-number [ instance instance-name ]
缺省情況下,係統沒有運行BGP。
(4) 將遠端VTEP和ED配置為對等體。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } as-number as-number
(5) 創建BGP EVPN地址族,並進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(6) 使能本地路由器與指定對等體/對等體組交換BGP EVPN路由的能力。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } enable
缺省情況下,本地路由器不能與對等體/對等體組交換BGP EVPN路由。
(7) 配置向對等體/對等體組發布路由時,將下一跳屬性修改為自身的地址。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } next-hop-local
缺省情況下,向EBGP對等體/對等體組發布的所有路由,都將下一跳屬性修改為自身的地址;向IBGP對等體/對等體組發布的EBGP路由,不修改下一跳屬性。
本配置中指定的對等體應為本數據中心的VTEP。
(8) 配置向對等體/對等體組發布路由、將從對等體/對等體組接收到的路由發布給其他對等體時,將路由的Router MAC修改為自身的Router MAC地址。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } router-mac-local [ dci ]
缺省情況下,不會修改路由的Router MAC。
本配置中指定的對等體應為遠端ED。
當本端需要與對等體/對等體組建立VXLAN-DCI隧道時,建議指定dci參數。
EVPN數據中心互聯組網中,在以下場景中需要ED修改EVPN路由的RD、L3VNI和RT:
· 不同數據中心使用的L3VNI不同,通過本配置修改L3VNI,以實現數據中心之間的互通。
· 不同數據中心互通,需要RT值匹配。當數據中心組網規模較大時,數據中心之間的RT配置比較複雜。配置本功能後,ED可直接修改EVPN路由的RT值,數據中心之間發布EVPN路由使用統一的RT值即可,無需進行複雜的RT配置。
· 當用戶不希望泄露本地數據中心使用的L3VNI時,可以在ED上執行本配置,將本地所有L3VNI均替換為ED上的L3VNI,對外僅體現ED上的L3VNI。
執行peer re-originated命令後,ED修改路由中的L3VNI、RD和RT,並向指定對等體/對等體組發布修改後的EVPN路由,不會向對等體/對等體組發布源EVPN路由。此時,如果某些對等體/對等體組希望接收源EVPN路由,則可在ED上執行peer advertise original-route命令,使ED同時向對等體/對等體組發布修改後的EVPN路由和源EVPN路由。
同時執行peer re-originated和peer advertise original-route命令後,如果某些對等體/對等體組為減少本地路由條目,僅希望接收源EVPN路由,則可在ED上執行peer suppress re-originated命令,使ED僅向對等體/對等體組發布源EVPN路由。
在ED上配置mapping vni命令後,源EVPN路由和重生成路由攜帶的二層VXLAN ID都會被修改為映射的遠端VXLAN ID。
如果ED上本地VPN實例的RD與接收到的BGP EVPN路由的RD相同,執行本配置後,則不會替換該路由的L3VNI和RT,也不會重新生成路由,導致該BGP EVPN路由無法向對等體/對等體組發布。因此,執行本配置時,建議在不同設備上為VPN實例配置不同的RD。
(1) 進入係統視圖。
system-view
(2) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(3) 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(4) 配置從對等體/對等體組接收到BGP EVPN路由後,修改路由中的信息。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } re-originated [ imet | ip-prefix | mac-ip ] [ replace-rt ]
缺省情況下,不修改從對等體/對等體組接收到的EVPN路由的信息。
(5) (可選)配置向對等體/對等體組發布源EVPN路由。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise original-route
缺省情況下,執行peer re-originated命令修改路由信息後,不向對等體/對等體組發布源EVPN路由。
(6) (可選)配置抑製向對等體/對等體組發送修改路由信息後的EVPN路由。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } suppress re-originated { imet | ip-prefix | mac-ip }
缺省情況下,執行peer re-originated命令修改路由信息後,向對等體/對等體組發送修
改後的EVPN路由。
在數據中心互聯組網中,為減少ED上的路由條目,可通過執行本配置,抑製ED向對等體/對等體組發送指定類型的路由。
當不同數據中心的EVPN網關VSI虛接口的IP地址相同時,請不要抑製發布MAC/IP發布路由,否則會導致ED間無法互通。
(1) 進入係統視圖。
system-view
(2) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(3) 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(4) 配置向對等體/對等體組發布EVPN路由時不發送指定類型的路由。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise evpn-route suppress { ip-prefix | mac-ip }
缺省情況下,不抑製向對等體/對等體組發布EVPN路由。
在不同的數據中心中,同一租戶的相同子網可能使用不同的VXLAN。這些數據中心互聯時,若要保證同一租戶相同子網之間的流量進行二層轉發,則ED設備上需要執行本配置,在不同的VXLAN之間建立映射關係。
指定映射的遠端VXLAN後,ED接收到本數據中心內VTEP發送的MAC/IP發布路由時,將其學習到本地VXLAN中,並在向其他ED通告該MAC/IP發布路由前,將路由中攜帶的VXLAN替換為映射的遠端VXLAN。從其他ED接收到映射的遠端VXLAN內的MAC/IP發布路由時,本地ED將該路由學習到本地VXLAN中。
可以通過以下方式建立映射關係:
· 將本地VXLAN直接映射為另一個數據中心中使用的VXLAN。采用此方式時,隻需在一個數據中心的ED上指定映射的遠端VXLAN。例如,數據中心1內使用VXLAN 10、數據中心2內使用VXLAN 20時,隻需在數據中心1的ED上配置VXLAN 10映射為遠端VXLAN 20。
· 將不同數據中心ED上的本地VXLAN映射為相同的VXLAN(稱為中間VXLAN)。采用此方式時,需要在所有數據中心的ED上都指定映射的遠端VXLAN為中間VXLAN。例如,數據中心1內使用VXLAN 10、數據中心2內使用VXLAN 20、數據中心3內使用VXLAN 30時,需要在三個數據中心的ED上均配置映射的遠端VXLAN為中間VXLAN(如VXLAN 500)。當多個數據中心互聯,且不同數據中心使用的VXLAN各不相同時,需要使用此方式。中間VXLAN隻能用於VXLAN映射,不能用作普通VXLAN來處理VXLAN業務。
在某些特殊組網中,如果不希望跨數據中心轉發三層流量,則可以配置VXLAN映射時刪除EVPN路由中與L3VNI關聯的VPN實例的RT屬性,確保遠端設備接收到EVPN路由後,不會將該路由學習到VPN實例路由表中,不會生成三層轉發表項,從而保證數據中心之間隻能轉發二層流量。
本地設備上需要創建映射的遠端VXLAN,為其配置EVPN實例,並為該EVPN實例配置RD和Route Target屬性。
在使用VXLAN映射功能時,不要為EVPN實例和VPN實例的EVPN地址族、EVPN實例和公網實例的EVPN地址族配置相同的Export target,否則可能導致三層轉發不通。
(1) 進入係統視圖。
system-view
(2) 進入VSI視圖。
vsi vsi-name
(3) 進入EVPN實例視圖。
evpn encapsulation vxlan
(4) 指定本地VXLAN映射的遠端VXLAN。
mapping vni vxlan-id
缺省情況下,未指定本地VXLAN映射的遠端VXLAN。
本命令中指定的映射遠端VXLAN ID不能與l3-vni命令配置的L3VNI相同,也不能與reserved vxlan命令配置的保留VXLAN相同。reserved vxlan命令的詳細介紹,請參見“VXLAN命令參考”中的“VXLAN”。
(5) (可選)配置VXLAN映射時刪除EVPN路由中屬於VPN實例的RT屬性。
a. 請依次執行以下命令退回係統視圖。
quit
quit
b. 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
c. 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
d. 配置VXLAN映射時刪除EVPN路由中屬於VPN實例的RT屬性。
mapping-vni remove vpn-target
缺省情況下,VXLAN映射時不會刪除EVPN路由中屬於VPN實例的RT屬性。
不同的數據中心之間通過MPLS L3VPN網絡互聯時,ED同時作為MPLS L3VPN的PE設備,進行MPLS L3VPN相關處理。此時,ED上除了完成MPLS L3VPN和EVPN配置外,還需要配置BGP EVPN和BGP VPNv4/VPNv6路由相互引入以實現數據中心之間的互通。
圖1-4 通過MPLS L3VPN網絡連接不同的數據中心
(1) 進入係統視圖。
system-view
(2) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(3) 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(4) 配置允許BGP VPNv4或VPNv6路由通過EVPN地址族發布給鄰居。
advertise l3vpn route [ replace-rt ][ advertise-policy policy-name ]
缺省情況下,BGP VPNv4或VPNv6路由不會通過EVPN地址族向外發送。
執行本命令後,BGP VPNv4或VPNv6路由將作為EVPN的IP前綴路由發布給鄰居。
(1) 進入係統視圖。
system-view
(2) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(3) 進入BGP VPNv4地址族視圖或BGP VPNv6地址族視圖。
address-family { vpnv4 | vpnv6 }
(4) 配置允許BGP EVPN路由通過VPNv4或VPNv6地址族發布給鄰居。
advertise evpn route [ replace-rt ][ advertise-policy policy-name ]
缺省情況下,BGP EVPN路由不會通過VPNv4和VPNv6地址族向外發送。
執行本命令後,設備會將EVPN的IP前綴路由、攜帶主機路由信息的MAC/IP發布路由通過VPNv4或VPNv6地址族發布給鄰居。
在數據中心網絡的邊緣部署兩台ED,並為其配置相同的虛擬IP地址後,這兩台ED將虛擬成為一台ED設備,從而避免ED單點故障對網絡造成影響。
當數據中心網絡邊緣僅有一台ED設備時,請不要配置ED的虛擬IP地址。
兩台ED設備上配置的虛擬IP地址必須相同,該虛擬IP地址應為ED設備上某個LoopBack接口的IP地址,且該地址不能與BGP對等體的地址相同。
兩台ED設備被虛擬成一台設備以後,ED設備不能在本地接入虛擬機,隻能作為數據中心互聯的邊緣設備使用,且不能在單台ED設備上引入外部路由。
本特性與EVPN支持M-LAG特性互斥,即不能同時配置evpn edge group和evpn m-lag group命令。
EVPN數據中心互聯支持雙ED組網中,Underlay和Overlay網絡必須同為IPv4網絡,或同為IPv6網絡。
在設備上通過undo bgp命令關閉EVPN地址族所在的BGP實例,會導致該設備上的evpn edge group配置被刪除,請謹慎使用。
(1) 進入係統視圖。
system-view
(2) 配置ED設備的虛擬IP地址。
evpn edge group group-ipv4
缺省情況下,未指定ED設備的虛擬IP地址。
在兩台ED上均開啟EVPN M-LAG功能,並為其配置相同的虛擬ED地址後,這兩台ED將虛擬成為一台ED設備。該ED設備采用虛擬ED地址作為源端地址與遠端VTEP/ED自動建立VXLAN/VXLAN-DCI隧道,從而避免ED單點故障對網絡造成影響。
配置本功能後,建議不要在ED設備上配置evpn m-lag local命令,否則可能會導致報文轉發失敗。
EVPN數據中心互聯支持M-LAG組網中,如果ED需要連接用戶站點,則建議通過M-LAG接口將用戶站點同時接入組成M-LAG係統的兩台ED,即建議不要在ED上配置單掛AC。
(1) 進入係統視圖。
system-view
(2) 在ED上開啟EVPN M-LAG功能,並配置虛擬ED地址。
evpn m-lag group { virtual-vtep-ipv4 | virtual-vtep-ipv6 }
缺省情況下,EVPN M-LAG功能處於關閉狀態。
(3) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(4) 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(5) 配置發布EVPN路由時,將下一跳地址修改為M-LAG的虛擬ED地址。
nexthop evpn-m-lag group-address
缺省情況下,向EBGP對等體/對等體組發布路由時,將下一跳地址修改為建立BGP會話時使用的源接口的地址;向IBGP對等體/對等體組發布EBGP路由時,不修改下一跳地址。
EVPN數據中心互聯組網中,在ED上同時執行了本配置和mapping vni配置時,當ED從VTEP或遠端ED接收到SMET路由後,如果路由中的Route Target屬性與本地EVPN實例的Import Route Target屬性匹配,則將該SMET路由中的Route Target屬性替換為映射的遠端VXLAN ID所在EVPN實例的Route Target屬性,並將替換後的SMET路由發布給遠端ED或VTEP,實現在數據中心二層互聯且使用不同VXLAN的組網中組播流量的跨VXLAN轉發。
本功能需要在ED上配合mapping vni功能使用。如果ED上未配置mapping vni功能,則本功能不生效。
(1) 進入係統視圖。
system-view
(2) 進入VSI視圖。
vsi vsi-name
(3) 進入EVPN實例視圖。
evpn encapsulation vxlan
(4) 配置根據映射的遠端VXLAN,重生成SMET路由。
mapping-vni-based smet
缺省情況下,不會根據映射的遠端VXLAN重生成SMET路由。
水平分割組是一種配置策略,配置本功能,peer split-group命令指定的對等體/對等體組將會加入到指定的水平分割組。設備從水平分割組內的對等體收到的所有流量不會被轉發給同一水平分割組內的其他對等體,可以轉發給不同水平分割組的其他對等體,或未配置水平分割組的其他對等體。這樣一來,通過設置水平分割組就可以實現精準的流量控製,從而避免無效的流量傳輸以及環路的產生。
在EVPN數據中心互聯場景中,通過將不同數據中心的ED劃分到相同的水平分割組,可以實現ED對來自遠端數據中心ED的流量進行水平分割,使得這些流量不被轉發給其他數據中心的ED,以免造成環路。
水平分割組僅具有本地意義,即該配置僅在當前設備上生效。
(1) 進入係統視圖。
system-view
(2) 進入BGP實例視圖。
bgp as-number [ instance instance-name ]
(3) 進入BGP EVPN地址族視圖。
address-family l2vpn evpn
(4) 配置BGP EVPN對等體/對等體組所屬的水平分割組。
peer { group-name | ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } split-group split-group-name
缺省情況下,未配置BGP EVPN對等體/對等體組所屬的水平分割組。
本節僅以IPv4站點接入IPv4網絡為例,IPv4站點接入IPv6、IPv6站點接入IPv4網絡、IPv6站點接入IPv6網絡的配置與此類似。
Switch A和Switch B為數據中心1的VTEP,Switch C和Switch D為數據中心2的VTEP,Switch B和Switch C為兩個數據中心的ED。數據中心1和數據中心2分別使用VXLAN 10、VXLAN 30處理同一業務的流量。通過EVPN數據中心互連實現數據中心1和數據中心2的二層互通。
圖1-5 數據中心二層互聯且使用不同VXLAN配置組網圖
(1) 配置IP地址和單播路由協議
配置各接口的IP地址和子網掩碼;在IP核心網絡內配置OSPF協議,確保交換機之間路由可達。(具體配置過程略)
(2) 配置Switch A
# 開啟L2VPN能力。
<SwitchA> system-view
[SwitchA] l2vpn enable
# 關閉遠端MAC地址自動學習功能。
[SwitchA] vxlan tunnel mac-learning disable
# 在VSI實例vpna下創建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchA-vsi-vpna] evpn encapsulation vxlan
[SwitchA-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchA-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchA-vsi-vpna-evpn-vxlan] quit
[SwitchA-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchA] bgp 100
[SwitchA-bgp-default] peer 2.2.2.2 as-number 100
[SwitchA-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchA-bgp-default] address-family l2vpn evpn
[SwitchA-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchA-bgp-default-evpn] quit
[SwitchA-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 100的數據幀。
[SwitchA] interface twenty-fivegige 1/0/1
[SwitchA-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchA-Twenty-FiveGigE1/0/1] port trunk permit vlan 100
[SwitchA-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 100
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] quit
(3) 配置Switch B
# 開啟L2VPN能力。
<SwitchB> system-view
[SwitchB] l2vpn enable
# 關閉遠端MAC地址自動學習功能。
[SwitchB] vxlan tunnel mac-learning disable
# 在與Switch C相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchB] interface twenty-fivegige 1/0/1
[SwitchB-Twenty-FiveGigE1/0/1] dci enable
[SwitchB-Twenty-FiveGigE1/0/1] quit
# 在VSI實例vpna下創建VXLAN 10。
[SwitchB] vsi vpna
[SwitchB-vsi-vpna] vxlan 10
[SwitchB-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchB-vsi-vpna] evpn encapsulation vxlan
[SwitchB-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchB-vsi-vpna-evpn-vxlan] vpn-target auto
# 配置本端VXLAN 10映射為遠端VXLAN 500。在對端ED上需要將VXLAN 500映射為對端ED上的VXLAN 30。
[SwitchB-vsi-vpna-evpn-vxlan] mapping vni 500
[SwitchB-vsi-vpna-evpn-vxlan] quit
[SwitchB-vsi-vpna] quit
# 在VSI實例vpnb下創建VXLAN 500,該VXLAN ID用於二層轉發時替換本地的VXLAN。
[SwitchB] vsi vpnb
[SwitchB-vsi-vpnb] vxlan 500
[SwitchB-vsi-vpnb-vxlan-500] quit
# 在VSI實例vpnb下創建EVPN實例,並配置EVPN實例的RD和RT。RT需要手工配置。
[SwitchB-vsi-vpnb] evpn encapsulation vxlan
[SwitchB-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchB-vsi-vpnb-evpn-vxlan] vpn-target 123:456
[SwitchB-vsi-vpnb-evpn-vxlan] quit
[SwitchB-vsi-vpnb] quit
# 配置BGP發布EVPN路由,指定向Switch A發布路由時將路由下一跳修改為自身的地址,向Switch C發布路由、從Switch C接收路由並發布時修改Router MAC。
[SwitchB] bgp 100
[SwitchB-bgp-default] peer 3.3.3.3 as-number 200
[SwitchB-bgp-default] peer 3.3.3.3 connect-interface loopback 0
[SwitchB-bgp-default] peer 3.3.3.3 ebgp-max-hop 64
[SwitchB-bgp-default] peer 1.1.1.1 as-number 100
[SwitchB-bgp-default] peer 1.1.1.1 connect-interface loopback 0
[SwitchB-bgp-default] address-family l2vpn evpn
[SwitchB-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchB-bgp-default-evpn] peer 3.3.3.3 router-mac-local
[SwitchB-bgp-default-evpn] peer 1.1.1.1 enable
[SwitchB-bgp-default-evpn] peer 1.1.1.1 next-hop-local
[SwitchB-bgp-default-evpn] quit
[SwitchB-bgp-default] quit
(4) 配置Switch C
# 開啟L2VPN能力。
<SwitchC> system-view
[SwitchC] l2vpn enable
# 關閉遠端MAC地址自動學習功能。
[SwitchC] vxlan tunnel mac-learning disable
# 在與Switch B相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道
[SwitchC] interface twenty-fivegige 1/0/1
[SwitchC-Twenty-FiveGigE1/0/1] dci enable
[SwitchC-Twenty-FiveGigE1/0/1] quit
# 在VSI實例vpna下創建VXLAN 30。
[SwitchC] vsi vpna
[SwitchC-vsi-vpna] vxlan 30
[SwitchC-vsi-vpna-vxlan-30] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchC-vsi-vpna] evpn encapsulation vxlan
[SwitchC-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchC-vsi-vpna-evpn-vxlan] vpn-target auto
# 配置本端VXLAN 30映射為遠端VXLAN 500。在對端ED上需要將VXLAN 500映射為對端ED上的VXLAN 10。
[SwitchC-vsi-vpna-evpn-vxlan] mapping vni 500
[SwitchC-vsi-vpna-evpn-vxlan] quit
[SwitchC-vsi-vpna] quit
# 在VSI實例vpnb下創建VXLAN 500,該VXLAN ID用於二層轉發時替換本地的VXLAN。
[SwitchC] vsi vpnb
[SwitchC-vsi-vpnb] vxlan 500
[SwitchC-vsi-vpnb-vxlan-500] quit
# 在VSI實例vpnb下創建EVPN實例,並配置EVPN實例的RD和RT。RT需要手工配置。
[SwitchC-vsi-vpnb] evpn encapsulation vxlan
[SwitchC-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchC-vsi-vpnb-evpn-vxlan] vpn-target 123:456
[SwitchC-vsi-vpnb-evpn-vxlan] quit
[SwitchC-vsi-vpnb] quit
# 配置BGP發布EVPN路由,指定向Switch D發布路由時將路由下一跳修改為自身的地址,向Switch B發布路由、從Switch B接收路由並發布時修改Router MAC。
[SwitchC] bgp 200
[SwitchC-bgp-default] peer 2.2.2.2 as-number 100
[SwitchC-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchC-bgp-default] peer 2.2.2.2 ebgp-max-hop 64
[SwitchC-bgp-default] peer 4.4.4.4 as-number 200
[SwitchC-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[SwitchC-bgp-default] address-family l2vpn evpn
[SwitchC-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchC-bgp-default-evpn] peer 2.2.2.2 router-mac-local
[SwitchC-bgp-default-evpn] peer 4.4.4.4 enable
[SwitchC-bgp-default-evpn] peer 4.4.4.4 next-hop-local
[SwitchC-bgp-default-evpn] quit
[SwitchC-bgp-default] quit
(5) 配置Switch D
# 開啟L2VPN能力。
<SwitchD> system-view
[SwitchD] l2vpn enable
# 關閉遠端MAC地址自動學習功能。
[SwitchD] vxlan tunnel mac-learning disable
# 在VSI實例vpna下創建VXLAN 30。
[SwitchD] vsi vpna
[SwitchD-vsi-vpna] vxlan 30
[SwitchD-vsi-vpna-vxlan-30] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchD-vsi-vpna] evpn encapsulation vxlan
[SwitchD-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchD-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchD-vsi-vpna-evpn-vxlan] quit
[SwitchD-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchD] bgp 200
[SwitchD-bgp-default] peer 3.3.3.3 as-number 200
[SwitchD-bgp-default] peer 3.3.3.3 connect-interface Loopback 0
[SwitchD-bgp-default] address-family l2vpn evpn
[SwitchD-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchD-bgp-default-evpn] quit
[SwitchD-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 200的數據幀。
[SwitchD] interface twenty-fivegige 1/0/1
[SwitchD-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchD-Twenty-FiveGigE1/0/1] port trunk permit vlan 200
[SwitchD-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchD-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 200
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchD-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchD-Twenty-FiveGigE1/0/1-srv1000] quit
(1) 驗證ED(下文以Switch B為例,Switch C驗證方法與此類似)
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過Inclusive Multicast Ethernet Tag Route發現鄰居Switch A和Switch C,並分別與其建立VXLAN隧道、VXLAN-DCI隧道。
[SwitchB] display evpn auto-discovery imet
Total number of automatically discovered peers: 2
VSI name: vpna
RD PE_address Tunnel_address Tunnel mode VXLAN ID
1:10 1.1.1.1 1.1.1.1 VXLAN 10
1:500 3.3.3.3 3.3.3.3 VXLAN-DCI 500
# 查看Switch B上的Tunnel接口信息,可以看到VXLAN模式和VXLAN-DCI模式的Tunnel接口處於up狀態。
[SwitchB] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2.2.2.2, destination 1.1.1.1
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2.2.2.2, destination 3.3.3.3
Tunnel protocol/transport UDP_VXLAN-DCI/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看Switch B上的VSI信息,可以看到VSI內創建的VXLAN,以及關聯的VXLAN隧道、VXLAN-DCI隧道等信息。vpnb下沒有關聯隧道。
[SwitchB] display l2vpn vsi verbose
VSI Name: vpna
VSI Index : 0
VSI State : Up
MTU : 1500
Bandwidth : Unlimited
Broadcast Restrain : Unlimited
Multicast Restrain : Unlimited
Unknown Unicast Restrain: Unlimited
MAC Learning : Enabled
MAC Table Limit : -
MAC Learning rate : -
Drop Unknown : -
Flooding : Enabled
Statistics : Disabled
VXLAN ID : 10
Tunnel Statistics : Enabled
Tunnels:
Tunnel Name Link ID State Type Flood proxy
Tunnel1 0x5000000 UP Auto Disabled
Tunnel1 0x5000001 UP Auto Disabled
VSI Name: vpnb
VSI Index : 1
VSI State : Down
MTU : 1500
Bandwidth : Unlimited
Broadcast Restrain : Unlimited
Multicast Restrain : Unlimited
Unknown Unicast Restrain: Unlimited
MAC Learning : Enabled
MAC Table Limit : -
MAC Learning rate : -
Drop Unknown : -
Flooding : Enabled
Statistics : Disabled
VXLAN ID : 500
# 查看EVPN的MAC地址表項,可以看到已經學習到虛擬機的MAC地址信息,且從對端數據中心學到的MAC地址表項帶有M標誌。
[SwitchB] display evpn route mac
Flags: D - Dynamic B - BGP L - Local active
G - Gateway S - Static M - Mapping I - Invalid
VSI name: vpna
MAC address Link ID/Name Flags Next hop
0001-0001-0011 Tunnel1 B 1.1.1.1
0001-0001-0033 Tunnel1 BM 3.3.3.3
(2) 驗證主機
虛擬機VM 1、VM 2之間可以互訪。
本節僅以IPv4站點接入IPv4網絡為例,IPv6站點接入IPv4網絡的配置與此類似。
Switch A為數據中心1的分布式網關,Switch D為數據中心2的分布式網關,Switch B和Switch C為兩個數據中心的ED。通過EVPN數據中心互連實現數據中心1和數據中心2的三層互通。
圖1-6 數據中心三層互聯配置組網圖
(1) 配置設備工作的硬件資源模式。
# 配置Switch A、Switch B、Switch C和Switch D工作的硬件資源模式,並重啟設備。以Switch A為例,其他設備的配置方法與此相同。
[SwitchA] hardware-resource vxlan l3gw
Do you want to change the specified hardware resource working mode? [Y/N]:y
The hardware resource working mode is changed, please save the configuration and
reboot the system to make it effective.
[SwitchA] quit
<SwitchA> reboot
Start to check configuration with next startup configuration file, please wait..
.......DONE!
Current configuration may be lost after the reboot, save current configuration?
[Y/N]:y
This command will reboot the device. Continue? [Y/N]:y
(2) 配置IP地址和單播路由協議
# 在VM 1上指定網關地址為10.1.1.1;在VM 2上指定網關地址為10.1.2.1。(具體配置過程略)
# 配置各接口的IP地址和子網掩碼;在IP核心網絡內配置OSPF協議,確保交換機之間路由可達。(具體配置過程略)
(3) 配置Switch A
# 開啟L2VPN能力。
<SwitchA> system-view
[SwitchA] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchA] vxlan tunnel mac-learning disable
[SwitchA] vxlan tunnel arp-learning disable
# 在VSI實例vpna下創建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchA-vsi-vpna] evpn encapsulation vxlan
[SwitchA-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchA-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchA-vsi-vpna-evpn-vxlan] quit
[SwitchA-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchA] bgp 100
[SwitchA-bgp-default] peer 2.2.2.2 as-number 100
[SwitchA-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchA-bgp-default] address-family l2vpn evpn
[SwitchA-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchA-bgp-default-evpn] quit
[SwitchA-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 100的數據幀。
[SwitchA] interface twenty-fivegige 1/0/1
[SwitchA-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchA-Twenty-FiveGigE1/0/1] port trunk permit vlan 100
[SwitchA-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 100
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] quit
# 配置L3VNI的RD和RT。
[SwitchA] ip vpn-instance vpn1
[SwitchA-vpn-instance-vpn1] route-distinguisher 1:1
[SwitchA-vpn-instance-vpn1] address-family ipv4
[SwitchA-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchA-vpn-ipv4-vpn1] quit
[SwitchA-vpn-instance-vpn1] address-family evpn
[SwitchA-vpn-evpn-vpn1] vpn-target 1:1
[SwitchA-vpn-evpn-vpn1] quit
[SwitchA-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchA] interface vsi-interface 1
[SwitchA-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface1] ip address 10.1.1.1 255.255.255.0
[SwitchA-Vsi-interface1] mac-address 1-1-1
[SwitchA-Vsi-interface1] distributed-gateway local
[SwitchA-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchA] interface vsi-interface 2
[SwitchA-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface2] l3-vni 1000
[SwitchA-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] gateway vsi-interface 1
[SwitchA-vsi-vpna] quit
(4) 配置Switch B
# 開啟L2VPN能力。
<SwitchB> system-view
[SwitchB] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchB] vxlan tunnel mac-learning disable
[SwitchB] vxlan tunnel arp-learning disable
# 在與Switch C相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchB] interface twenty-fivegige 1/0/1
[SwitchB-Twenty-FiveGigE1/0/1] dci enable
[SwitchB-Twenty-FiveGigE1/0/1] quit
# 配置BGP發布EVPN路由,指定向Switch A發布路由時將路由下一跳修改為自身的地址,向Switch C發布路由、從Switch C接收路由並發布時修改Router MAC。
[SwitchB] bgp 100
[SwitchB-bgp-default] peer 3.3.3.3 as-number 200
[SwitchB-bgp-default] peer 3.3.3.3 connect-interface loopback 0
[SwitchB-bgp-default] peer 3.3.3.3 ebgp-max-hop 64
[SwitchB-bgp-default] peer 1.1.1.1 as-number 100
[SwitchB-bgp-default] peer 1.1.1.1 connect-interface loopback 0
[SwitchB-bgp-default] address-family l2vpn evpn
[SwitchB-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchB-bgp-default-evpn] peer 3.3.3.3 router-mac-local
[SwitchB-bgp-default-evpn] peer 1.1.1.1 enable
[SwitchB-bgp-default-evpn] peer 1.1.1.1 next-hop-local
[SwitchB-bgp-default-evpn] quit
[SwitchB-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchB] ip vpn-instance vpn1
[SwitchB-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchB-vpn-instance-vpn1] address-family ipv4
[SwitchB-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchB-vpn-ipv4-vpn1] quit
[SwitchB-vpn-instance-vpn1] address-family evpn
[SwitchB-vpn-evpn-vpn1] vpn-target 1:1
[SwitchB-vpn-evpn-vpn1] quit
[SwitchB-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchB] interface vsi-interface 2
[SwitchB-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchB-Vsi-interface2] l3-vni 1000
[SwitchB-Vsi-interface2] quit
(5) 配置Switch C
# 開啟L2VPN能力。
<SwitchC> system-view
[SwitchC] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchC] vxlan tunnel mac-learning disable
[SwitchC] vxlan tunnel arp-learning disable
# 在與Switch B相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道
[SwitchC] interface twenty-fivegige 1/0/1
[SwitchC-Twenty-FiveGigE1/0/1] dci enable
[SwitchC-Twenty-FiveGigE1/0/1] quit
# 配置BGP發布EVPN路由,指定向Switch D發布路由時將路由下一跳修改為自身的地址,向Switch B發布路由、從Switch B接收路由並發布時修改Router MAC。
[SwitchC] bgp 200
[SwitchC-bgp-default] peer 2.2.2.2 as-number 100
[SwitchC-bgp-default] peer 2.2.2.2 connect-interface Loopback 0
[SwitchC-bgp-default] peer 2.2.2.2 ebgp-max-hop 64
[SwitchC-bgp-default] peer 4.4.4.4 as-number 200
[SwitchC-bgp-default] peer 4.4.4.4 connect-interface Loopback 0
[SwitchC-bgp-default] address-family l2vpn evpn
[SwitchC-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchC-bgp-default-evpn] peer 2.2.2.2 router-mac-local
[SwitchC-bgp-default-evpn] peer 4.4.4.4 enable
[SwitchC-bgp-default-evpn] peer 4.4.4.4 next-hop-local
[SwitchC-bgp-default-evpn] quit
[SwitchC-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchC] ip vpn-instance vpn1
[SwitchC-vpn-instance-vpn1] route-distinguisher 1:3
[SwitchC-vpn-instance-vpn1] address-family ipv4
[SwitchC-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchC-vpn-ipv4-vpn1] quit
[SwitchC-vpn-instance-vpn1] address-family evpn
[SwitchC-vpn-evpn-vpn1] vpn-target 1:1
[SwitchC-vpn-evpn-vpn1] quit
[SwitchC-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchC] interface vsi-interface 2
[SwitchC-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchC-Vsi-interface2] l3-vni 1000
[SwitchC-Vsi-interface2] quit
(6) 配置Switch D
# 開啟L2VPN能力。
<SwitchD> system-view
[SwitchD] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchD] vxlan tunnel mac-learning disable
[SwitchD] vxlan tunnel arp-learning disable
# 在VSI實例vpnb下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchD] vsi vpnb
[SwitchD-vsi-vpnb] evpn encapsulation vxlan
[SwitchD-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchD-vsi-vpnb-evpn-vxlan] vpn-target auto
[SwitchD-vsi-vpnb-evpn-vxlan] quit
# 創建VXLAN 20。
[SwitchD-vsi-vpnb] vxlan 20
[SwitchD-vsi-vpnb-vxlan-20] quit
[SwitchD-vsi-vpnb] quit
# 配置BGP發布EVPN路由。
[SwitchD] bgp 200
[SwitchD-bgp-default] peer 3.3.3.3 as-number 200
[SwitchD-bgp-default] peer 3.3.3.3 connect-interface Loopback 0
[SwitchD-bgp-default] address-family l2vpn evpn
[SwitchD-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchD-bgp-default-evpn] quit
[SwitchD-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例3000,該實例用來匹配VLAN 3的數據幀。
[SwitchD] interface twenty-fivegige 1/0/1
[SwitchD-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchD-Twenty-FiveGigE1/0/1] port trunk permit vlan 3
[SwitchD-Twenty-FiveGigE1/0/1] service-instance 3000
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] encapsulation s-vid 3
# 配置以太網服務實例1000與VSI實例vpnb關聯。
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] xconnect vsi vpnb
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] quit
# 配置L3VNI的RD和RT。
[SwitchD] ip vpn-instance vpn1
[SwitchD-vpn-instance-vpn1] route-distinguisher 1:4
[SwitchD-vpn-instance-vpn1] address-family ipv4
[SwitchD-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchD-vpn-ipv4-vpn1] quit
[SwitchD-vpn-instance-vpn1] address-family evpn
[SwitchD-vpn-evpn-vpn1] vpn-target 1:1
[SwitchD-vpn-evpn-vpn1] quit
[SwitchD-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchD] interface vsi-interface 1
[SwitchD-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface1] ip address 10.1.2.1 255.255.255.0
[SwitchD-Vsi-interface1] mac-address 1-2-1
[SwitchD-Vsi-interface1] distributed-gateway local
[SwitchD-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchD] interface vsi-interface 2
[SwitchD-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface2] l3-vni 1000
[SwitchD-Vsi-interface2] quit
# 配置VXLAN 20所在的VSI實例和接口VSI-interface1關聯。
[SwitchD] vsi vpnb
[SwitchD-vsi-vpnb] gateway vsi-interface 1
[SwitchD-vsi-vpnb] quit
(1) 驗證ED(下文以Switch B為例,Switch C驗證方法與此類似)
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居Switch A和Switch C,並分別與其建立VXLAN隧道、VXLAN-DCI隧道。
[SwitchB] display evpn auto-discovery macip-prefix
Destination IP Source IP L3VNI Tunnel mode OutInterface
1.1.1.1 2.2.2.2 1000 VXLAN Vsi-interface2
3.3.3.3 2.2.2.2 1000 VXLAN-DCI Vsi-interface2
# 查看Switch B上的Tunnel接口信息,可以看到VXLAN模式和VXLAN-DCI模式的Tunnel接口處於up狀態。
[SwitchB] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2.2.2.2, destination 1.1.1.1
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2.2.2.2, destination 3.3.3.3
Tunnel protocol/transport UDP_VXLAN-DCI/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IP路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchB] display ip routing-table vpn-instance vpn1
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 BGP 255 0 1.1.1.1 Vsi2
10.1.1.11/32 BGP 255 0 1.1.1.1 Vsi2
10.1.2.0/24 BGP 255 0 3.3.3.3 Vsi2
10.1.2.22/32 BGP 255 0 3.3.3.3 Vsi2
(2) 驗證主機
虛擬機VM 1、VM 2之間可以互訪。
本節僅以IPv6站點接入IPv6網絡為例,IPv4站點接入IPv6網絡的配置與此類似。
Switch A為數據中心1的分布式網關,Switch D為數據中心2的分布式網關,Switch B和Switch C為兩個數據中心的ED。通過EVPN數據中心互連實現數據中心1和數據中心2的三層互通。
圖1-7 數據中心三層互聯IPv6 Underlay配置組網圖
(1) 配置IP地址和單播路由協議
# 在VM 1上指定網關地址為10::1;在VM 2上指定網關地址為20::1。(具體配置過程略)
# 配置各接口的IP地址和子網掩碼;在IP核心網絡內配置OSPFv3協議,確保交換機之間路由可達。(具體配置過程略)
(2) 配置Switch A
# 開啟L2VPN能力。
<SwitchA> system-view
[SwitchA] l2vpn enable
# 關閉遠端MAC地址和遠端ND自動學習功能。
[SwitchA] vxlan tunnel mac-learning disable
[SwitchA] vxlan tunnel nd-learning disable
# 在VSI實例vpna下創建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchA-vsi-vpna] evpn encapsulation vxlan
[SwitchA-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchA-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchA-vsi-vpna-evpn-vxlan] quit
[SwitchA-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchA] bgp 100
[SwitchA-bgp-default] router-id 1.1.1.1
[SwitchA-bgp-default] peer 2::2 as-number 100
[SwitchA-bgp-default] peer 2::2 connect-interface loopback 0
[SwitchA-bgp-default] address-family l2vpn evpn
[SwitchA-bgp-default-evpn] peer 2::2 enable
[SwitchA-bgp-default-evpn] quit
[SwitchA-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 100的數據幀。
[SwitchA] interface twenty-fivegige 1/0/1
[SwitchA-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 100
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] quit
# 配置L3VNI的RD和RT。
[SwitchA] ip vpn-instance vpn1
[SwitchA-vpn-instance-vpn1] route-distinguisher 1:1
[SwitchA-vpn-instance-vpn1] address-family ipv6
[SwitchA-vpn-ipv6-vpn1] vpn-target 2:2
[SwitchA-vpn-ipv6-vpn1] quit
[SwitchA-vpn-instance-vpn1] address-family evpn
[SwitchA-vpn-evpn-vpn1] vpn-target 1:1
[SwitchA-vpn-evpn-vpn1] quit
[SwitchA-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchA] interface vsi-interface 1
[SwitchA-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface1] ipv6 address 10::1 64
[SwitchA-Vsi-interface1] mac-address 1-1-1
[SwitchA-Vsi-interface1] distributed-gateway local
[SwitchA-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchA] interface vsi-interface 2
[SwitchA-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface2] ipv6 address auto link-local
[SwitchA-Vsi-interface2] l3-vni 1000
[SwitchA-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] gateway vsi-interface 1
[SwitchA-vsi-vpna] quit
(3) 配置Switch B
# 開啟L2VPN能力。
<SwitchB> system-view
[SwitchB] l2vpn enable
# 關閉遠端MAC地址和遠端ND自動學習功能。
[SwitchB] vxlan tunnel mac-learning disable
[SwitchB] vxlan tunnel nd-learning disable
# 在與Switch C相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchB] interface vlan-interface 12
[SwitchB-Vlan-interface12] dci enable
[SwitchB-Vlan-interface12] quit
# 配置BGP發布EVPN路由,指定向Switch A發布路由時將路由下一跳修改為自身的地址,向Switch C發布路由、從Switch C接收路由並發布時修改Router MAC。
[SwitchB] bgp 100
[SwitchB-bgp-default] router-id 2.2.2.2
[SwitchB-bgp-default] peer 3::3 as-number 200
[SwitchB-bgp-default] peer 3::3 connect-interface loopback 0
[SwitchB-bgp-default] peer 3::3 ebgp-max-hop 64
[SwitchB-bgp-default] peer 1::1 as-number 100
[SwitchB-bgp-default] peer 1::1 connect-interface loopback 0
[SwitchB-bgp-default] address-family l2vpn evpn
[SwitchB-bgp-default-evpn] peer 3::3 enable
[SwitchB-bgp-default-evpn] peer 3::3 router-mac-local
[SwitchB-bgp-default-evpn] peer 1::1 enable
[SwitchB-bgp-default-evpn] peer 1::1 next-hop-local
[SwitchB-bgp-default-evpn] quit
[SwitchB-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchB] ip vpn-instance vpn1
[SwitchB-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchB-vpn-instance-vpn1] address-family ipv6
[SwitchB-vpn-ipv6-vpn1] vpn-target 2:2
[SwitchB-vpn-ipv6-vpn1] quit
[SwitchB-vpn-instance-vpn1] address-family evpn
[SwitchB-vpn-evpn-vpn1] vpn-target 1:1
[SwitchB-vpn-evpn-vpn1] quit
[SwitchB-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchB] interface vsi-interface 2
[SwitchB-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchB-Vsi-interface2] ipv6 address auto link-local
[SwitchB-Vsi-interface2] l3-vni 1000
[SwitchB-Vsi-interface2] quit
(4) 配置Switch C
# 開啟L2VPN能力。
<SwitchC> system-view
[SwitchC] l2vpn enable
# 關閉遠端MAC地址和遠端ND自動學習功能。
[SwitchC] vxlan tunnel mac-learning disable
[SwitchC] vxlan tunnel nd-learning disable
# 在與Switch B相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道
[SwitchC] interface vlan-interface 12
[SwitchC-Vlan-interface12] dci enable
[SwitchC-Vlan-interface12] quit
# 配置BGP發布EVPN路由,指定向Switch D發布路由時將路由下一跳修改為自身的地址,向Switch B發布路由、從Switch B接收路由並發布時修改Router MAC。
[SwitchC] bgp 200
[SwitchC-bgp-default] router-id 3.3.3.3
[SwitchC-bgp-default] peer 2::2 as-number 100
[SwitchC-bgp-default] peer 2::2 connect-interface Loopback 0
[SwitchC-bgp-default] peer 2::2 ebgp-max-hop 64
[SwitchC-bgp-default] peer 4::4 as-number 200
[SwitchC-bgp-default] peer 4::4 connect-interface Loopback 0
[SwitchC-bgp-default] address-family l2vpn evpn
[SwitchC-bgp-default-evpn] peer 2::2 enable
[SwitchC-bgp-default-evpn] peer 2::2 router-mac-local
[SwitchC-bgp-default-evpn] peer 4::4 enable
[SwitchC-bgp-default-evpn] peer 4::4 next-hop-local
[SwitchC-bgp-default-evpn] quit
[SwitchC-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchC] ip vpn-instance vpn1
[SwitchC-vpn-instance-vpn1] route-distinguisher 1:3
[SwitchC-vpn-instance-vpn1] address-family ipv6
[SwitchC-vpn-ipv6-vpn1] vpn-target 2:2
[SwitchC-vpn-ipv6-vpn1] quit
[SwitchC-vpn-instance-vpn1] address-family evpn
[SwitchC-vpn-evpn-vpn1] vpn-target 1:1
[SwitchC-vpn-evpn-vpn1] quit
[SwitchC-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchC] interface vsi-interface 2
[SwitchC-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchC-Vsi-interface2] ipv6 address auto link-local
[SwitchC-Vsi-interface2] l3-vni 1000
[SwitchC-Vsi-interface2] quit
(5) 配置Switch D
# 開啟L2VPN能力。
<SwitchD> system-view
[SwitchD] l2vpn enable
# 關閉遠端MAC地址和遠端ND自動學習功能。
[SwitchD] vxlan tunnel mac-learning disable
[SwitchD] vxlan tunnel nd-learning disable
# 在VSI實例vpnb下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchD] vsi vpnb
[SwitchD-vsi-vpnb] evpn encapsulation vxlan
[SwitchD-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchD-vsi-vpnb-evpn-vxlan] vpn-target auto
[SwitchD-vsi-vpnb-evpn-vxlan] quit
# 創建VXLAN 20。
[SwitchD-vsi-vpnb] vxlan 20
[SwitchD-vsi-vpnb-vxlan-20] quit
[SwitchD-vsi-vpnb] quit
# 配置BGP發布EVPN路由。
[SwitchD] bgp 200
[SwitchD-bgp-default] router-id 4.4.4.4
[SwitchD-bgp-default] peer 3::3 as-number 200
[SwitchD-bgp-default] peer 3::3 connect-interface Loopback 0
[SwitchD-bgp-default] address-family l2vpn evpn
[SwitchD-bgp-default-evpn] peer 3::3 enable
[SwitchD-bgp-default-evpn] quit
[SwitchD-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例3000,該實例用來匹配VLAN 3的數據幀。
[SwitchD] interface twenty-fivegige 1/0/1
[SwitchD-Twenty-FiveGigE1/0/1] service-instance 3000
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] encapsulation s-vid 3
# 配置以太網服務實例1000與VSI實例vpnb關聯。
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] xconnect vsi vpnb
[SwitchD-Twenty-FiveGigE1/0/1-srv3000] quit
# 配置L3VNI的RD和RT。
[SwitchD] ip vpn-instance vpn1
[SwitchD-vpn-instance-vpn1] route-distinguisher 1:4
[SwitchD-vpn-instance-vpn1] address-family ipv6
[SwitchD-vpn-ipv6-vpn1] vpn-target 2:2
[SwitchD-vpn-ipv6-vpn1] quit
[SwitchD-vpn-instance-vpn1] address-family evpn
[SwitchD-vpn-evpn-vpn1] vpn-target 1:1
[SwitchD-vpn-evpn-vpn1] quit
[SwitchD-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchD] interface vsi-interface 1
[SwitchD-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface1] ipv6 address 20::1 64
[SwitchD-Vsi-interface1] mac-address 1-2-1
[SwitchD-Vsi-interface1] distributed-gateway local
[SwitchD-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchD] interface vsi-interface 2
[SwitchD-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface2] ipv6 address auto link-local
[SwitchD-Vsi-interface2] l3-vni 1000
[SwitchD-Vsi-interface2] quit
# 配置VXLAN 20所在的VSI實例和接口VSI-interface1關聯。
[SwitchD] vsi vpnb
[SwitchD-vsi-vpnb] gateway vsi-interface 1
[SwitchD-vsi-vpnb] quit
(1) 驗證ED(下文以Switch B為例,Switch C驗證方法與此類似)
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居Switch A和Switch C,並分別與其建立VXLAN隧道、VXLAN-DCI隧道。
[SwitchB] display evpn ipv6 auto-discovery macip-prefix
Destination IP : 1::1
Source IP : 2::2
L3VNI : 1000
Tunnel mode : VXLAN
OutInterface : Vsi-interface2
Destination IP : 3::3
Source IP : 2::2
L3VNI : 1000
Tunnel mode : VXLAN-DCI
OutInterface : Vsi-interface2
# 查看Switch B上的Tunnel接口信息,可以看到VXLAN模式和VXLAN-DCI模式的Tunnel接口處於up狀態。
[SwitchB] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2::2, destination 1::1
Tunnel protocol/transport UDP_VXLAN/IPv6
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel2 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 2::2, destination 3::3
Tunnel protocol/transport UDP_VXLAN-DCI/IPv6
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IPv6路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchB] display ipv6 routing-table vpn-instance vpn1
Destinations : 7 Routes : 7
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 10::/64 Protocol : BGP4+
NextHop : 1::1 Preference: 255
Interface : Vsi2 Cost : 0
Destination: 10::11/128 Protocol : BGP4+
NextHop : 1::1 Preference: 255
Interface : Vsi2 Cost : 0
Destination: 20::/64 Protocol : BGP4+
NextHop : 3::3 Preference: 255
Interface : Vsi2 Cost : 0
Destination: 20::22/128 Protocol : BGP4+
NextHop : 3::3 Preference: 255
Interface : Vsi2 Cost : 0
Destination: FE80::/10 Protocol : Direct
NextHop : :: Preference: 0
Interface : InLoop0 Cost : 0
Destination: FF00::/8 Protocol : Direct
NextHop : :: Preference: 0
Interface : NULL0
(2) 驗證主機
虛擬機VM 1、VM 2之間可以互訪。
本節僅以IPv4站點接入IPv4網絡為例,IPv4站點接入IPv6、IPv6站點接入IPv4網絡、IPv6站點接入IPv6網絡的配置與此類似。
Switch A為數據中心1的分布式網關,Switch G為數據中心2的分布式網關,Switch B作為路由反射器,Switch C和Switch D為數據中心1的雙ED設備,Switch F為數據中心2的ED設備,Switch E為連接兩個數據中心ED設備的DCI網絡設備。通過EVPN數據中心互連實現數據中心1和數據中心2的三層互通。
圖1-8 數據中心三層互聯支持雙ED配置組網圖
(1) 配置設備工作的硬件資源模式。
# 配置Switch A、Switch C、Switch D、Switch F和Switch G工作的硬件資源模式,並重啟設備。以Switch A為例,其他設備的配置方法與此相同。
[SwitchA] hardware-resource vxlan l3gw
Do you want to change the specified hardware resource working mode? [Y/N]:y
The hardware resource working mode is changed, please save the configuration and
reboot the system to make it effective.
[SwitchA] quit
<SwitchA> reboot
Start to check configuration with next startup configuration file, please wait..
.......DONE!
Current configuration may be lost after the reboot, save current configuration?
[Y/N]:y
This command will reboot the device. Continue? [Y/N]:y
(2) 配置IP地址和單播路由協議
# 在VM 1上指定網關地址為100.1.1.1;在VM 2上指定網關地址為100.1.2.1。(具體配置過程略)
# 配置各接口的IP地址和子網掩碼;配置OSPF協議,確保各交換機之間路由可達。(具體配置過程略)
(3) 配置Switch A
# 開啟L2VPN能力。
<SwitchA> system-view
[SwitchA] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchA] vxlan tunnel mac-learning disable
[SwitchA] vxlan tunnel arp-learning disable
# 在VSI實例vpna下創建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchA-vsi-vpna] evpn encapsulation vxlan
[SwitchA-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchA-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchA-vsi-vpna-evpn-vxlan] quit
[SwitchA-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchA] bgp 100
[SwitchA-bgp-default] peer 2.2.2.2 as-number 100
[SwitchA-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchA-bgp-default] address-family l2vpn evpn
[SwitchA-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchA-bgp-default-evpn] quit
[SwitchA-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 100的數據幀。
[SwitchA] interface twenty-fivegige 1/0/1
[SwitchA-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchA-Twenty-FiveGigE1/0/1] port trunk permit vlan 100
[SwitchA-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 100
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] quit
# 配置L3VNI的RD和RT。
[SwitchA] ip vpn-instance vpn1
[SwitchA-vpn-instance-vpn1] route-distinguisher 1:1
[SwitchA-vpn-instance-vpn1] address-family ipv4
[SwitchA-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchA-vpn-ipv4-vpn1] quit
[SwitchA-vpn-instance-vpn1] address-family evpn
[SwitchA-vpn-evpn-vpn1] vpn-target 1:1
[SwitchA-vpn-evpn-vpn1] quit
[SwitchA-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchA] interface vsi-interface 1
[SwitchA-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface1] ip address 100.1.1.1 255.255.255.0
[SwitchA-Vsi-interface1] mac-address 1-1-1
[SwitchA-Vsi-interface1] distributed-gateway local
[SwitchA-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchA] interface vsi-interface 2
[SwitchA-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface2] l3-vni 1000
[SwitchA-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] gateway vsi-interface 1
[SwitchA-vsi-vpna] quit
(4) 配置Switch B
# 配置BGP路由反射。
<SwitchB> system-view
[SwitchB] bgp 100
[SwitchB-bgp-default] group evpn internal
[SwitchB-bgp-default] peer evpn connect-interface loopback 0
[SwitchB-bgp-default] peer 1.1.1.1 group evpn
[SwitchB-bgp-default] peer 3.3.3.3 group evpn
[SwitchB-bgp-default] peer 4.4.4.4 group evpn
[SwitchB-bgp-default] address-family l2vpn evpn
[SwitchB-bgp-default-evpn] undo policy vpn-target
[SwitchB-bgp-default-evpn] peer evpn enable
[SwitchB-bgp-default-evpn] peer evpn reflect-client
[SwitchB-bgp-default-evpn] quit
(5) 配置Switch C
# 開啟L2VPN能力。
<SwitchC> system-view
[SwitchC] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchC] vxlan tunnel mac-learning disable
[SwitchC] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchC] interface twenty-fivegige 1/0/1
[SwitchC-Twenty-FiveGigE1/0/1] dci enable
[SwitchC-Twenty-FiveGigE1/0/1] quit
# 配置BGP發布EVPN路由,指定向Switch B發布路由時將路由下一跳修改為自身的地址,向Switch F發布路由、從Switch F接收路由並發布時修改Router MAC。
[SwitchC] bgp 100
[SwitchC-bgp-default] peer 6.6.6.6 as-number 200
[SwitchC-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchC-bgp-default] peer 6.6.6.6 ebgp-max-hop 64
[SwitchC-bgp-default] peer 2.2.2.2 as-number 100
[SwitchC-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchC-bgp-default] address-family l2vpn evpn
[SwitchC-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchC-bgp-default-evpn] peer 6.6.6.6 router-mac-local
[SwitchC-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchC-bgp-default-evpn] peer 2.2.2.2 next-hop-local
[SwitchC-bgp-default-evpn] quit
[SwitchC-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchC] ip vpn-instance vpn1
[SwitchC-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchC-vpn-instance-vpn1] address-family ipv4
[SwitchC-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchC-vpn-ipv4-vpn1] quit
[SwitchC-vpn-instance-vpn1] address-family evpn
[SwitchC-vpn-evpn-vpn1] vpn-target 1:1
[SwitchC-vpn-evpn-vpn1] quit
[SwitchC-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchC] interface vsi-interface 2
[SwitchC-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchC-Vsi-interface2] l3-vni 1000
[SwitchC-Vsi-interface2] mac-address 1-2-3
[SwitchC-Vsi-interface2] quit
# 配置ED的虛擬IP地址為接口LoopBack2的IP地址1.2.3.4,並配置通過OSPF發布該地址。
[SwitchC] evpn edge group 1.2.3.4
[SwitchC] interface loopback 2
[SwitchC-LoopBack2] ip address 1.2.3.4 32
[SwitchC-LoopBack2] quit
[SwitchC] ospf
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 1.2.3.4 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit
# 創建Monitor Link組,將與Switch E相連的物理接口、LoopBack0接口和LoopBack2接口加入到Monitor Link組,設置Monitor Link組下行接口的回切延時為90秒。
[SwitchC] undo monitor-link disable
[SwitchC] monitor-link group 1
[SwitchC-mtlk-group1] port twenty-fivegige 1/0/1 uplink
[SwitchC-mtlk-group1] port loopback 0 downlink
[SwitchC-mtlk-group1] port loopback 2 downlink
[SwitchC-mtlk-group1] downlink up-delay 90
[SwitchC-mtlk-group1] quit
(6) 配置Switch D
# 開啟L2VPN能力。
<SwitchD> system-view
[SwitchD] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchD] vxlan tunnel mac-learning disable
[SwitchD] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchD] interface twenty-fivegige 1/0/1
[SwitchD-Twenty-FiveGigE1/0/1] dci enable
[SwitchD-Twenty-FiveGigE1/0/1] quit
# 配置BGP發布EVPN路由,指定向Switch B發布路由時將路由下一跳修改為自身的地址,向Switch F發布路由、從Switch F接收路由並發布時修改Router MAC。
[SwitchD] bgp 100
[SwitchD-bgp-default] peer 6.6.6.6 as-number 200
[SwitchD-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchD-bgp-default] peer 6.6.6.6 ebgp-max-hop 64
[SwitchD-bgp-default] peer 2.2.2.2 as-number 100
[SwitchD-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchD-bgp-default] address-family l2vpn evpn
[SwitchD-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchD-bgp-default-evpn] peer 6.6.6.6 router-mac-local
[SwitchD-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchD-bgp-default-evpn] peer 2.2.2.2 next-hop-local
[SwitchD-bgp-default-evpn] quit
[SwitchD-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchD] ip vpn-instance vpn1
[SwitchD-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchD-vpn-instance-vpn1] address-family ipv4
[SwitchD-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchD-vpn-ipv4-vpn1] quit
[SwitchD-vpn-instance-vpn1] address-family evpn
[SwitchD-vpn-evpn-vpn1] vpn-target 1:1
[SwitchD-vpn-evpn-vpn1] quit
[SwitchD-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchD] interface vsi-interface 2
[SwitchD-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface2] l3-vni 1000
[SwitchD-Vsi-interface2] mac-address 1-2-3
[SwitchD-Vsi-interface2] quit
# 配置ED的虛擬IP地址為接口LoopBack2的IP地址1.2.3.4,並配置通過OSPF發布該地址。
[SwitchD] evpn edge group 1.2.3.4
[SwitchD] interface loopback 2
[SwitchD-LoopBack2] ip address 1.2.3.4 32
[SwitchD-LoopBack2] quit
[SwitchD] ospf
[SwitchD-ospf-1] area 0
[SwitchD-ospf-1-area-0.0.0.0] network 1.2.3.4 0.0.0.0
[SwitchD-ospf-1-area-0.0.0.0] quit
[SwitchD-ospf-1] quit
# 創建Monitor Link組,將與Switch E相連的物理接口、LoopBack0接口和LoopBack2接口加入到Monitor Link組,設置Monitor Link組下行接口的回切延時為90秒。
[SwitchD] undo monitor-link disable
[SwitchD] monitor-link group 1
[SwitchD-mtlk-group1] port twenty-fivegige 1/0/1 uplink
[SwitchD-mtlk-group1] port loopback 0 downlink
[SwitchD-mtlk-group1] port loopback 2 downlink
[SwitchD-mtlk-group1] downlink up-delay 90
[SwitchD-mtlk-group1] quit
(7) 配置Switch F
# 開啟L2VPN能力。
<SwitchF> system-view
[SwitchF] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchF] vxlan tunnel mac-learning disable
[SwitchF] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道
[SwitchF] interface twenty-fivegige 1/0/1
[SwitchF-Twenty-FiveGigE1/0/1] dci enable
[SwitchF-Twenty-FiveGigE1/0/1] quit
# 配置BGP發布EVPN路由,指定向Switch G發布路由時將路由下一跳修改為自身的地址,向Switch C和Switch D發布路由、從Switch C和Switch D接收路由並發布時修改Router MAC。
[SwitchF] bgp 200
[SwitchF-bgp-default] peer 3.3.3.3 as-number 100
[SwitchF-bgp-default] peer 3.3.3.3 connect-interface loopback 0
[SwitchF-bgp-default] peer 3.3.3.3 ebgp-max-hop 64
[SwitchF-bgp-default] peer 4.4.4.4 as-number 100
[SwitchF-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[SwitchF-bgp-default] peer 4.4.4.4 ebgp-max-hop 64
[SwitchF-bgp-default] peer 7.7.7.7 as-number 200
[SwitchF-bgp-default] peer 7.7.7.7 connect-interface loopback 0
[SwitchF-bgp-default] address-family l2vpn evpn
[SwitchF-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchF-bgp-default-evpn] peer 3.3.3.3 router-mac-local
[SwitchF-bgp-default-evpn] peer 4.4.4.4 enable
[SwitchF-bgp-default-evpn] peer 4.4.4.4 router-mac-local
[SwitchF-bgp-default-evpn] peer 7.7.7.7 enable
[SwitchF-bgp-default-evpn] peer 7.7.7.7 next-hop-local
[SwitchF-bgp-default-evpn] quit
[SwitchF-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchF] ip vpn-instance vpn1
[SwitchF-vpn-instance-vpn1] route-distinguisher 1:4
[SwitchF-vpn-instance-vpn1] address-family ipv4
[SwitchF-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchF-vpn-ipv4-vpn1] quit
[SwitchF-vpn-instance-vpn1] address-family evpn
[SwitchF-vpn-evpn-vpn1] vpn-target 1:1
[SwitchF-vpn-evpn-vpn1] quit
[SwitchF-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchF] interface vsi-interface 2
[SwitchF-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchF-Vsi-interface2] l3-vni 1000
[SwitchF-Vsi-interface2] quit
(8) 配置Switch G
# 開啟L2VPN能力。
<SwitchG> system-view
[SwitchG] l2vpn enable
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchG] vxlan tunnel mac-learning disable
[SwitchG] vxlan tunnel arp-learning disable
# 在VSI實例vpnb下創建VXLAN 20。
[SwitchG] vsi vpnb
[SwitchG-vsi-vpnb] vxlan 20
[SwitchG-vsi-vpnb-vxlan-20] quit
# 在VSI實例vpnb下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchG-vsi-vpnb] evpn encapsulation vxlan
[SwitchG-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchG-vsi-vpnb-evpn-vxlan] vpn-target auto
[SwitchG-vsi-vpnb-evpn-vxlan] quit
[SwitchG-vsi-vpnb] quit
# 配置BGP發布EVPN路由。
[SwitchG] bgp 200
[SwitchG-bgp-default] peer 6.6.6.6 as-number 200
[SwitchG-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchG-bgp-default] address-family l2vpn evpn
[SwitchG-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchG-bgp-default-evpn] quit
[SwitchG-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例2000,該實例用來匹配VLAN 200的數據幀。
[SwitchG] interface twenty-fivegige 1/0/1
[SwitchG-Twenty-FiveGigE1/0/1] port link-type trunk
[SwitchG-Twenty-FiveGigE1/0/1] port trunk permit vlan 200
[SwitchG-Twenty-FiveGigE1/0/1] service-instance 2000
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] encapsulation s-vid 200
# 配置以太網服務實例2000與VSI實例vpnb關聯。
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] xconnect vsi vpnb
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] quit
# 配置L3VNI的RD和RT。
[SwitchG] ip vpn-instance vpn1
[SwitchG-vpn-instance-vpn1] route-distinguisher 1:5
[SwitchG-vpn-instance-vpn1] address-family ipv4
[SwitchG-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchG-vpn-ipv4-vpn1] quit
[SwitchG-vpn-instance-vpn1] address-family evpn
[SwitchG-vpn-evpn-vpn1] vpn-target 1:1
[SwitchG-vpn-evpn-vpn1] quit
[SwitchG-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchG] interface vsi-interface 1
[SwitchG-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchG-Vsi-interface1] ip address 100.1.2.1 255.255.255.0
[SwitchG-Vsi-interface1] mac-address 2-2-2
[SwitchG-Vsi-interface1] distributed-gateway local
[SwitchG-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchG] interface vsi-interface 2
[SwitchG-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchG-Vsi-interface2] l3-vni 1000
[SwitchG-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchG] vsi vpnb
[SwitchG-vsi-vpnb] gateway vsi-interface 1
[SwitchG-vsi-vpnb] quit
(1) 驗證ED(下文以Switch C為例,Switch D驗證方法與此類似)
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居Switch A和Switch F,並分別與其建立VXLAN隧道、VXLAN-DCI隧道。
[SwitchC] display evpn auto-discovery macip-prefix
Destination IP Source IP L3VNI Tunnel mode OutInterface
1.1.1.1 1.2.3.4 1000 VXLAN Vsi-interface2
6.6.6.6 1.2.3.4 1000 VXLAN-DCI Vsi-interface2
# 查看Switch C上的Tunnel接口信息,可以看到VXLAN模式和VXLAN-DCI模式的Tunnel接口處於up狀態。
[SwitchC] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.2.3.4, destination 1.1.1.1
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.2.3.4, destination 6.6.6.6
Tunnel protocol/transport UDP_VXLAN-DCI/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IP路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchC] display ip routing-table vpn-instance vpn1
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost NextHop Interface
100.1.1.0/24 BGP 255 0 1.1.1.1 Vsi2
100.1.1.10/32 BGP 255 0 1.1.1.1 Vsi2
100.1.2.0/24 BGP 255 0 6.6.6.6 Vsi2
100.1.2.20/32 BGP 255 0 6.6.6.6 Vsi2
(2) 驗證Switch A
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居ED(Switch C和Switch D組成的虛擬ED),並與其建立VXLAN隧道。
[SwitchA] display evpn auto-discovery macip-prefix
Destination IP Source IP L3VNI Tunnel mode OutInterface
1.2.3.4 1.1.1.1 1000 VXLAN Vsi-interface2
# 查看Switch A上的Tunnel接口信息,可以看到VXLAN模式的Tunnel接口處於up狀態。
[SwitchA] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 1.2.3.4
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IP路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchA] display ip routing-table vpn-instance vpn1
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost NextHop Interface
100.1.2.0/24 BGP 255 0 1.2.3.4 Vsi2
100.1.2.10/32 BGP 255 0 1.2.3.4 Vsi2
(3) 驗證主機
虛擬機VM 1、VM 2之間可以互訪。當Switch C或Switch D出現故障後,VM 1、VM 2之間仍然可以互訪。
Switch A為數據中心1的分布式網關;Switch G為數據中心2的分布式網關;Switch B作為數據中心1的路由反射器;Switch C和Switch D為數據中心1的ED設備,在Switch C和Switch D上配置M-LAG,實現ED設備的備份;Switch F為數據中心2的ED設備;Switch E為連接兩個數據中心ED設備的DCI網絡設備。通過EVPN數據中心互連實現數據中心1和數據中心2的三層互通。
圖1-9 數據中心三層互聯支持M-LAG組網圖
產品特有說明-數據中心三層互聯雙ED配置舉例(交換應用)
(1) 配置設備工作的硬件資源模式。
# 配置Switch A、Switch B、Switch C、Switch D、Switch F和Switch G工作的硬件資源模式,並重啟設備。以Switch A為例,其他設備的配置方法與此相同。
[SwitchA] hardware-resource vxlan l3gw
Do you want to change the specified hardware resource working mode? [Y/N]:y
The hardware resource working mode is changed, please save the configuration and
reboot the system to make it effective.
[SwitchA] quit
<SwitchA> reboot
Start to check configuration with next startup configuration file, please wait..
.......DONE!
Current configuration may be lost after the reboot, save current configuration?
[Y/N]:y
This command will reboot the device. Continue? [Y/N]:y
(2) 配置IP地址和單播路由協議
# 在VM 1上指定網關地址為100.1.1.1;在VM 2上指定網關地址為100.1.2.1。(具體配置過程略)
# 配置各接口的IP地址和子網掩碼;配置OSPF協議,確保各交換機之間路由可達。(具體配置過程略)
(3) 配置Switch A
# 開啟L2VPN能力。
<SwitchA> system-view
[SwitchA] l2vpn enable
產品特有說明-數據中心互聯支持雙ED配置舉例-SwitchA硬件資源模式
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchA] vxlan tunnel mac-learning disable
[SwitchA] vxlan tunnel arp-learning disable
# 在VSI實例vpna下創建VXLAN 10。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] vxlan 10
[SwitchA-vsi-vpna-vxlan-10] quit
# 在VSI實例vpna下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchA-vsi-vpna] evpn encapsulation vxlan
[SwitchA-vsi-vpna-evpn-vxlan] route-distinguisher auto
[SwitchA-vsi-vpna-evpn-vxlan] vpn-target auto
[SwitchA-vsi-vpna-evpn-vxlan] quit
[SwitchA-vsi-vpna] quit
# 配置BGP發布EVPN路由。
[SwitchA] bgp 100
[SwitchA-bgp-default] peer 2.2.2.2 as-number 100
[SwitchA-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchA-bgp-default] address-family l2vpn evpn
[SwitchA-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchA-bgp-default-evpn] quit
[SwitchA-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例1000,該實例用來匹配VLAN 100的數據幀。
[SwitchA] interface twenty-fivegige 1/0/1
產品特有說明-數據中心三層互聯雙ED配置舉例-Switch A Permit VLAN
[SwitchA-Twenty-FiveGigE1/0/1] service-instance 1000
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] encapsulation s-vid 100
# 配置以太網服務實例1000與VSI實例vpna關聯。
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] xconnect vsi vpna
[SwitchA-Twenty-FiveGigE1/0/1-srv1000] quit
# 配置L3VNI的RD和RT。
[SwitchA] ip vpn-instance vpn1
[SwitchA-vpn-instance-vpn1] route-distinguisher 1:1
[SwitchA-vpn-instance-vpn1] address-family ipv4
[SwitchA-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchA-vpn-ipv4-vpn1] quit
[SwitchA-vpn-instance-vpn1] address-family evpn
[SwitchA-vpn-evpn-vpn1] vpn-target 1:1
[SwitchA-vpn-evpn-vpn1] quit
[SwitchA-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchA] interface vsi-interface 1
[SwitchA-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface1] ip address 100.1.1.1 255.255.255.0
[SwitchA-Vsi-interface1] mac-address 1-1-1
[SwitchA-Vsi-interface1] distributed-gateway local
[SwitchA-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchA] interface vsi-interface 2
[SwitchA-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchA-Vsi-interface2] l3-vni 1000
[SwitchA-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchA] vsi vpna
[SwitchA-vsi-vpna] gateway vsi-interface 1
[SwitchA-vsi-vpna] quit
(4) 配置Switch B
# 配置BGP路由反射。
<SwitchB> system-view
[SwitchB] bgp 100
[SwitchB-bgp-default] group evpn internal
[SwitchB-bgp-default] peer evpn connect-interface loopback 0
[SwitchB-bgp-default] peer 1.1.1.1 group evpn
[SwitchB-bgp-default] peer 3.3.3.3 group evpn
[SwitchB-bgp-default] peer 4.4.4.4 group evpn
[SwitchB-bgp-default] address-family l2vpn evpn
[SwitchB-bgp-default-evpn] undo policy vpn-target
[SwitchB-bgp-default-evpn] peer evpn enable
[SwitchB-bgp-default-evpn] peer evpn reflect-client
[SwitchB-bgp-default-evpn] quit
(5) 配置Switch C
# 開啟L2VPN能力。
<SwitchC> system-view
[SwitchC] l2vpn enable
產品特有說明-雙ED-SwitchC配置硬件資源模式
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchC] vxlan tunnel mac-learning disable
[SwitchC] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchC] interface vlan-interface 13
[SwitchC-Vlan-interface13] dci enable
[SwitchC-Vlan-interface13] quit
# 開啟EVPN M-LAG功能,並配置虛擬VTEP地址為1.2.3.4。
[SwitchA] evpn m-lag group 1.2.3.4
# 配置M-LAG係統。
[SwitchC] m-lag system-mac 0001-0001-0001
[SwitchC] m-lag system-number 1
[SwitchC] m-lag system-priority 10
[SwitchC] m-lag keepalive ip destination 60.1.1.1 source 60.1.1.2
[SwitchC] m-lag restore-delay 180
# 創建二層聚合接口3,並配置該接口為動態聚合模式。
[SwitchC] interface bridge-aggregation 3
[SwitchC-Bridge-Aggregation3] link-aggregation mode dynamic
[SwitchC-Bridge-Aggregation3] quit
# 將端口Twenty-FiveGigE1/0/3加入到聚合組3中。
[SwitchC] interface twenty-fivegige 1/0/3
[SwitchC-Twenty-FiveGigE1/0/3] port link-aggregation group 3
[SwitchC-Twenty-FiveGigE1/0/3] quit
# 將二層聚合接口3配置為peer-link接口。
[SwitchC] interface bridge-aggregation 3
[SwitchC-Bridge-Aggregation3] port m-lag peer-link 1
[SwitchC-Bridge-Aggregation3] quit
# 配置BGP發布EVPN路由,指定向Switch B發布路由時將路由下一跳修改為自身的地址,向Switch F發布路由、從Switch F接收路由並發布時修改Router MAC。
[SwitchC] bgp 100
[SwitchC-bgp-default] peer 6.6.6.6 as-number 200
[SwitchC-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchC-bgp-default] peer 6.6.6.6 ebgp-max-hop 64
[SwitchC-bgp-default] peer 2.2.2.2 as-number 100
[SwitchC-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchC-bgp-default] address-family l2vpn evpn
[SwitchC-bgp-default-evpn] nexthop evpn-m-lag group-address
[SwitchC-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchC-bgp-default-evpn] peer 6.6.6.6 router-mac-local
[SwitchC-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchC-bgp-default-evpn] peer 2.2.2.2 next-hop-local
[SwitchC-bgp-default-evpn] quit
[SwitchC-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchC] ip vpn-instance vpn1
[SwitchC-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchC-vpn-instance-vpn1] address-family ipv4
[SwitchC-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchC-vpn-ipv4-vpn1] quit
[SwitchC-vpn-instance-vpn1] address-family evpn
[SwitchC-vpn-evpn-vpn1] vpn-target 1:1
[SwitchC-vpn-evpn-vpn1] quit
[SwitchC-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchC] interface vsi-interface 2
[SwitchC-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchC-Vsi-interface2] l3-vni 1000
[SwitchC-Vsi-interface2] mac-address 1-2-3
[SwitchC-Vsi-interface2] quit
# 創建Monitor Link組,將與Switch E相連的物理接口、LoopBack0接口和LoopBack2接口加入到Monitor Link組,設置Monitor Link組下行接口的回切延時為90秒。
[SwitchC] undo monitor-link disable
[SwitchC] monitor-link group 1
[SwitchC-mtlk-group1] port twenty-fivegige 1/0/1 uplink
[SwitchC-mtlk-group1] port loopback 0 downlink
[SwitchC-mtlk-group1] port loopback 2 downlink
[SwitchC-mtlk-group1] downlink up-delay 90
[SwitchC-mtlk-group1] quit
(6) 配置Switch D
# 開啟L2VPN能力。
<SwitchD> system-view
[SwitchD] l2vpn enable
產品特有說明-雙ED-SwitchD-配置硬件資源模式
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchD] vxlan tunnel mac-learning disable
[SwitchD] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道。
[SwitchD] interface vlan-interface 14
[SwitchD-Vlan-interface14] dci enable
[SwitchD-Vlan-interface14] quit
# 開啟EVPN的M-LAG模式,並配置虛擬VTEP地址為1.2.3.4。
[SwitchD] evpn m-lag group 1.2.3.4
# 配置M-LAG係統。
[SwitchD] m-lag system-mac 0001-0001-0001
[SwitchD] m-lag system-number 2
[SwitchD] m-lag system-priority 10
[SwitchD] m-lag keepalive ip destination 60.1.1.1 source 60.1.1.2
[SwitchD] m-lag restore-delay 180
# 創建二層聚合接口3,並配置該接口為動態聚合模式。
[SwitchD] interface bridge-aggregation 3
[SwitchD-Bridge-Aggregation3] link-aggregation mode dynamic
[SwitchD-Bridge-Aggregation3] quit
# 將端口Twenty-FiveGigE1/0/3加入到聚合組3中。
[SwitchD] interface twenty-fivegige 1/0/3
[SwitchD-Twenty-FiveGigE1/0/3] port link-aggregation group 3
[SwitchD-Twenty-FiveGigE1/0/3] quit
# 將二層聚合接口3配置為peer-link接口。
[SwitchD] interface bridge-aggregation 3
[SwitchD-Bridge-Aggregation3] port m-lag peer-link 1
[SwitchD-Bridge-Aggregation3] quit
# 配置BGP發布EVPN路由,指定向Switch B發布路由時將路由下一跳修改為自身的地址,向Switch F發布路由、從Switch F接收路由並發布時修改Router MAC。
[SwitchD] bgp 100
[SwitchD-bgp-default] peer 6.6.6.6 as-number 200
[SwitchD-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchD-bgp-default] peer 6.6.6.6 ebgp-max-hop 64
[SwitchD-bgp-default] peer 2.2.2.2 as-number 100
[SwitchD-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[SwitchD-bgp-default] address-family l2vpn evpn
[SwitchD-bgp-default-evpn] nexthop evpn-m-lag group-address
[SwitchD-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchD-bgp-default-evpn] peer 6.6.6.6 router-mac-local
[SwitchD-bgp-default-evpn] peer 2.2.2.2 enable
[SwitchD-bgp-default-evpn] peer 2.2.2.2 next-hop-local
[SwitchD-bgp-default-evpn] quit
[SwitchD-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchD] ip vpn-instance vpn1
[SwitchD-vpn-instance-vpn1] route-distinguisher 1:2
[SwitchD-vpn-instance-vpn1] address-family ipv4
[SwitchD-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchD-vpn-ipv4-vpn1] quit
[SwitchD-vpn-instance-vpn1] address-family evpn
[SwitchD-vpn-evpn-vpn1] vpn-target 1:1
[SwitchD-vpn-evpn-vpn1] quit
[SwitchD-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchD] interface vsi-interface 2
[SwitchD-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchD-Vsi-interface2] l3-vni 1000
[SwitchD-Vsi-interface2] mac-address 1-2-3
[SwitchD-Vsi-interface2] quit
# 創建Monitor Link組,將與Switch E相連的物理接口、LoopBack0接口和LoopBack2接口加入到Monitor Link組,設置Monitor Link組下行接口的回切延時為90秒。
[SwitchD] undo monitor-link disable
[SwitchD] monitor-link group 1
[SwitchD-mtlk-group1] port twenty-fivegige 1/0/1 uplink
[SwitchD-mtlk-group1] port loopback 0 downlink
[SwitchD-mtlk-group1] port loopback 2 downlink
[SwitchD-mtlk-group1] downlink up-delay 90
[SwitchD-mtlk-group1] quit
(7) 配置Switch F
# 開啟L2VPN能力。
<SwitchF> system-view
[SwitchF] l2vpn enable
產品特有說明-雙ED-SwitchF-配置硬件資源模式
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchF] vxlan tunnel mac-learning disable
[SwitchF] vxlan tunnel arp-learning disable
# 在與Switch E相連的三層接口上使能DCI功能,以便EVPN自動建立VXLAN-DCI隧道
[SwitchF] interface vlan-interface 15
[SwitchF-Vlan-interface15] dci enable
[SwitchF-Vlan-interface15] quit
# 配置BGP發布EVPN路由,指定向Switch G發布路由時將路由下一跳修改為自身的地址,向Switch C和Switch D發布路由、從Switch C和Switch D接收路由並發布時修改Router MAC。
[SwitchF] bgp 200
[SwitchF-bgp-default] peer 3.3.3.3 as-number 100
[SwitchF-bgp-default] peer 3.3.3.3 connect-interface loopback 0
[SwitchF-bgp-default] peer 3.3.3.3 ebgp-max-hop 64
[SwitchF-bgp-default] peer 4.4.4.4 as-number 100
[SwitchF-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[SwitchF-bgp-default] peer 4.4.4.4 ebgp-max-hop 64
[SwitchF-bgp-default] peer 7.7.7.7 as-number 200
[SwitchF-bgp-default] peer 7.7.7.7 connect-interface loopback 0
[SwitchF-bgp-default] address-family l2vpn evpn
[SwitchF-bgp-default-evpn] peer 3.3.3.3 enable
[SwitchF-bgp-default-evpn] peer 3.3.3.3 router-mac-local
[SwitchF-bgp-default-evpn] peer 4.4.4.4 enable
[SwitchF-bgp-default-evpn] peer 4.4.4.4 router-mac-local
[SwitchF-bgp-default-evpn] peer 7.7.7.7 enable
[SwitchF-bgp-default-evpn] peer 7.7.7.7 next-hop-local
[SwitchF-bgp-default-evpn] quit
[SwitchF-bgp-default] quit
# 配置L3VNI的RD和RT。
[SwitchF] ip vpn-instance vpn1
[SwitchF-vpn-instance-vpn1] route-distinguisher 1:4
[SwitchF-vpn-instance-vpn1] address-family ipv4
[SwitchF-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchF-vpn-ipv4-vpn1] quit
[SwitchF-vpn-instance-vpn1] address-family evpn
[SwitchF-vpn-evpn-vpn1] vpn-target 1:1
[SwitchF-vpn-evpn-vpn1] quit
[SwitchF-vpn-instance-vpn1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchF] interface vsi-interface 2
[SwitchF-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchF-Vsi-interface2] l3-vni 1000
[SwitchF-Vsi-interface2] quit
(8) 配置Switch G
# 開啟L2VPN能力。
<SwitchG> system-view
[SwitchG] l2vpn enable
產品特有說明-數據中心三層互聯支持雙ED-SwitchG配置硬件資源模式
# 關閉遠端MAC地址和遠端ARP自動學習功能。
[SwitchG] vxlan tunnel mac-learning disable
[SwitchG] vxlan tunnel arp-learning disable
# 在VSI實例vpnb下創建VXLAN 20。
[SwitchG] vsi vpnb
[SwitchG-vsi-vpnb] vxlan 20
[SwitchG-vsi-vpnb-vxlan-20] quit
# 在VSI實例vpnb下創建EVPN實例,並配置自動生成EVPN實例的RD和RT。
[SwitchG-vsi-vpnb] evpn encapsulation vxlan
[SwitchG-vsi-vpnb-evpn-vxlan] route-distinguisher auto
[SwitchG-vsi-vpnb-evpn-vxlan] vpn-target auto
[SwitchG-vsi-vpnb-evpn-vxlan] quit
[SwitchG-vsi-vpnb] quit
# 配置BGP發布EVPN路由。
[SwitchG] bgp 200
[SwitchG-bgp-default] peer 6.6.6.6 as-number 200
[SwitchG-bgp-default] peer 6.6.6.6 connect-interface loopback 0
[SwitchG-bgp-default] address-family l2vpn evpn
[SwitchG-bgp-default-evpn] peer 6.6.6.6 enable
[SwitchG-bgp-default-evpn] quit
[SwitchG-bgp-default] quit
# 在接入服務器的接口Twenty-FiveGigE1/0/1上創建以太網服務實例2000,該實例用來匹配VLAN 200的數據幀。
[SwitchG] interface twenty-fivegige 1/0/1
產品特有說明-數據中心三層互聯雙ED配置舉例-Switch G Permit VLAN
[SwitchG-Twenty-FiveGigE1/0/1] service-instance 2000
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] encapsulation s-vid 200
# 配置以太網服務實例2000與VSI實例vpnb關聯。
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] xconnect vsi vpnb
[SwitchG-Twenty-FiveGigE1/0/1-srv2000] quit
# 配置L3VNI的RD和RT。
[SwitchG] ip vpn-instance vpn1
[SwitchG-vpn-instance-vpn1] route-distinguisher 1:4
[SwitchG-vpn-instance-vpn1] address-family ipv4
[SwitchG-vpn-ipv4-vpn1] vpn-target 2:2
[SwitchG-vpn-ipv4-vpn1] quit
[SwitchG-vpn-instance-vpn1] address-family evpn
[SwitchG-vpn-evpn-vpn1] vpn-target 1:1
[SwitchG-vpn-evpn-vpn1] quit
[SwitchG-vpn-instance-vpn1] quit
# 配置VSI虛接口VSI-interface1。
[SwitchG] interface vsi-interface 1
[SwitchG-Vsi-interface1] ip binding vpn-instance vpn1
[SwitchG-Vsi-interface1] ip address 100.1.2.1 255.255.255.0
[SwitchG-Vsi-interface1] mac-address 2-2-2
[SwitchG-Vsi-interface1] distributed-gateway local
[SwitchG-Vsi-interface1] quit
# 創建VSI虛接口VSI-interface2,在該接口上配置VPN實例vpn1對應的L3VNI為1000。
[SwitchG] interface vsi-interface 2
[SwitchG-Vsi-interface2] ip binding vpn-instance vpn1
[SwitchG-Vsi-interface2] l3-vni 1000
[SwitchG-Vsi-interface2] quit
# 配置VXLAN 10所在的VSI實例和接口VSI-interface1關聯。
[SwitchG] vsi vpnb
[SwitchG-vsi-vpnb] gateway vsi-interface 1
[SwitchG-vsi-vpnb] quit
(1) 驗證ED(下文以Switch C為例,Switch D驗證方法與此類似)
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居Switch A和Switch F,並分別與其建立VXLAN隧道、VXLAN-DCI隧道。
[SwitchC] display evpn auto-discovery macip-prefix
Destination IP Source IP L3VNI Tunnel mode OutInterface
1.1.1.1 3.3.3.3 1000 VXLAN Vsi-interface2
6.6.6.6 3.3.3.3 1000 VXLAN-DCI Vsi-interface2
# 查看Switch C上的Tunnel接口信息,可以看到VXLAN模式和VXLAN-DCI模式的Tunnel接口處於up狀態。
[SwitchC] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.2.3.4, destination 1.1.1.1
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.2.3.4, destination 6.6.6.6
Tunnel protocol/transport UDP_VXLAN-DCI/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IP路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchC] display ip routing-table vpn-instance vpn1
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost NextHop Interface
100.1.1.0/24 BGP 255 0 1.1.1.1 Vsi2
100.1.1.10/32 BGP 255 0 1.1.1.1 Vsi2
100.1.2.0/24 BGP 255 0 6.6.6.6 Vsi2
100.1.2.20/32 BGP 255 0 6.6.6.6 Vsi2
(2) 驗證Switch A
# 查看EVPN通過BGP自動發現的鄰居信息,可以看到EVPN通過MAC/IP發布路由或IP前綴路由發現鄰居ED(Switch C和Switch D組成的虛擬ED),並與其建立VXLAN隧道。
[SwitchA] display evpn auto-discovery macip-prefix
Destination IP Source IP L3VNI Tunnel mode OutInterface
1.2.3.4 1.1.1.1 1000 VXLAN Vsi-interface2
# 查看Switch A上的Tunnel接口信息,可以看到VXLAN模式的Tunnel接口處於up狀態。
[SwitchA] display interface tunnel
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64 kbps
Maximum transmission unit: 1464
Internet protocol processing: Disabled
Last clearing of counters: Never
Tunnel source 1.1.1.1, destination 1.2.3.4
Tunnel protocol/transport UDP_VXLAN/IP
Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看VPN實例vpn1的IP路由表項,可以看到已經學習到虛擬機的IP路由信息。
[SwitchA] display ip routing-table vpn-instance vpn1
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost NextHop Interface
100.1.2.0/24 BGP 255 0 1.2.3.4 Vsi2
100.1.2.10/32 BGP 255 0 1.2.3.4 Vsi2
(3) 驗證主機
虛擬機VM 1、VM 2之間可以互訪。當Switch C或Switch D出現故障後,VM 1、VM 2之間仍然可以互訪。
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!