簡介
本檔案介紹Catalyst 9000系列交換器上EVPN中BGP VRF自動RD和自動RT的EVPN簡化CLI。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本文中的資訊係根據以下軟體和硬體版本:
- Catalyst 9300
- Catalyst 9400
- Catalyst 9500
- Catalyst 9600
- Cisco IOS® XE 17.12.1及更高版本
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
第3層EVPN部署涉及具有許多配置選項的VRF配置,包括但不限於路由區分器(RD)和路由目標(RT)。
- 在引入BGP VRF自動RD自動RT功能之前,需要至少5條配置線路(1條用於RD,4條用於RT)來設定特定的VRF以供BGP EVPN使用。
- 使用BGP VRF Auto RD Auto RT時,這只能透過2條線路實現(如果啟用了全局VRF rd-auto,則每個VRF可能會有一條線路)。
- 自動RD和靜態RD在功能上沒有任何差異。每個RD在一個給定的路由器或交換機內必須是唯一的。
- Auto RT和靜態RT之間的功能區別在於,Auto RT對於導入和導出、常規和裝訂只為一個且相同,而靜態RT可以配置為零對多。
- 此外,自動RT也可以與任何特定VRF中的靜態RT共存(在此功能之前,您可以在現有靜態RT之外額外配置Auto RT)。
自動RD將由BGP路由器ID加上內部生成的唯一編號組成,例如,如果BGP路由器ID為192.168.1.1,則自動RD將為「192.168.1.1:1」。
- 自動RT將包含BGP AS編號和正在配置的vnid。例如:如果BGP AS編號為65000,而vnid配置為123,則自動RT將為「65000:123」。
- 這適用於匯入和匯出、一般和縫合路由目標。
- 如果BGP AS為4位元組,則改用AS_TRANS,即23456。
簡化配置的能力對於部署的可行性是非常理想的(如果不是必要的話),並且已廣泛用於BGP EVPN交換矩陣。此功能對於EVPN是理想的,因為它有助於避免在脊柱-枝葉拓撲中編寫和維護廣泛而複雜的配置,其中許多VRF是在特定枝葉中配置的。
技術
VRF |
虛擬路由轉送 |
定義與其他VRF和全局IPv4/IPv6路由域分開的第3層路由域 |
AF |
地址系列 |
定義BGP處理的型別字首和路由資訊 |
AS |
自治系統 |
屬於某個網路或網路集合的一組網際網路可路由IP字首,它們全部由單個實體或組織管理、控制和監督 |
RD |
路由區分器 |
允許BGP區分不同VRF中的一個字首和另一個字首 |
RT |
路由目標 |
路由目標用於限制路由更新。確定裝置允許導入的字首 |
EVPN |
乙太網路虛擬私人網路 |
允許BGP傳輸第2層MAC和第3層IP資訊的擴展是EVPN和 使用多重通訊協定邊界閘道通訊協定(MP-BGP)作為通訊協定,以分配屬於VXLAN重疊網路的可達性資訊。 |
VXLAN |
虛擬可擴充LAN (區域網路) |
VXLAN的用途是克服VLAN和STP的固有限制。建議的IETF標準[RFC 7348]可提供與VLAN相同的乙太網第2層網路服務,但具有更高的靈活性。從功能上講,它是UDP內MAC封裝協定,在第3層底層網路上作為虛擬重疊運行。 |
設定
全局VRF RD-auto
Leaf-01#sh run | include vrf rd-auto
vrf rd-auto <-- Enable Auto RD for all the VRFs
Leaf-01#sh run | section vrf definition blue
vrf definition blue
vnid 123 evpn-instance <-- Enable Auto RT
!
address-family ipv4 <-- address-family needs to be specified
route-target 100:123 <-- Optionally can have static route-target as required
exit-address-family
!
每個VRF rd-auto配置
Leaf-01#sh run | section vrf definition green
vrf definition green
rd-auto <-- Enable Auto RD for this VRF green
vnid 35 evpn-instance <-- Enable Auto RT
!
address-family ipv4 <-- address-family needs to be specified
exit-address-family
!
address-family ipv6
exit-address-family
註:不同的VRF可以有靜態和自動RD,但如果首先分配了自動RD,則靜態RD的實際值不能與自動RD相同。
提示:當前刪除靜態RD將刪除VRF中配置的路由目標配置,以及BGP IPv4和/或IPv6 VRF地址系列(以及下面關聯的配置)。 因此,刪除自動RD會有類似行為。 除非絕對必要,否則建議不要觸發RD刪除。 更改RD(即刪除現有RD,靜態或自動,然後增加新的RD,靜態或自動,成本高且需要延遲時間命令才能通過)
混合靜態RD和自動RD
vrf rd-auto
vrf definition green <-- This VRF green uses auto RD
vnid 35 evpn-instance
!
address-family ipv6
exit-address-family
vrf definition red <-- This VRF red uses static RD
rd-auto disable
rd 100:1
!
address-family ipv4
route-target export 100:1
route-target import 100:1
route-target export 100:1 stitching
route-target import 100:1 stitching
exit-address-family
BGP地址系列IPv4 Vrf和Ipv6 Vrf
(此配置示例是對現有功能的總結)
Leaf-01#show run | sec r bgp
router bgp 65000 <-- Required for Auto RT
bgp router-id 192.168.1.1 <-- Required for Auto RD
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 192.168.1.2 remote-as 65000
neighbor 192.168.1.2 update-source Loopback0
neighbor 192.168.1.3 remote-as 65001
neighbor 192.168.1.3 update-source Loopback0
!
address-family ipv4 vrf green
advertise l2vpn evpn
redistributed connected
exit-address-family
!
address-family ipv6 vrf green
advertise l2vpn evpn
redistribute connected
exit-address-family
注意:其他主幹路由反射器的配置是相同的,因此本節不會重複進行此操作
注意:其他EVPN枝葉可以使用靜態RD或RT配置。只要RT匹配,EVPN字首就可以相互導入/導出。
驗證
分葉
驗證枝葉,以使用自動RD
VTEP1#show vrf blue
Name Default RD Protocols Interfaces
blue 192.168.1.1:1(auto) ipv4 Vl34
Lo101
Et1/1
Vl4
Vl15
VTEP1#show vrf green
Name Default RD Protocols Interfaces
green 192.168.1.1:2(auto) ipv6 Lo102
Et1/2
Vl5
Vl13
VTEP1#show vrf detail blue
VRF blue (VRF Id = 2); default RD 192.168.1.1:1(auto); default VPNID
New CLI format, supports multiple address-families
vnid: 123 evpn-instance vni 35000 core-vlan 34
Flags: 0x180C
Interfaces:
Vl34 Lo101 Et1/1
Vl4 Vl15
Address family ipv4 unicast (Table ID = 0x2):
Flags: 0x0
Export VPN route-target communities
RT:100:123 RT:65000:123 (auto)
Import VPN route-target communities
RT:100:123 RT:65000:123 (auto)
Export VPN route-target stitching communities
RT:65000:123 (auto)
Import VPN route-target stitching communities
RT:65000:123 (auto)
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
Address family ipv6 unicast not active
Address family ipv4 multicast not active
Address family ipv6 multicast not active
VTEP1#show vrf detail green
VRF green (VRF Id = 4); default RD 192.168.1.1:2(auto); default VPNID
New CLI format, supports multiple address-families
vnid: 35 evpn-instance
Flags: 0x380C
Interfaces:
Lo102 Et1/2 Vl5
Vl13
Address family ipv4 unicast not active
Address family ipv6 unicast (Table ID = 0x1E000002):
Flags: 0x0
Export VPN route-target communities
RT:65000:35 (auto)
Import VPN route-target communities
RT:65000:35 (auto)
Export VPN route-target stitching communities
RT:65000:35 (auto)
Import VPN route-target stitching communities
RT:65000:35 (auto)
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
Address family ipv4 multicast not active
Address family ipv6 multicast not active
疑難排解
調試
如果VRF自動RD自動RT出現問題,您可以使用調試來檢視有關該問題的詳細資訊
啟用相關調試
Leaf-01#debug ip bgp autordrt
Leaf-01#debug vrf create
Leaf-01#debug vrf delete
顯示 除錯資訊
VTEP1#show debug
VRF Manager:
VRF creation debugging is on
VRF deletion debugging is on
Packet Infra debugs:
Ip Address Port
------------------------------------------------------|----------
IP routing:
BGP auto rd rt debugging is on
觀察每個配置步驟中產生的調試
Leaf-01(config)#vrf definition test
*Jun 26 08:19:44.173: LID: Get id @0x7F4414FE4A18 - current A [1..2705] (checking enabled)
*Jun 26 08:19:44.173: LID: AVAIL (verified) - id A
*Jun 26 08:19:44.173: vrfmgr: VRF test: Created vrf_rec with vrfid 0xA
*Jun 26 08:19:44.173: BGP: VRF config event of rd-auto change for vrf test
*Jun 26 08:19:44.173: BGP-VPN: bgp vpn global rd-auto for vrf test assigns rd of 192.168.1.1:6
*Jun 26 08:19:44.173: BGP: VRF config event of vnid change for vrf test
Leaf-01(config-vrf)#vnid 246 evpn-instance
% vnid 246 evpn-instance auto (vni 0 core-vlan 0) is configured in "vrf test"
*Jun 26 08:20:03.466: BGP: VRF config event of vnid change for vrf test
Leaf-01(config-vrf)#address-family ipv4
*Jun 26 08:20:12.276: vrfmgr: VRF test ipv4 unicast: Received topology create notification
*Jun 26 08:20:12.276: vrfmgr: VRF test ipv4 multicast: Received topology create notification
*Jun 26 08:20:12.276: vrfmgr: VRF test ipv4 unicast: Created vrf_sub_rec with vrfid 0xA, tableid 0xA
*Jun 26 08:20:12.276: BGP: VRF config event of vnid change for vrf test
*Jun 26 08:20:12.276: BGP: afi 0 vrf test vnid 246 RT assign
*Jun 26 08:20:12.276: BGP: vrf assign auto import stitching rt for VRF test
*Jun 26 08:20:12.276: BGP: vrf assign auto export stitching rt for VRF test
Leaf-01(config-vrf-af)#address-family ipv6
*Jun 26 08:20:20.949: vrfmgr: VRF test ipv6 unicast: Received topology create notification
*Jun 26 08:20:20.949: vrfmgr: VRF test ipv6 multicast: Received topology create notification
*Jun 26 08:20:20.949: vrfmgr: VRF test ipv6 unicast: Created vrf_sub_rec with vrfid 0xA, tableid 0x1E000004
*Jun 26 08:20:20.949: BGP: VRF config event of vnid change for vrf test
*Jun 26 08:20:20.949: BGP: afi 0 vrf test vnid 246 RT assign
*Jun 26 08:20:20.949: BGP: vrf assign auto import stitching rt for VRF test
*Jun 26 08:20:20.949: BGP: vrf assign auto export stitching rt for VRF test
*Jun 26 08:20:20.949: BGP: afi 1 vrf test vnid 246 RT assign
*Jun 26 08:20:20.949: BGP: vrf assign auto import stitching rt for VRF test
*Jun 26 08:20:20.949: BGP: vrf assign auto export stitching rt for VRF test
Leaf-01(config-vrf-af)#do sh vrf detail test
VRF test (VRF Id = 10); default RD 192.168.1.1:6(auto); default VPNID <-- VRF ID = 10 (hex 0xA) | auto RD assigned matches debug "assigns rd of 192.168.1.1:6"
New CLI format, supports multiple address-families
vnid: 246 evpn-instance
Flags: 0x180C
No interfaces
Address family ipv4 unicast (Table ID = 0xA):
Flags: 0x0
Export VPN route-target communities
RT:65000:246 (auto)
Import VPN route-target communities
RT:65000:246 (auto)
Export VPN route-target stitching communities
RT:65000:246 (auto)
Import VPN route-target stitching communities
RT:65000:246 (auto)
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
Address family ipv6 unicast (Table ID = 0x1E000004): <-- ID matches debug "Created vrf_sub_rec with vrfid 0xA, tableid 0x1E000004"
Flags: 0x0
Export VPN route-target communities
RT:65000:246 (auto)
Import VPN route-target communities
RT:65000:246 (auto)
Export VPN route-target stitching communities
RT:65000:246 (auto)
Import VPN route-target stitching communities
RT:65000:246 (auto)
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
Address family ipv4 multicast not active
Address family ipv6 multicast not active
Leaf-01(config-vrf-af)#do sh run vrf test
Building configuration...
Current configuration : 145 bytes
vrf definition test
vnid 246 evpn-instance
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-family
Catalyst和Nexus互操作性
問題
預設情況下,Nexus分配基於vni的路由目標(ASN:VNI),而Catalyst分配基於evi的路由目標(ASN:EVI)。
當route-target不匹配時,您可以看到以下症狀:
- L2VPN EVPN的BGP連線建立,並且BGP表中顯示第3類路由
- 未建立NVE對等
- 通道鄰接仍不完整
修正
有兩個選項可以解決此Interop問題
- 在一端配置手動路由目標,使其匹配
- 配置C9500以使用「route-target auto vni」分配基於vni的路由目標
在l2vpn evpn部分下應用以下cli(針對選項2)
address-family l2vpn evpn
rewrite-evpn-rt-asn <---
相關資訊