本記事は、Spine-Leaf構成の基礎を理解し、Linux(FRR)環境でBGP EVPN/VXLANを用いたL2延伸を実際に構築してみたいネットワークエンジニア・学生に向けた備忘録です。
BGP EVPN/VXLANによるL2延伸の実装
プロトコル名:BGP EVPN, VXLAN, OSPF
アーキテクチャ:Spine-Leaf, オーバーレイ/アンダーレイ
使用技術:FRR (Free Range Routing)
目的/結果:L2延伸, コントロールプレーン構築
用語
EVPN/VXLANとは
L3ネットワーク上に論理的なL2ネットワークを
構築するトンネリングプロトコル
VXLANでは、VNI(VXLAN ID)でイーサネットフレームを
カプセル化することでトンネリングを実現している
2014/8 にIETF RFC7348として公開されている
EVPNはオーバーレイネットワークのMACアドレス学習コントロールプレーンとして機能する
VTEP( VXLAN Tunnel End Point )
トラフィックがVXLANトンネルに出入りするループバックの
インターフェースまたは仮想インターフェースのこと
送信側VTEPでイーサネットフレームに VNI(VXLAN Network Identifier)と呼ばれる
論理ネットワークを識別するためのIDを付加した上で
イーサネットフレームをVXLANパケットにカプセル化
L3ネットワークを介して宛先となる転送先のVTEP( リモートVTEP )へ転送
受信したVTEPでは、
VXLANによるカプセル化を解除し、宛先となるデバイスへオリジナルのイーサネットフレームを転送する
VXLANネットワーク識別子 (VNI) VXLAN Network Identifier
VLANのようなイメージ
各レイヤー2サブネットをセグメント化するために使用
フラッディング
ブロードキャストや不明な宛先の通信
HER (Head-End Replication)
ブロードキャスト、未知のユニキャスト、マルチキャスト(BUM)トラフィックを、
ネットワーク内の各デバイス(VTEP)へ転送・配信するための仕組みの一つ
HERの仕組み
パケット受信:送信元スイッチがBUMトラフィックを受け取る
コピー作成:送信元スイッチ自身が、宛先リストにあるすべてのVTEPの数だけパケットを複製
個別に送信:複製した各パケットを、ユニキャスト(宛先を指定した通信)としてそれぞれの宛先スイッチへ送信
Leaf-2# show evpn vni 100
VNI: 100
Type: L2
Tenant VRF: default
VxLAN interface: vxlan100
VxLAN ifIndex: 4
SVI interface: br100
SVI ifIndex: 5
Local VTEP IP: 172.16.0.4
Mcast group: 0.0.0.0
Remote VTEPs for this VNI:
#このVNI(100)におけるフラッディングにおいてマルチキャストグループを使わずに
#HERモードで動いてる
172.16.0.3 flood: HER
Number of MACs (local and remote) known for this VNI: 2
Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 4
Advertise-gw-macip: No
Advertise-svi-macip: Yes
マルチキャストを使わない場合、送信元(Head-End)であるLeafノードが、
宛先の数だけパケットをコピーして配る(Replication)必要があるため、HERが必須となる
00:00:00:00:00:00 dst 172.16.0.3 self permanent
参考
VXLANパケット
port 4789がVXLANの標準ポート
#tcpdump -i eth0 port 4789 -n -vv
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
07:51:44.280903 IP (tos 0x0, ttl 64, id 28015, offset 0, flags [none], proto UDP (17), length 134)
#Underlay
#VXLANトンネルの両端にあるVTEPのIPアドレス
172.16.0.4.58876 > 172.16.0.3.4789: [bad udp cksum 0x58ab -> 0x994c!] VXLAN, flags [I] (0x08), vni 100
IP (tos 0x0, ttl 64, id 35670, offset 0, flags [none], proto ICMP (1), length 84)
#Overlay
#実際に通信を行っている仮想マシンやコンテナ同士のアドレス
192.168.100.2 > 192.168.100.1: ICMP echo reply, id 868, seq 1, length 64
#パケットをファイルに保存
#tcpdump -i any port 4789 -w vxlan_capture.pcap
#中身を表示
#tcpdump -r vxlan_capture.pcap -nn -vvv
#tcpdump -r vxlan_capture.pcap -nn -vvv
reading from file vxlan_capture.pcap, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144
Warning: interface names might be incorrect
#1つ目 (07:52:19.662593 / In)
#eth1 から 172.16.0.3(対向のVTEP)が送信した VXLAN パケットを受信
07:52:19.662593 eth1 In IP (tos 0x0, ttl 63, id 9142, offset 0, flags [none], proto UDP (17), length 134)
172.16.0.3.58876 > 172.16.0.4.4789: [bad udp cksum 0x58ab -> 0x994c!] VXLAN, flags [I] (0x08), vni 100
IP (tos 0x0, ttl 64, id 38795, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.100.1 > 192.168.100.2: ICMP echo request, id 869, seq 1, length 64
# 192.168.100.2 から 192.168.100.1 への応答が、VXLAN でカプセル化されている。
07:52:19.662642 eth0 Out IP (tos 0x0, ttl 64, id 46884, offset 0, flags [none], proto UDP (17), length 134)
172.16.0.4.58876 > 172.16.0.3.4789: [bad udp cksum 0x58ab -> 0x994c!] VXLAN, flags [I] (0x08), vni 100
IP (tos 0x0, ttl 64, id 4418, offset 0, flags [none], proto ICMP (1), length 84)
192.168.100.2 > 192.168.100.1: ICMP echo reply, id 869, seq 1, length 64
環境
proxmox
ubuntuLXC_image
FRR8.x
proxmox側でLXCを作成する
spine-1
vmbr5 eth0 10.0.0.1/30
vmbr6 eth1 20.0.0.1/30
lo:172.16.0.1
spine-2
vmbr5 eth0 10.0.0.5/30
vmbr6 eth1 20.0.0.5/30
lo:172.16.0.2
leaf-1
vmbr5 eth0 10.0.0.2/30
vmbr6 eth1 20.0.0.6/30
lo:172.16.0.3
leaf-2
vmbr5 eth0 10.0.0.6/30
vmbr6 eth1 20.0.0.2/30
lo:172.16.0.4
全ノードで実行
#loアドレスにIPv4アドレスを割り当てる
#確認
ip addr add 172.16.0.X/32 dev lo label lo:0
ip addr show lo
OSPFプロセスにネットワークを参加させる
#--------------------------------------------#
#spine-1
router ospf
ospf router-id 172.16.0.1
!物理インターフェース隣接ルーターと接続用を広報
network 10.0.0.0/30 area 0
network 20.0.0.0/30 area 0
!Loopbackインターフェースを広報
network 172.16.0.1/32 area 0
#--------------------------------------------#
#spine-2
router ospf
ospf router-id 172.16.0.2
network 10.0.0.6/30 area 0
network 20.0.0.6/30 area 0
network 172.16.0.2/32 area 0
#--------------------------------------------#
#leaf-1
router ospf
ospf router-id 172.16.0.3
network 10.0.0.0/30 area 0
network 20.0.0.6/30 area 0
network 172.16.0.3/32 area 0
#--------------------------------------------#
#leaf-2
router ospf
ospf router-id 172.16.0.4
network 10.0.0.6/30 area 0
network 20.0.0.0/30 area 0
network 172.16.0.4/32 area 0
#--------------------------------------------#
OSPFネイバーを確認する
#show ip ospf neighbor
Spine-2# show ip ospf neighbor
#Neighbor ID 対向のOSPFルーターID
#Stateが「Full/Backup」「Full/DR 」ならば正常
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
172.16.0.4 1 Full/Backup 16.416s 31.459s 10.0.0.6 eth0:10.0.0.5 0 0 0
172.16.0.3 1 Full/DR 2m52s 37.476s 20.0.0.6 eth1:20.0.0.5 0 0 0
OSPFの等コスト負荷分散を確認する
Closトポロジー(Spine-Leafアーキテクチャ)
Leaf-2# show ip route ospf
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
#>: ベストパス
#*: FIB(転送用テーブル)にインストール済み
#ステータス 宛先ネットワークアドレスとサブネットマスク [管理距離 / コスト] 次ホップ 送信先IF 経過時間
#送信先IFはパケットを送り出すルーターのインターフェースのこと
O>* 10.0.0.0/30 [110/20] via 20.0.0.1, eth1, weight 1, 00:02:58
#隣のルーターと物理的・直接的に繋がっているネットワーク
O 10.0.0.4/30 [110/10] is directly connected, eth0, weight 1, 00:03:11
O 20.0.0.0/30 [110/10] is directly connected, eth1, weight 1, 00:02:58
O>* 20.0.0.4/30 [110/20] via 10.0.0.5, eth0, weight 1, 00:03:03
O>* 172.16.0.1/32 [110/10] via 20.0.0.1, eth1, weight 1, 00:02:58
O>* 172.16.0.2/32 [110/10] via 10.0.0.5, eth0, weight 1, 00:03:03
#コストが同じなため二つともベストパスに選出されている。ロードバランシングと呼ぶ
O>* 172.16.0.3/32 [110/20] via 10.0.0.5, eth0, weight 1, 00:02:58
* via 20.0.0.1, eth1, weight 1, 00:02:58
O 172.16.0.4/32 [110/0] is directly connected, lo, weight 1, 00:02:57
OSPF経由でループバックへの到達性を確保。
ループバックアドレスのOSPF広報および疎通確認がとれた
BGPの設定に入る
ループバックインターフェース(lo)を使用してBGPネイバーを張る際、
update-source(更新元ソースの指定)」と「ebgp-multihop(EBGPの場合)」を忘れない
spine1~2
ip link add dummy0 type dummy
ip link set dummy0 up
#1
ip addr add 10.100.0.1/24 dev dummy0
#2
ip addr add 10.100.0.2/24 dev dummy0
ip addr show dummy0
SpineスイッチのBGP設定
設定項目のメモ
BGPピアグループの作成
複数のLeafスイッチに対して
共通の設定を適用するため
neighbor LEAF peer-group
ソフト再構成
BGPセッションを再確立せずに
経路情報の再読み込みを行うための設定
soft-reconfiguration inbound
ルートマップ
入出力される経路に対してポリシーを適用するフィルタ
route-map PERMIT-ALL
マルチパス
複数のLeafへの経路を同時にルーティングテーブルへ入れる
maximum-paths 2
#Spine-1
route-map PERMIT-ALL permit 10
!
router bgp 65000
bgp router-id 172.16.0.1
neighbor LEAF peer-group
neighbor LEAF remote-as 65001
neighbor 172.16.0.3 peer-group LEAF
neighbor 172.16.0.4 peer-group LEAF
neighbor LEAF update-source lo
neighbor LEAF ebgp-multihop 2
!
address-family ipv4 unicast
network 10.100.0.0/24
network 172.16.0.1/32
neighbor LEAF next-hop-self
neighbor LEAF soft-reconfiguration inbound
neighbor LEAF route-map PERMIT-ALL in
neighbor LEAF route-map PERMIT-ALL out
maximum-paths 2
exit-address-family
#Spine-2
route-map PERMIT-ALL permit 10
!
router bgp 65000
bgp router-id 172.16.0.2
neighbor LEAF peer-group
neighbor LEAF remote-as 65001
neighbor 172.16.0.3 peer-group LEAF
neighbor 172.16.0.4 peer-group LEAF
neighbor LEAF update-source lo
neighbor LEAF ebgp-multihop 2
!
address-family ipv4 unicast
network 10.100.0.0/24
network 172.16.0.2/32
neighbor LEAF next-hop-self
neighbor LEAF soft-reconfiguration inbound
neighbor LEAF route-map PERMIT-ALL in
neighbor LEAF route-map PERMIT-ALL out
maximum-paths 2
exit-address-family
LeafスイッチのBGP設定
#Leaf-1
route-map PERMIT-ALL permit 10
!
router bgp 65001
bgp router-id 172.16.0.3
neighbor SPINE peer-group
neighbor SPINE remote-as 65000
neighbor 172.16.0.1 peer-group SPINE
neighbor 172.16.0.2 peer-group SPINE
neighbor SPINE update-source lo
neighbor SPINE ebgp-multihop 2
address-family ipv4 unicast
network 172.16.0.3/32
neighbor SPINE soft-reconfiguration inbound
neighbor SPINE route-map PERMIT-ALL in
neighbor SPINE route-map PERMIT-ALL out
maximum-paths 2
exit-address-family
#Leaf-2
route-map PERMIT-ALL permit 10
!
router bgp 65001
bgp router-id 172.16.0.4
neighbor SPINE peer-group
neighbor SPINE remote-as 65000
neighbor 172.16.0.1 peer-group SPINE
neighbor 172.16.0.2 peer-group SPINE
neighbor SPINE update-source lo
neighbor SPINE ebgp-multihop 2
address-family ipv4 unicast
network 172.16.0.4/32
neighbor SPINE soft-reconfiguration inbound
neighbor SPINE route-map PERMIT-ALL in
neighbor SPINE route-map PERMIT-ALL out
maximum-paths 2
exit-address-family
ネイバーがloアドレスで確率されていることを確認する
Leaf-2# show ip bgp summary
IPv4 Unicast Summary (VRF default):
BGP router identifier 172.16.0.4, local AS number 65001 vrf-id 0
BGP table version 2
RIB entries 7, using 1344 bytes of memory
Peers 2, using 1448 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
172.16.0.1 4 65000 9 11 0 0 0 00:01:38 2 2 N/A
172.16.0.2 4 65000 9 11 0 0 0 00:01:38 2 2 N/A
Total number of neighbors 2
BGPテーブルにはあるが、RIBにはインストールされていない
#メモ:OSPFとBGPで二重広報をしていた
ネクストホップへの到達性確認
#OSPFによって正しくアドバタイズされている
#AD値110標準
#最適経路 bestとなっている
# Known via "ospf", distance 110, metric 10, best
Leaf-2# show ip route 172.16.0.1
Routing entry for 172.16.0.1/32
Known via "ospf", distance 110, metric 10, best
Last update 00:34:09 ago
* 20.0.0.1, via eth1, weight 1
Leaf-2# show ip route 172.16.0.2
Routing entry for 172.16.0.2/32
Known via "ospf", distance 110, metric 10, best
Last update 00:34:15 ago
* 10.0.0.5, via eth0, weight 1
#ネクストホップへの経路は確立されている
Leaf-2# show ip bgp 10.100.0.0/24
BGP routing table entry for 10.100.0.0/24, version 0
Paths: (2 available, no best path)
Not advertised to any peer
65000
172.16.0.1 (inaccessible) from 172.16.0.1 (172.16.0.1)
Origin IGP, metric 0, invalid, external
Last update: Sat Jun 13 05:55:11 2026
65000
172.16.0.2 (inaccessible) from 172.16.0.2 (172.16.0.2)
Origin IGP, metric 0, invalid, external
Last update: Sat Jun 13 05:55:11 2026
Leaf-2# show ip route 10.100.0.0/24
% Network not in table
ミス 二重広告してるからでは BGP/OSPF loアドレス
BGPから再広報を削除してみる
#Spine Leafでbgpからloアドレスの広報を削除する
router bgp AN
address-family ipv4 unicast
no network 172.16.0.X/32
clear ip bgp *
BGPの制御プレーンが正しく構築されたことを確認
Leaf-2# show ip route 172.16.0.1
Routing entry for 172.16.0.1/32
Known via "ospf", distance 110, metric 10, best
Last update 00:42:31 ago
* 20.0.0.1, via eth1, weight 1
Leaf-2# show ip bgp 10.100.0.0/24
BGP routing table entry for 10.100.0.0/24, version 5
Paths: (2 available, best #2, table default)
Advertised to non peer-group peers:
172.16.0.1 172.16.0.2
65000
172.16.0.2 (metric 10) from 172.16.0.2 (172.16.0.2)
Origin IGP, metric 0, valid, external, multipath #マルチパスの有効化
Last update: Sat Jun 13 06:06:46 2026
65000
172.16.0.1 (metric 10) from 172.16.0.1 (172.16.0.1)
Origin IGP, metric 0, valid, external, multipath, best (Router ID)
Last update: Sat Jun 13 06:06:46 2026
実際のパケット転送に使用できる状態なことを確認する
BGP ECMPの確認
Leaf-2# show ip bgp
BGP table version is 5, local router ID is 172.16.0.4, vrf id 0
Default local pref 100, local AS 65001
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*= 10.100.0.0/24 172.16.0.2 0 0 65000 i
*> 172.16.0.1 0 0 65000 i
Displayed 1 routes and 2 total paths
EVPNで同じL2セグメントを延伸したい
VXLANのカプセル化オーバーヘッドを考慮し1550バイトに設定する
#Spine/leaf
ip link set dev eth0 mtu 1550
ip link set dev eth1 mtu 1550
#設定の確認
#ip link show [NIC]
実際に大きなパケットが通るか確認する
#Leaf-2
#ping [対向のVTEPのIP] -s 1472 -M do
ping -c 3 172.16.0.3 -s 1472 -M do
#Spineノードに対しても
ping -c 3 172.16.0.1 -s 1472 -M do
#疎通確認する
Leaf間で同じVNIを使う
VXLANを利用したL2 VPN(オーバーレイネットワーク)の構築手順
VXLANの通信成立に必要な要素
向先(VTEP)を認識させる必要がある
nolearning を指定しているため
対向先のMACアドレスとIP(VTEPアドレス)を静的に手動登録するか、
BGP EVPNなどで動的にコントロールプレーンを解決する必要がある
#----------------------------------------------NOTE
#カプセル化の構成
#vxlan100 を作成し、L2ブリッジ br100 に所属させる
#VXLANインターフェースが自動的にMACアドレスを学習するのを防ぐためnolearningの指定をする
#誤った学習によるトラフィックのループを防ぐため
#-------------------------------------------------
#Leaf-1
ip link add vxlan100 type vxlan id 100 \
local 172.16.0.3 \
dstport 4789 \
nolearning
ip link set dev vxlan100 mtu 1550
ip link set vxlan100 up
#Bridge を作る
#FRRが広告するMACのために
ip link add br100 type bridge
ip link set br100 up
ip link set vxlan100 master br100
ip link add dummy100 type dummy
ip link set dummy100 up
#dummy100をbr100に追加する
ip link set dummy100 master br100
#個別に学習をオフにする
bridge link set dev vxlan100 learning off
#Leaf-2
ip link add vxlan100 type vxlan id 100 \
local 172.16.0.4 \
dstport 4789 \
nolearning
ip link set dev vxlan100 mtu 1550
ip link set vxlan100 up
ip link add br100 type bridge
ip link set br100 up
ip link set vxlan100 master br100
ip link add dummy100 type dummy
ip link set dummy100 up
ip link set dummy100 master br100
bridge link set dev vxlan100 learning off
VXLANトンネルとしての要件を確認する
#MTUの確認->1550
#学習の無効化->bridge_slave ... learning off
#ブリッジへの接続 master br100
root@Leaf-1:/# ip -d link show vxlan100
6: vxlan100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1550 qdisc noqueue master br100 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether a2:df:fb:92:0b:59 brd ff:ff:ff:ff:ff:ff promiscuity 1 allmulti 1 minmtu 68 maxmtu 65535
vxlan id 100 fan-map local 172.16.0.3 srcport 0 0 dstport 4789 nolearning ttl auto ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning off flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 8000.66:cc:a3:c3:93:f9 designated_root 8000.66:cc:a3:c3:93:f9 hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on bcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off locked off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
EVPNアドレスファミリ(コントロールプレーン)を確立する
BGP EVPNの設定にすすむ
#Spine
router bgp 65000
no bgp ebgp-requires-policy
address-family l2vpn evpn
neighbor LEAF activate
#Leaf
router bgp 65001
no bgp ebgp-requires-policy
address-family l2vpn evpn
#SVI(Switch Virtual Interface)に割り当てられたIPアドレスを、
#BGP EVPN経由で他のVTEP(対向ルータ)へ広報する
advertise-all-vni
advertise-svi-ip
neighbor SPINE activate
コントロールプレーン(EVPN)とデータプレーン(VXLAN)の紐付けは成功
対向との通信(リモートVTEPの認識)がまだ完了していない Remote VTEPs
Leaf-2# show evpn vni
VNI Type VxLAN IF # MACs # ARPs # Remote VTEPs Tenant VRF
100 L2 vxlan100 1 1 0 default
Leaf-2# show bgp l2vpn evpn summary
BGP router identifier 172.16.0.4, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 3, using 576 bytes of memory
Peers 2, using 1448 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
172.16.0.1 4 65000 100 97 0 0 0 00:01:05 0 2 N/A
172.16.0.2 4 65000 97 93 0 0 0 00:01:09 0 2 N/A
Total number of neighbors 2
ルートを正しく受け取れていることを確認する
Spine-2# show bgp l2vpn evpn summary
BGP router identifier 172.16.0.2, local AS number 65000 vrf-id 0
BGP table version 0
RIB entries 3, using 576 bytes of memory
Peers 2, using 1448 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
172.16.0.3 4 65001 97 98 0 0 0 00:02:04 2 4 N/A
172.16.0.4 4 65001 100 97 0 0 0 00:02:09 2 4 N/A
Total number of neighbors 2
Type-2(MAC/IP)とType-3(Inclusive Multicast)の両方が見えている
Spine-2# show bgp l2vpn evpn
BGP table version is 6, local router ID is 172.16.0.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN type-1 prefix: [1]:[EthTag]:[ESI]:[IPlen]:[VTEP-IP]:[Frag-id]
EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 172.16.0.3:2
*> [2]:[0]:[48]:[66:cc:a3:c3:93:f9]:[128]:[fe80::5895:fbff:fee7:5475]
172.16.0.3 0 65001 i
RT:65001:100 ET:8
*> [3]:[0]:[32]:[172.16.0.3]
172.16.0.3 0 65001 i
RT:65001:100 ET:8
Route Distinguisher: 172.16.0.4:2
*> [2]:[0]:[48]:[aa:73:c4:93:93:52]:[128]:[fe80::1421:b7ff:fe93:982c]
172.16.0.4 0 65001 i
RT:65001:100 ET:8
*> [3]:[0]:[32]:[172.16.0.4]
172.16.0.4 0 65001 i
RT:65001:100 ET:8
Displayed 4 out of 4 total prefixes
Leaf-2 側で State/PfxRcd が 0 ということはSpineがこれらのルートをLeaf-2へ広告(UPDATE)していない
#Spine
router bgp 65000
address-family l2vpn evpn
#Next-Hop-Unchanged(attribute-unchanged ) の確認
neighbor LEAF attribute-unchanged next-hop
neighbor LEAF allowas-in
#Leaf/Spine
clear ip bgp *
router bgp 65001
address-family l2vpn evpn
# Spineからのルート自分のAS番号が入っているものを受け入れる
neighbor SPINE allowas-in 1
172.16.0.1 (Spine-1) から 2つ のプレフィックスを受信できたことを確認する
Leaf-2# show bgp l2vpn evpn summary
BGP router identifier 172.16.0.4, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 3, using 576 bytes of memory
Peers 2, using 1448 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
172.16.0.1 4 65000 156 148 0 0 0 00:00:06 2 4 N/A
172.16.0.2 4 65000 137 153 0 0 0 00:00:06 0 4 N/A
Total number of neighbors 2
Leaf-2がSpine-2からのルートを重複として無視している?
BGP EVPN コントロールプレーンと VXLAN データプレーンの統合を確認する
Leaf-2# show evpn vni 100
VNI: 100
Type: L2
Tenant VRF: default
VxLAN interface: vxlan100
VxLAN ifIndex: 4
SVI interface: br100
SVI ifIndex: 5
#VTEPの状態
#このスイッチ(Leaf-2)が通信に使用するソースIPアドレス
Local VTEP IP: 172.16.0.4
Mcast group: 0.0.0.0
# 172.16.0.3 がリモートVTEP(Leaf-1)として登録している
#HER (Head-End Replication): マルチキャストグループ(IP)を使わずに、
#ユニキャストで複製(レプリケーション)して各VTEPへパケットを送信する方式
Remote VTEPs for this VNI:
172.16.0.3 flood: HER
#計2つのMACアドレスを把握
Number of MACs (local and remote) known for this VNI: 2
#ARP/ND情報も2つ把握
Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 2
Advertise-gw-macip: No
Advertise-svi-macip: No
EVPNでは、同じVLAN(またはVRF)に所属するスイッチ同士だけが
通信できるように、タグをつける
#RT:65001:100(Route Target)
BGPコントロールプレーンの状態を理解する
Leaf-2# show bgp l2vpn evpn
BGP table version is 6, local router ID is 172.16.0.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN type-1 prefix: [1]:[EthTag]:[ESI]:[IPlen]:[VTEP-IP]:[Frag-id]
EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
# [Type] [EthTagは基本0] [lenはサイズ] [VTEPのトンネル終端IP]
EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
Network Next Hop Metric LocPrf Weight Path
#2はMAC/IPアドレス、3はマルチキャスト転送用
#*> [2/3]
Route Distinguisher: 172.16.0.3:2
#Type-2 ルートMAC/IPアドバタイズ)
#[48]: MACアドレスのビット数
#[66:cc:a3:c3:93:f9]: 学習したMACアドレス本体
#[128]: IPアドレスのビット数(IPv6の場合)
#[fe80::...]: そのMACアドレスが持っているIPv6アドレス(リンクローカル)
#このMACアドレス(66:cc...)とIPv6を持つホストは、172.16.0.3(Leaf-1)の先にいる
*> [2]:[0]:[48]:[66:cc:a3:c3:93:f9]:[128]:[fe80::5895:fbff:fee7:5475]
#0 65000 65001 i
# 0: Metric (MED: Multi-Exit Discriminator)BGPのメトリック
#0のため特別な経路制御(優先順位の操作)は行われていない
# 65000 65001 : 65000 65001: 経由してきたAS番号のリスト
# i : (IGP): そのルートがどのプロトコルから生成されたか
# iはInterior Gateway Protocol(この場合はEVPN内部で生成された)を意味する
#Next Hop
172.16.0.3 0 65000 65001 i
#のVLAN(VRF)に属する情報かを識別するID
RT:65001:100 ET:8
#Type-3 ルート(Inclusive Multicast)
#ここへのマルチキャスト(フラッディング)を許可するというルート
# 172.16.0.3とVXLANトンネルを張ってブロードキャストや不明なユニキャストを転送して良い
# ->インクリメンタル・マルチキャスト
#ET:8(Ethernet Tag ID)
#EVI(EVPN Instance)やVLANの識別に使われる
#のMACアドレスやルートが 「VLAN 8」に所属している情報であることを示している
*> [3]:[0]:[32]:[172.16.0.3]
172.16.0.3 0 65000 65001 i
RT:65001:100 ET:8
Route Distinguisher: 172.16.0.4:2
*> [2]:[0]:[48]:[aa:73:c4:93:93:52]:[128]:[fe80::1421:b7ff:fe93:982c]
172.16.0.4 32768 i
ET:8 RT:65001:100
*> [3]:[0]:[32]:[172.16.0.4]
172.16.0.4 32768 i
ET:8 RT:65001:100
Displayed 4 out of 4 total prefixes
Leaf-2# show evpn mac vni 100
Number of MACs (local and remote) known for this VNI: 2
Flags: N=sync-neighs, I=local-inactive, P=peer-active, X=peer-proxy
MAC Type Flags Intf/Remote ES/VTEP VLAN Seq #'s
66:cc:a3:c3:93:f9 remote 172.16.0.3 0/0
aa:73:c4:93:93:52 local br100 1 0/0
MACテーブルの確認
root@Leaf-2:/# bridge fdb show dev vxlan100
#リモートホストの情報 (Leaf-1配下のホスト)
66:cc:a3:c3:93:f9 vlan 1 extern_learn master br100
66:cc:a3:c3:93:f9 extern_learn master br100
#ローカルホストの情報
#このスイッチのローカルポート(br100)に直結している(permanent)
aa:73:c4:93:93:52 vlan 1 master br100 permanent
aa:73:c4:93:93:52 master br100 permanent
#extern_learn 、BGP(コントロールプレーン)から受け取って学んだマーク
66:cc:a3:c3:93:f9 dst 172.16.0.3 self extern_learn
#デフォルトの転送先
00:00:00:00:00:00 dst 172.16.0.3 self permanent
FRR 側で ARP も広報するように設定
# Leaf-1 / Leaf-2
router bgp 65001
address-family l2vpn evpn
vni 100
advertise-svi-ip
#Leaf-1
ip addr add 192.168.100.1/24 dev br100
#Leaf-2
ip addr add 192.168.100.2/24 dev br100
疎通確認
dummy100インターフェースを使用しBGP EVPN コントロールプレーン経由で
VXLANトンネルが構築されL2 延伸が成功していることを確認
oot@Leaf-2:/# ping -c 3192.168.100.1
ping: invalid argument: '3192.168.100.1'
root@Leaf-2:/# ping -c 3 192.168.100.1
PING 192.168.100.1 (192.168.100.1) 56(84) bytes of data.
64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=0.161 ms
64 bytes from 192.168.100.1: icmp_seq=2 ttl=64 time=0.109 ms
64 bytes from 192.168.100.1: icmp_seq=3 ttl=64 time=0.102 ms
--- 192.168.100.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2031ms
rtt min/avg/max/mdev = 0.102/0.124/0.161/0.026 ms
Spine-2ノードでeth0を落としてみる
通信が継続されることを確認する
ip link set eth0 down
#Leaf-2
ping 192.168.100.1
