固定アドレスと動的アドレス間のポリシーベースIPsec(スター型)

固定IPアドレスのセンター拠点に対して動的IPアドレスのエッジ拠点から接続するポリシーベースIPsecの設定例。

このタスクについて

VPNを構成するセンター拠点がIPアドレス固定割当、かつ、エッジ拠点が動的割当である場合の設定例です。

ここでは、1つのセンター拠点と2つのエッジ拠点でスター型のVPNを構成するコンフィグを紹介します。

エッジ拠点がNAT環境下に設置される場合にも適用できます。

手順

  1. 設定情報の用意
    項目 備考
    センター拠点(A)のIPアドレス 198.51.100.1 拠点Aの接続元IPアドレス(アドレス形式の識別子を兼ねる)
    • IPv6アドレスに読み替えることでIPv6ネットワーク間のVPNにも適用できます。
    エッジ拠点(B)のVPN終端インタフェース pppoe0 PPPoE接続サービスを利用する場合
    エッジ拠点(B)の識別子 edgeB.example.jp FQDN形式の識別子
    エッジ拠点(C)のVPN終端インタフェース ge0 LAN環境内(NAT環境など)から接続する場合
    エッジ拠点(C)の識別子 edgeC.example.jp FQDN形式の識別子
    拠点A-Bの事前共有鍵 A-B_xYYrRk5n8PhR-ra* IPsec/IKEの折衝を行う対向と共有する文字列
    • 全拠点で共通の鍵を使用することもできます。
    拠点A-Cの事前共有鍵 A-C_0nJX/C9?KF*Bo_8&
    拠点B-Cの事前共有鍵 B-C_F-+P^s9P!SD]s5cd
    VPN全体のネットワークアドレス 192.168.0.0/16
    センター拠点(A)のLAN側ネットワークアドレス 192.168.1.0/24
    エッジ拠点(B)のLAN側ネットワークアドレス 192.168.2.0/24
    エッジ拠点(C)のLAN側ネットワークアドレス 192.168.3.0/24
    IKEの鍵交換モード aggressive 拠点のグローバルアドレスが固定でないためアグレッシブモードを使用する
    NAT Traversal enable NAT Traversalはデフォルト値がenableのため省略可
  2. センター拠点(A)の設定例
    A-B間の設定
    ike.peer.0.address                            : dynamic
    ike.peer.0.exchange-mode                      : aggressive
    ike.peer.0.preshared-key                      : A-B_xYYrRk5n8PhR-ra*
    ike.peer.0.my-identifier.type                 : address
    ike.peer.0.peers-identifier.type              : fqdn
    ike.peer.0.peers-identifier.fqdn              : edgeB.example.jp
    ike.peer.0.nat-traversal                      : enable
    ipsec.security-association.sa0.address-type   : dynamic
    ipsec.security-policy.0.source.address        : 192.168.0.0/16
    ipsec.security-policy.0.destination.address   : 192.168.2.0/24
    ipsec.security-policy.0.security-association  : sa0
    A-C間の設定
    ike.peer.1.address                            : dynamic
    ike.peer.1.exchange-mode                      : aggressive
    ike.peer.1.preshared-key                      : A-C_0nJX/C9?KF*Bo_8&
    ike.peer.1.my-identifier.type                 : address
    ike.peer.1.peers-identifier.type              : fqdn
    ike.peer.1.peers-identifier.fqdn              : edgeC.example.jp
    ike.peer.1.nat-traversal                      : enable
    ipsec.security-association.sa1.address-type   : dynamic
    ipsec.security-policy.1.source.address        : 192.168.0.0/16
    ipsec.security-policy.1.destination.address   : 192.168.3.0/24
    ipsec.security-policy.1.security-association  : sa1
    • エッジ拠点のアドレスが固定でないため、センター拠点は対向アドレスにdynamicを指定し、相手識別子に文字列形式(fqdnまたはuser-fqdn)を使用します。
    • エッジ拠点がNAT環境下から接続する場合、アドレスの書換を検知すると自動的にNAT Traversalが適用されます。
      • ".nat-traversal : force" に変更するとアドレス書換の有無によらずNAT Traversalが適用されます。
    • センター拠点はエッジ拠点間の通信を中継するため、各エッジ拠点向けのセキュリティポリシーの source.address にVPN全体のネットワークアドレスを指定します。
  3. エッジ拠点(B)の設定例
    B-A間の設定
    ike.peer.0.address                            : 198.51.100.1
    ike.peer.0.exchange-mode                      : aggressive
    ike.peer.0.preshared-key                      : A-B_xYYrRk5n8PhR-ra*
    ike.peer.0.my-identifier.type                 : fqdn
    ike.peer.0.my-identifier.fqdn                 : edgeB.example.jp
    ike.peer.0.peers-identifier.type              : address
    ipsec.security-association.sa0.address-type   : static
    ipsec.security-association.sa0.local-address  : pppoe0
    ipsec.security-association.sa0.remote-address : 198.51.100.1
    ipsec.security-policy.10.source.address       : 192.168.2.0/24
    ipsec.security-policy.10.destination.address  : 192.168.0.0/16
    ipsec.security-policy.10.security-association : sa0
    自拠点内の通信をパス(除外)する設定
    ipsec.security-policy.0.source.address        : 192.168.2.1/32
    ipsec.security-policy.0.destination.address   : 192.168.2.0/24
    ipsec.security-policy.0.security-association  : pass
    • エッジ拠点は自身のIPアドレスが固定でないため、自己識別子に文字列形式(fqdnまたはuser-fqdn)を使用し、IPsecセキュリティアソシエーションのローカルアドレスにVPN終端インタフェースを指定します。
    • エッジ拠点は他のエッジ拠点へのパケットもセンター拠点へ送信するため、センター拠点向けのセキュリティポリシーの destination.address にVPN全体のネットワークアドレスを指定します。
      • これに加えて、自拠点内の通信をセンター拠点へ送信しないためのセキュリティアソシエーションを設定します。
        注: 除外のためのポリシーには他より若いインデックス番号を指定する必要があります。
  4. エッジ拠点(C)の設定例
    C-A間の設定
    ike.peer.0.address                            : 198.51.100.1
    ike.peer.0.exchange-mode                      : aggressive
    ike.peer.0.preshared-key                      : A-C_0nJX/C9?KF*Bo_8&
    ike.peer.0.my-identifier.type                 : fqdn
    ike.peer.0.my-identifier.fqdn                 : edgeC.example.jp
    ike.peer.0.peers-identifier.type              : address
    ipsec.security-association.sa0.address-type   : static
    ipsec.security-association.sa0.local-address  : ge0
    ipsec.security-association.sa0.remote-address : 198.51.100.1
    ipsec.security-policy.10.source.address       : 192.168.3.0/24
    ipsec.security-policy.10.destination.address  : 192.168.0.0/16
    ipsec.security-policy.10.security-association : sa0
    自拠点内の通信をパス(除外)する設定
    ipsec.security-policy.0.source.address        : 192.168.3.1/32
    ipsec.security-policy.0.destination.address   : 192.168.3.0/24
    ipsec.security-policy.0.security-association  : pass
    • エッジ拠点(B)と同様に、IPアドレスや自己識別子を読み替えて設定します。