1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VyOSでVXLANを設定してみた(後編 EVPN/MP-BGP編)

Last updated at Posted at 2024-05-18

はじめに

 ネットワークスペシャリスト試験(ネスペ)の令和6年(2024年)春試験午後Ⅱ問1で出題されたVXLANの構成を,VyOSで作ってみました。
 前編では,マルチキャスト構成を作りました。本記事では,問題文後半の「新検証ネットワーク」の一部を作ります。アンダーレイのL3ネットワークをOSPFで構成します。オーバレイのL2ネットワークをVXLANで,VXLANのコントロールプレーンをMP-BGPで構成するEVPNです。
 BGPはIPv4経路情報の交換のためではなく,VXLANで扱うL2の情報の交換に利用します。

問題文の構成図

出典:IPAに掲載された過去問

image.png

image.png

image.png

今回作った構成図

問題文の構成図のうち,最低限のVXLAN動作を確認できる構成に抜粋しました。
image.png

材料

  • Leaf/pine用L3SW代わりのVyOS1.5(vyos-1.5-rolling-202405070019-amd64.iso)

構成の補足

  • 「今回作った構成図」の要素は全てConfigに反映済みですが,「今回作った構成図」に載ってない設定(問題文に合わせた他のVNIやVLANなど)もあるのでご注意ください。
  • VyOSはProxmox上で稼働させましたが,Proxmoxの説明は本記事では省略します。(ちなみに,LinuxBridgeをセグメント毎に作成し,VyOSの仮想NICや物理NICと関連付けしました)
  • リンクアグリゲーションを構成するためのESI(Ethernet Segment Identifier)は,VyOSには現時点で実装されていないようです。なので,今回はESIの設定はしてません。

設定

L3SW11(VyOS).conf
# VXLANインタフェースと,物理インタフェース(eth3)のタグVLANの関連付け
set interfaces bridge br110 member interface eth3.110
set interfaces bridge br110 member interface vxlan10010
set interfaces bridge br120 member interface eth3.120
set interfaces bridge br120 member interface vxlan10020
set interfaces bridge br130 member interface eth3.130
set interfaces bridge br130 member interface vxlan10030

# インタフェース毎にIPアドレスを設定
# MTUを1550にしたのは,VXLANパケット送出インタフェースには50Byteの
# VXLANオーバヘッド分を付与するため(設定しないと,VXLANのsource-interface
# 設定で怒られる
set interfaces ethernet eth1 address '10.1.0.2/30'
set interfaces ethernet eth1 mtu '1550'
set interfaces ethernet eth2 address '10.2.0.2/30'
set interfaces ethernet eth2 mtu '1550'

# 物理インタフェースに仮想インタフェース(=VLAN)を設定
set interfaces ethernet eth3 vif 110
set interfaces ethernet eth3 vif 120
set interfaces ethernet eth3 vif 130

# Loopbackアドレス。VyOSの場合dummyインタフェースの方が良いらしいですが
# 今回は敢えてLoopbackで。
set interfaces loopback lo address '10.0.0.11/32'

# VXLAN設定
# see https://docs.vyos.io/en/equuleus/configuration/interfaces/vxlan.html

# VNI10010の設定
set interfaces vxlan vxlan10010 source-address '10.0.0.11'
set interfaces vxlan vxlan10010 vni '10010'

# VNI10020の設定
set interfaces vxlan vxlan10020 source-address '10.0.0.11'
set interfaces vxlan vxlan10020 vni '10020'

# VNI10030の設定
set interfaces vxlan vxlan10030 source-address '10.0.0.11'
set interfaces vxlan vxlan10030 vni '10030'

# MP-BGPの設定
# vni情報をBGPに広報する設定
set protocols bgp address-family l2vpn-evpn advertise-all-vni
#iBGPピアの設定
set protocols bgp neighbor 10.0.0.1 address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.1 remote-as 'internal'
set protocols bgp neighbor 10.0.0.1 update-source 'lo'
set protocols bgp neighbor 10.0.0.2 address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.2 remote-as 'internal'
set protocols bgp neighbor 10.0.0.2 update-source 'lo'
# RouterIDや自AS番号の設定
set protocols bgp parameters router-id '10.0.0.11'
set protocols bgp system-as '65001'

# OSPF設定
set protocols ospf area 0 network '10.1.0.0/30'
set protocols ospf area 0 network '10.0.0.11/32'
set protocols ospf area 0 network '10.2.0.0/30'
set protocols ospf maximum-paths '4'
set protocols ospf parameters router-id '10.0.0.11'

set system host-name 'L3SW11'
L3SW31(VyOS).conf
# 設定の意図はL3SW11と同じなので詳細は省略
set interfaces bridge br310 member interface eth3.310
set interfaces bridge br310 member interface vxlan10010
set interfaces bridge br320 member interface eth3.320
set interfaces bridge br320 member interface vxlan10040
set interfaces bridge br330 member interface eth3.330
set interfaces bridge br330 member interface vxlan10030
set interfaces ethernet eth1 address '10.1.0.18/30'
set interfaces ethernet eth1 mtu '1550'
set interfaces ethernet eth2 address '10.2.0.18/30'
set interfaces ethernet eth2 mtu '1550'
set interfaces ethernet eth3 vif 310
set interfaces ethernet eth3 vif 320
set interfaces ethernet eth3 vif 330
set interfaces loopback lo address '10.0.0.31/32'
set interfaces vxlan vxlan10010 source-address '10.0.0.31'
set interfaces vxlan vxlan10010 vni '10010'
set interfaces vxlan vxlan10030 source-address '10.0.0.31'
set interfaces vxlan vxlan10030 vni '10030'
set interfaces vxlan vxlan10040 source-address '10.0.0.31'
set interfaces vxlan vxlan10040 vni '10040'
set protocols bgp address-family l2vpn-evpn advertise-all-vni
set protocols bgp neighbor 10.0.0.1 address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.1 remote-as 'internal'
set protocols bgp neighbor 10.0.0.1 update-source 'lo'
set protocols bgp neighbor 10.0.0.2 address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.2 remote-as 'internal'
set protocols bgp neighbor 10.0.0.2 update-source 'lo'
set protocols bgp parameters router-id '10.0.0.31'
set protocols bgp system-as '65001'
set protocols ospf area 0 network '10.1.0.16/30'
set protocols ospf area 0 network '10.2.0.16/30'
set protocols ospf area 0 network '10.0.0.31/32'
set protocols ospf maximum-paths '4'
set protocols ospf parameters router-id '10.0.0.31'
set system host-name 'L3SW31'
L3SW01(VyOS).conf

# Interface
set interfaces ethernet eth1 address '10.1.0.1/30'
set interfaces ethernet eth1 mtu '1550'
set interfaces ethernet eth2 address '10.1.0.5/30'
set interfaces ethernet eth2 mtu '1550'
set interfaces ethernet eth3 address '10.1.0.9/30'
set interfaces ethernet eth3 mtu '1550'
set interfaces ethernet eth4 address '10.1.0.13/30'
set interfaces ethernet eth4 mtu '1550'
set interfaces ethernet eth5 address '10.1.0.17/30'
set interfaces ethernet eth5 mtu '1550'
set interfaces ethernet eth6 address '10.1.0.21/30'
set interfaces ethernet eth6 mtu '1550'
set interfaces loopback lo address '10.0.0.1/32'

# BGP
set protocols bgp address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.2 address-family l2vpn-evpn
set protocols bgp neighbor 10.0.0.2 remote-as 'internal'
set protocols bgp neighbor 10.0.0.2 update-source 'lo'
set protocols bgp neighbor 10.0.0.11 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.11 remote-as 'internal'
set protocols bgp neighbor 10.0.0.11 update-source 'lo'
set protocols bgp neighbor 10.0.0.12 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.12 remote-as 'internal'
set protocols bgp neighbor 10.0.0.12 update-source 'lo'
set protocols bgp neighbor 10.0.0.21 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.21 remote-as 'internal'
set protocols bgp neighbor 10.0.0.21 update-source 'lo'
set protocols bgp neighbor 10.0.0.22 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.22 remote-as 'internal'
set protocols bgp neighbor 10.0.0.22 update-source 'lo'
set protocols bgp neighbor 10.0.0.31 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.31 remote-as 'internal'
set protocols bgp neighbor 10.0.0.31 update-source 'lo'
set protocols bgp neighbor 10.0.0.32 address-family l2vpn-evpn route-reflector-client
set protocols bgp neighbor 10.0.0.32 remote-as 'internal'
set protocols bgp neighbor 10.0.0.32 update-source 'lo'
set protocols bgp parameters cluster-id '10.0.0.0'
set protocols bgp parameters router-id '10.0.0.1'
set protocols bgp system-as '65001'

# OSPF
set protocols ospf area 0 network '10.1.0.0/30'
set protocols ospf area 0 network '10.1.0.4/30'
set protocols ospf area 0 network '10.1.0.8/30'
set protocols ospf area 0 network '10.1.0.12/30'
set protocols ospf area 0 network '10.1.0.16/30'
set protocols ospf area 0 network '10.1.0.20/30'
set protocols ospf area 0 network '10.0.0.1/32'
set protocols ospf maximum-paths '4'
set protocols ospf parameters router-id '10.0.0.1'

結果

無事にvm11からvm31にPingが飛びました。
image.png

(おまけ)VyOSの確認コマンド

show interfaces vxlan vxlan100XX

# VXLANインタフェースのMACアドレス学習状態
show evpn mac vni 10010
sudo bridge fdb show dev vxlan10010

# BGP neighborへadvertiseした情報
show bgp l2vpn evpn neighbors BGPネイバーのIPアドレス advertised-routes

参考

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?