Juniper vSRX ピアの接続
IBM Cloud VPN for VPC を使用すると、VPN トンネルを介して VPC をオンプレミス・ネットワークに安全に接続できます。 このトピックでは、Juniper の VPN ゲートウェイを、VPN for VPC に接続するように構成する方法について説明します。
Juniper vSRX でフェーズ 2 で Perfect Forward Secrecy (PFS) を有効にする必要がある場合は、カスタム IPsec ポリシーを作成して、VPC 内の VPN のデフォルト・ポリシーを置き換える必要があります。 詳しくは、Juniper vSRX に対するカスタム IPsec ポリシーの作成を参照してください。
以下の手順は、Juniper vSRX、JUNOS ソフトウェア・リリース [23.2R1-S1 Standard 23.2.1.1]に基づいています。
オンプレミス・ピアへの接続を続行する前に、VPN ゲートウェイの制限 をお読みください。
Juniper の VPN は、VPN for VPC から接続要求を受け取ると、IPsec フェーズ 1 のパラメーターを使用して、セキュア接続を確立し、VPN for VPC ゲートウェイを認証します。 その後、セキュリティー・ポリシーで接続が許可されると、Juniper の VPN は、IPsec フェーズ 2 のパラメーターを使用して、トンネルを確立し、IPsec セキュリティー・ポリシーを適用します。 鍵管理サービス、認証サービス、およびセキュリティー・サービスは、IKE プロトコルを使用して動的にネゴシエーションされます。
これらの機能をサポートするために、Juniper の vSRX ユニットに対して以下の手順を実行する必要があります。
- フェーズ 1 のパラメーターを定義します。これは、Juniper vSRX の VPN がリモート・ピアを認証してセキュア接続を確立するために必要なパラメーターです。
- フェーズ 2 のパラメーターを定義します。これは、Juniper vSRX の VPN が VPN for VPC への VPN トンネルを作成するために必要なパラメーターです。
一般的な構成手順は次のとおりです。
- フェーズ 1 で
IKEv2
を選択します。 - ポリシー・ベース・モードをセットアップします。
- フェーズ 1 プロポーザルで
DH-group 19
を有効にします。 - フェーズ 1 プロポーザルで
lifetime = 36000
を設定します。 - フェーズ 2 プロポーザルで PFS を有効にします。
- フェーズ 2 プロポーザルで
lifetime = 10800
を設定します。 - フェーズ 2 プロポーザルでピアとサブネットの情報を入力します。
- 外部インターフェースで UDP 500 トラフィックを許可します
Juniper vSRX のポリシー・ベースの構成
セキュリティーをセットアップする方法の例を以下に示します。
-
ポリシー・ベース VPN の IKE プロポーザルを構成します。
set security ike proposal ibm-vpc-ike-proposal authentication-method pre-shared-keys set security ike proposal ibm-vpc-ike-proposal dh-group group19 set security ike proposal ibm-vpc-ike-proposal authentication-algorithm sha-256 set security ike proposal ibm-vpc-ike-proposal encryption-algorithm aes-256-cbc set security ike proposal ibm-vpc-ike-proposal lifetime-seconds 86400 set security ike policy ibm-vpc-ike-policy mode main set security ike policy ibm-vpc-ike-policy proposals ibm-vpc-ike-proposal set security ike policy ibm-vpc-ike-policy pre-shared-key ascii-text <your-psk>
-
ポリシー・ベース VPN ゲートウェイへの IKE ゲートウェイを構成します。
set security ike gateway ibm-vpc-policy-vpn-gateway ike-policy ibm-vpc-ike-policy set security ike gateway ibm-vpc-policy-vpn-gateway address <VPN for VPC Gateway Public IP> set security ike gateway ibm-vpc-policy-vpn-gateway dead-peer-detection interval 2 set security ike gateway ibm-vpc-policy-vpn-gateway dead-peer-detection threshold 3 set security ike gateway ibm-vpc-policy-vpn-gateway local-identity inet <vSRX Public IP> set security ike gateway ibm-vpc-policy-vpn-gateway external-interface ae1.0 set security ike gateway ibm-vpc-policy-vpn-gateway version v2-only
-
ポリシー・ベース VPN の IPsec プロポーザルを構成します。
set security ipsec proposal ibm-vpc-ipsec-proposal protocol esp set security ipsec proposal ibm-vpc-ipsec-proposal authentication-algorithm hmac-sha-256-128 set security ipsec proposal ibm-vpc-ipsec-proposal encryption-algorithm aes-256-cbc set security ipsec proposal ibm-vpc-ipsec-proposal lifetime-seconds 3600 set security ipsec policy ibm-vpc-ipsec-policy perfect-forward-secrecy keys group19 set security ipsec policy ibm-vpc-ipsec-policy proposals ibm-vpc-ipsec-proposal
-
ポリシー・ベース VPN ゲートウェイへの VTI および VPN 接続を構成します。
set interfaces st0 unit 2 description Tunnel-to-IBM-VPC-POLICY-VPN-GATEWAY set interfaces st0 unit 2 family inet set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn bind-interface st0.2 set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn ike gateway ibm-vpc-policy-vpn-gateway set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn ike ipsec-policy ibm-vpc-ipsec-policy set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn traffic-selector pair1 local-ip <on-premise-subnet> set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn traffic-selector pair1 remote-ip <vpc-subnet> set security ipsec vpn ibm-vpc-policy-vpn-gateway-vpn establish-tunnels immediately
-
IKE/IPsec プロトコル・トラフィックを許可するようにコントロール・プレーン・ファイアウォールを構成します。
set firewall filter PROTECT-IN term IPSec-IKE from source-address <VPN for VPC Gateway Public IP>/32 set firewall filter PROTECT-IN term IPSec-IKE from protocol udp set firewall filter PROTECT-IN term IPSec-IKE from port 500 set firewall filter PROTECT-IN term IPSec-IKE then accept set firewall filter PROTECT-IN term IPSec-ESP from source-address <VPN for VPC Gateway Public IP>/32 set firewall filter PROTECT-IN term IPSec-ESP from protocol esp set firewall filter PROTECT-IN term IPSec-ESP then accept set firewall filter PROTECT-IN term IPSec-4500 from source-address <VPN for VPC Gateway Public IP>/32 set firewall filter PROTECT-IN term IPSec-4500 from protocol udp set firewall filter PROTECT-IN term IPSec-4500 from port 4500 set firewall filter PROTECT-IN term IPSec-4500 then accept
-
オンプレミスと IBM VPC の間のトラフィックを許可するようにデータ・プレーン・ファイアウォールを構成します。
set security zones security-zone vpn-zone interfaces st0.2 set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match source-address any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match destination-address any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match application any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn then permit set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match source-address any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match destination-address any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match application any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private then permit
-
vSRX で TCP MSS クランプを構成して、不要なフラグメント化を回避します。
set security flow tcp-mss ipsec-vpn mss 1360
-
構成ファイルの実行が完了したら、CLI で以下のコマンドを使用して接続状況を確認できます。
run show security ipsec security-associations
Juniper vSRX に対するカスタム IPsec ポリシーの作成
デフォルトでは、 VPN for VPC はフェーズ 2 で PFS を使用不可にします。 フェーズ 2 で Juniper vSRX で PFS を有効にする必要がある場合は、カスタム IPsec ポリシーを作成して、VPC 内の VPN のデフォルト・ポリシーを置き換える必要があります。
VPN for VPC でカスタム IPsec ポリシーを使用するには、以下の手順に従います。
-
IBM Cloud コンソールの VPN for VPC ページで、 「IPsec ポリシー」 タブを選択します。
-
**「新規 IPsec ポリシー (New IPsec policy)」**をクリックし、以下の値を指定します。
- 認証 フィールドには、sha256 を選択します。
- **「暗号化」**フィールドで aes256 を選択します。
- **「PFS」**オプションを選択します。
- DH グループ フィールドには、19 を選択します。
- **「鍵ライフタイム」**フィールドで 3600 を指定します。
-
VPC で VPN 接続を作成するときに、このカスタム IPsec ポリシーを選択します。
Juniper vSRX 用の経路ベースの構成のセットアップ
以下の構成は、2 つのトンネルに重み付き設定を使用して、Juniper vSRX の VPN と VPN for VPC の間に経路ベースのトンネルを 2 つセットアップする方法を示しています。
VPN for VPC ゲートウェイには、ピアのアドレスが vSRX のパブリック IP である接続が必要です。
vSRX 構成を設定する例を以下に示します。
-
経路ベース VPN の IKE プロポーザルを構成します。
set security ike proposal ibm-vpc-ike-proposal authentication-method pre-shared-keys set security ike proposal ibm-vpc-ike-proposal dh-group group19 set security ike proposal ibm-vpc-ike-proposal authentication-algorithm sha-256 set security ike proposal ibm-vpc-ike-proposal encryption-algorithm aes-256-cbc set security ike proposal ibm-vpc-ike-proposal lifetime-seconds 86400 set security ike policy ibm-vpc-ike-policy mode main set security ike policy ibm-vpc-ike-policy proposals ibm-vpc-ike-proposal set security ike policy ibm-vpc-ike-policy pre-shared-key ascii-text <your-psk>
-
1 次トンネルへの IKE ゲートウェイを構成します。
set security ike gateway ibm-vpc-gateway-primary ike-policy ibm-vpc-ike-policy set security ike gateway ibm-vpc-gateway-primary address <VPN for VPC Gateway Small Public IP> set security ike gateway ibm-vpc-gateway-primary dead-peer-detection interval 2 set security ike gateway ibm-vpc-gateway-primary dead-peer-detection threshold 3 set security ike gateway ibm-vpc-gateway-primary local-identity inet <vSRX Public IP> set security ike gateway ibm-vpc-gateway-primary external-interface ae1.0 set security ike gateway ibm-vpc-gateway-primary version v2-only
-
経路ベース VPN の IPsec プロポーザルを構成します。
set security ipsec proposal ibm-vpc-ipsec-proposal protocol esp set security ipsec proposal ibm-vpc-ipsec-proposal authentication-algorithm hmac-sha-256-128 set security ipsec proposal ibm-vpc-ipsec-proposal encryption-algorithm aes-256-cbc set security ipsec proposal ibm-vpc-ipsec-proposal lifetime-seconds 3600 set security ipsec policy ibm-vpc-ipsec-policy perfect-forward-secrecy keys group19 set security ipsec policy ibm-vpc-ipsec-policy proposals ibm-vpc-ipsec-proposal
-
1 次 VPN トンネルへの VTI および VPN 接続を構成します。
仮想トンネル・インターフェースを作成し、インターフェース上でリンク・ローカル・アドレス (
169.254.0.2/30
) を構成します。 リンク・ローカル・アドレスを選択し、それが装置上の他のアドレスと重複しないように注意してください。 30 ビット・ネットマスクのサブネットには、2 つの使用可能な IP アドレス (169.254.0.1
および169.254.0.2
) があります。 最初の IP アドレス169.254.0.1
は IBM VPN ゲートウェイ VTI アドレスとして使用され、2 番目の IP アドレス169.254.0.2
は vSRX VTI アドレスとして使用されます。 vSRX 上に複数の VTI がある場合は、別のリンク・ローカル・サブネット (169.254.0.4/30
、169.254.0.8/30
など) を選択できます。IBM VPN ゲートウェイで
169.254.0.1
を構成する必要はありません。 これは、vSRXで経路を構成する場合にのみ参照されます。set interfaces st0 unit 2 multipoint set interfaces st0 unit 2 family inet next-hop-tunnel 169.254.0.1 ipsec-vpn ibm-vpc-gateway-primary-vpn set interfaces st0 unit 2 family inet address 169.254.0.2/30 set security ipsec vpn ibm-vpc-gateway-primary-vpn bind-interface st0.2 set security ipsec vpn ibm-vpc-gateway-primary-vpn ike gateway ibm-vpc-gateway-primary set security ipsec vpn ibm-vpc-gateway-primary-vpn ike ipsec-policy ibm-vpc-ipsec-policy set security ipsec vpn ibm-vpc-gateway-primary-vpn establish-tunnels immediately
-
1 次 VPN トンネルへの経路を構成します。
set routing-options static route <your-VPC-subnet> next-hop 169.254.0.1
-
経路ベース VPN の IKE/IPsec プロトコル・トラフィックを許可するようにコントロール・プレーン・ファイアウォールを構成します。
set firewall filter PROTECT-IN term IPSec-IKE from source-address <VPN for VPC Gateway Small Public IP>/32 set firewall filter PROTECT-IN term IPSec-IKE from protocol udp set firewall filter PROTECT-IN term IPSec-IKE from port 500 set firewall filter PROTECT-IN term IPSec-IKE then accept set firewall filter PROTECT-IN term IPSec-ESP from source-address <VPN for VPC Gateway Small Public IP>/32 set firewall filter PROTECT-IN term IPSec-ESP from protocol esp set firewall filter PROTECT-IN term IPSec-ESP then accept set firewall filter PROTECT-IN term IPSec-4500 from source-address <VPN for VPC Gateway Small Public IP>/32 set firewall filter PROTECT-IN term IPSec-4500 from protocol udp set firewall filter PROTECT-IN term IPSec-4500 from port 4500 set firewall filter PROTECT-IN term IPSec-4500 then accept
-
経路ベースの VPN 用にオンプレミスと IBM VPC の間のトラフィックを許可するようにデータ・プレーン・ファイアウォールを構成します。
set security zones security-zone vpn-zone interfaces st0.2 set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match source-address any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match destination-address any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn match application any set security policies from-zone SL-PRIVATE to-zone vpn-zone policy private_to_vpn then permit set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match source-address any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match destination-address any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private match application any set security policies from-zone vpn-zone to-zone SL-PRIVATE policy vpn_to_private then permit
-
vSRX で TCP MSS クランプを構成して、経路ベースの VPN の不要なフラグメント化を回避します。
set security flow tcp-mss ipsec-vpn mss 1360
-
2 次トンネルへの IKE ゲートウェイを構成します。
set security ike gateway ibm-vpc-gateway-secondary ike-policy ibm-vpc-ike-policy set security ike gateway ibm-vpc-gateway-secondary address <VPN for VPC Gateway Big Public IP> set security ike gateway ibm-vpc-gateway-secondary dead-peer-detection interval 2 set security ike gateway ibm-vpc-gateway-secondary dead-peer-detection threshold 3 set security ike gateway ibm-vpc-gateway-secondary local-identity inet <vSRX Public IP> set security ike gateway ibm-vpc-gateway-secondary external-interface ae1.0 set security ike gateway ibm-vpc-gateway-secondary version v2-only
-
2 次 VPN トンネルへの VTI および VPN 接続を構成します。
set interfaces st0 unit 3 multipoint set interfaces st0 unit 3 family inet next-hop-tunnel 169.254.0.5 ipsec-vpn ibm-vpc-gateway-secondary-vpn set interfaces st0 unit 3 family inet address 169.254.0.6/30 set security ipsec vpn ibm-vpc-gateway-secondary-vpn bind-interface st0.3 set security ipsec vpn ibm-vpc-gateway-secondary-vpn ike gateway ibm-vpc-gateway-secondary set security ipsec vpn ibm-vpc-gateway-secondary-vpn ike ipsec-policy ibm-vpc-ipsec-policy set security ipsec vpn ibm-vpc-gateway-secondary-vpn establish-tunnels immediately
-
2 次トンネルからの IKE/IPsec プロトコル・トラフィックを許可するようにコントロール・プレーン・ファイアウォールを構成します。
set firewall filter PROTECT-IN term IPSec-IKE from source-address <VPN for VPC Gateway Big Public IP>/32 set firewall filter PROTECT-IN term IPSec-ESP from source-address <VPN for VPC Gateway Big Public IP>/32 set firewall filter PROTECT-IN term IPSec-4500 from source-address <VPN for VPC Gateway Big Public IP>/32
-
VTC をセキュリティー・ゾーンに追加します。
set security zones security-zone vpn-zone interfaces st0.3
-
2 次トンネルへの経路を追加します。
set routing-options static route <your-VPC-subnet> qualified-next-hop 169.254.0.5 preference 30
構成の確認
以下の手順に従って構成を確認します。
-
両方のトンネルで IKE のフェーズ 1 が機能していることを確認します。
run show security ike sa
-
両方のトンネルで IKE のフェーズ 2 が機能していることを確認します。
run show security ipsec sa
-
経路を表示します。
run show route <static route>