CXシリーズで構成されるEVPN-VXLANファブリックへのCentralized L3 Gatewayの展開により、EVPN-VXLANファブリックに配置されるVTEPのうち1つを使用して、VXLAN内のホストへレイヤ3フォワーディング(ルーティング)を提供します。
ゲートウェイ機能を持つVTEPは、他のVTEPおよび外部ネットワークへ接続します。
【参考】
*EVPN VXLAN Guide: Centralized L3 gateway deployment (P40)
https://arubanetworking.hpe.com/techdocs/AOS-CX/10.15/PDF/vxlan.pdf
【検証構成】
本投稿では、設定と動作確認の紹介を目的にしておりますので、機器台数や構成、接続などは最小限としています。
【CXスイッチの設定】
- 外部接続用の設定
CX5は、キャンパスコアやインターネットなどの外部接続に相当する機器としています。
Border Leafとして設定するCX2-LeafへBGPで経路をアドバタイズさせます。
[CX5]
!
interface 1/1/5
no shutdown
ip address 192.168.5.5/24
interface loopback 0
ip address 10.1.1.5/32
interface loopback 1
ip address 192.168.101.254/24
ip address 192.168.102.254/24 secondary
!
route-map loop1-to-bgp permit seq 11
match interface loopback1
set origin igp
!
router bgp 64521
bgp router-id 10.1.1.5
neighbor 192.168.5.2 remote-as 64520
address-family ipv4 unicast
neighbor 192.168.5.2 activate
redistribute connected route-map loop1-to-bgp
exit-address-family
!
[CX2]
vrf Core
rd 10.1.1.2:3
address-family ipv4 unicast
route-target export 64520:3
route-target import 64520:1
route-target import 64520:3
exit-address-family
vrf VRF1
rd 10.1.1.2:1
address-family ipv4 unicast
route-target export 64520:1
route-target import 64520:1
route-target import 64520:3
exit-address-family
!
interface 1/1/5
no shutdown
vrf attach Core
ip address 192.168.5.2/24
interface loopback 0
ip address 10.1.1.2/32
ip ospf 1 area 0.0.0.0
!
router bgp 64520
bgp router-id 10.1.1.2
vrf Core
neighbor 192.168.5.5 remote-as 64521
address-family ipv4 unicast
neighbor 192.168.5.5 activate
exit-address-family
!
vrf VRF1
address-family ipv4 unicast
redistribute connected
exit-address-family
!
・CX2-Leafでは、2つのVRFを設定しています。VRF名Coreは、CX5との外部接続用、VRF名VRF1は、SVI100へ紐づけています。
・rdは、VRF毎にユニークな値となるように設定します。トラブルシューティングを容易にするために、ループバックアドレス:VRF番号で設定しています。
・vrfで設定するroute-targetは、BGP AS番号:VRF番号で設定しています。今回の設定でのVRF名VRF1は、VRF番号1としています。
- アンダーレイの設定
CX1、CX2、CX3の各スイッチにループバックインタフェースを設定し、OSPFでアドバタイズさせます。
[CX3-Spine]
!
interface 1/1/1
no shutdown
mtu 9198
ip mtu 9198
ip address 192.168.1.3/24
ip ospf 1 area 0.0.0.0
no ip ospf passive
ip ospf network point-to-point
interface 1/1/2
no shutdown
mtu 9198
ip mtu 9198
ip address 192.168.2.3/24
ip ospf 1 area 0.0.0.0
no ip ospf passive
ip ospf network point-to-point
interface loopback 0
ip address 10.1.1.3/32
ip ospf 1 area 0.0.0.0
!
router ospf 1
router-id 10.1.1.3
max-metric router-lsa on-startup
passive-interface default
area 0.0.0.0
!
[CX1-Leaf]
!
interface 1/1/1
no shutdown
mtu 9198
ip mtu 9198
ip address 192.168.1.1/24
ip ospf 1 area 0.0.0.0
no ip ospf passive
ip ospf network point-to-point
interface loopback 0
ip address 10.1.1.1/32
ip ospf 1 area 0.0.0.0
!
router ospf 1
router-id 10.1.1.1
max-metric router-lsa on-startup
passive-interface default
area 0.0.0.0
!
[CX2-Leaf]
!
interface 1/1/2
no shutdown
mtu 9198
ip mtu 9198
ip address 192.168.2.2/24
ip ospf 1 area 0.0.0.0
no ip ospf passive
ip ospf network point-to-point
!
router ospf 1
router-id 10.1.1.2
max-metric router-lsa on-startup
passive-interface default
area 0.0.0.0
!
- MP-BGPの設定
コントロールプレーンとして利用するEVPNを動作させるために、MP-BGPを設定します。
[CX3-Spine]
!
router bgp 64520
bgp router-id 10.1.1.3
neighbor 10.1.1.1 remote-as 64520
neighbor 10.1.1.1 update-source loopback 0
neighbor 10.1.1.2 remote-as 64520
neighbor 10.1.1.2 update-source loopback 0
address-family l2vpn evpn
neighbor 10.1.1.1 route-reflector-client
neighbor 10.1.1.1 send-community extended
neighbor 10.1.1.1 activate
neighbor 10.1.1.2 route-reflector-client
neighbor 10.1.1.2 send-community extended
neighbor 10.1.1.2 activate
exit-address-family
!
[CX1-Leaf]
!
router bgp 64520
bgp router-id 10.1.1.1
neighbor 10.1.1.3 remote-as 64520
neighbor 10.1.1.3 update-source loopback 0
address-family l2vpn evpn
neighbor 10.1.1.3 send-community extended
neighbor 10.1.1.3 activate
exit-address-family
!
[CX2-Leaf]
!
router bgp 64520
neighbor 10.1.1.3 remote-as 64520
neighbor 10.1.1.3 update-source loopback 0
address-family l2vpn evpn
neighbor 10.1.1.3 send-community extended
neighbor 10.1.1.3 activate
exit-address-family
!
- ホスト接続に関する設定
ホストが接続されるセグメントに利用するVLAN、インタフェースの設定をします。
[CX1-Leaf]
!
vlan 100
!
interface 1/1/4
no shutdown
no routing
vlan access 100
!
- VXLANの設定
L2 VNIを設定して、VLANとVXLANトンネルインタフェースを関連づけします。
[CX1-Leaf]
!
evpn
vlan 100
rd auto
route-target export 64520:100
route-target import 64520:100
!
interface vxlan 1
source ip 10.1.1.1
no shutdown
vni 100
vlan 100
!
[補足]
・evpnで設定するroute-targetは、BGP AS番号:VLAN IDで設定しています。
[CX2-Leaf]
!
evpn
vlan 100
rd auto
route-target export 64520:100
route-target import 64520:100
!
interface vxlan 1
source ip 10.1.1.2
no shutdown
vni 100
vlan 100
!
- Centralized L3 Gatewayに関する設定
今回の構成では、CX2-LeafをBorder LeafとしてVXLAN内に展開されるホストのゲートウェイとして動作させます。
AOX-CXバージョン10.04以降より、Centralized L3 gatewayとして展開するBorder Leafが、単体またはVSX構成で動作する時でもactive-gateway ipとactive-gateway ip macの設定が必要となっています。
[CX2-Leaf]
!
interface vlan 100
vrf attach VRF1
ip address 172.16.100.2/24
active-gateway ip mac 12:00:00:00:01:01
active-gateway ip 172.16.100.254
!
- CX4の設定
CX4を通信確認用にIPアドレスとデフォルトゲートウェイを設定します。
[CX4]
!
vlan 100
!
interface 1/1/4
no shutdown
no routing
vlan access 100
interface vlan 100
ip mtu 9000
ip address 172.16.100.4/24
!
ip route 0.0.0.0/0 172.16.100.254
!
【疎通確認】
CX4からデフォルトゲートウェイのアドレス、CX5のloopback 1に設定しているアドレス宛に、pingを実行してみます。
CX4# ping 172.16.100.254 source 172.16.100.4 repetitions 5
PING 172.16.100.254 (172.16.100.254) from 172.16.100.4 : 100(128) bytes of data.
108 bytes from 172.16.100.254: icmp_seq=1 ttl=64 time=3.14 ms
108 bytes from 172.16.100.254: icmp_seq=2 ttl=64 time=3.26 ms
108 bytes from 172.16.100.254: icmp_seq=3 ttl=64 time=2.79 ms
108 bytes from 172.16.100.254: icmp_seq=4 ttl=64 time=3.37 ms
108 bytes from 172.16.100.254: icmp_seq=5 ttl=64 time=3.14 ms
--- 172.16.100.254 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 2.791/3.138/3.373/0.194 ms
CX4#
CX4# ping 192.168.101.254 source 172.16.100.4 repetitions 5
PING 192.168.101.254 (192.168.101.254) from 172.16.100.4 : 100(128) bytes of data.
108 bytes from 192.168.101.254: icmp_seq=1 ttl=63 time=8.46 ms
108 bytes from 192.168.101.254: icmp_seq=2 ttl=63 time=4.22 ms
108 bytes from 192.168.101.254: icmp_seq=3 ttl=63 time=11.3 ms
108 bytes from 192.168.101.254: icmp_seq=4 ttl=63 time=3.92 ms
108 bytes from 192.168.101.254: icmp_seq=5 ttl=63 time=3.56 ms
--- 192.168.101.254 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 3.557/6.284/11.272/3.063 ms
CX4#
CX4# ping 192.168.102.254 source 172.16.100.4 repetitions 5
PING 192.168.102.254 (192.168.102.254) from 172.16.100.4 : 100(128) bytes of data.
108 bytes from 192.168.102.254: icmp_seq=1 ttl=63 time=6.92 ms
108 bytes from 192.168.102.254: icmp_seq=2 ttl=63 time=3.91 ms
108 bytes from 192.168.102.254: icmp_seq=3 ttl=63 time=4.26 ms
108 bytes from 192.168.102.254: icmp_seq=4 ttl=63 time=4.02 ms
108 bytes from 192.168.102.254: icmp_seq=5 ttl=63 time=6.48 ms
--- 192.168.102.254 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 3.911/5.117/6.921/1.304 ms
CX4#
【VXLANファブリックを構成するCXスイッチの動作・状態の確認】
CX4からCX5のloopback 1に設定しているアドレス宛などに通信が発生すると、SpineやLeafのスイッチに、ホスト(CX4)やゲートウェイの情報が登録されていることを確認できます。
[CX1-Leaf]
CX1-Leaf# show bgp l2vpn evpn
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, e external S Stale, R Removed, a additional-paths
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN Route-Type 2 prefix: [2]:[ESI]:[EthTag]:[MAC]:[OrigIP]
EVPN Route-Type 3 prefix: [3]:[EthTag]:[OrigIP]
EVPN Route-Type 5 prefix: [5]:[ESI]:[EthTag]:[IPAddrLen]:[IPAddr]
VRF : default
Local Router-ID 10.1.1.1
Network Nexthop Metric LocPrf Weight Path
-------------------------------------------------------------------------------------------------------------------------------------
Route Distinguisher: 10.1.1.1:100 (L2VNI 100)
*> [2]:[0]:[0]:[08:00:09:a1:a1:a9]:[] 10.1.1.1 0 100 0 ?
*> [2]:[0]:[0]:[08:00:09:a1:a1:ef]:[] 10.1.1.1 0 100 0 ?
*> [3]:[0]:[10.1.1.1] 10.1.1.1 0 100 0 ?
Route Distinguisher: 10.1.1.2:100 (L2VNI 100)
*>i [2]:[0]:[0]:[12:00:00:00:01:01]:[172.16.100.254] 10.1.1.2 0 100 0 ?
*>i [3]:[0]:[10.1.1.2] 10.1.1.2 0 100 0 ?
Total number of entries 5
CX1-Leaf#
[CX2-Leaf]
CX2-Leaf# show bgp l2vpn evpn
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, e external S Stale, R Removed, a additional-paths
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN Route-Type 2 prefix: [2]:[ESI]:[EthTag]:[MAC]:[OrigIP]
EVPN Route-Type 3 prefix: [3]:[EthTag]:[OrigIP]
EVPN Route-Type 5 prefix: [5]:[ESI]:[EthTag]:[IPAddrLen]:[IPAddr]
VRF : default
Local Router-ID 10.1.1.2
Network Nexthop Metric LocPrf Weight Path
-------------------------------------------------------------------------------------------------------------------------------------
Route Distinguisher: 10.1.1.1:100 (L2VNI 100)
*>i [2]:[0]:[0]:[08:00:09:a1:a1:a9]:[] 10.1.1.1 0 100 0 ?
*>i [2]:[0]:[0]:[08:00:09:a1:a1:ef]:[] 10.1.1.1 0 100 0 ?
*>i [3]:[0]:[10.1.1.1] 10.1.1.1 0 100 0 ?
Route Distinguisher: 10.1.1.2:100 (L2VNI 100)
*> [2]:[0]:[0]:[12:00:00:00:01:01]:[172.16.100.254] 10.1.1.2 0 100 0 ?
*> [3]:[0]:[10.1.1.2] 10.1.1.2 0 100 0 ?
Total number of entries 5
CX2-Leaf#
CX2-Leaf# show ip route vrf Core
Displaying ipv4 routes selected for forwarding
Origin Codes: C - connected, S - static, L - local
R - RIP, B - BGP, O - OSPF, D - DHCP
U - Unnumbered
Type Codes: E - External BGP, I - Internal BGP, V - VPN, EV - EVPN
IA - OSPF internal area, E1 - OSPF external type 1
E2 - OSPF external type 2
VRF: Core
Prefix Nexthop Interface VRF(egress) Origin/ Distance/ Age
Type Metric
--------------------------------------------------------------------------------------------------------
172.16.100.0/24 - vlan100 VRF1 B/I [200/0] 00h:32m:53s
192.168.5.0/24 - 1/1/5 - C [0/0] -
192.168.5.2/32 - 1/1/5 - L [0/0] -
192.168.101.0/24 192.168.5.5 1/1/5 - B/E [20/0] 00h:32m:38s
192.168.102.0/24 192.168.5.5 1/1/5 - B/E [20/0] 00h:32m:38s
Total Route Count : 5
CX2-Leaf# show ip route vrf VRF1
Displaying ipv4 routes selected for forwarding
Origin Codes: C - connected, S - static, L - local
R - RIP, B - BGP, O - OSPF, D - DHCP
U - Unnumbered
Type Codes: E - External BGP, I - Internal BGP, V - VPN, EV - EVPN
IA - OSPF internal area, E1 - OSPF external type 1
E2 - OSPF external type 2
VRF: VRF1
Prefix Nexthop Interface VRF(egress) Origin/ Distance/ Age
Type Metric
--------------------------------------------------------------------------------------------------------
172.16.100.0/24 - vlan100 - C [0/0] -
172.16.100.2/32 - vlan100 - L [0/0] -
192.168.101.0/24 192.168.5.5 1/1/5 Core B/I [200/0] 00h:32m:38s
192.168.102.0/24 192.168.5.5 1/1/5 Core B/I [200/0] 00h:32m:38s
Total Route Count : 4
CX2-Leaf#
[CX3-Spine]
CX3-Spine# show bgp l2vpn evpn
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, e external S Stale, R Removed, a additional-paths
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN Route-Type 2 prefix: [2]:[ESI]:[EthTag]:[MAC]:[OrigIP]
EVPN Route-Type 3 prefix: [3]:[EthTag]:[OrigIP]
EVPN Route-Type 5 prefix: [5]:[ESI]:[EthTag]:[IPAddrLen]:[IPAddr]
VRF : default
Local Router-ID 10.1.1.3
Network Nexthop Metric LocPrf Weight Path
-------------------------------------------------------------------------------------------------------------------------------------
Route Distinguisher: 10.1.1.1:100 (L2VNI 100)
*>i [2]:[0]:[0]:[08:00:09:a1:a1:a9]:[] 10.1.1.1 0 100 0 ?
*>i [2]:[0]:[0]:[08:00:09:a1:a1:ef]:[] 10.1.1.1 0 100 0 ?
*>i [3]:[0]:[10.1.1.1] 10.1.1.1 0 100 0 ?
Route Distinguisher: 10.1.1.2:100 (L2VNI 100)
*>i [2]:[0]:[0]:[12:00:00:00:01:01]:[172.16.100.254] 10.1.1.2 0 100 0 ?
*>i [3]:[0]:[10.1.1.2] 10.1.1.2 0 100 0 ?
Total number of entries 5
CX3-Spine#
[CX4]
ARPテーブルの状態を確認すると、デフォルトゲートウェイのアドレスに対するMACアドレスとして、Border Leafに設定した仮想MACアドレスを学習していることが確認できます。
CX4# show arp
IPv4 Address MAC Port Physical Port State
-------------------------------------------------------------------------------------------------------------
172.16.100.254 12:00:00:00:01:01 vlan100 1/1/4 reachable
172.16.100.2 08:00:09:03:49:42 vlan100 1/1/4 reachable
Total Number Of ARP Entries Listed: 2.
-------------------------------------------------------------------------------------------------------------
CX4#
#Blog #Wired