NETWORK ENGINEER BLOG

Tips and Reviews for Engineers

Nexus1000V VXLAN 設定例

VXLAN とは

2012年8月、米 Cisco、VMware、Citrix、Red Hat、Arista などにより、IETF へドラフトが提出された新たな論理ネットワークに関する規格です。VXLAN の特徴は下記のとおりです。

VXLAN の特徴
  • L3 ネットワーク上にオーバーレイする仮想 L2 ネットワーク
  • 仮想マシンからの L2 フレームを、仮想イーサネットモジュール(VEM)でカプセリング
  • カプセリングのオーバーヘッドは 50byte
  • VXALN セグメントは 50byte の内 24bit のセグメント ID(VNI)で識別*1
  • VXLAN トンネルを終端するポイント*2は、ハイパーバイザー上 or 物理ネットワーク装置に実装
  • L2 ブロードキャスト/マルチ キャスト/Unknown unicast には、 IP マルチキャストを利用
  • VXLAN セグメント毎にマルチキャストグループを構成
    • 仮想マシンと VNI、マルチキャストグループへの関連付けを実施
    • 仮想マシンが配下にいなければ、該当 VNI のマルチキャストグループから脱退
VXLAN フレームフォーマット

f:id:FriendsNow:20120821201153p:plain:w500

検証環境
  • SEIL/x86 Fuji version 2.60
  • Nexus1000v.4.2.1.SV1.5.2b(Evaluation License)
  • VMware vCenter Server 5.0 Standard(Evaluation License)
  • VMware ESXi 5.0 Enterprise Plus(Evaluation License)
  • VMware Workstation 9.0.1 build-894247

f:id:FriendsNow:20120821204701p:plain:w600

SEIL/x86 設定

インターフェースの基本設定を行います。

# interface lan1 address 10.10.10.254/24

# show config interface lan1
interface lan1 media auto
interface lan1 queue normal
interface lan1 add 10.10.10.254/24

Multicast PIM-SPARSE を有効化します。

# route dynamic pim-sparse enable
# route dynamic pim-sparse interface lan1 enable

# show status route dynamic pim-sparse

Virtual Interface Table
 Vif  Interface Local-Address     Subnet               Thresh   Flags          N
eighbors
  0   lan0      192.168.72.30     192.168.72.0/24      1        DISABLED
  1   lan1      10.10.10.254      10.10.10.0/24        1        DR NO-NBR

Multicast Routing Table
 Source          Group           RP-addr         Flags
--------------------------(*,*,RP)--------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0

---------------------------RP-Set----------------------------
Current BSR address: 0.0.0.0
RP-address      Incoming   Group prefix   Priority   Holdtime
Nexus1000V VSM 設定

VXLAN を有効化します。

N1KV-VSM(config)# feature segmentation
N1KV-VSM %SEG_BD-2-SEG_BD_ENABLED: Feature Segmentation enabled

N1KV-VSM# show feature | grep enabled
http-server           1         enabled
segmentation          1         enabled
sshServer             1         enabled

VXLAN 機能用ポートプロファイルを作成します。

N1KV-VSM(config)# port-profile type vethernet VXLAN-VMK
N1KV-VSM(config-port-prof)# vmware port-group
N1KV-VSM(config-port-prof)# switchport access vlan 10
N1KV-VSM(config-port-prof)# capability vxlan
N1KV-VSM(config-port-prof)# no shutdown
N1KV-VSM(config-port-prof)# state enabled
N1KV-VSM(config-port-prof)# end

N1KV-VSM# show port-profile name VXLAN-VMK

port-profile VXLAN-VMK
 type: Vethernet
 description:
 status: enabled
 max-ports: 32
 min-ports: 1
 inherit:
 config attributes:
  switchport access vlan 10
  capability vxlan
  no shutdown
 evaluated config attributes:
  switchport access vlan 10
  capability vxlan
  no shutdown
 assigned interfaces:
  Vethernet1
  Vethernet2
 port-group: VXLAN-VMK
 system vlans: none
 capability l3control: no
 capability iscsi-multipath: no
 capability vxlan: yes
 capability l3-vn-service: no
 port-profile role: none
 port-binding: static

VXLAN 用アップリンクを作成します。

N1KV-VSM(config)#  port-profile type ethernet VXLAN-Uplink
N1KV-VSM(config-port-prof)# vmware port-group
N1KV-VSM(config-port-prof)# switchport mode trunk
N1KV-VSM(config-port-prof)# mtu 1550
N1KV-VSM(config-port-prof)# switchport trunk allowed vlan 10
N1KV-VSM(config-port-prof)# no shutdown
N1KV-VSM(config-port-prof)# system vlan 10
N1KV-VSM(config-port-prof)# state enabled

VXLAN BRIDGE DOMAIN を作成します。

N1KV-VSM(config)# bridge-domain Tenant-A
N1KV-VSM(config-bd)# segment id 12001
N1KV-VSM(config-bd)# group 229.0.0.1
N1KV-VSM(config-bd)# end

N1KV-VSM(config)# bridge-domain Tenant-B
N1KV-VSM(config-bd)# segment id 13001
N1KV-VSM(config-bd)# group 229.0.0.1
N1KV-VSM(config-bd)# end

N1KV-VSM# show bridge-domain Tenant-A

Bridge-domain Tenant-A (0 ports in all)
Segment ID: 12001 (Manual/Active)
Group IP: 229.0.0.1
State: UP               Mac learning: Enabled

N1KV-VSM# show bridge-domain Tenant-B

Bridge-domain Tenant-B (0 ports in all)
Segment ID: 13001 (Manual/Active)
Group IP: 229.0.0.1
State: UP               Mac learning: Enabled

ポートプロファイルを作成及び BD を関連付けます。

N1KV-VSM(config)# port-profile type vethernet VXLAN-A-12001
N1KV-VSM(config-port-prof)# switchport mode access
N1KV-VSM(config-port-prof)# switchport access bridge-domain Tenant-A
N1KV-VSM(config-port-prof)# no shutdown
N1KV-VSM(config-port-prof)# vmware port-group
N1KV-VSM(config-port-prof)# state enabled
N1KV-VSM(config-port-prof)# end

N1KV-VSM(config)# port-profile type vethernet VXLAN-B-13001
N1KV-VSM(config-port-prof)# switchport mode access
N1KV-VSM(config-port-prof)# switchport access bridge-domain Tenant-B
N1KV-VSM(config-port-prof)# no shutdown
N1KV-VSM(config-port-prof)# vmware port-group
N1KV-VSM(config-port-prof)# state enabled
N1KV-VSM(config-port-prof)# end

N1KV-VSM# show port-profile name VXLAN-A-12001

port-profile VXLAN-A-12001
 type: Vethernet
 description:
 status: enabled
 max-ports: 32
 min-ports: 1
 inherit:
 config attributes:
  switchport mode access
  switchport access bridge-domain Tenant-A
  no shutdown
 evaluated config attributes:
  switchport mode access
  switchport access bridge-domain Tenant-A
  no shutdown
 assigned interfaces:
  Vethernet3
  Vethernet5
 port-group: VXLAN-A-12001
 system vlans: none
 capability l3control: no
 capability iscsi-multipath: no
 capability vxlan: no
 capability l3-vn-service: no
 port-profile role: none
 port-binding: static

N1KV-VSM# show port-profile name VXLAN-B-13001

port-profile VXLAN-B-13001
 type: Vethernet
 description:
 status: enabled
 max-ports: 32
 min-ports: 1
 inherit:
 config attributes:
  switchport mode access
  switchport access bridge-domain Tenant-B
  no shutdown
 evaluated config attributes:
  switchport mode access
  switchport access bridge-domain Tenant-B
  no shutdown
 assigned interfaces:
  Vethernet4
  Vethernet6
 port-group: VXLAN-B-13001
 system vlans: none
 capability l3control: no
 capability iscsi-multipath: no
 capability vxlan: no
 capability l3-vn-service: no
 port-profile role: none
 port-binding: static
vSphere ESXi5.0 設定

Nexus1000v 分散仮想スイッチから[ホストの追加]をクリックします。
f:id:FriendsNow:20130202053621p:plain

VSM で作成したアップリンクポートグループ[VXLAN-Uplink]を選択し[次へ]をクリックします。
f:id:FriendsNow:20130202053627p:plain

[次へ]をクリックします。
f:id:FriendsNow:20130202053633p:plain

[次へ]をクリックします。
f:id:FriendsNow:20130202053640p:plain

内容を確認し[終了]をクリックします。
f:id:FriendsNow:20130202053646p:plain

[vSphere Distributed vSwitch]の[仮想アダプタの管理]をクリックします。
f:id:FriendsNow:20130202053654p:plain

[追加]をクリックします。
f:id:FriendsNow:20130202053704p:plain

[新規仮想アダプタ]を選択し[次へ]をクリックします。
f:id:FriendsNow:20130202053711p:plain

[VMkernel]を選択し[次へ]をクリックします。
f:id:FriendsNow:20130202053717p:plain

VSM で作成したポートグループ「VLAN-VMK」を選択し[次へ]をクリックします。
f:id:FriendsNow:20130202053725p:plain

IP アドレス/サブネットマスクを設定し[次へ]をクリックします。
f:id:FriendsNow:20130202053732p:plain

[終了]をクリックします。
f:id:FriendsNow:20130202053737p:plain

VSM で作成したポートプロファイルを、仮想マシンのネットワークラベルに適用します。
f:id:FriendsNow:20130202053743p:plain

VSM コマンドによる確認

VXLAN vEthernet インターフェイス情報の確認

N1KV-VSM#  show system internal seg_bd info port
if_index = <0x1c000020>
Bridge-domain Tenant-A
rid = 216172786878513184
swbd = 4096

if_index = <0x1c000030>
Bridge-domain Tenant-B
rid = 216172786878513200
swbd = 4097

if_index = <0x1c000040>
Bridge-domain Tenant-A
rid = 216172786878513216
swbd = 4096

if_index = <0x1c000050>
Bridge-domain Tenant-B
rid = 216172786878513232
swbd = 4097

vEthernet ブリッジ設定情報の確認

N1KV-VSM# show system internal seg_bd info port ifindex 0x1c000020
Bridge Domain: Tenant-A
Segment ID: 12001
Group IP: 229.0.0.12

N1KV-VSM# show system internal seg_bd info port ifindex 0x1c000050
Bridge Domain: Tenant-B
Segment ID: 13001
Group IP: 229.0.0.13
VEM コマンドによる確認

VXLAN vEthernet 状況の確認

VMware ESXi02
~ # vemcmd show port segments
                          Native  Seg
  LTL   VSM Port  Mode    SegID   State
   50      Veth4   A      13001   FWD
   51      Veth5   A      12001   FWD

VMware ESXi03
~ # vemcmd show port segments
                          Native  Seg
  LTL   VSM Port  Mode    SegID   State
   50      Veth6   A      13001   FWD
   51      Veth3   A      12001   FWD

VXLAN vmknic 状況の確認

VMware ESXi02
~ # vemcmd show vxlan interfaces
LTL           IP       Seconds since Last
                       IGMP Query Received
(* Interface on which IGMP Joins are sent)
------------------------------------------
 49     10.10.10.12       112         *

VMware ESXi03
~ # vemcmd show vxlan interfaces
LTL           IP       Seconds since Last
                       IGMP Query Received
(* Interface on which IGMP Joins are sent)
------------------------------------------
 49     10.10.10.13        53         *

Remote IP 学習状況の確認

VMware ESXi02
~ # vemcmd show l2 bd-name Tenant-A
Bridge domain    9 brtmax 4096, brtcnt 2, timeout 300
Segment ID 12001, swbd 4096, "Tenant-A"
Flags:  P - PVLAN  S - Secure  D - Drop
       Type         MAC Address   LTL   timeout   Flags    PVLAN    Remote IP
     Static   00:50:56:9a:2b:0f    51         0                      0.0.0.0
    Dynamic   00:50:56:9a:2b:0d    21       241                  10.10.10.13

VMware ESXi02
~ # vemcmd show l2 bd-name Tenant-B
Bridge domain   10 brtmax 4096, brtcnt 2, timeout 300
Segment ID 13001, swbd 4097, "Tenant-B"
Flags:  P - PVLAN  S - Secure  D - Drop
       Type         MAC Address   LTL   timeout   Flags    PVLAN    Remote IP
     Static   00:50:56:9a:2b:13    50         0                      0.0.0.0
    Dynamic   00:50:56:9a:2b:11    21        10                  10.10.10.13

VMware ESXi03
~ # vemcmd show l2 bd-name Tenant-A
Bridge domain    9 brtmax 4096, brtcnt 2, timeout 300
Segment ID 12001, swbd 4096, "Tenant-A"
Flags:  P - PVLAN  S - Secure  D - Drop
       Type         MAC Address   LTL   timeout   Flags    PVLAN    Remote IP
    Dynamic   00:50:56:9a:2b:0f    21        79                  10.10.10.12
     Static   00:50:56:9a:2b:0d    51         0                      0.0.0.0

VMware ESXi03
~ # vemcmd show l2 bd-name Tenant-B
Bridge domain   10 brtmax 4096, brtcnt 2, timeout 300
Segment ID 13001, swbd 4097, "Tenant-B"
Flags:  P - PVLAN  S - Secure  D - Drop
       Type         MAC Address   LTL   timeout   Flags    PVLAN    Remote IP
    Dynamic   00:50:56:9a:2b:13    21        95                  10.10.10.12
     Static   00:50:56:9a:2b:11    50         0                      0.0.0.0

以上

*1:理論上、約1677万の論理ネットワークに対応

*2:VTEP:VTP:VXLAN Tunnel End Point