LoginSignup
1
0

More than 3 years have passed since last update.

Yamaha NVR700W で Azure へ IPSec VPN(IKEv2 + BGP)接続してみてみた

Last updated at Posted at 2020-09-06

■ 目的

最近、AzureとOracle CloudのCross-Cloud接続のためか、Azureとオンプレミスとの接続の問い合わせもくるので、Azure とオンプレミスを YAMAHA NVR700Wを使って、IPSec VPN接続してみてみます。
Azureの IPSecの BGP接続は、BGPの Peer IPに/30 のペアIPではなく異なるIPで接続するするため、設定が難しいので、BGPとIKEv2の接続で、IPSec VPN接続してみてみます。

■ 構成

構成.png
以下手順で接続していくと、Virtual Network GatewayのPubric IPや、BGP Peer IPアドレスが発行されるので、それら全て必要な情報を表記しています。

■ Azure設定

● Gateway Subnet作成

Virtual Netwok Gatewayを配置するための、専用の'GatewaySubnet' という名前のSubnetを作成

① Subnet画面
IPSec接続する 仮想ネットワーク(vNET)画面の左ペインから [サブネット]を選択し、サブネット画面にある [+ゲートウェイ サブネット]をクリック
01.png

② Subnet追加画面
以下設定を行い [OK] をクリック

アドレス範囲 (CIDRブロック): Virtual Netwok Gatewayを接続するためのSubnetのSIDRを設定

02.png

③ GatewaySubnet作成完了
03.png

● Local Network Gateway作成

CPEリソースとなるローカルネットワークゲートウェイへYamaha NVR700Wの情報を設定します

① すべてのサービス画面
すべてのサービス画面から、[ローカル ネットワーク ゲートウェイ]をクリック
01.png

② ローカル ネットワーク ゲートウェイ画面
[ローカル ネットワーク ゲートウェイの作成]をクリック
02.png

③ ローカル ネットワーク ゲートウェイの作成画面
以下設定を行い [作成] をクリック

・名前: 任意の名前を設定
・IPアドレス: Yamaha NVR700WのPublic IPを設定
・アドレス空間: BGPで動的伝搬されるためNullでOK
・BGP設定の構成: チェック
・自律システム番号(ASN): Yamaha NVR700Wの Private ASNを設定
・BGPピアのIPアドレス: 適当なYamaha NVR700WのBGP Peer IPを設定
・リソースグループ: ローカル ネットワーク ゲートウェイを作成するAzureのリソースグツープを選択
・場所: [東日本]を選択

03.png

④ ローカル ネットワーク ゲートウェイ作成完了
04.png

05.png

● Virtual Network Gateway作成

① すべてのサービス画面
すべてのサービス画面から、[仮想ネットワーク ゲートウェイ]をクリック
01.png

② 仮想ネットワーク ゲートウェイ画面
[仮想ネットワーク ゲートウェイの作成]をクリック
02.png

③ 仮想ネットワーク ゲートウェイの作成画面
以下設定を行い [確認および作成] をクリック
※ SKUは、ゲートウェイの SKUを参照

・名前: 任意の名前を設定
・地域: [東日本]を選択
・ゲートウェイの種類: [VPN]   を選択
・VPNの種類: [ルートベース]を選択
・SKU: IKEv2接続するため、Basc以外の [VpnGw1]などを選択
・仮想ネットワーク: 仮想ネットワーク ゲートウェイ配置するvNETを選択
・パブリックIPアドレス: [新規作成]をクリック
・パブリックIPアドレス名: 任意の名前を設定
・アクティブ/アクティブモードの有効化: 今回は検証用のため、[無効]を選択
・BGP ASNの構成: [有効]を選択
・自律システム番号(ASN): AzureのデフォルトASNを 65515 のまま設定

03.png

④ 仮想ネットワーク ゲートウェイの作成:確認および作成画面
設定内容を確認し問題なければ、[作成]をクリック
04.png

⑤ 仮想ネットワーク ゲートウェイの作成完了
仮想ネットワーク ゲートウェイのデプロイには数十分要します
07.png

⑥ IPSec VPN接続用 Public IPアドレス確認
作成した仮想ネットワーク ゲートウェイ画面の左ペインにある[概要]をクリックし、
パブリックIPアドレスを確認し、Yamaha NVR700Wへ設定します
08.png

⑥ BGP Peer IPアドレス確認
作成した仮想ネットワーク ゲートウェイ画面の左ペインにある[構成]をクリックし、
BGP Peer IPアドレスとASNを確認し、Yamaha NVR700Wへ設定します
09.png

● 接続作成

Yamaha NVR700Wと仮想ネットワーク ゲートウェイを接続する設定を行います

① 仮想ネットワーク ゲートウェイ画面
作成した仮想ネットワーク ゲートウェイ画面の左ペインにある[接続]をクリックし、[+追加]をクリック
01.png

③ 接続の追加画面
以下設定を行い [OK] をクリック

・名前: 任意の名前を設定
・接続の種類: サイト対サイト(IPSec)を選択
・仮想ネットワークゲートウェイ: 作成した仮想ネットワークゲートウェイを選択
・ローカル ネットワーク ゲートウェイ: 作成したローカル ネットワーク ゲートウェイを選択
・共有キー(PSK): IPsec接続するための共有キーを設定
・IKEプロトコル: [IKEv2]を選択

02.png

④ 接続の作成完了
03.png
04.png

■ Yamaha NVR700W設定

● NAT設定

IPSec VPNするためのポートを登録

nat descriptor masquerade static 31000 1 192.168.0.1 udp 500
nat descriptor masquerade static 31000 2 192.168.0.1 esp
nat descriptor masquerade static 31000 3 192.168.0.1 udp 4500

● IPSec VPN設定

① IPSec tunnel設定

tunnel select 1
ipsec tunnel 1
ipsec sa policy 1 1 esp aes256-cbc sha256-hmac anti-replay-check=off
ipsec ike version 1 2
ipsec ike duration child-sa 1 27000
ipsec ike duration ike-sa 1 28800
ipsec ike group 1 modp1024
ipsec ike keepalive log 1 off
ipsec ike keepalive use 1 on rfc4306
ipsec ike local address 1 100.100.100.101
ipsec ike local name 1 100.100.100.101 ipv4-addr
ipsec ike nat-traversal 1 on
ipsec ike message-id-control 1 on
ipsec ike child-exchange type 1 2
ipsec ike pre-shared-key 1 text PassWord01
ipsec ike remote address 1 200.200.200.201
ipsec ike remote name 1 200.200.200.201 ipv4-addr
ipsec ike negotiation receive 1 off
ip tunnel tcp mss limit auto
tunnel enable 1

③ BGP用 tunnel設定

ipsec tunnel outer df-bit clear
ip tunnel address 192.168.254.1/32
ip tunnel remote address 172.16.255.6
ip tunnel tcp mss limit 1379
tunnel enable 1

② IPSec 設定反映

ipsec auto refresh on

● BGP設定

① BGP設定

ip route 172.16.255.6/32 gateway tunnel 1
bgp use on
bgp autonomous-system 65000
bgp neighbor 1 65515 172.16.255.6 hold-time=30 local-address=192.168.254.1 ignore-capability=on
bgp router id 192.168.254.1
# bgp import filter 1 equal 0.0.0.0/0
# bgp import filter 1 include 0.0.0.0/0
bgp import filter 1 equal 192.168.0.0/24
bgp import 65515 static filter 1

② BGP設定反映

bgp configure refresh 

● IPSec SA確認

# show ipsec sa
Total: isakmp:1 send:1 recv:1

sa    sgw isakmp connection    dir  life[s] remote-id
----------------------------------------------------------------------------
1     1    -     ike           -    28708   200.200.200.201
2     1    1     tun[0001]esp  send 26908   200.200.200.201
3     1    1     tun[0001]esp  recv 26908   200.200.200.201

● BGP状態確認

① BGP の隣接ルーターに関する情報確認

# show status bgp neighbor 172.16.255.6
    BGP neighbor is 172.16.255.6, remote AS 65515, local AS 65000, external link
    BGP version 4, remote router ID 172.16.255.6
    BGP state = Established, up for 00:04:49
    Last read 00:00:06, hold time is 30, keepalive interval is 10 seconds
    Received 33 messages, 0 notifications, 0 in queue
    Sent 32 messages, 0 notifications, 0 in queue
    Connection established 1; dropped 0
    Last reset never
    Local host: 192.168.254.1, Local port: 1260
    Foreign host: 172.16.255.6, Foreign port: 179

② 隣接ルーターに広告している経路を確認

# show status bgp neighbor 172.16.255.6 advertised-routes
    Total routes: 1
    *: valid route
    Network            Next Hop        Metric LocPrf Path
    * 192.168.0.0/24   192.168.254.1                 65000 IGP

③ 隣接ルーターから受信した経路を確認

# show status bgp neighbor 172.16.255.6 received-routes
    Total routes: 1
    *: valid route
    Network            Next Hop        Metric LocPrf Path
    * 172.16.0.0/16      172.16.255.6                  65515 IGP

④ 隣接ルーターから受信した経路のうち有効なものを確認

# show status bgp neighbor 172.16.255.6 routes
    Total routes: 1
    *: valid route
    Network            Next Hop        Metric LocPrf Path
    * 172.16.0.0/16      172.16.255.6                  65515 IGP

● Route確認

# show ip route
    Destination         Gateway          Interface       Kind  Additional Info.
    default             100.100.100.102   WAN1(PDP)    static
    172.16.0.0/16       172.16.255.6      TUNNEL[1]       BGP  path=65515
    172.16.255.6/32     -                 TUNNEL[1]    static
    192.168.0.0/24    192.168.0.1          LAN1  implicit
    192.168.254.1/32    -                 TUNNEL[1]  implicit
    210.0.0.0/8         100.100.100.101        WAN1  implicit

■ Azure Route確認

AzureのRouteへ、オンプレミス側のCIDRが伝搬されていることを確認

■ 接続テスト

● Azure --> オンプレミス

① ping疎通確認

[azureuser@azure-inst01 ~]$ ping 192.168.0.0.2 -c 3
    PING 192.168.0.0.2 (192.168.0.0.2) 56(84) bytes of data.
    64 bytes from 192.168.0.0.2: icmp_seq=1 ttl=63 time=84.8 ms
    64 bytes from 192.168.0.0.2: icmp_seq=2 ttl=63 time=85.0 ms
    64 bytes from 192.168.0.0.2: icmp_seq=3 ttl=63 time=63.9 ms

    --- 192.168.0.0.2 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2002ms
    rtt min/avg/max/mdev = 63.944/77.964/85.075/9.916 ms

② traceroute経路確認

[azureuser@azure-inst01 ~]$ sudo traceroute -I 192.168.0.0.2
    traceroute to 192.168.0.0.2 (192.168.0.0.2), 30 hops max, 60 byte packets
    1  192.168.254.1 (192.168.254.1)  73.804 ms  84.564 ms  90.320 ms
    2  192.168.0.0.2 (192.168.0.0.2)  96.722 ms * *

● オンプレミス --> Azure

① ping疎通確認

[onp@MacBook:~]$ ping 172.16.0.4 -c 3
    PING 172.16.0.4 (172.16.0.4) 56(84) bytes of data.
    64 bytes from 172.16.0.4: icmp_seq=1 ttl=63 time=55.4 ms
    64 bytes from 172.16.0.4: icmp_seq=2 ttl=63 time=72.1 ms
    64 bytes from 172.16.0.4: icmp_seq=3 ttl=63 time=62.7 ms

    --- 172.16.0.4 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2002ms
    rtt min/avg/max/mdev = 55.464/63.445/72.128/6.821 ms

② traceroute経路確認

[onp@MacBook:~]$ sudo traceroute -I 172.16.0.4
    traceroute to 172.16.0.4 (172.16.0.4), 30 hops max, 60 byte packets
    1  setup.netvolante.jp (192.168.0.1)  0.386 ms  0.270 ms  0.395 ms
    2  172.16.0.4 (172.16.0.4)  57.859 ms  65.803 ms  71.636 ms

■ YAMAHA NVR700W 最終コンフィグ

# show config
    # NVR700W Rev.15.00.16 (Thu Jun 20 19:48:42 2019)
    # MAC Address : 00:a0:de:b3:32, 00:a0:de:b3:33
    # Memory 256Mbytes, 2LAN, 1ONU, 1WWAN
    # main:  NVR700W ver=00 serial=TESTSERIAL
    # Reporting Date: Sep 6 12:34:56 2020
    console character en.ascii
    ip route default gateway pdp wan1
    ip route 172.16.255.6 gateway tunnel 1
    ip lan1 address 192.168.0.1/24
    ip wan1 address pdp
    ip wan1 nat descriptor 31000
    wan1 bind wwan 1
    wwan select 1
    description wwan Ipsim
    wwan always-on on
    wwan auth accept chap
    wwan auth myname sim@with sim
    wwan auto connect on
    wwan disconnect time off
    wwan disconnect input time off
    wwan disconnect output time off
    wwan access-point name 4gn.jp
    wwan access limit length off
    wwan access limit time off
    wwan enable 1
    tunnel select 1
    ipsec tunnel 1
    ipsec sa policy 1 1 esp aes256-cbc sha256-hmac anti-replay-check=off
    ipsec ike version 1 2
    ipsec ike duration child-sa 1 27000
    ipsec ike duration ike-sa 1 28800
    ipsec ike group 1 modp1024
    ipsec ike keepalive log 1 off
    ipsec ike keepalive use 1 on rfc4306
    ipsec ike local address 1 100.100.100.101
    ipsec ike local name 1 100.100.100.101 ipv4-addr
    ipsec ike nat-traversal 1 on
    ipsec ike message-id-control 1 on
    ipsec ike child-exchange type 1 2
    ipsec ike pre-shared-key 1 text SharedKey01
    ipsec ike remote address 1 200.200.200.201
    ipsec ike remote name 1 200.200.200.201 ipv4-addr
    ipsec ike negotiation receive 1 off
    ipsec tunnel outer df-bit clear
    ip tunnel address 192.168.254.1
    ip tunnel remote address 172.16.255.6
    ip tunnel tcp mss limit 1379
    tunnel enable 1
    ip filter 500000 restrict * * * * *
    nat descriptor type 31000 masquerade
    nat descriptor address outer 31000 primary
    nat descriptor masquerade static 31000 1 192.168.0.1 udp 500
    nat descriptor masquerade static 31000 2 192.168.0.1 esp
    nat descriptor masquerade static 31000 3 192.168.0.1 udp 4500
    bgp use on
    bgp autonomous-system 65000
    bgp neighbor 1 65515 172.16.255.6 hold-time=30 local-address=192.168.254.1 ignore-capability=on
    bgp router id 192.168.254.1
    bgp import filter 1 equal 192.168.0.0/24
    bgp import 65515 static filter 1
    ipsec auto refresh on
    telnetd host lan
    dhcp service server
    dhcp server rfc2131 compliant except remain-silent
    dhcp scope 1 192.168.0.0.2-192.168.0.191/24
    dns host lan1
    dns server pdp wan1
    dns server select 500401 pdp wan1 any .
    dns private address spoof on
    dns private name setup.netvolante.jp
    analog supplementary-service pseudo call-waiting
    analog extension dial prefix sip prefix="9#"
    statistics traffic on
    wwan-module use on

■ 参考

● YAMAHA
 ・Microsoft Azureの仮想ネットワーク(IPsec)を設定する
 ・Microsoft AzureとVPN(IPsec IKEv2)接続するルーターの設定 : コマンド設定
 ・BGP-4 設定ガイド
●Azure
 ・VPN Gateway のドキュメント
 ・仮想ネットワーク ゲートウェイとは
 ・VPN Gateway のトラブルシューティング

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