1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

NEC IXで構成するL2-VPN(Ether over IP)のサンプル構成

1
Last updated at Posted at 2026-05-10

概要

NEC IX2215のEther over IP機能とIPSEC(IKEv2)機能を利用し、拠点間L2-VPNを複数拠点で張る検証を行ったのでそのメモを書いておきます。
電力系インターネット回線を利用し県跨ぎでのVPNでの接続(調査)と、NTT光ネクスト(インターネット接続なし)を使った環境を用意し接続しました。
各拠点から本部へは、別々のブリッジとし、各拠点間をハブアンドスポークで同一のネットワークを通すのではなく、各拠点のL2ネットワークを、本部のルーターで各L2のネットワークとして別々に受けとる仕組みです。
なおここで記載している内容はあくまでも動作検証のものであり、検証結果で一部表示している速度や遅延、設定内容については、参考内容としてご利用ください。
※本記事の内容は作成者の環境での検証結果であり、その正確性や安全性を保証するものではありません。本内容を利用したことにより生じた、いかなる損害についても筆者は一切の責任を負いかねます。導入の際は必ずご自身の環境で十分な検証を行ってください。

接続概要図

image.png

各拠点の説明と前提条件

全体の前提条件

  • 各拠点は、Gi0を、WANポートとし、Gi1をVPN経由で通したいローカルネットワークを通すポートとして設定
  • 本部各拠点ともNEC IX2215で構成
  • 各拠点は、ブリッジ接続のGi1ポートの配下にL2スイッチがあり、L2スイッチからGi1ポートに接続
  • 本部から各拠点のルーターは直接操作・管理しないことから、VPN経由でリモートルーターに接続する想定ではないため、VRIポートにIPアドレスを付与しない構成で接続。(別のメンテナンス回線から接続を想定)
  • ESPが通らない可能性がある環境(拠点3)があることから、NATトラバーサル前提での接続を想定
  • ファームウェアは、各拠点とも「Version 10.11.14」を利用

拠点1

  • 光クロス(10Gbps)契約の回線。ONUから、IXのGi0に接続。諸般の事情によりIPv6アドレスを固定で設定。
    (DDNSの利用なし)
  • Gi1に接続するローカルネットワークは、配下にL2スイッチがあり、複数のタグVLAN(802.1q)が設定されており、そのVLANトランクポートをそのまま本部と接続させる。
  • Gi2は、管理ネットワーク接続とし、NTPなどの接続ができるネットワークに接続している。

拠点2

  • 電力系インターネット接続でWAN側はPPPoEで接続。WAN側IPは動的IPで接続。拠点のPCがつながっているため、NATルータと兼用し、Gi2ポートは、各PCなどが接続される。(スイッチ構成)

拠点3

  • すでに建物設備でNATされたインターネット回線が敷設済み。WAN側はDHCPで取得したアドレス(ローカルアドレス)経由で、インターネットに接続

本部

  • インターネット系は、上位UTM(FortiGate)にてPPPoEで接続。WAN側IPアドレスは、IPv4固定IPアドレス。UTMにDMZポートを用意し、IXのGi0番ポートに接続
  • フレッツ網は光ネクスト(1G)接続で、Gi1にONUから直接接続。IPoEでRAでIPアドレスを取得。(拠点への接続は、固定IPアドレスで接続しDDNSは未使用)
  • 各拠点とのブリッジポートを以下のように設定し、各拠点のネットワークをそれぞれ別のポートとして受信できるようにする
    -- Gi2 ポート5 ・・・拠点1ブリッジ(VLAN-GROUP 1)
    -- Gi2 ポート6 ・・・拠点2ブリッジ(VLAN-GROUP 2)
    -- Gi2 ポート7 ・・・拠点3ブリッジ(VLAN-GROUP 3)
    Gi2の1~4は、管理ネットワークとする。

各拠点のConfig

拠点1

hostname brch1
timezone +09 00
!
!ログ出力設定
logging buffered 
logging subsystem all warn
logging subsystem ike info
logging timestamp datetime
!
no syslog ip enable
!
username admin password plain <パスワード> administrator
!
ntp ip enable
!
!mfeedのNTPを参照
ntp server 210.173.160.27 
ntp source GigaEthernet2.0
!
!
!
!インターネット系管理系ネットワークのデフォゲ
ip route default 10.123.X.X
!
!
!光ネクストのデフォルトゲートウェイ
ipv6 route default 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
!
!
!
!
bridge irb enable
!
!
!インターネット系のDNSを指定
ip name-server 8.8.8.8
!
!
ssh-server ip enable
!
http-server authentication-method digest
http-server username admin secret-password xxxxx
http-server ip enable
!
!
ikev2 authentication psk id keyid ID_HEADQ key char xxxxx
ikev2 authentication psk id keyid ID_BRANCH1 key char yyyyy
!
!NetMister設定
nm ip enable
nm account <アカウント名> password plain <パスワード>
nm sitename vpngrp
nm logging enable
!
!
route-map set-nexthop permit 10
!
route-map web-dmvpn-map permit 10
!
ppp profile gigaethernet0.1
!
ip dhcp profile web-dhcp-gigaethernet2.0
!
ipv6 dhcp client-profile dhcpv6-cl
  option-request dns-servers
  ia-pd subscriber GigaEthernet2.0
!
router bgp 65534
  peer-group dmvpn-group remote-as 65534
!
!
!IKEv2プロファイル設定
ikev2 default-profile
  dpd interval 10
  local-authentication psk id keyid ID_BRANCH1
  nat-traversal keepalive 20 force
  sa-proposal enc aes-cbc-256
  sa-proposal integrity sha2-256
  sa-proposal dh 768-bit
  sa-proposal prf sha2-256
!
device GigaEthernet0
!
device GigaEthernet1
!
device GigaEthernet2
!
device BRI0
  isdn switch-type hsd128k
!
device USB0
  shutdown
!
!光クロスWAN側設定
interface GigaEthernet0.0
  ipv6 enable
  ipv6 address 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64
  no shutdown
!
VPNで通すネットワークポート
interface GigaEthernet1.0
  no ip address
  bridge-group 1
  no shutdown
!
interface GigaEthernet2.0
  ip address 10.123.0.xxx/24
  no shutdown
!
interface BRI0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface USB-Serial0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface BVI1
  no ip address
  bridge-group 1
  no shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
!
interface Tunnel0.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 1
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 ipsec pre-fragment
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet0.0 auto
  ikev2 ipsec-mode transport
  ikev2 peer any authentication psk id keyid ID_HEADQ
  no shutdown

拠点2

hostname brch2
timezone +09 00
!
!ログ出力設定
logging buffered 
logging subsystem all warn
logging subsystem ike info
logging timestamp datetime
!
username admin password plain <パスワード> administrator
!
ntp ip enable
!mfeedのNTPサーバを指定
ntp server 210.173.160.27
ntp source GigaEthernet0.1
!
!
!PPPoEのインターフェースがdefaultゲートウェイ
ip route default GigaEthernet0.1
ip dhcp enable
!
!
bridge irb enable
!
!DNSサーバ指定
ip name-server 8.8.8.8
!
proxy-dns ip enable
!
!
ssh-server ip enable
!
http-server username admin password <パスワード>
http-server ip enable
!
!
ikev2 authentication psk id keyid ID_HEADQ key char xxxxx
ikev2 authentication psk id keyid ID_BRANCH2 key char yyyyy
!
!NetMister設定
nm ip enable
nm account <アカウント名> password plain <パスワード>
nm sitename vpngrp
nm logging enable
!
!
ppp profile elecpowerisp
  authentication myname <ISPのユーザ名>
  authentication password <ISPのユーザ名> <ISPのパスワード>
!
ppp profile gigaethernet0.2
!
ip dhcp profile brch2dhcp
  dns-server x.x.x.x y.y.y.y
!
ikev2 default-profile
  dpd interval 10
  local-authentication psk id keyid ID_BRANCH2
  nat-traversal keepalive 20 force
  sa-proposal enc aes-cbc-256
  sa-proposal integrity sha2-256
  sa-proposal dh 768-bit
  sa-proposal prf sha2-256
!
device GigaEthernet0
!
device GigaEthernet1
!
device GigaEthernet2
!
device BRI0
  isdn switch-type hsd128k
!
device USB0
  shutdown
!
interface GigaEthernet0.0
  no ip address
  shutdown
!
interface GigaEthernet1.0
  no ip address
  bridge-group 1
  no shutdown
!
interface GigaEthernet2.0
  ip address 192.168.x.x/24
  ip dhcp binding brch2dhcp
  no shutdown
!
interface BRI0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface USB-Serial0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface GigaEthernet0.1
  encapsulation pppoe
  auto-connect
  ppp binding elecpowerisp
  ip address ipcp
  ip tcp adjust-mss auto
!クライアントがインターネットに接続できるようにNATする  
  ip napt enable
!IPSECで利用するポートを開ける
  ip napt static GigaEthernet0.1 udp 500
  ip napt static GigaEthernet0.1 50
  ip napt static GigaEthernet0.1 udp 4500
  no shutdown
!
interface BVI1
  bridge-group 1
  no shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
!
interface Tunnel0.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 1
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 initial-contact
  ikev2 ipsec pre-fragment
  ikev2 local-authentication psk id keyid ID_BRANCH2
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet0.1
  ikev2 ipsec-mode transport
  ikev2 peer <本部のWAN-IP> authentication psk id keyid ID_HEADQ
  no shutdown

拠点3

hostname brch3
timezone +09 00
!
!ログ出力設定
logging buffered 
logging subsystem all warn
logging subsystem ike info
logging timestamp datetime
username admin password hash <パスワード> administrator
!
ntp ip enable
!mfeedのNTPサーバを指定
ntp server 210.173.160.27
ntp source GigaEthernet0.0
!
!
bridge irb enable
!
!
ssh-server ip enable
!
http-server username admin
http-server ip enable
!
!
ikev2 authentication psk id keyid ID_HEADQ key char xxxxx
ikev2 authentication psk id keyid ID_BRANCH3 key char zzzzz
!
!
!NetMister設定
nm ip enable
nm account <アカウント名> password plain <パスワード>
nm sitename vpngrp
nm logging enable
!
ikev2 default-profile
  dpd interval 10
  local-authentication psk id keyid ID_BRANCH3
  nat-traversal keepalive 20 force
  sa-proposal enc aes-cbc-256
  sa-proposal integrity sha2-256
  sa-proposal dh 768-bit
  sa-proposal prf sha2-256
!
device GigaEthernet0
!
device GigaEthernet1
!
device GigaEthernet2
!
device BRI0
  isdn switch-type hsd128k
!
device USB0
  shutdown
!
interface GigaEthernet0.0
  ip address dhcp receive-default
  no shutdown
!
interface GigaEthernet1.0
  no ip address
  bridge-group 1
  no shutdown
!
interface GigaEthernet2.0
  ip address 172.21.y.y/24
  no shutdown
!
interface BRI0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface USB-Serial0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface BVI1
  no ip address
  bridge-group 1
  no shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
!
interface Tunnel0.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 1
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 ipsec pre-fragment
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet0.0 auto
  ikev2 ipsec-mode transport
  ikev2 peer <本部のインターネットWAN-IP> authentication psk id keyid ID_HEADQ
  no shutdown

本部

timezone +09 00
!
!ログ出力設定
logging buffered 
logging subsystem all warn
logging subsystem ike info
logging timestamp datetime
!
no syslog ip enable
!
username admin password plain <パスワード> administrator
!
!
!DMZのUTMのIPアドレス(デフォルトゲートウェイ)
ip route default 10.255.x.x
!
!
bridge irb enable
!
!
proxy-dns ip enable
proxy-dns interface GigaEthernet1.0 priority 254
!
!
ssh-server ip enable
!
http-server username admin
http-server ip enable
!
!
ikev2 authentication psk id keyid ID_HEADQ key char xxxxx
ikev2 authentication psk id keyid ID_BRANCH1 key char xxxxx
ikev2 authentication psk id keyid ID_BRANCH2 key char yyyyy
ikev2 authentication psk id keyid ID_BRANCH3 key char zzzzz
!
!
!NetMister設定
nm ip enable
nm account <アカウント名> password plain <パスワード>
nm sitename vpngrp
nm logging enable
!
ipv6 dhcp client-profile dhcpv6-cl
  information-request
  option-request dns-servers
!
ikev2 default-profile
  dpd interval 10
  local-authentication psk id keyid ID_HEADQ
  nat-traversal keepalive 20 force
  sa-proposal enc aes-cbc-256
  sa-proposal integrity sha2-256
  sa-proposal dh 768-bit
  sa-proposal prf sha2-256
!
device GigaEthernet0
!
device GigaEthernet1
!
!Gi2の5~7番ポートをスイッチから独立ポートとして各ポートを分離させる
device GigaEthernet2
  vlan-group 1 port 5
  vlan-group 2 port 6
  vlan-group 3 port 7
!
device BRI0
  isdn switch-type hsd128k
!
device USB0
  shutdown
!
!電力系インターネットのDMZポート
interface GigaEthernet0.0
  ip address 10.255.xxx.xxx/24
  ipv6 address autoconfig
  no shutdown
!
!フレッツ光ネクストのWANポート(IPはRAから取得)
interface GigaEthernet1.0
  no ip address
  ipv6 enable
!インターフェースIDを固定する(任意)
  ipv6 interface-identifier 00:00:00:00:aa:bb:cc:dd
  ipv6 address autoconfig receive-default
  ipv6 nd ra enable
  ipv6 nd ra other-config-flag
  no shutdown
!
!管理ネットワーク
interface GigaEthernet2.0
  ip address 10.113.x.x/22
  no shutdown
!
interface BRI0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
interface USB-Serial0.0
  encapsulation ppp
  no auto-connect
  no ip address
  shutdown
!
!拠点1のブリッジポート(Gi2の5番ポート)
interface GigaEthernet2:1.0
  no ip address
  bridge-group 1
  no shutdown
!
!拠点2のブリッジポート(Gi2の6番ポート)
interface GigaEthernet2:2.0
  no ip address
  bridge-group 2
  no shutdown
!
!拠点3のブリッジポート(Gi2の7番ポート)
interface GigaEthernet2:3.0
  no ip address
  bridge-group 3
  no shutdown
!
interface Dialer0
  encapsulation ppp
  no auto-connect
  ppp binding pppoe
  no ip address
  shutdown
!
!拠点1のブリッジ
interface BVI1
  no ip address
  bridge-group 1
  no shutdown
!
!拠点2のブリッジ
interface BVI2
  no ip address
  bridge-group 2
  no shutdown
!
!拠点3のブリッジ
interface BVI3
  no ip address
  bridge-group 3
  no shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
!
!拠点1のトンネル
interface Tunnel0.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 1
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 ipsec pre-fragment
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet1.0 auto
  ikev2 ipsec-mode transport
!拠点1の光クロスIPアドレスを指定
  ikev2 peer 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx authentication psk id keyid ID_BRANCH1
  no shutdown
!
!拠点2のトンネル
interface Tunnel1.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 2
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 ipsec pre-fragment
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet0.0 auto
  ikev2 ipsec-mode transport
!拠点2は、IPアドレスが動的なのでどこからでも受信できるようにしている
  ikev2 peer any authentication psk id keyid ID_BRANCH2 
  no shutdown
!
!拠点3のトンネル
interface Tunnel2.0
  tunnel mode ether-ip ipsec-ikev2
  no ip address
  bridge-group 3
  bridge ip tcp adjust-mss 1300
  ikev2 connect-type auto
  ikev2 ipsec pre-fragment
  ikev2 nat-traversal keepalive 60
  ikev2 outgoing-interface GigaEthernet0.0 auto
  ikev2 ipsec-mode transport
!拠点3は、IPアドレスが不明なのでどこからでも受信できるようにしている
  ikev2 peer any authentication psk id keyid ID_BRANCH3
  no shutdown

設定におけるポイント

ブリッジに関する部分

  1. 本部側は、GigaEther2のポートを分割してブリッジしています。
    vlan-groupで指定した番号は、ポート番号とは一致していない点に注意が必要です。
    ブリッジに指定したポートは、L2フレームを流すため、802.1qのVLANトランクもそのまま転送されます。IX側でVLANを紐解くTAGのインターフェースを用意していないため、トランクされたVLANを紐解くには、受信側でTAGがお話しできるL2/L3スイッチを接続し、スイッチ側で必要なTAGの指定、アンタグポートの指定を行う必要があります。
  2. 各ブリッジポートはそれぞれ別のネットワークとして受信します。それぞれのネットワークのネイティブVLANで別々のネットワークが流れているので、受信する側のスイッチで同じNativeVLANに接続すると、各拠点のネットワークがL2で接続されてしまうので注意が必要です。(あえて各拠点をL2で接続したい場合は、すべてを同じブリッジグループに入れれば、L2/L3スイッチ不要で拠点間ブリッジが可能です)
  3. L2のVPNは、ブロードキャストをそのまま転送するためWAN側ネットワークの負荷が増大する可能性があります。
  4. VPNのブリッジごとに「interface BVIx」を作成していますが、L2のインターフェースにIPを今回は付与していないため、任意の設定となります。

ログ設定

ログを出力させるため以下の設定を任意で入れることがおすすめです

logging buffered 
logging subsystem all warn
logging subsystem ike info
logging timestamp datetime

NetMisterの登録

こちらは、任意ですが便利な機能が無償で利用できます。
詳細は、以下を参照ください。
https://www.necplatforms.co.jp/product/netmeister/index.html
NetMisterを有効化するには、アカウント登録後以下の設定を追加します

nm ip enable
nm account <アカウント名> password plain <パスワード>
nm sitename <サイト名>
nm logging enable

IPSec IKEv2設定のポイント

接続元のグローバルIPが不定の場合、ike peerのアドレスを本部側(WAN固定IP側)を指定します。

WAN-IP不定の場合(拠点)
ikev2 peer <相手拠点のWAN固定IP> authentication psk id keyid ID_BRANCH3```
拠点WAN-IP不定の場合、本部側(固定IP)は、anyで受け付けるようにする(本部)
ikev2 peer any authentication psk id keyid ID_BRANCH```

拠点も本部もWANIPが固定の場合は、それぞれお互いのグローバルIPを指定します。

IPv6アドレスについて

今回、光ネクストおよび光クロスの回線はいずれもフレッツの契約のみでインターネット系がないため、インターネット上のDDNSに登録するというアクションができませんでした。そのため、1拠点のIPアドレスを、自動取得するpれフィックスを事前に確認し、インターフェースID部分を固定化し、固定IPアドレスとして登録しました。
(RAで取得すると、デフォルトゲートウェイは、リンクローカルアドレスで取得となりますが、trace routeなどで取得するとdefaultゲートウェイのグローバルユニキャストアドレスを探すことができます)

L2-VPNのメリットとデメリット

  • L3-VPNでの拠点接続が一般的ですが、これはブロードキャストドメインを分割するという意味で多くの拠点を接続する際に適切な選択肢であると思います。
  • 一方L2VPNの場合、ブロードキャストやマルチキャストをそのまま通信が可能です。ブロードキャストで装置を探すソフトウェア(家庭内においては、NASを探すツールやスマホアプリなのでハードディスクレコーダーやエアコンなど家電を操作する際にデバイスを接続する場合にも利用できます。
  • 今回、検証として電力系インターネットの2拠点(県跨ぎで直線で約100km距離(公共の交通機関では200km程度なのでおそらく回線経路もそれぐらいの距離)で、有線接続でだいたい5msの遅延の遅延でした。
    検証として、一般家庭よく利用される、Panasonic DIGAのハードディスクレコーダのお部屋ジャンプリンク機能は、同一L2ネットワークかつ遅延がおよそ8ms以下の環境で利用可能ですので、Dixiv Player Uを使って動作を確認したところ、正常に拠点先にあるDIGA経由での動画を閲覧することができました。(トライアル版で確認したので長時間の視聴は確認しておりません)
  • 一方で、L2のブロードキャストをすべてVPN上に流してしまうため、WAN回線のトラフィックが増大する傾向にあります。特に複数拠点を接続する場合、本部にあたる複数拠点を受信するWAN回線のトラフィックはかなり大きくなることが推測されます。VLANトランク接続の場合、クライアントが大量に接続されるクライアント系のVLANなど不要や、サーバのクラスタ構成のハートビートネットワークなど不要な通信をVLANトランクの対象から外すことが大切です。特にサーバのハートビートセグメントは、ブロードキャストでサーバーの存在を識別するものもあり、L2-VPNでブロードキャストの範囲が大きくなり遅延が発生するとクラスタ側に影響を与える可能性もあります。
1
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?