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?

CML2でVXLAN/EVPNを検証してみる Part4【Config一覧編】

0
Last updated at Posted at 2026-10-17

はじめに

本記事では、Cisco Modeling Labs(CML2)を使用して構築した、VXLAN EVPN環境の設定情報を紹介します。

今回は、iBGPを使用したSpine-Leaf構成を採用しており、Spineスイッチ2台、Leafスイッチ4台の合計6台のNexus 9000vで検証しています。

各機器のConfigを掲載していますので、VXLAN EVPNを実際に構築・検証したい方の参考になれば幸いです。

なお、設定を流用する場合は、管理用IPアドレス、インターフェイス番号、認証情報などを適宜変更してください。

注意事項

  • 本記事は、NX-OS 10.3(1)を使用した検証環境を基にしています。
  • NX-OSのバージョンや機種によって、使用できるコマンドや必要な設定が異なる場合があります。
  • Configは通信に関連する主要な設定を抽出したものです。機器の初期セットアップや認証設定などは別途必要です。
  • PIMマルチキャストやTCAMに関する設定は、使用するプラットフォームの仕様を確認してください。

検証環境

使用機器

項目 内容
エミュレーター Cisco Modeling Labs(CML2)
ネットワークOS Cisco NX-OS 10.3(1)
仮想スイッチ Nexus 9000v
Spineスイッチ 2台
Leafスイッチ 4台
BGP AS番号 65000
アンダーレイのルーティング OSPF
オーバーレイのコントロールプレーン MP-BGP EVPN(iBGP)
BUMトラフィックの転送方式 PIMマルチキャスト
仮想デフォルトゲートウェイ Anycast Gateway

検証環境に必要なメモリ

今回の検証環境では、Nexus 9000vを6台稼働させるために、その他の検証用機器も含めて合計約50GBのメモリを使用しました。

必要なメモリ量は、使用するNX-OSイメージやCMLのバージョン、起動するノード数などによって変動します。

特にNexus 9000vは比較的多くのメモリを消費するため、余裕のあるハードウェア構成を推奨します。

物理構成図とアドレス情報

image.png

今回の検証環境は、2台のSpineスイッチに4台のLeafスイッチを接続した構成です。

各Leafスイッチは両方のSpineスイッチに接続されています。

機器ごとのIPアドレス

機器名 管理IPアドレス BGP Router ID / Loopback1 VTEP IPアドレス
SpineSW1 192.168.0.201 1.1.1.1 -
SpineSW2 192.168.0.202 2.2.2.2 -
LeafSW1 192.168.0.203 3.3.3.3 13.13.13.13
LeafSW2 192.168.0.204 4.4.4.4 14.14.14.14
LeafSW3 192.168.0.205 5.5.5.5 15.15.15.15
LeafSW4 192.168.0.206 6.6.6.6 16.16.16.16

アンダーレイのIPアドレス

Spine側 Spine側IP Leaf側 Leaf側IP
SpineSW1 Eth1/1 10.1.1.1/30 LeafSW1 Eth1/1 10.1.1.2/30
SpineSW1 Eth1/2 10.1.1.5/30 LeafSW2 Eth1/1 10.1.1.6/30
SpineSW1 Eth1/3 10.1.1.9/30 LeafSW3 Eth1/1 10.1.1.10/30
SpineSW1 Eth1/4 10.1.1.13/30 LeafSW4 Eth1/1 10.1.1.14/30
SpineSW2 Eth1/1 10.1.2.1/30 LeafSW1 Eth1/2 10.1.2.2/30
SpineSW2 Eth1/2 10.1.2.5/30 LeafSW2 Eth1/2 10.1.2.6/30
SpineSW2 Eth1/3 10.1.2.9/30 LeafSW3 Eth1/2 10.1.2.10/30
SpineSW2 Eth1/4 10.1.2.13/30 LeafSW4 Eth1/2 10.1.2.14/30

VLAN・VNIの対応関係

VLAN VNI 種別 用途
VLAN 140 50140 L2 VNI Tenant-1のL2セグメント
VLAN 141 50141 L2 VNI Tenant-1のL2セグメント
VLAN 999 50999 L3 VNI Tenant-1のL3ルーティング

今回の構成では、Tenant-1というVRFを作成し、2つのL2 VNIと1つのL3 VNIを使用します。

VLAN 140とVLAN 141のデフォルトゲートウェイには、各Leafスイッチで共通のIPアドレスと仮想MACアドレスを使用するAnycast Gatewayを採用しています。

重要なConfigの解説

ここでは、VXLAN EVPNを構築するうえで重要なコマンドを整理します。

詳細については、Cisco公式のConfiguration Guideを参照してください。

1. VXLAN EVPNの有効化

VXLAN EVPNを利用するためには、関連機能を有効にする必要があります。

コマンド 説明
feature vn-segment-vlan-based VLANとVNIのマッピング機能を有効化
feature nv overlay VXLANオーバーレイ機能を有効化
nv overlay evpn VXLANのEVPNコントロールプレーンを有効化
feature bgp BGP機能を有効化
feature interface-vlan SVI機能を有効化

NVEインターフェイスを作成するLeafスイッチでは、VXLAN関連機能を有効にする必要があります。

2. VLANとL2 VNIのマッピング

vlan 140
  vn-segment 50140

vlan 141
  vn-segment 50141

vn-segmentコマンドでVLANとL2 VNIを対応付けます。

今回の構成では、VLAN 140をVNI 50140、VLAN 141をVNI 50141にマッピングしています。

これにより、異なるVTEP間で同一VNIに所属するL2セグメントを拡張できます。

3. VRFとL3 VNIの設定

vrf context Tenant-1
  vni 50999
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn
コマンド 説明
vrf context Tenant-1 VRFの作成
vni 50999 VRFとL3 VNIの関連付け
rd auto RDを自動設定
address-family ipv4 unicast IPv4ユニキャストアドレスファミリの設定
route-target both auto インポート・エクスポート用のRoute Targetを自動設定
route-target both auto evpn EVPN向けのRoute Targetを自動設定

RD(Route Distinguisher)は、異なるVRFに存在する経路を識別するための値です。

RT(Route Target)は、VPN経路のインポート・エクスポートを制御するために使用します。

今回のようなiBGP構成では、autoによるRTの自動設定を利用できます。

一方、eBGPを使用する場合は、RTの自動設定方式や相互接続条件が異なるため、手動設定が必要になる場合があります。

4. L3 VNI用VLANの設定

vlan 999
  vn-segment 50999

interface Vlan999
  no shutdown
  vrf member Tenant-1
  ip forward

VLAN 999は、L3 VNI 50999に対応する内部VLANです。

L3 VNIはVXLANによるL3ルーティングに使用されるものであり、通常のサーバ接続用VLANとは用途が異なります。

このVLANをテナントVRFに関連付けることで、VXLANファブリック内でL3トラフィックを転送できるようにします。

5. Anycast Gatewayの設定

fabric forwarding anycast-gateway-mac 0000.2222.3333

interface Vlan140
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.140.1/24
  fabric forwarding mode anycast-gateway
コマンド 説明
fabric forwarding anycast-gateway-mac Anycast Gatewayで使用する仮想MACアドレスを設定
fabric forwarding mode anycast-gateway SVIでAnycast Gatewayを有効化
ip address SVIのIPアドレスを設定

Anycast Gatewayは、複数のLeafスイッチで同じデフォルトゲートウェイのIPアドレスと仮想MACアドレスを使用する仕組みです。

各Leafスイッチがローカルでデフォルトゲートウェイとして機能するため、ホストが接続されているLeafスイッチでL3転送を実行できます。

注意:同一のAnycast Gatewayを提供するLeafスイッチでは、仮想MACアドレスを統一する必要があります。

6. NVEインターフェイスの設定

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback13

  member vni 50140
    suppress-arp
    mcast-group 239.0.0.140

  member vni 50141
    suppress-arp
    mcast-group 239.0.0.141

  member vni 50999 associate-vrf
コマンド 説明
interface nve1 NVEインターフェイスを作成
host-reachability protocol bgp ホストの到達可能性情報をBGP EVPNで交換
source-interface loopback13 VTEPの送信元IPアドレスを指定
member vni 50140 L2 VNIをNVEインターフェイスに追加
mcast-group 239.0.0.140 L2 VNIに対応するマルチキャストグループを指定
suppress-arp ARP Suppressionを有効化
member vni 50999 associate-vrf L3 VNIをVRFに関連付け

NVE(Network Virtualization Edge)インターフェイスは、VXLANのカプセル化・カプセル化解除を行うための論理インターフェイスです。

今回の構成では、BUMトラフィックの転送にPIMマルチキャストを利用しています。

そのため、L2 VNIごとにmcast-groupを設定しています。

7. Ingress Replicationについて

VXLANのBUMトラフィックを転送する方法として、PIMマルチキャスト以外にIngress Replicationがあります。

interface nve1
  member vni 50140
    ingress-replication protocol bgp

Ingress Replicationは、送信元VTEPがBUMトラフィックを複製し、対象のリモートVTEPにユニキャストで送信する方式です。

この方式を使用する場合、VXLANのBUM転送を目的としたアンダーレイのPIMマルチキャスト環境は不要になります。

ただし、本記事の実際の検証ConfigではIngress Replicationではなく、PIMマルチキャストを使用しています。

mcast-groupとingress-replication protocol bgpは、同じL2 VNIに対するBUM転送方式の選択肢として理解してください。

8. BGP EVPNの設定

router bgp 65000
  router-id 3.3.3.3
  address-family ipv4 unicast
  address-family l2vpn evpn

  neighbor 1.1.1.1
    remote-as 65000
    update-source loopback1
    address-family l2vpn evpn
      send-community
      send-community extended
コマンド 説明
router bgp 65000 BGPプロセスの設定
router-id BGP Router IDの指定
neighbor BGPピアの設定
remote-as 対向BGPピアのAS番号
update-source BGPセッションの送信元インターフェイス指定
address-family l2vpn evpn EVPN経路交換用のアドレスファミリを設定
send-community extended Extended Community属性を送信

今回の検証では、全Spine・LeafスイッチでAS番号65000を使用しています。

SpineスイッチはRoute Reflector(RR)として動作し、Leafスイッチ間のEVPN経路交換を中継します。

そのため、Leafスイッチ同士が直接BGPピアを確立する必要はありません。

9. SpineスイッチのRoute Reflector設定

router bgp 65000
  address-family l2vpn evpn
    retain route-target all

  template peer LEAF-PEER
    remote-as 65000
    update-source loopback1

    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client

route-reflector-clientは、対象のBGPピアをRoute Reflector Clientとして指定するコマンドです。

retain route-target allは、Spineスイッチがローカルで使用していないRTを持つEVPN経路についても、保持するための設定です。

今回の構成では、SpineSW1とSpineSW2の両方をRoute Reflectorとして利用しています。

10. EVPNのRD・RT設定

evpn
  vni 50140 l2
    rd auto
    route-target import auto
    route-target export auto

  vni 50141 l2
    rd auto
    route-target import auto
    route-target export auto

各L2 VNIにRDとRTを設定します。

コマンド 説明
evpn EVPN設定モードに移行
vni 50140 l2 L2 VNIを指定
rd auto RDを自動設定
route-target import auto インポートRTを自動設定
route-target export auto エクスポートRTを自動設定

なお、L3 VNIのRD・RT設定はテナントVRF側で行います。

11. PIM Anycast RPの設定

今回の構成では、2台のSpineスイッチでAnycast RPを使用しています。

ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8
ip pim anycast-rp 11.11.11.11 1.1.1.1
ip pim anycast-rp 11.11.11.11 2.2.2.2

Anycast RPは、複数のRP(Rendezvous Point)で共通のRPアドレスを使用するための仕組みです。

今回の構成では、両SpineスイッチにLoopback11として11.11.11.11/32を設定しています。

BGP Route ReflectorとPIM Anycast RPは、役割が異なる機能です。

前者はBGPの経路交換を中継するための機能であり、後者はPIMマルチキャストのRPを冗長化するための機能です。

12. ARP Suppressionの設定

interface nve1
  member vni 50140
    suppress-arp

ARP Suppressionは、VTEPが学習したIPアドレスとMACアドレスの対応情報を利用し、不要なARP Requestのフラッディングを抑制する機能です。

NX-OSのバージョンやハードウェアによっては、ARP Suppressionを使用するためにTCAM領域の調整が必要になります。

今回取得したConfigでは、以下の設定を使用しています。

hardware access-list tcam region vpc-convergence 0
hardware access-list tcam region arp-ether 512

TCAMの設定はプラットフォーム固有の制約があるため、他の機種にそのまま適用しないでください。

また、TCAM領域の変更後に再起動が必要となる場合があります。

13. eBGPを使用する場合の補足

本記事ではiBGPを使用していますが、eBGPによるEVPNファブリックを構築する場合は、以下のコマンドが関係することがあります。

コマンド 用途
allowas-in AS_PATH内に自身のAS番号が含まれる経路の受信を許可
disable-peer-as-check 経路広告時のピアASチェックを無効化
set ip next-hop unchanged BGP経路のNext Hopを変更せず維持
route-target import インポート対象のRTを指定
route-target export エクスポートするRTを指定

これらのコマンドは、eBGPを使用すれば必ずすべて必要になるというものではありません。

実際のAS設計やBGPセッション構成、使用するNX-OSのバージョンに応じて設定してください。


SpineSW1のConfig

ここからは、検証環境で使用した各機器のConfigを掲載します。

認証情報やSNMP認証ハッシュ、RMONなどの自動生成・共通管理設定は省略し、VXLAN EVPNの通信検証に関係する設定を中心に整理しています。

hostname SpineSW1

feature ospf
feature bgp
feature pim
nv overlay evpn

no system default switchport

clock timezone JST 9 0

! PIM Anycast RP
ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8
ip pim anycast-rp 11.11.11.11 1.1.1.1
ip pim anycast-rp 11.11.11.11 2.2.2.2

! Management VRF
vrf context management
  ip route 0.0.0.0/0 192.168.0.1

! Underlay Interfaces
interface Ethernet1/1
  mtu 9216
  ip address 10.1.1.1/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.1.5/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  mtu 9216
  ip address 10.1.1.9/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/4
  mtu 9216
  ip address 10.1.1.13/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

! Management Interface
interface mgmt0
  vrf member management
  ip address 192.168.0.201/24

! BGP Router ID
interface loopback1
  ip address 1.1.1.1/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

! PIM Anycast RP
interface loopback11
  ip address 11.11.11.11/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

! OSPF
router ospf UNDERLAY-NET
  router-id 1.1.1.1

! BGP Route Reflector
router bgp 65000
  router-id 1.1.1.1
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  template peer LEAF-PEER
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client

    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client

  neighbor 3.3.3.3
    inherit peer LEAF-PEER

  neighbor 4.4.4.4
    inherit peer LEAF-PEER

  neighbor 5.5.5.5
    inherit peer LEAF-PEER

  neighbor 6.6.6.6
    inherit peer LEAF-PEER

SpineSW2のConfig

SpineSW2はSpineSW1とほぼ同じ設定です。

IPアドレスとRouter IDを変更しています。

hostname SpineSW2

feature ospf
feature bgp
feature pim
nv overlay evpn

no system default switchport

clock timezone JST 9 0

! PIM Anycast RP
ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8
ip pim anycast-rp 11.11.11.11 1.1.1.1
ip pim anycast-rp 11.11.11.11 2.2.2.2

vrf context management
  ip route 0.0.0.0/0 192.168.0.1

! Underlay Interfaces
interface Ethernet1/1
  mtu 9216
  ip address 10.1.2.1/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.2.5/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  mtu 9216
  ip address 10.1.2.9/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/4
  mtu 9216
  ip address 10.1.2.13/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface mgmt0
  vrf member management
  ip address 192.168.0.202/24

! BGP Router ID
interface loopback1
  ip address 2.2.2.2/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

! PIM Anycast RP
interface loopback11
  ip address 11.11.11.11/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

router ospf UNDERLAY-NET
  router-id 2.2.2.2

! BGP Route Reflector
router bgp 65000
  router-id 2.2.2.2
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  template peer LEAF-PEER
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client

    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client

  neighbor 3.3.3.3
    inherit peer LEAF-PEER

  neighbor 4.4.4.4
    inherit peer LEAF-PEER

  neighbor 5.5.5.5
    inherit peer LEAF-PEER

  neighbor 6.6.6.6
    inherit peer LEAF-PEER

LeafSW1のConfig

LeafSW1では、VXLANのVTEP、Anycast Gateway、L2/L3 VNI、BGP EVPNなどを設定しています。

hostname LeafSW1

feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature nv overlay
nv overlay evpn

no system default switchport

clock timezone JST 9 0

! ARP Suppression用TCAM設定
! 使用機種・バージョンに応じて要確認
hardware access-list tcam region vpc-convergence 0
hardware access-list tcam region arp-ether 512

! Anycast Gateway MAC
fabric forwarding anycast-gateway-mac 0000.2222.3333

! PIM
ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

! VLAN / VNI
vlan 140
  name L2-VNI-140-Tenant1
  vn-segment 50140

vlan 141
  name L2-VNI-141-Tenant1
  vn-segment 50141

vlan 999
  vn-segment 50999

spanning-tree vlan 1,140-141,999 priority 4096

! Tenant VRF
vrf context Tenant-1
  vni 50999
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn

vrf context management
  ip route 0.0.0.0/0 192.168.0.1

! Anycast Gateway
interface Vlan140
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.140.1/24
  fabric forwarding mode anycast-gateway

interface Vlan141
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.141.1/24
  fabric forwarding mode anycast-gateway

! L3 VNI
interface Vlan999
  no shutdown
  vrf member Tenant-1
  ip forward

! VXLAN NVE
interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback13

  member vni 50140
    suppress-arp
    mcast-group 239.0.0.140

  member vni 50141
    suppress-arp
    mcast-group 239.0.0.141

  member vni 50999 associate-vrf

! Underlay Interfaces
interface Ethernet1/1
  mtu 9216
  ip address 10.1.1.2/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.2.2/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

! Server-facing Interface
interface Ethernet1/11
  switchport
  switchport access vlan 140
  no shutdown

! Management
interface mgmt0
  vrf member management
  ip address 192.168.0.203/24

! BGP Router ID
interface loopback1
  ip address 3.3.3.3/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

! VTEP
interface loopback13
  ip address 13.13.13.13/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

! OSPF
router ospf UNDERLAY-NET
  router-id 3.3.3.3

! BGP EVPN
router bgp 65000
  router-id 3.3.3.3
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  neighbor 1.1.1.1
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

  neighbor 2.2.2.2
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

! EVPN L2 VNI
evpn
  vni 50140 l2
    rd auto
    route-target import auto
    route-target export auto

  vni 50141 l2
    rd auto
    route-target import auto
    route-target export auto

LeafSW2のConfig

LeafSW2はLeafSW1とほぼ同じ設定です。

IPアドレス、Router ID、VTEP用Loopbackインターフェイスなどを変更しています。

hostname LeafSW2

feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature nv overlay
nv overlay evpn

no system default switchport

clock timezone JST 9 0

hardware access-list tcam region vpc-convergence 0
hardware access-list tcam region arp-ether 512

fabric forwarding anycast-gateway-mac 0000.2222.3333

ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 140
  name L2-VNI-140-Tenant1
  vn-segment 50140

vlan 141
  name L2-VNI-141-Tenant1
  vn-segment 50141

vlan 999
  vn-segment 50999

spanning-tree vlan 1,140-141,999 priority 4096

vrf context Tenant-1
  vni 50999
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn

vrf context management
  ip route 0.0.0.0/0 192.168.0.1

interface Vlan140
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.140.1/24
  fabric forwarding mode anycast-gateway

interface Vlan141
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.141.1/24
  fabric forwarding mode anycast-gateway

interface Vlan999
  no shutdown
  vrf member Tenant-1
  ip forward

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback14

  member vni 50140
    suppress-arp
    mcast-group 239.0.0.140

  member vni 50141
    suppress-arp
    mcast-group 239.0.0.141

  member vni 50999 associate-vrf

interface Ethernet1/1
  mtu 9216
  ip address 10.1.1.6/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.2.6/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface mgmt0
  vrf member management
  ip address 192.168.0.204/24

interface loopback1
  ip address 4.4.4.4/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

interface loopback14
  ip address 14.14.14.14/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

router ospf UNDERLAY-NET
  router-id 4.4.4.4

router bgp 65000
  router-id 4.4.4.4
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  neighbor 1.1.1.1
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

  neighbor 2.2.2.2
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

evpn
  vni 50140 l2
    rd auto
    route-target import auto
    route-target export auto

  vni 50141 l2
    rd auto
    route-target import auto
    route-target export auto

LeafSW3のConfig

LeafSW3では、サーバ接続用インターフェイスにVLAN 140とVLAN 141を割り当てています。

hostname LeafSW3

feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature nv overlay
nv overlay evpn

no system default switchport

clock timezone JST 9 0

hardware access-list tcam region vpc-convergence 0
hardware access-list tcam region arp-ether 512

fabric forwarding anycast-gateway-mac 0000.2222.3333

ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 140
  name L2-VNI-140-Tenant1
  vn-segment 50140

vlan 141
  name L2-VNI-141-Tenant1
  vn-segment 50141

vlan 999
  vn-segment 50999

spanning-tree vlan 1,140-141,999 priority 4096

vrf context Tenant-1
  vni 50999
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn

vrf context management
  ip route 0.0.0.0/0 192.168.0.1

interface Vlan140
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.140.1/24
  fabric forwarding mode anycast-gateway

interface Vlan141
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.141.1/24
  fabric forwarding mode anycast-gateway

interface Vlan999
  no shutdown
  vrf member Tenant-1
  ip forward

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback15

  member vni 50140
    suppress-arp
    mcast-group 239.0.0.140

  member vni 50141
    suppress-arp
    mcast-group 239.0.0.141

  member vni 50999 associate-vrf

interface Ethernet1/1
  mtu 9216
  ip address 10.1.1.10/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.2.10/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

! Server-facing Interfaces
interface Ethernet1/10
  switchport
  switchport access vlan 141
  no shutdown

interface Ethernet1/11
  switchport
  switchport access vlan 140
  no shutdown

interface mgmt0
  vrf member management
  ip address 192.168.0.205/24

interface loopback1
  ip address 5.5.5.5/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

interface loopback15
  ip address 15.15.15.15/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

router ospf UNDERLAY-NET
  router-id 5.5.5.5

router bgp 65000
  router-id 5.5.5.5
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  neighbor 1.1.1.1
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

  neighbor 2.2.2.2
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

evpn
  vni 50140 l2
    rd auto
    route-target import auto
    route-target export auto

  vni 50141 l2
    rd auto
    route-target import auto
    route-target export auto

LeafSW4のConfig

LeafSW4は、LeafSW1~LeafSW3と同様のVXLAN EVPN設定を使用しています。

hostname LeafSW4

feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature nv overlay
nv overlay evpn

no system default switchport

clock timezone JST 9 0

hardware access-list tcam region vpc-convergence 0
hardware access-list tcam region arp-ether 512

fabric forwarding anycast-gateway-mac 0000.2222.3333

ip pim rp-address 11.11.11.11 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 140
  name L2-VNI-140-Tenant1
  vn-segment 50140

vlan 141
  name L2-VNI-141-Tenant1
  vn-segment 50141

vlan 999
  vn-segment 50999

spanning-tree vlan 1,140-141,999 priority 4096

vrf context Tenant-1
  vni 50999
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn

vrf context management
  ip route 0.0.0.0/0 192.168.0.1

interface Vlan140
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.140.1/24
  fabric forwarding mode anycast-gateway

interface Vlan141
  no shutdown
  vrf member Tenant-1
  no ip redirects
  ip address 172.21.141.1/24
  fabric forwarding mode anycast-gateway

interface Vlan999
  no shutdown
  vrf member Tenant-1
  ip forward

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback16

  member vni 50140
    suppress-arp
    mcast-group 239.0.0.140

  member vni 50141
    suppress-arp
    mcast-group 239.0.0.141

  member vni 50999 associate-vrf

interface Ethernet1/1
  mtu 9216
  ip address 10.1.1.14/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  mtu 9216
  ip address 10.1.2.14/30
  ip ospf network point-to-point
  no ip ospf passive-interface
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface mgmt0
  vrf member management
  ip address 192.168.0.206/24

interface loopback1
  ip address 6.6.6.6/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

interface loopback16
  ip address 16.16.16.16/32
  ip ospf network point-to-point
  ip router ospf UNDERLAY-NET area 0.0.0.0
  ip pim sparse-mode

router ospf UNDERLAY-NET
  router-id 6.6.6.6

router bgp 65000
  router-id 6.6.6.6
  timers bgp 5 15

  address-family ipv4 unicast

  address-family l2vpn evpn
    retain route-target all

  neighbor 1.1.1.1
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

  neighbor 2.2.2.2
    remote-as 65000
    update-source loopback1

    address-family ipv4 unicast
      send-community
      send-community extended

    address-family l2vpn evpn
      send-community
      send-community extended

evpn
  vni 50140 l2
    rd auto
    route-target import auto
    route-target export auto

  vni 50141 l2
    rd auto
    route-target import auto
    route-target export auto

設定確認用コマンド

構築後に使用する主な確認コマンドを整理します。

アンダーレイの確認

show ip interface brief
show ip ospf neighbors
show ip route
show ip pim neighbor
show ip pim rp
show ip mroute

OSPFのNeighborが確立していること、各Loopbackアドレスへの到達性があることを確認します。

また、PIMのNeighborとRP情報が正しく学習されていることを確認してください。

BGP EVPNの確認

show bgp sessions
show bgp l2vpn evpn summary
show bgp l2vpn evpn

BGPセッションの確立状態と、EVPN経路の学習状況を確認します。

特に、各Leafスイッチから2台のSpineスイッチに対してiBGPセッションが確立していることが重要です。

VXLANの確認

show nve interface
show nve peers
show nve vni
show vxlan interface

NVEインターフェイスの状態、リモートVTEPとのPeer状態、VNIの状態を確認します。

なお、表示できる情報や使用可能なコマンドはNX-OSのバージョンによって異なります。

VRF・MAC・ARPの確認

show vrf
show vrf interface
show vlan brief
show mac address-table
show ip arp vrf Tenant-1

各VLANとVNIの対応関係、SVIのVRF所属、MACアドレスやARP情報を確認します。

まとめ

今回は、CML2で構築したiBGP方式のVXLAN EVPN環境について、Spineスイッチ2台とLeafスイッチ4台のConfigを紹介しました。

今回の構成における重要なポイントは、以下のとおりです。

  • アンダーレイにはOSPFを使用する。
  • オーバーレイのコントロールプレーンにはMP-BGP EVPNを使用する。
  • SpineスイッチをBGP Route Reflectorとして構成する。
  • LeafスイッチにVTEPとAnycast Gatewayを設定する。
  • L2 VNIとL3 VNIを使用してL2/L3通信を実現する。
  • BUMトラフィックの転送にはPIMマルチキャストを使用する。
  • PIM Anycast RPを使用してRPを冗長化する。

VXLAN EVPNは設定項目が多いものの、アンダーレイ、オーバーレイ、VTEP、VNI、BGP EVPNの役割を分けて理解することで、構成全体を整理しやすくなります。

参考資料

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?