3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWSーGCP間をVPNでつないでみた

Posted at

AWSとGCPの間をIPSec VPNでつないでみました。

構成

AWS側にVirtual Private Gateways、GCP側にVPN Gatewayを用意して、両者をIPsec VPNで接続します。

vpn-gcp.png

GCPのドキュメントにはAWSと接続可能との記述があります。(英語版)
https://cloud.google.com/vpn/docs/concepts/overview

A gateway that is connected to a Cloud VPN gateway. A peer VPN gateway can be one of the following:

  • Another Cloud VPN gateway
  • A VPN gateway hosted by another cloud provider such as AWS or Azure
  • An on-premises VPN device or VPN service

接続結果

AWS側

aws-gcp.png

GCP側

gcp-aws.png

必要なもの

  • GCPのアカウント
  • AWSのアカウント

構築手順

Pre shared keyとIP以外はデフォルト値で接続できました。

1. GCP: VPN connectionの作成開始

Classic VPNを選択します。

gcp-1.png

名前等指定します。IP addressはこの画面から新規に作成します。

gcp-2.png

2. AWS: Virtual Private GatewayとCustomer Gatewayの作成

Virtual Private GatewayとCustomer Gatewayを作成します。
Customer Gateway作成時に、1.で作成したIPを指定します。

3. AWS: VPN Connectionの作成

VPN Connection作成時に、2.で作成したVirtual Private GatewayとCustomer Gatewayを指定します。
また今回はルーティングはStaticにしたので、GCP側のCIDRを指定します。
Pre-Shared Keyは指定しないまま、作成します。

4. GCP: Tunnelの指定

Remote peer IP addressに3.で作成したtunnelのOutside IP Addressを指定します。
Remote network IP rangesには、AWSのVPCのCIDRを指定します。
IKE pre-shared keyを作成して、Doneをクリックします。

tunnelは2個必要なので、上記手順をもう1回繰り返します。

gcp-3.png

tunnelを2個指定したらCreateをクリックしてVPN connectionを作成します。

gcp-4.png

5. AWS: VPN ConnectionにPre-Shared Keyを設定

4.で作成したIKE pre-shared keyを、VPN Connectionの各tunnelのPre-Shared Keyに設定します。
tunnelは1個づつしか変更できないため、少し時間がかかります。

6. 完成

3
4
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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?