簡介
本檔案介紹如何在虛擬可擴充區域網路(VxLAN)中的兩個虛擬通道端點(VTEP)之間測試網狀架構連線。
必要條件
需求
思科建議您瞭解以下主題:
- Nexus NX-OS軟體
- 邊界閘道通訊協定(BGP)
- VxLAN
採用元件
本檔案中的資訊是根據搭載NXOS版本10.3(3)的Cisco Nexus N9K-C93180YC-EX。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
設定
一旦VxLAN被設定,使用者通常希望測試它是否能按預期工作。雖然建議的方法是在連線到不同VTEP的兩個終端主機之間執行Ping測試,但也可以使用VTEP上的環回介面測試交換矩陣連線。
註:使用交換機虛擬介面(SVI)作為ping測試的源或目標不是有效的交換矩陣連線測試。原因是由於任播網關功能,我們在交換矩陣SVI上擁有相同的IP。
網路圖表
組態
在此VxLAN部署中,Nexus N9K-2配置為SPINE,而N9K-1和N9K-2都配置為VTEP。
第3層是擴充的,因此每個虛擬路由和轉送(VRF)在兩個VTEP上都有第3層虛擬網路介面(VNI)。
為VRF evpn_a配置的第3層VNI為50100。
N9K-1
步驟1.我們將環回配置為要測試的VRF的一部分。
N9K-1(config)# interface loopback50
N9K-1(config-if)# vrf member evpn_a
Message reported by command :: vrf member evpn_a
Warning: Deleted all L3 config on interface loopback50
N9K-1(config-if)# ip address 10.255.255.1/32
步驟2.我們將環回通告到交換矩陣中。否則,即使ICMP請求到達目的地,目的地本身仍無法傳回ICMP回覆。
N9K-1(config)# router bgp 65522
N9K-1(config-router)# vrf evpn_a
N9K-1(config-router-vrf)# address-family ipv4 unicast
N9K-1(config-router-vrf-af)# network 10.255.255.1/32
N9K-2
步驟1.我們將環回配置為要測試的VRF的一部分。
N9K-2(config)# interface loopback50
N9K-2(config-if)# vrf member evpn_a
Message reported by command :: vrf member evpn_a
Warning: Deleted all L3 config on interface loopback50
N9K-2(config-if)# ip address 10.255.255.2/32
步驟2.我們將環回通告到交換矩陣中。否則,即使ICMP請求到達目的地,目的地本身仍無法傳回ICMP回覆。
N9K-2(config)# router bgp 65522
N9K-2(config-router)# vrf evpn_a
N9K-2(config-router-vrf)# address-family ipv4 unicast
N9K-2(config-router-vrf-af)# network 10.255.255.2/32
驗證
步驟1.確認地址系列IPv4單播的本機BGP表中存在環回。
N9K-1# show ip bgp 10.255.255.1/32 vrf evpn_a
BGP routing table information for VRF evpn_a, address family IPv4 Unicast
BGP routing table entry for 10.255.255.1/32, version 732
Paths: (1 available, best #1)
Flags: (0x80c0002) (high32 0x000020) on xmit-list, is not in urib, exported
vpn: version 1053, (0x00000000100002) on xmit-list
Multipath: eBGP iBGP
Advertised path-id 1, VPN AF advertised path-id 1
Path type: local, path is valid, is best path, no labeled nexthop, is extd
AS-Path: NONE, path locally originated
0.0.0.0 (metric 0) from 0.0.0.0 (10.2.254.100)
Origin IGP, MED not set, localpref 100, weight 32768
Extcommunity: RT:65522:50100
VRF advertise information:
Path-id 1 not advertised to any peer
VPN AF advertise information:
Path-id 1 not advertised to any peer
N9K-2# show ip bgp 10.255.255.2/32 vrf evpn_a
BGP routing table information for VRF evpn_a, address family IPv4 Unicast
BGP routing table entry for 10.255.255.2/32, version 241
Paths: (1 available, best #1)
Flags: (0x80c0002) (high32 0x000020) on xmit-list, is not in urib, exported
vpn: version 417, (0x00000000100002) on xmit-list
Multipath: eBGP iBGP
Advertised path-id 1, VPN AF advertised path-id 1
Path type: local, path is valid, is best path, no labeled nexthop, is extd
AS-Path: NONE, path locally originated
0.0.0.0 (metric 0) from 0.0.0.0 (10.2.254.100)
Origin IGP, MED not set, localpref 100, weight 32768
Extcommunity: RT:65522:50100
VRF advertise information:
Path-id 1 not advertised to any peer
VPN AF advertise information:
Path-id 1 not advertised to any peer
步驟2.確認環回存在於地址系列L2VPN EVPN的本地BGP表中,並且會通告給預期的網路虛擬介面(NVE)對等體。
N9K-1# show bgp l2vpn evpn 10.255.255.1 vrf evpn_a
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 10.2.0.49:4 (L3VNI 50100)
BGP routing table entry for [5]:[0]:[0]:[32]:[10.255.255.1]/224, version 36993
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
10.2.1.49 (metric 0) from 0.0.0.0 (10.2.0.49)
Origin IGP, MED not set, localpref 100, weight 32768
Received label 50100
Extcommunity: RT:65522:50100 ENCAP:8 Router MAC:a0e0.af67.511d
Path-id 1 advertised to peers:
10.2.0.33 10.2.0.34
N9K-2#
LEAF48# show bgp l2vpn evpn 10.255.255.2 vrf evpn_a
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 10.2.0.48:4 (L3VNI 50100)
BGP routing table entry for [5]:[0]:[0]:[32]:[10.255.255.2]/224, version 13373
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
10.2.1.48 (metric 0) from 0.0.0.0 (10.2.0.48)
Origin IGP, MED not set, localpref 100, weight 32768
Received label 50100
Extcommunity: RT:65522:50100 ENCAP:8 Router MAC:6cb2.aeee.5a97
Path-id 1 advertised to peers:
10.2.0.33 10.2.0.34
步驟3.確認已從遠端NVE對等體收到更新。
N9K-1# show bgp l2vpn evpn 10.255.255.2 vrf evpn_a
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 10.2.0.49:4 (L3VNI 50100)
BGP routing table entry for [5]:[0]:[0]:[32]:[10.255.255.2]/224, version 36995
Paths: (1 available, best #1)
Flags: (0x000002) (high32 00000000) on xmit-list, is not in l2rib/evpn, is not in HW
Advertised path-id 1
Path type: internal, path is valid, is best path, no labeled nexthop
Imported from 10.2.0.48:4:[5]:[0]:[0]:[32]:[10.255.255.2]/224
Gateway IP: 0.0.0.0
AS-Path: NONE, path sourced internal to AS
10.2.1.48 (metric 6) from 10.2.0.33 (10.2.0.33)
Origin IGP, MED not set, localpref 100, weight 0
Received label 50100
Extcommunity: RT:65522:50100 Route-Import:10.2.1.147:3100 Source AS:65522:0
ENCAP:8 Router MAC:6cb2.aeee.5a97
Originator: 10.2.0.48 Cluster list: 0.0.255.242
Path-id 1 not advertised to any peer
N9K-2# show bgp l2vpn evpn 10.255.255.1 vrf evpn_a
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 10.2.0.48:4 (L3VNI 50100)
BGP routing table entry for [5]:[0]:[0]:[32]:[10.255.255.1]/224, version 13372
Paths: (1 available, best #1)
Flags: (0x000002) (high32 00000000) on xmit-list, is not in l2rib/evpn, is not in HW
Advertised path-id 1
Path type: internal, path is valid, is best path, no labeled nexthop
Imported from 10.2.0.49:4:[5]:[0]:[0]:[32]:[10.255.255.1]/224
Gateway IP: 0.0.0.0
AS-Path: NONE, path sourced internal to AS
10.2.1.49 (metric 6) from 10.2.0.33 (10.2.0.33)
Origin IGP, MED not set, localpref 100, weight 0
Received label 50100
Extcommunity: RT:65522:50100 Route-Import:10.2.1.49:3100 Source AS:65522:0
ENCAP:8 Router MAC:a0e0.af67.511d
Originator: 10.2.0.49 Cluster list: 0.0.255.242
Path-id 1 not advertised to any peer
步驟4.確認路由表中存在遠端環迴路由,下一跳是預期的NVE對等路由器。
N9K-1# show ip route 10.255.255.2 vrf evpn_a
IP Route Table for VRF "evpn_a"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%
' in via output denotes VRF
10.255.255.2/32, ubest/mbest: 1/0 *via 10.2.1.48%default, [200/0], 00:12:39, bgp-65522, internal, tag 65522, segid: 50100 tunnelid: 0xa020130 encap: VXLAN N9K-2# show ip route 10.255.255.1 vrf evpn_a IP Route Table for VRF "evpn_a" '*' denotes best ucast next-hop '**' denotes best mcast next-hop '[x/y]' denotes [preference/metric] '%
' in via output denotes VRF
10.255.255.1/32, ubest/mbest: 1/0 *via 10.2.1.49%default, [200/0], 00:15:36, bgp-65522, internal, tag 65522, segid: 50100 tunnelid: 0xa020131 encap: VXLAN
步驟5.將ICMP請求傳送到遠端環回,使用本地環回作為源。
N9K-1# ping 10.255.255.2 source-interface loopback 50
PING 10.255.255.2 (10.255.255.2): 56 data bytes
64 bytes from 10.255.255.2: icmp_seq=0 ttl=254 time=2.009 ms
64 bytes from 10.255.255.2: icmp_seq=1 ttl=254 time=1.26 ms
64 bytes from 10.255.255.2: icmp_seq=2 ttl=254 time=1.231 ms
64 bytes from 10.255.255.2: icmp_seq=3 ttl=254 time=1.142 ms
64 bytes from 10.255.255.2: icmp_seq=4 ttl=254 time=1.127 ms
--- 10.255.255.2 ping statistics ---
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min/avg/max = 1.127/1.353/2.009 ms
N9K-2# ping 10.255.255.1 source-interface loopback 50
PING 10.255.255.1 (10.255.255.1): 56 data bytes
64 bytes from 10.255.255.1: icmp_seq=0 ttl=254 time=1.47 ms
64 bytes from 10.255.255.1: icmp_seq=1 ttl=254 time=1.396 ms
64 bytes from 10.255.255.1: icmp_seq=2 ttl=254 time=1.327 ms
64 bytes from 10.255.255.1: icmp_seq=3 ttl=254 time=1.451 ms
64 bytes from 10.255.255.1: icmp_seq=4 ttl=254 time=1.366 ms
--- 10.255.255.1 ping statistics ---
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min/avg/max = 1.327/1.402/1.47 ms
相關資訊
設定VXLAN BGP EVPN