0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

EVPN/VXLAN動かしてみた(Part2)

Last updated at Posted at 2025-08-07

前回の記事
EVPN/VXLAN動かしてみた(Part1)

Part1の振り返り

Part1では主にアンダーレイの設定を行いました

  • 物理Interface設定
  • Loopback Interface設定(VTEP用、EVPN用)
  • ダイナミックルーティング設定(アンダーレイのBGP(LoopbackInterfaceのIP広報))

今回は引き続きオーバーレイの設定を入れていきます

  • EVPN MP-BGP設定

    • コントロールプレーンとして EVPN を使用します
    • MP-BGP の MP_REACH_NLRI 属性を通じて、EVPN Route Type(Type 2, 3, 5 など)を交換します
    • Type 2(MAC/IP Advertisement)は L2ブリッジング用途、Type 5(IP Prefix Advertisement)は L3ルーティング用途に使用されます
  • VXLAN設定

    • データプレーンとして動作します
    • UDPベースの VXLAN カプセル化により、異なる VTEP 間での L2セグメントの延伸(ブリッジング)を実現します

〇Overlay_EVPN設定

Loopback0でiBGPを形成

image.png

Config
Spine001
router bgp 64512
   neighbor LEAF-EVPN peer group
   neighbor LEAF-EVPN next-hop-unchanged
   neighbor LEAF-EVPN update-source Loopback0
   neighbor LEAF-EVPN ebgp-multihop 3
   neighbor LEAF-EVPN send-community extended
   neighbor LEAF-EVPN maximum-routes 12000
   neighbor 172.17.0.1 peer group LEAF-EVPN
   neighbor 172.17.0.1 remote-as 64612
   neighbor 172.17.0.1 description ## OVERLAY-To-Leaf001 ##
   neighbor 172.17.0.2 peer group LEAF-EVPN
   neighbor 172.17.0.2 remote-as 64613
   neighbor 172.17.0.2 description ## OVERLAY-To-Leaf002 ##
   neighbor 172.17.0.3 peer group LEAF-EVPN
   neighbor 172.17.0.3 remote-as 64614
   neighbor 172.17.0.3 description ## OVERLAY-To-Leaf003 ##
   !
   address-family evpn
      neighbor LEAF-EVPN activate
   !
   address-family ipv4
      no neighbor LEAF-EVPN activate
Spine002
router bgp 64512
   neighbor LEAF-EVPN peer group
   neighbor LEAF-EVPN next-hop-unchanged
   neighbor LEAF-EVPN update-source Loopback0
   neighbor LEAF-EVPN ebgp-multihop 3
   neighbor LEAF-EVPN send-community extended
   neighbor LEAF-EVPN maximum-routes 12000
   neighbor 172.17.0.1 peer group LEAF-EVPN
   neighbor 172.17.0.1 remote-as 64612
   neighbor 172.17.0.1 description ## OVERLAY-To-Leaf001 ##
   neighbor 172.17.0.2 peer group LEAF-EVPN
   neighbor 172.17.0.2 remote-as 64613
   neighbor 172.17.0.2 description ## OVERLAY-To-Leaf002 ##
   neighbor 172.17.0.3 peer group LEAF-EVPN
   neighbor 172.17.0.3 remote-as 64614
   neighbor 172.17.0.3 description ## OVERLAY-To-Leaf003 ##
   !
   address-family evpn
      neighbor LEAF-EVPN activate
   !
   address-family ipv4
      no neighbor LEAF-EVPN activate
Leaf001
router bgp 64612
   neighbor SPINE-EVPN peer group
   neighbor SPINE-EVPN remote-as 64512
   neighbor SPINE-EVPN update-source Loopback0
   neighbor SPINE-EVPN ebgp-multihop 3
   neighbor SPINE-EVPN send-community extended
   neighbor SPINE-EVPN maximum-routes 12000
   neighbor 172.16.0.1 peer group SPINE-EVPN
   neighbor 172.16.0.2 peer group SPINE-EVPN
   !
   address-family evpn
      neighbor SPINE-EVPN activate
   !
   address-family ipv4
      no neighbor SPINE-EVPN activate
Leaf002
router bgp 64613
   neighbor SPINE-EVPN peer group
   neighbor SPINE-EVPN remote-as 64512
   neighbor SPINE-EVPN update-source Loopback0
   neighbor SPINE-EVPN ebgp-multihop 3
   neighbor SPINE-EVPN send-community extended
   neighbor SPINE-EVPN maximum-routes 12000
   neighbor 172.16.0.1 peer group SPINE-EVPN
   neighbor 172.16.0.2 peer group SPINE-EVPN
   !
   address-family evpn
      neighbor SPINE-EVPN activate
   !
   address-family ipv4
      no neighbor SPINE-EVPN activate
Leaf003
router bgp 64614
   neighbor SPINE-EVPN peer group
   neighbor SPINE-EVPN remote-as 64512
   neighbor SPINE-EVPN update-source Loopback0
   neighbor SPINE-EVPN ebgp-multihop 3
   neighbor SPINE-EVPN send-community extended
   neighbor SPINE-EVPN maximum-routes 12000
   neighbor 172.16.0.1 peer group SPINE-EVPN
   neighbor 172.16.0.2 peer group SPINE-EVPN
   !
   address-family evpn
      neighbor SPINE-EVPN activate
   !
   address-family ipv4
      no neighbor SPINE-EVPN activate

MP-BGPでは、Path Attribute の一種として Extended Communities が付加されます。
この中には Route Target などの情報が含まれており、EVPNルートの Import/Export を制御するために重要です。

これが送信されないと、受信側で適切なルート選択ができず、EVPNの動作に支障が出るため、
send-community extended の設定は EVPN環境では必須です。

※ 実際のパケット内容については、今後 PCAP を取得して確認予定です。

〇Overlay_VXLAN設定

Loopback1をVTEPとして使用

VTEPの設定やVlan<-->L2VNIの紐づけ、L3VNIの設定などをしていきます
EVPNのRoute Type2,3,5を用いてL2ブリッジング、L3ルーティングに必要な情報を交換し
それらの情報をもとにVTEP間でUDPでトンネリングを行います
なお、今回はVXLAN間通信も試しますのでL3VNIの設定なども行います
Spineはただの土管になりますから、VXLANの設定はLeafのみに行います

Config
Leaf001
##-----------------------------------------------------------------------------------
##--全Leaf同じ設定を入れるため002,003は割愛。SVIのIPとRD(Route Distinguisher)は固有値に。
##-----------------------------------------------------------------------------------
!
vlan 100,200
!
vrf instance VRF-1
   rd 10.0.0.15:9999
!
interface Vxlan1
   vxlan source-interface Loopback1
   vxlan udp-port 4789
   vxlan vlan 100 vni 10100
   vxlan vlan 200 vni 10200
   vxlan vrf VRF-1 vni 9999 
! #------SVI----------
interface Vlan100
   vrf VRF-1
   ip address 10.100.0.240/24
   ip virtual-router address 10.100.0.254
!
interface Vlan200
   vrf VRF-1
   ip address 10.200.0.240/24
   ip virtual-router address 10.200.0.254
!
ip virtual-router mac-address 00:00:00:00:00:0a
!
router bgp 64612
 ~snip~
   !
   vlan 100
      rd 10.0.0.15:100
      route-target both 100:10100 
      redistribute learned
   !
   vlan 200
      rd 10.0.0.15:200
      route-target both 200:10200
      redistribute learned
   !
   vrf VRF-1
      rd 10.0.0.15:9999
      route-target import 99:9999
      route-target export 99:9999
      redistribute connected

🔧 設定ポイント補足

  • vxlan vrf VRF-1 vni 9999:VRF-1 に対応する L3VNI を定義。L3VXLAN通信に必要。

  • rd(Route Distinguisher):EVPNルートを一意に識別するための値。VLANごと、VRFごとにユニークに設定。

  • route-target:EVPNルートのインポート/エクスポート制御。L2VNIでは both、L3VNIでは import/export を明示。

  • redistribute learned
    他VTEPから受信した MAC/IP 情報(Type 2)を BGP に再広告することで、他の VTEP にも伝播させる。
    → L2VNI における MAC 学習の拡散に必要。

  • redistribute connected
    ローカルの SVI(Vlanインターフェース)に設定された IP プレフィックスを EVPN 経由で広告(Type 5)。
    → L3VNI におけるルーティング情報の共有に必要。

L3VNIやL2VNIなどが出てきますが整理のためイメージを作成してみました

  • L2ブリッジング(同一Vlan通信)の場合はL2VNI(Vlanに紐づくVNI)でVXLANカプセル化
  • L3ルーティング(Vxlan間通信)の場合はL3VNI(VRFに紐づくVNI)でVXLANカプセル化
    ※詳細は次回、PACPを取得して見ていきます!
    image.png

〇Status確認

オーバーレイの設定が完了したのでEVPN,VXLANのステータスを確認します

Overlay
Spine001==== show bgp summary ====
BGP summary information for VRF default
Router identifier 172.16.0.1, local AS number 64512
Neighbor             AS Session State AFI/SAFI                AFI/SAFI State   NLRI Rcd   NLRI Acc
----------- ----------- ------------- ----------------------- -------------- ---------- ----------
172.17.0.1        64612 Established   L2VPN EVPN              Negotiated              6          6
172.17.0.2        64613 Established   L2VPN EVPN              Negotiated              2          2
172.17.0.3        64614 Established   L2VPN EVPN              Negotiated              6          6
Spine002==== show bgp summary ====
BGP summary information for VRF default
Router identifier 172.16.0.2, local AS number 64512
Neighbor              AS Session State AFI/SAFI                AFI/SAFI State   NLRI Rcd   NLRI Acc
------------ ----------- ------------- ----------------------- -------------- ---------- ----------
172.17.0.1         64612 Established   L2VPN EVPN              Negotiated              4          4
172.17.0.2         64613 Established   L2VPN EVPN              Negotiated              2          2
172.17.0.3         64614 Established   L2VPN EVPN              Negotiated              6          6
Leaf001==== show bgp summary ====
BGP summary information for VRF default
Router identifier 172.17.0.1, local AS number 64612
Neighbor              AS Session State AFI/SAFI                AFI/SAFI State   NLRI Rcd   NLRI Acc
------------ ----------- ------------- ----------------------- -------------- ---------- ----------
172.16.0.1         64512 Established   L2VPN EVPN              Negotiated              8          8
172.16.0.2         64512 Established   L2VPN EVPN              Negotiated              8          8
Leaf002==== show bgp summary ====
BGP summary information for VRF default
Router identifier 172.17.0.2, local AS number 64613
Neighbor              AS Session State AFI/SAFI                AFI/SAFI State   NLRI Rcd   NLRI Acc
------------ ----------- ------------- ----------------------- -------------- ---------- ----------
172.16.0.1         64512 Established   L2VPN EVPN              Negotiated             12         12
172.16.0.2         64512 Established   L2VPN EVPN              Negotiated             12         12
Leaf003==== show bgp summary ====
BGP summary information for VRF default
Router identifier 172.17.0.3, local AS number 64614
Neighbor              AS Session State AFI/SAFI                AFI/SAFI State   NLRI Rcd   NLRI Acc
------------ ----------- ------------- ----------------------- -------------- ---------- ----------
172.16.0.1         64512 Established   L2VPN EVPN              Negotiated              8          8
172.16.0.2         64512 Established   L2VPN EVPN              Negotiated              8          8
Leaf001==== show bgp evpn ====
##----Leaf002,003も同様なので割愛
BGP routing table information for VRF default
Router identifier 172.17.0.1, local AS number 64612
Route status codes: * - valid, > - active, S - Stale, E - ECMP head, e - ECMP
                    c - Contributing to ECMP, % - Pending best path selection
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop

          Network                Next Hop              Metric  LocPref Weight  Path
 * >      RD: 10.0.0.15:100 imet 10.0.0.15
                                 -                     -       -       0       i
 * >      RD: 10.0.0.15:200 imet 10.0.0.15
                                 -                     -       -       0       i
 * >Ec    RD: 10.0.0.16:100 imet 10.0.0.16
                                 10.0.0.16             -       100     0       64512 64613 i
 *  ec    RD: 10.0.0.16:100 imet 10.0.0.16
                                 10.0.0.16             -       100     0       64512 64613 i
 * >Ec    RD: 10.0.0.16:200 imet 10.0.0.16
                                 10.0.0.16             -       100     0       64512 64613 i
 *  ec    RD: 10.0.0.16:200 imet 10.0.0.16
                                 10.0.0.16             -       100     0       64512 64613 i
 * >Ec    RD: 10.0.0.17:100 imet 10.0.0.17
                                 10.0.0.17             -       100     0       64512 64614 i
 *  ec    RD: 10.0.0.17:100 imet 10.0.0.17
                                 10.0.0.17             -       100     0       64512 64614 i
 * >Ec    RD: 10.0.0.17:200 imet 10.0.0.17
                                 10.0.0.17             -       100     0       64512 64614 i
 *  ec    RD: 10.0.0.17:200 imet 10.0.0.17
                                 10.0.0.17             -       100     0       64512 64614 i
Leaf001==== show interface vxlan1 ====
##----Leaf002,003も同様なので割愛
Vxlan1 is up, line protocol is up (connected)
  Hardware is Vxlan
  Source interface is Loopback1 and is active with 10.0.0.15
  Listening on UDP port 4789
  Replication/Flood Mode is headend with Flood List Source: EVPN
  Remote MAC learning via EVPN
  VNI mapping to VLANs
  Static VLAN to VNI mapping is 
    [100, 10100]      [200, 10200]     
  Dynamic VLAN to VNI mapping for 'evpn' is
    [4094, 9999]     
  Note: All Dynamic VLANs used by VCS are internal VLANs.
        Use 'show vxlan vni' for details.
  Static VRF to VNI mapping is 
   [VRF-1, 9999]
  Headend replication flood vtep list is: ##--VNIごとにリモートVTEPが検出できている
   100 10.0.0.17       10.0.0.16      
   200 10.0.0.17       10.0.0.16      
  Shared Router MAC is 0000.0000.0000

※本環境でのノード、VTEP IP、VNI,RD,RTの対応表

Node VTEP IP VNI RD RT
Leaf001 10.0.0.15 100 10.0.0.15:100 100:10100
200 10.0.0.15:200 200:10200
Leaf002 10.0.0.16 100 10.0.0.16:100 100:10100
200 10.0.0.16:200 200:10200
Leaf003 10.0.0.17 100 10.0.0.17:100 100:10100
200 10.0.0.17:200 200:10200
  • Spine<->LeafでEVPNがEstablishedになっていることが確認できました
  • show bgp evpnの結果からRouteType3を受信していることが確認できました
    • RD:10.0.0.x:100 などの出力から、リモートVTEPがVNI100、200に所属していることを学習しています
  • vxlan interface (VTEP)がUpになっており、リモートVTEPも検出できていることが確認できました

次回

無事にアンダーレイ/オーバーレイの構築ができ、ステータス確認もできました!
次回は実際にホストを接続し同一Vlan、Vlan間通信を発生させ、各種ステータスやパケットキャプチャをみていきたいとおもいます

おわり

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?