簡介
本檔案介紹如何在VTEP與外部節點之間設定eBGP對等。
必要條件
現有VXLAN環境。
需求
思科建議您瞭解以下主題:
- NXOS平台
- Qos
- Elam瞭解
- VXLAN VRF延遲
採用元件
名稱 |
平台 |
版本 |
葉 |
N9K-C9332D-GX2B |
10.2(6) |
BL |
N9K-C9348D-GX2A |
10.2(5) |
EXT-R |
N9K-C9348D-GX2A |
10.2(3) |
骨幹 |
N9K-C93108TC-FX3P |
10.1(1) |
"本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。」
拓撲
註:在本示例中,eBGP對等會話將在枝葉(vtep)和EXT-R(外部裝置,VXLAN交換矩陣外)之間配置。
在本示例中,BL知道通過預設vrf上的OSPF的EXT-R IP,並知道通過VXLAN的LEAF環回100 IP,並且它在預設VRF中重新分發到OSPF。
要執行此洩漏技術區配置和驗證Nexus交換機上的VXLAN VRF洩漏檢查:https://www.cisco.com/c/en/us/support/docs/switches/nexus-9000-series-switches/221709-configure-and-verify-vxlan-vrf-leaking-o.html
為了簡化本文檔,下面將對BL上的VRF洩漏配置進行總結。
BL洩漏配置:
ip prefix-list VXLAN-VRF-default-to-Tenant permit 172.16.120.55/32
route-map VXLAN-VRF-default-to-Tenant
match ip address prefix-list VXLAN-VRF-default-to-Tenant
ip prefix-list VXLAN-VRF-Tenant-to-default permit 192.168.150.150/32
route-map VXLAN-VRF-Tenant-to-default
match ip address prefix-list VXLAN-VRF-Tenant-to-default
route-map BGP-OSPF
match ip address prefix-list VXLAN-VRF-Tenant-to-default
match route-type internal
router bgp 65000
address-family ipv4 unicast
redistribute ospf 1 route-map VXLAN-VRF-default-to-Tenant
vrf context tenant-a
address-family ipv4 unicast
import vrf default map VXLAN-VRF-default-to-Tenant advertise-vpn
vrf context tenant-a
address-family ipv4 unicast
export vrf default map VXLAN-VRF-Tenant-to-default allow-vpn
router ospf 1
redistribute bgp 65000 route-map BGP-OSPF
檢驗通往外部路由器的路由
第一步是驗證VTEP中是否存在通往外部路由器的路由。
在本示例中,BL將路由172.16.120.55從預設VRF洩漏到租戶VRF並將其通告到LEAF。
LEAF# show ip route 172.16.120.55 vrf tenant-a
IP Route Table for VRF "tenant-a"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
172.16.120.55/32, ubest/mbest: 1/0
*via 172.16.0.5%default, [200/2], 00:16:01, bgp-65000, internal, tag 65000, segid: 303030 tunnelid: 0xac100005 encap: VXLAN
設定
在Nexus 9000上,VTEP和外部路由器之間支援eBGP對等。
要使這種對等成為可能,需要在VTEP上配置專用環回。
建立專用環回
設定
|
命令或操作 |
目的 |
步驟 1 |
LEAF#配置終端 輸入配置命令,每行一個。以CNTL/Z結束。 |
進入配置模式。 |
步驟 2 |
LEAF(config)# interface lo 100 |
建立專用環回。 |
步驟 3 |
LEAF(config-if)# vrf member tenant-a 警告:已刪除介面loopback100上的所有L3配置 |
將租戶VRF連線到環回。 |
步驟 4 |
LEAF(config-if)# ip address 192.168.150.150/32 |
為環回分配IP。 |
通告BGP上的環回
為了能夠連線到外部路由器,需要在BGP上通告建立的專用環回。
設定
|
命令或操作 |
目的 |
步驟 1 |
LEAF#配置終端 輸入配置命令,每行一個。以CNTL/Z結束。 |
進入配置模式。 |
步驟 2 |
LEAF(config)# router bgp 65000 |
進入BGP配置。 |
步驟 3 |
LEAF(config-router)# vrf tenant-a |
進入BGP VRF。 |
步驟 4 |
LEAF(config-router-vrf)# address-family ipv4 unicast |
進入BGP VRF地址系列ipv4 |
步驟 5 |
LEAF(config-router-vrf-af)#網路192.168.150.150/32 |
通告環回IP。 |
提示:BGP通告也可以使用路由對映完成,並使用直接重新分發進行通告。
驗證
驗證是否已將路由匯入枝葉VTEP上的BGP租戶VRF
LEAF# show ip bgp 192.168.150.150 vrf tenant-a
BGP routing table information for VRF tenant-a, address family IPv4 Unicast
BGP routing table entry for 192.168.150.150/32, version 20
Paths: (1 available, best #1)
Flags: (0x80c0002) (high32 0x000020) on xmit-list, is not in urib, exported
vpn: version 25, (0x00000000100002) on xmit-list
Advertised path-id 1, VPN AF advertised path-id 1
Path type: local, path is valid, is best path, no labeled nexthop, is extd
Imported to 1 destination(s)
Imported paths list: tenant-b
AS-Path: NONE, path locally originated
0.0.0.0 (metric 0) from 0.0.0.0 (192.168.150.150)
Origin IGP, MED not set, localpref 100, weight 32768
Extcommunity: RT:1:1 RT:65000:303030
VRF advertise information:
Path-id 1 not advertised to any peer
VPN AF advertise information:
Path-id 1 not advertised to any peer
驗證是否已將路由匯入到枝葉VTEP上的BGP L2VPN
LEAF# sh bgp l2vpn evpn 192.168.150.150
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 172.16.0.2:3 (L3VNI 303030)
BGP routing table entry for [5]:[0]:[0]:[32]:[192.168.150.150]/224, version 59
Paths: (1 available, best #1)
Flags: (0x000002) (high32 00000000) on xmit-list, is not in l2rib/evpn
Advertised path-id 1
Path type: local, path is valid, is best path, no labeled nexthop
Gateway IP: 0.0.0.0
AS-Path: NONE, path locally originated
172.16.0.2 (metric 0) from 0.0.0.0 (172.16.0.2)
Origin IGP, MED not set, localpref 100, weight 32768
Received label 303030
Extcommunity: RT:65000:303030 ENCAP:8 Router MAC:9c54.1651.5cd7
Path-id 1 advertised to peers:
10.101.11.1
驗證是否已在BL租戶VRF上匯入路由
BL# show ip route 192.168.150.150 vrf tenant-a
IP Route Table for VRF "tenant-a"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
192.168.150.150/32, ubest/mbest: 1/0
*via 172.16.0.2%default, [200/0], 00:01:13, bgp-65000, internal, tag 65000, segid: 303030 tunnelid: 0xac100002 encap: VXLAN
驗證是否已在BL預設VRF上匯入路由
由於外部路由器通過預設VRF已知,因此必須將VTEP環回IP匯入到BL上的預設VRF。
BL(config-router-vrf-neighbor)# show ip route 192.168.150.150
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
192.168.150.150/32, ubest/mbest: 1/0
*via 172.16.0.2, [200/0], 00:12:16, bgp-65000, internal, tag 65000, segid: 303030 tunnelid: 0xac100002 encap: VXLAN
在枝葉上配置eBGP對等
建立專用環回後,即可在BGP VRF上執行eBGP對等。
設定
|
命令或操作 |
目的 |
步驟 1 |
LEAF#配置終端 輸入配置命令,每行一個。以CNTL/Z結束。 |
進入配置模式。 |
步驟 2 |
LEAF(config)# router bgp 65000 |
進入BGP配置。 |
步驟 3 |
LEAF(config-router)# vrf tenant-a |
進入BGP VRF。 |
步驟 4 |
LEAF(config-router-vrf)# address-family ipv4 unicast |
進入BGP VRF地址系列ipv4 |
步驟 5 |
LEAF(config-router-vrf-af)# neighbor 172.16.120.55 remote-as 64577 |
建立eBGP鄰居。 |
步驟 6 |
LEAF(config-router-vrf-neighbor)# update-source loopback 100 |
使用環回100作為更新源。 |
步驟 7 |
LEAF(config-router-vrf-neighbor)# address-family ipv4 unicast |
進入鄰居地址系列ipv4配置。 |
步驟 8 |
LEAF(config-router-vrf-neighbor-af)# ebgp-multihop 10 |
為eBGP對等的資料包分配ttl。 |
在外部路由器(EXT-R)上配置eBGP對等
建立專用環回後,即可在BGP VRF上執行eBGP對等。
設定
|
命令或操作 |
目的 |
步驟 1 |
EXT-R#配置終端 輸入配置命令,每行一個。以CNTL/Z結束。 |
進入配置模式。 |
步驟 2 |
EXT-R(config)# router bgp 64577 |
進入BGP配置。 |
步驟 3 |
EXT-R(config-router)# vrf blue |
進入BGP VRF。 |
步驟 4 |
EXT-R(config-router-vrf)# address-family ipv4 unicast |
進入BGP VRF地址系列ipv4 |
步驟 5 |
EXT-R(config-router-vrf-af)#neighbor 192.168.150.150 remote-as 65000 |
建立eBGP鄰居。 |
步驟 6 |
EXT-R(config-router-vrf-neighbor)# update-source loopback 10 |
使用環回100作為更新源。 |
步驟 7 |
EXT-R(config-router-vrf-neighbor)# address-family ipv4 unicast |
進入鄰居地址系列ipv4配置。 |
步驟 8 |
EXT-R(config-router-vrf-neighbor-af)# ebgp-multihop 10 |
為eBGP對等的資料包分配ttl。 |
總結步驟
葉
- 配置終端
- interface lo 100
- vrf成員tenant-a
- ip address 192.168.150.150/32
- router bgp 65000
- vrf tenant-a
- address-family ipv4 unicast
- 網路192.168.150.150/32
- neighbor 172.16.120.55
- remote-as 64577
- update-source loopback 100
- address-family ipv4 unicast
- ebgp-multihop 10
EXT-R
- 配置終端
- router bgp 64577
- vrf藍色
- address-family ipv4 unicast
- neighbor 172.16.120.55
- remote-as 64577
- update-source loopback 100
- address-family ipv4 unicast
- ebgp-multihop 10
驗證
驗證枝葉上的eBGP鄰居
LEAF# show ip bgp summary vrf tenant-a
BGP summary information for VRF tenant-a, address family IPv4 Unicast
BGP router identifier 192.168.150.150, local AS number 65000
BGP table version is 23, IPv4 Unicast config peers 1, capable peers 1
13 network entries and 14 paths using 2436 bytes of memory
BGP attribute entries [8/2816], BGP AS path entries [0/0]
BGP community entries [0/0], BGP clusterlist entries [3/12]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.120.55 4 64577 6 6 23 0 0 00:00:27 0
驗證外部路由器上的eBGP鄰居
EXT-R(config-router-vrf-neighbor)# show ip bgp summary vrf blue
BGP summary information for VRF blue, address family IPv4 Unicast
BGP router identifier 172.16.120.55, local AS number 64577
BGP table version is 15, IPv4 Unicast config peers 1, capable peers 1
13 network entries and 13 paths using 3588 bytes of memory
BGP attribute entries [2/704], BGP AS path entries [1/6]
BGP community entries [0/0], BGP clusterlist entries [0/0]
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.150.150 4 65000 13 6 15 0 0 00:00:48 13