0
0

More than 3 years have passed since last update.

⇒踏み台 on Azure⇒(VPN)⇒リモートホスト on AWSを実現する設定内容

Last updated at Posted at 2021-03-26

やりたいこと

Azureにある踏み台サーバとSite-to-Site VPN経由でAWSにあるリモートホストに接続する
image.png

設定内容

Azure

VNETピアリング
Azure VNET"10.30.0.0/16"⇒VNET"10.20.0.0/16"のピアリング設定
赤枠の設定でAzure VNET"10.20.0.0/16"のVirtual Network Gatewayを使用するようにする
image.png
逆方向のAzure VNET"10.30.0.0/16"←VNET"10.20.0.0/16"にも同様に設定
image.png

Virtual Network Gateway
通常の手順でAWSのVPN Gatewayと接続設定
image.png

AWS

VPN Gateway
通常の手順でAzureのVirtual Network Gatewayと接続設定
image.png
静的ルートはAzure VNET"10.30.0.0/16"を設定する
image.png

ルートテーブル
リモートホストが属するAWS VPN"10.10.0.0/16"のプライベートサブネットにアタッチされているルートテーブルの設定
送信先をAzure VNET"10.30.0.0/16"とし、ターゲットに上記VPN Gatewayを設定する
image.png

セキュリティグループ
リモートホストにアタッチされているセキュリティグループのインバウンドルール設定
image.png

接続確認

bash_or_powershell
# ローカルクライアントから踏み台に接続してポートフォワード設定
ssh azureuser@<踏み台サーバのパブリックIP> -L 10022:10.10.0.128:22 -N

# ローカルクライアントでもう一つターミナルを開いてリモートホストに接続
ssh ec2-user@localhost -i <リモートホストの秘密鍵のパス> -p 10022

image.png

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