AWSハードウェアVPNでトンネルCIDRと事前共有鍵が設定可能になりました

2017.10.11

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは、菊池です。

VPCへのハードウェアVPNでは、カスタマーゲートウェイ(オンプレミス側のルータ)のプライベートIPと、ルーティングプロトコル(BGP or Static)を設定することで、簡単に接続をすることが可能です。このVPN接続において、トンネル接続に使用するCIDRと事前共有鍵(Pre-Shared-Keys)を指定することが可能になりました。

これまで、トンネルのCIDRと事前共有鍵(Pre-Shared-Keys)は、ダウンロードできるサンプルコンフィグにて自動で割当されていました。今回のアップデートにより、この2つのパラメータが明示的に指定可能になります。

トンネルCIDR

以下のように、VGWとカスタマーゲートウェイの間に作成されるトンネルに割り当てるIPアドレスブロックです。

vpn-cidr-key-000

以下を除く、リンクローカルアドレス:169.254.0.0/16の範囲から、/30のサイズで指定できます。

利用できない範囲
  • 169.254.0.0/30
  • 169.254.1.0/30
  • 169.254.2.0/30
  • 169.254.3.0/30
  • 169.254.4.0/30
  • 169.254.5.0/30
  • 169.254.169.252/30

事前共有鍵(Pre-Shared-Key)

IKEの認証に用いる文字列です。8〜64文字の範囲で、英数、ピリオド、アンダースコアが利用可能です。また、0で始まる文字列は利用できません。

指定しない場合、ランダムな32文字の文字列で設定されます。

やってみた

実際に試してみます。

マネジメントコンソールで、VPCのメニューから[VPN接続の作成]に進みます。Tunnel Optionsの項目に、CIDRとPre-Shared-Keyを設定する項目があります。

vpn-cidr-key-001

vpn-cidr-key-002

以下のように設定し、作成してみました。

vpn-cidr-key-003

サンプルコンフィグ(Cisco ISR)をダウンロードしてみました。

~~~~~~~~省略~~~~~~~~
crypto keyring keyring-vpn-55f1103c-0
  local-address xxx.xxx.xxx.xxx
  pre-shared-key address xxx.xxx.xxx.xxx key ClassmethodTest
exit
~~~~~~~~省略~~~~~~~~
interface Tunnel1
  ip address 169.254.10.2 255.255.255.252
  ip virtual-reassembly
  tunnel source xxx.xxx.xxx.xxx
  tunnel destination xxx.xxx.xxx.xxx
  tunnel mode ipsec ipv4
  tunnel protection ipsec profile ipsec-vpn-55f1103c-0
  ! This option causes the router to reduce the Maximum Segment Size of
  ! TCP packets to prevent packet fragmentation.
  ip tcp adjust-mss 1379 
  no shutdown
exit
~~~~~~~~省略~~~~~~~~
crypto keyring keyring-vpn-55f1103c-1
  local-address xxx.xxx.xxx.xxx
  pre-shared-key address xxx.xxx.xxx.xxx key ClassmethodTest
exit
~~~~~~~~省略~~~~~~~~
interface Tunnel2
  ip address 169.254.10.6 255.255.255.252
  ip virtual-reassembly
  tunnel source xxx.xxx.xxx.xxx
  tunnel destination xxx.xxx.xxx.xxx 
  tunnel mode ipsec ipv4
  tunnel protection ipsec profile ipsec-vpn-55f1103c-1
  ! This option causes the router to reduce the Maximum Segment Size of
  ! TCP packets to prevent packet fragmentation.
  ip tcp adjust-mss 1379 
  no shutdown
exit
~~~~~~~~省略~~~~~~~~

2つのトンネルに割り当てるIPアドレスと、事前共有鍵が反映されています。

まとめ

以上です。

細かいアップデートですが、これまでの完全なランダムな適用に対し、複数のVPN接続をする際の管理や、社内のポリシーに従った設定ができるようになりました。もちろん、指定が不要な場合には、これまで通り特に意識することなく設定することも可能です。