IPsec-VPNを使用してデータセンターをAlibaba Cloud仮想プライベートクラウド (VPC) に接続するには、Alibaba cloudでVPNゲートウェイを設定し、データセンターのゲートウェイデバイスにVPN設定を追加する必要があります。 このトピックでは、FortiGateファイアウォールにVPN設定を追加する方法について説明します。
シナリオ
この例では、企業がAlibaba CloudにVPCをデプロイしています。 VPCのCIDRブロックは10.0.0.0/16です。 アプリケーションは、VPCのECS (Elastic Compute Service) インスタンスにデプロイされます。 同社には、VPCと通信するためにCIDRブロック192.168.0.0/16を使用する必要があるデータセンターがあります。 同社は、相互リソースアクセスを実装するために、データセンターとクラウド上のVPC間にIPsec-VPN接続を確立したいと考えています。
このシナリオでは、データセンターのFortiGateファイアウォールが、パブリックIPアドレスを使用してデュアルトンネルモードでAlibaba CloudへのIPsec-VPN接続を確立します。 シングルトンネルモードでIPsec-VPN接続を確立する場合は、このトピックの「シングルトンネルを使用するFortiGateファイアウォールの構成」をご参照ください。
CIDRブロックプランとサンプルVPN設定
CIDRブロックプラン
リソース | CIDRブロック | IPアドレス |
データセンター | VPCと通信する必要があるCIDRブロック: 192.168.0.0/16 | サーバーIPアドレス: 192.168.10.211 |
FortiGateファイアウォール | インターフェイスのCIDRブロック: 192.168.0.0/16 |
|
VPC | プライマリCIDRブロック: 10.0.0.0/16 vSwitch 1: 10.0.10.0/24 vSwitch 2: 10.0.20.0/24 | ECS IPアドレス: 10.0.10.247 |
パブリックVPNゲートウェイ | 非該当 |
説明 VPNゲートウェイを作成すると、システムはVPNゲートウェイにIPアドレスを自動的に割り当てます。 |
BGP動的ルーティングのCIDRブロックプラン
このトピックでは、静的ルーティングに加えて、Border Gateway Protocol (BGP) 動的ルーティングを使用するIPsec-VPN接続を確立するようにFortiGateファイアウォールを構成する方法についても説明します。 BGP動的ルーティングを使用する必要がない場合は、このセクションをスキップしてください。 次の表に、BGP動的ルーティングのCIDRブロックプランを示します。
リソース | トンネル | BGPトンネルCIDRブロック | BGP IPアドレス | BGPローカルASN |
VPN ゲートウェイ | トンネル1 | 169.254.10.0/30 説明 VPNゲートウェイでは、各トンネルのCIDRブロックは一意である必要があります。 | 169.254.10.1 | 65535 |
トンネル2 | 169.254.20.0/30 | 169.254.20.1 | ||
FortiGateファイアウォール | トンネル1 | 169.254.10.0/30 | 169.254.10.2 | 65500 |
トンネル2 | 169.254.20.0/30 | 169.254.20.2 |
サンプルVPN設定
この例では、トンネル1はアクティブトンネルであり、トンネル2はスタンバイトンネルである。 2つのトンネルは同じサンプル値を使用する。
Alibaba CloudとFortiGateファイアウォールのVPN設定は、各トンネルで同じである必要があります。
パラメーター | Alibaba Cloudのサンプル値 | FortiGateファイアウォールのサンプル値 | |
事前共有キー | 123456 **** | 123456 **** | |
インターネットキー交換 (IKE) 設定 | IKE バージョン | ikev2 | ikev2 |
ネゴシエーションモード | メイン | メイン | |
暗号化アルゴリズム | des | des 説明 このシナリオでFortiGateファイアウォールで使用されるソフトウェアバージョンは、Advanced Encryption Standard (AES) アルゴリズムをサポートしていません。 したがって、この例では、データ暗号化標準 (DES) アルゴリズムが使用される。 AESアルゴリズムの使用を推奨します。 | |
認証アルゴリズム | sha1 | sha1 | |
Diffie-Hellman (DH) グループ | group2 | group2 | |
セキュリティアソシエーション (SA) ライフサイクル (秒) | 86400 | 86400 | |
IPsec設定 | 暗号化アルゴリズム | des | des 説明 このシナリオでFortiGateファイアウォールで使用されるソフトウェアバージョンは、AESアルゴリズムをサポートしていません。 したがって、この例ではDESアルゴリズムが使用される。 AESアルゴリズムの使用を推奨します。 |
認証アルゴリズム | sha1 | sha1 | |
DH グループ | group2 | group2 | |
SAライフサイクル (秒) | 86400 | 86400 | |
前提条件
このトピックでは、FortiGateファイアウォールにVPN設定を追加する方法についてのみ説明します。 Alibaba CloudでVPNゲートウェイを設定する手順は省略します。 FortiGateファイアウォールを設定する前に、VPNゲートウェイの作成、カスタマーゲートウェイの作成、IPsec-VPN接続の作成、およびVPNゲートウェイのルーティングの設定を完了していることを確認してください。
静的ルーティングを使用するIPsec-VPN接続を確立する方法の詳細については、「デュアルトンネルモードでVPCをデータセンターに接続する」をご参照ください。
BGP動的ルーティングを使用するIPsec-VPN接続を確立する方法の詳細については、「デュアルトンネルモードでVPCをデータセンターに接続し、BGP動的ルーティングを有効にする」をご参照ください。
このシナリオでは、データセンターのFortiGateファイアウォールが、パブリックIPアドレスを使用してAlibaba CloudへのIPsec-VPN接続をデュアルトンネルモードで確立します。 したがって、カスタマーゲートウェイを1つだけ作成する必要があります。 IPsec-VPN接続を作成すると、2つのトンネルを同じカスタマーゲートウェイに関連付けることができます。
手順
この例では、FortiOS V6.2.4を使用してFortiGateファイアウォールの設定方法を説明します。 次の内容は参照だけのためです。 特定のコマンドの詳細については、製造元のマニュアルを参照してください。
静的ルーティング
FortiGateファイアウォールのCLIに移動します。
フェーズ1のIPsec-VPN設定 (IKE設定とも呼ばれます) をFortiGateファイアウォールに追加します。
# Add Phase 1 IPsec-VPN configurations for Tunnel 1. config vpn ipsec phase1-interface edit "to_aliyun_test1" set interface "port1" # Set the interface to port1, which is the public network egress. set ike-version 2 set peertype any set net-device disable set proposal des-sha1 set localid-type address # Set the format of localid to IP address, which is the same as that of remoteid of Tunnel 1 on Alibaba Cloud. set dhgrp 2 set remote-gw 8.XX.XX.146 # Set the remote address of Tunnel 1 to IPsec address 1 of the VPN gateway. set psksecret 123456**** # Specify the pre-shared key for Tunnel 1. The pre-shared key on Alibaba Cloud must be the same as that on the FortiGate firewall. next end # Add Phase 2 IPsec-VPN configurations for Tunnel 2. config vpn ipsec phase1-interface edit "to_aliyun_test2" set interface "port1" # Set the interface to port1, which is the public network egress. set ike-version 2 set peertype any set net-device disable set proposal des-sha1 set localid-type address # Set the format of localid to IP address, which is the same as that of remoteid of Tunnel 2 on Alibaba Cloud. set dhgrp 2 set remote-gw 8.XX.XX.74 # Set the remote address of Tunnel 2 to IPsec address 2 of the VPN gateway. set psksecret 123456**** # Specify the pre-shared key for Tunnel 2. The pre-shared key on Alibaba Cloud must be the same as that on the FortiGate firewall. next endフェーズ2 IPsec-VPN設定 (IPsec設定とも呼ばれます) をFortiGateファイアウォールに追加します。
# Add Phase 2 IPsec-VPN configurations for Tunnel 1. config vpn ipsec phase2-interface edit "to_aliyun_test1" set phase1name "to_aliyun_test1" # Associate the interface with phase1-interface of Tunnel 1. set proposal des-sha1 set dhgrp 2 set auto-negotiate enable set keylifeseconds 86400 next end # Add Phase 2 IPsec-VPN configurations for Tunnel 2. config vpn ipsec phase2-interface edit "to_aliyun_test2" set phase1name "to_aliyun_test2" # Associate the interface with phase1-interface of Tunnel 2. set proposal des-sha1 set dhgrp 2 set auto-negotiate enable set keylifeseconds 86400 next endファイアウォールポリシーを設定します。
config firewall policy edit 1 set name "forti_to_aliyun1" # Specify the traffic that is allowed from the FortiGate firewall to Alibaba Cloud over Tunnel 1. set srcintf "port4" set dstintf "to_aliyun_test1" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 2 set name "aliyun_to_forti1" # Specify the traffic that is allowed from Alibaba Cloud to the FortiGate firewall over Tunnel 1. set srcintf "to_aliyun_test1" set dstintf "port4" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 3 set name "forti_to_aliyun2" # Specify the traffic that is allowed from the FortiGate firewall to Alibaba Cloud over Tunnel 2. set srcintf "port4" set dstintf "to_aliyun_test2" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 4 set name "aliyun_to_forti2" # Specify the traffic that is allowed from Alibaba Cloud to the FortiGate firewall over Tunnel 2. set srcintf "to_aliyun_test2" set dstintf "port4" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next endVPCへの静的ルートを設定します。
config router static edit 1 set dst 10.0.0.0 255.255.0.0 set priority 0 set device "to_aliyun_test1" next edit 2 set dst 10.0.0.0 255.255.0.0 set priority 10 # Decrease the priority of the route pointing to Tunnel 2. This way, traffic is preferentially transmitted over Tunnel 1. set device "to_aliyun_test2" next end
BGP動的ルーティング
FortiGateファイアウォールのCLIに移動します。
フェーズ1のIPsec-VPN設定 (IKE設定とも呼ばれます) をFortiGateファイアウォールに追加します。
# Add Phase 1 IPsec-VPN configurations for Tunnel 1. config vpn ipsec phase1-interface edit "to_aliyun_test1" set interface "port1" # Set the interface to port1, which is the public network egress. set ike-version 2 set peertype any set net-device disable set proposal des-sha1 set localid-type address # Set the format of localid to IP address, which is the same as that of remoteid of Tunnel 1 on Alibaba Cloud. set dhgrp 2 set remote-gw 8.XX.XX.146 # Set the remote address of Tunnel 1 to IPsec address 1 of the VPN gateway. set psksecret 123456**** # Specify the pre-shared key for Tunnel 1. The pre-shared key on Alibaba Cloud must be the same as that on the FortiGate firewall. next end # Add Phase 2 IPsec-VPN configurations for Tunnel 2. config vpn ipsec phase1-interface edit "to_aliyun_test2" set interface "port1" # Set the interface to port1, which is the public network egress. set ike-version 2 set peertype any set net-device disable set proposal des-sha1 set localid-type address # Set the format of localid to IP address, which is the same as that of remoteid of Tunnel 2 on Alibaba Cloud. set dhgrp 2 set remote-gw 8.XX.XX.74 # Set the remote address of Tunnel 2 to IPsec address 2 of the VPN gateway. set psksecret 123456**** # Specify the pre-shared key for Tunnel 2. The pre-shared key on Alibaba Cloud must be the same as that on the FortiGate firewall. next endフェーズ2 IPsec-VPN設定 (IPsec設定とも呼ばれます) をFortiGateファイアウォールに追加します。
# Add Phase 2 IPsec-VPN configurations for Tunnel 1. config vpn ipsec phase2-interface edit "to_aliyun_test1" set phase1name "to_aliyun_test1" # Associate the interface with phase1-interface of Tunnel 1. set proposal des-sha1 set dhgrp 2 set auto-negotiate enable set keylifeseconds 86400 next end # Add Phase 2 IPsec-VPN configurations for Tunnel 2. config vpn ipsec phase2-interface edit "to_aliyun_test2" set phase1name "to_aliyun_test2" # Associate the interface with phase1-interface of Tunnel 2. set proposal des-sha1 set dhgrp 2 set auto-negotiate enable set keylifeseconds 86400 next endファイアウォールポリシーを設定します。
config firewall policy edit 1 set name "forti_to_aliyun1" # Specify the traffic that is allowed from the FortiGate firewall to Alibaba Cloud over Tunnel 1. set srcintf "port4" set dstintf "to_aliyun_test1" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 2 set name "aliyun_to_forti1" # Specify the traffic that is allowed from Alibaba Cloud to the FortiGate firewall over Tunnel 1. set srcintf "to_aliyun_test1" set dstintf "port4" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 3 set name "forti_to_aliyun2" # Specify the traffic that is allowed from the FortiGate firewall to Alibaba Cloud over Tunnel 2. set srcintf "port4" set dstintf "to_aliyun_test2" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next edit 4 set name "aliyun_to_forti2" # Specify the traffic that is allowed from Alibaba Cloud to the FortiGate firewall over Tunnel 2. set srcintf "to_aliyun_test2" set dstintf "port4" set srcaddr "all" set dstaddr "all" set action accept set schedule "always" set service "ALL" next endトンネルインターフェイスのBGP IPアドレスを設定します。
config system interface edit "to_aliyun_test1" set ip 169.254.10.2 255.255.255.255 # Configure a BGP IP address for the interface of Tunnel 1. set remote-ip 169.254.10.1 255.255.255.255 # Configure a remote BGP IP address for Tunnel 1. next edit "to_aliyun_test2" set ip 169.254.20.2 255.255.255.255 # Configure a BGP IP address for the interface of Tunnel 2. set remote-ip 169.254.20.1 255.255.255.255 # Configure a remote BGP IP address for Tunnel 2. next endBGP動的ルーティングを設定します。
config router bgp set as 65500 set router-id 122.XX.XX.248 config neighbor edit "169.254.10.1" # Specify the BGP peer for Tunnel 1. set remote-as 65535 edit "169.254.20.1" set remote-as 65535 # Specify the BGP peer for Tunnel 2. next end config network edit 1 set prefix 192.168.0.0 255.255.0.0 # Specify the CIDR block in the data center that needs to communicate with the VPC. next end config redistribute "connected" # Redistribute the route of the directly-connected interface to BGP. set status enable end end