mcpField
H
hybrid-cloud-networking

hybrid-cloud-networking

github.com/hermeticormusクラウド・DevOps12377 回インストール4 週間前に更新
リポジトリ

hybrid-cloud-networking について

オンプレミス環境と AWS、Azure、GCP を接続する、クラウド・ネットワークエンジニア向けの構成ガイドです。VPN と専用接続、ルーティング、セキュリティ、高可用性、トラブルシューティングを扱います。

主な機能

  1. 01AWS、Azure、GCP の接続方式
  2. 02VPN と専用接続の設定
  3. 03BGP とルート伝播
  4. 04セキュリティと高可用性の設計
  5. 05監視、トラブルシューティング、コスト最適化

活用シーン

  1. 01オンプレミスのデータセンターとクラウドの接続
  2. 02ハイブリッドなアクティブ・アクティブ構成の設計
  3. 03ワークロードの段階的なクラウド移行
  4. 04VPN やルーティングの問題の調査

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/hermeticormus/libreuiux-claude-code --skill hybrid-cloud-networking

インストール後、Claude Code で/hybrid-cloud-networkingを入力して読み込まれたか確認します。

詳細

ハイブリッドクラウドネットワーキング

VPN、Direct Connect、ExpressRoute を使用して、オンプレミス環境とクラウド環境の間に安全で高性能な接続を構成します。

目的

オンプレミスのデータセンターとクラウドプロバイダー(AWS、Azure、GCP)の間に、安全で信頼性の高いネットワーク接続を確立します。

使用する場面

  • オンプレミス環境をクラウドに接続する
  • データセンターをクラウドに拡張する
  • ハイブリッドのアクティブ/アクティブ構成を実装する
  • コンプライアンス要件を満たす
  • クラウドへの段階的な移行を行う

接続オプション

AWS 接続
1. Site-to-Site VPN
  • インターネット経由の IPSec VPN
  • トンネルあたり最大 1.25 Gbps
  • 中程度の帯域幅で費用対効果が高い
  • レイテンシーが高く、インターネットに依存する
resource "aws_vpn_gateway" "main" {
  vpc_id = aws_vpc.main.id
  tags = {
    Name = "main-vpn-gateway"
  }
}

resource "aws_customer_gateway" "main" {
  bgp_asn    = 65000
  ip_address = "203.0.113.1"
  type       = "ipsec.1"
}

resource "aws_vpn_connection" "main" {
  vpn_gateway_id      = aws_vpn_gateway.main.id
  customer_gateway_id = aws_customer_gateway.main.id
  type                = "ipsec.1"
  static_routes_only  = false
}
2. AWS Direct Connect
  • 専用ネットワーク接続
  • 1 Gbps~100 Gbps
  • 低レイテンシーで、帯域幅が安定
  • 費用が高く、セットアップに時間が必要

参考: references/direct-connect.md を参照してください。

Azure 接続
1. Site-to-Site VPN
resource "azurerm_virtual_network_gateway" "vpn" {
  name                = "vpn-gateway"
  location            = azurerm_resource_group.main.location
  resource_group_name = azurerm_resource_group.main.name

  type     = "Vpn"
  vpn_type = "RouteBased"
  sku      = "VpnGw1"

  ip_configuration {
    name                          = "vnetGatewayConfig"
    public_ip_address_id          = azurerm_public_ip.vpn.id
    private_ip_address_allocation = "Dynamic"
    subnet_id                     = azurerm_subnet.gateway.id
  }
}
2. Azure ExpressRoute
  • 接続プロバイダー経由のプライベート接続
  • 最大 100 Gbps
  • 低レイテンシーで、高い信頼性
  • グローバル接続にはプレミアムが必要
GCP 接続
1. Cloud VPN
  • IPSec VPN(Classic または HA VPN)
  • HA VPN:SLA 99.99%
  • トンネルあたり最大 3 Gbps
2. Cloud Interconnect
  • 専用接続(10 Gbps、100 Gbps)
  • パートナー接続(50 Mbps~50 Gbps)
  • VPN より低レイテンシー

ハイブリッドネットワークパターン

パターン 1:ハブアンドスポーク
On-Premises Datacenter
         ↓
    VPN/Direct Connect
         ↓
    Transit Gateway (AWS) / vWAN (Azure)
         ↓
    ├─ Production VPC/VNet
    ├─ Staging VPC/VNet
    └─ Development VPC/VNet
パターン 2:マルチリージョンハイブリッド
On-Premises
    ├─ Direct Connect → us-east-1
    └─ Direct Connect → us-west-2
            ↓
        Cross-Region Peering
パターン 3:マルチクラウドハイブリッド
On-Premises Datacenter
    ├─ Direct Connect → AWS
    ├─ ExpressRoute → Azure
    └─ Interconnect → GCP

ルーティングの構成

BGP の構成
On-Premises Router:
- AS Number: 65000
- Advertise: 10.0.0.0/8

Cloud Router:
- AS Number: 64512 (AWS), 65515 (Azure)
- Advertise: Cloud VPC/VNet CIDRs
ルート伝播
  • ルートテーブルでルート伝播を有効にする
  • 動的ルーティングには BGP を使用する
  • ルートフィルタリングを実装する
  • ルートアドバタイズメントを監視する

セキュリティのベストプラクティス

  1. プライベート接続を使用する(Direct Connect/ExpressRoute)
  2. VPN トンネルの暗号化を実装する
  3. インターネット経由のルーティングを避けるため、VPC エンドポイントを使用する
  4. ネットワーク ACL とセキュリティグループを構成する
  5. 監視用に VPC Flow Logs を有効にする
  6. DDoS 対策を実装する
  7. PrivateLink/Private Endpoints を使用する
  8. CloudWatch/Monitor で接続を監視する
  9. 冗長性を実装する(デュアルトンネル)
  10. 定期的にセキュリティ監査を実施する

高可用性

デュアル VPN トンネル
resource "aws_vpn_connection" "primary" {
  vpn_gateway_id      = aws_vpn_gateway.main.id
  customer_gateway_id = aws_customer_gateway.primary.id
  type                = "ipsec.1"
}

resource "aws_vpn_connection" "secondary" {
  vpn_gateway_id      = aws_vpn_gateway.main.id
  customer_gateway_id = aws_customer_gateway.secondary.id
  type                = "ipsec.1"
}
アクティブ/アクティブ構成
  • 異なる場所から複数の接続を確立する
  • 自動フェイルオーバーに BGP を使用する
  • 等コストマルチパス(ECMP)ルーティング
  • すべての接続の状態を監視する

監視とトラブルシューティング

主なメトリクス
  • トンネルの状態(アップ/ダウン)
  • 受信/送信バイト数
  • パケット損失
  • レイテンシー
  • BGP セッションの状態
トラブルシューティング
# AWS VPN
aws ec2 describe-vpn-connections
aws ec2 get-vpn-connection-telemetry

# Azure VPN
az network vpn-connection show
az network vpn-connection show-device-config-script

コスト最適化

  1. トラフィックに基づいて接続のサイズを適正化する
  2. 低帯域幅のワークロードにはVPN を使用する
  3. 接続数を減らしてトラフィックを集約する
  4. データ転送コストを最小限に抑える
  5. 高帯域幅には Direct Connect を使用する
  6. トラフィック削減のためにキャッシュを実装する

参考ファイル

  • references/vpn-setup.md - VPN 構成ガイド
  • references/direct-connect.md - Direct Connect のセットアップ

関連スキル

  • multi-cloud-architecture - アーキテクチャの決定に使用
  • terraform-module-library - IaC の実装に使用

コメント