IPsec VPN を設定する
IPSec VPN 設計の目標
IPsec VPN は、以下の条件を満たす必要があります。
- インターネット サービス プロバイダによる WAN インターフェイスへの DHCP アドレス割り当てをサポートするように、動的 IPsec VPN を設定します。
- trustゾーンから発信されたトラフィックのみがIPsecトンネルを使用できることを確認します。
- 172.168.200.0/24サブネット宛てのトラフィックのみがIPsecトンネルを使用していることを確認します。
| パラメーター | 値 |
|---|---|
| トンネル インターフェイス | st0 |
| 支社/拠点トンネル IP | 10.0.0.1/24 |
| 企業トンネルIP | 10.0.0.2/24 |
| IKEプロポーザル | 標準 |
| IKEモード | 積極的 |
| 事前共有キー | 「srx_branch」 |
| トンネルの確立 | 直ちに |
| 支社/拠点 ID | 支店 |
| 企業アイデンティティ | 本社 |
| トンネル セキュリティ ゾーン | Vpn |
ルートベース IPsec VPN の設定
IPsec VPNを設定しましょう。
- デバイスコンソールでrootとしてログインします。CLI を起動し、設定モードに入ります。
login: branch_srx (ttyu0) root@branch_srx% cli root@branch_srx> configure Entering configuration mode [edit] root@branch_srx#
- st0トンネルインターフェイスを設定します。このシナリオでは、番号なしトンネルがサポートされています。ここでは、トンネルのエンド ポイントの番号付けを選択します。トンネルの番号付けの利点の 1 つは、接続に関する問題のデバッグに役立つトンネル エンド ポイントの ping テストを許可することです。
[edit] root@branch_srx# set interfaces st0 unit 0 family inet address 10.0.0.1/24
- 172.16.200.0/24 を宛先とするトラフィックを IPsec トンネルに誘導する静的ルートを定義します。
[edit] root@branch_srx# set routing-options static route 172.16.200.0/24 next-hop st0.0
- IKEパラメーターを設定します。動的 IPsec VPN をサポートする場合、ローカル ID およびリモートアイデンティティ パラメーターは重要です。静的IPアドレスを使用する場合、これらの静的IPアドレスを指定するローカルおよびリモートIKEゲートウェイを定義します。
ところで、セキュリティを少し設定するので、 階層に自分自身を
[edit security]停めます:[edit security] root@branch_srx# set ike proposal standard authentication-method pre-shared-keys root@branch_srx# set ike policy ike-pol mode aggressive root@branch_srx# set ike policy ike-pol proposals standard root@branch_srx# set ike policy ike-pol pre-shared-key ascii-text branch_srx root@branch_srx# set ike gateway ike-gw ike-policy ike-pol root@branch_srx# set ike gateway ike-gw address 172.16.1.1 root@branch_srx# set ike gateway ike-gw local-identity hostname branch root@branch_srx# set ike gateway ike-gw remote-identity hostname hq root@branch_srx# set ike gateway ike-gw external-interface ge-0/0/0
メモ:動的IPsec VPNをサポートするには、リモートエンドにIKEプロポーザルで ステートメントを
set security ike gateway ike-gw dynamic hostname <name>設定する必要があります。リモートエンドが接続を開始すると、IPではなくIKEプロポーザルに一致する名前が使用されます。この方法は、動的割り当てにより IP アドレスが変更される可能性がある場合に使用されます。 - IPsecトンネルパラメータを設定します。
[edit security] root@branch_srx# set ipsec proposal standard root@branch_srx# set ipsec policy ipsec-pol proposals standard root@branch_srx# set ipsec vpn to_hq bind-interface st0.0 root@branch_srx# set ipsec vpn to_hq ike gateway ike-gw root@branch_srx# set ipsec vpn to_hq ike ipsec-policy ipsec-pol root@branch_srx# set ipsec vpn to_hq establish-tunnels immediately
- ゾーンを作成 vpn し、ゾーンから trust ゾーンへのトラフィックフローを許可するように、セキュリティポリシーを vpn 調整します。IPsec トンネルの vpn 番号付けにオプトインした場合、デバッグで使用するホストバウンド ping を許可するようにゾーンを設定します。このステップでは、IPsecトンネルインターフェイスもゾーンに配置します vpn 。
[edit security] root@branch_srx# set policies from-zone trust to-zone vpn policy trust-to-vpn match source-address any root@branch_srx# set policies from-zone trust to-zone vpn policy trust-to-vpn match destination-address any root@branch_srx# set policies from-zone trust to-zone vpn policy trust-to-vpn match application any root@branch_srx# set policies from-zone trust to-zone vpn policy trust-to-vpn then permit root@branch_srx# set security zones security-zone vpn host-inbound-traffic system-services ping root@branch_srx# set zones security-zone vpn interfaces st0.0
メモ:この例では、任意の送信元または宛先 IP アドレスでシンプルかつ一致するようにしています。リモートサイトを宛先とするトラフィックのみをトンネルに送信する静的ルートに依存しています。セキュリティを強化するために、ローカルブランチ192.168.2.0/24およびリモート172.16.200.0/24サブネットのアドレス帳エントリーを定義することを検討してください。2 つのサブネットに対してアドレス帳エントリーが定義されている場合、セキュリティ ポリシーで と を
source-address <source_name>destination-address <dest_name>一致させます。ポリシーに送信元サブネットと宛先サブネットを含めると、トンネルを使用できるトラフィックに対してより明示的になります。 - ハンさん、もうすぐ完了です。IKE は、IPsec トンネルを保護するための共有キーをネゴシエートするために使用されていることを思い出してください。IKEメッセージは、ST0インターフェイス上でトンネルを確立するために、WANインターフェイス上で送受信する必要があります。
WANインターフェイスからアクセスできるローカルホストサービスを変更して、IKEを untrust 含める必要があります。
[edit security] root@branch_srx# set zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ike
それです。支社/拠点で IPsec ルートベース VPN を設定しました。変更は必ずコミットしてください。
結果
IPsec ルートベース VPN 構成の結果を表示します。簡潔にするために、デフォルト設定の部分を省略します。
[edit]
root@branch-srx# show interfaces st0
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
[edit]
root@branch-srx# show routing-options
static {
route 172.16.200.0/24 next-hop st0.0;
}
ike {
proposal standard {
authentication-method pre-shared-keys;
}
policy ike-pol {
mode aggressive;
proposals standard;
pre-shared-key ascii-text "$9$Yj4oGjHmf5FJGi.m56/dVwgZjk.5T39"; ## SECRET-DATA
}
gateway ike-gw {
ike-policy ike-pol;
address 172.16.1.1;
local-identity hostname branch;
remote-identity hostname hq;
external-interface ge-0/0/0;
}
}
ipsec {
proposal standard;
policy ipsec-pol {
proposals standard;
}
vpn to_hq {
bind-interface st0.0;
ike {
gateway ike-gw;
ipsec-policy ipsec-pol;
}
establish-tunnels immediately;
}
}
. . .
policies {
. . .
from-zone trust to-zone vpn {
policy trust-to-vpn {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
}
zones {
..
security-zone untrust {
screen untrust-screen;
interfaces {
ge-0/0/0.0 {
host-inbound-traffic {
system-services {
. . .
ike;
. . .
}
}
}
}
}
. . .
security-zone vpn {
host-inbound-traffic {
system-services {
ping;
}
}
interfaces {
st0.0;
}
}
}
設定をコミットして、SRX の変更を有効にしてください。
迅速な構成
迅速な設定:支社
IPsec VPNを迅速に設定するには、以下のステートメントを使用します set 。環境に必要に応じて設定ステートメントを編集し、SRXに貼り付けるだけです。
支社/拠点の SRX300 シリーズ デバイスの IPsec VPN 構成を次に示します。
set security ike proposal standard authentication-method pre-shared-keys set security ike policy ike-pol mode aggressive set security ike policy ike-pol proposals standard set security ike policy ike-pol pre-shared-key ascii-text "$9$Yj4oGjHmf5FJGi.m56/dVwgZjk.5T39" set security ike gateway ike-gw ike-policy ike-pol set security ike gateway ike-gw address 172.16.1.1 set security ike gateway ike-gw local-identity hostname branch set security ike gateway ike-gw remote-identity hostname hq set security ike gateway ike-gw external-interface ge-0/0/0 set security ipsec proposal standard set security ipsec policy ipsec-pol proposals standard set security ipsec vpn to_hq bind-interface st0.0 set security ipsec vpn to_hq ike gateway ike-gw set security ipsec vpn to_hq ike ipsec-policy ipsec-pol set security ipsec vpn to_hq establish-tunnels immediately set security policies from-zone trust to-zone vpn policy trust-to-vpn match source-address any set security policies from-zone trust to-zone vpn policy trust-to-vpn match destination-address any set security policies from-zone trust to-zone vpn policy trust-to-vpn match application any set security policies from-zone trust to-zone vpn policy trust-to-vpn then permit set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ike set security zones security-zone vpn interfaces st0.0 set security zones security-zone vpn host-inbound-traffic system-services ping set interfaces st0 unit 0 family inet address 10.0.0.1/24 set routing-options static route 172.16.200.0/24 next-hop st0.0
迅速な設定:リモートロケーション
完全性を実現するために、一致するリモートサイトのIPsec VPNクイック構成を次に示します。これは、支社/拠点について詳しく説明したのと同様です。主な違いは、 ステートメントを使用し、トラフィックを dynamic hostname トンネルに誘導するために使用される静的ルートの異なる宛先を使用することです。リモートサイトの vpn ゾーンで ping を許可します。その結果、トンネルエンドポイント(トンネルに番号を付けた)とループバックインターフェイスの両方に ping を実行します。リモートサイトのループバックインターフェイスは、172.16.200.0/24サブネットを表しています。リモートサイトのlo0インターフェイスはゾーンに vpn 配置されます。
set security ike proposal standard authentication-method pre-shared-keys set security ike policy ike-pol mode aggressive set security ike policy ike-pol proposals standard set security ike policy ike-pol pre-shared-key ascii-text "$9$1POEhrKMX7NbSrvLXNY2puORyKWLN-wg" set security ike gateway ike-gw ike-policy ike-pol set security ike gateway ike-gw dynamic hostname branch set security ike gateway ike-gw local-identity hostname hq set security ike gateway ike-gw external-interface ge-0/0/6 set security ipsec proposal standard set security ipsec policy ipsec-pol proposals standard set security ipsec vpn to_hq bind-interface st0.0 set security ipsec vpn to_hq ike gateway ike-gw set security ipsec vpn to_hq ike ipsec-policy ipsec-pol set security ipsec vpn to_hq establish-tunnels immediately set security policies from-zone trust to-zone vpn policy trust-to-vpn match source-address any set security policies from-zone trust to-zone vpn policy trust-to-vpn match destination-address any set security policies from-zone trust to-zone vpn policy trust-to-vpn match application any set security policies from-zone trust to-zone vpn policy trust-to-vpn then permit set security zones security-zone untrust interfaces ge-0/0/6.0 host-inbound-traffic system-services ike set security zones security-zone untrust interfaces ge-0/0/6.0 host-inbound-traffic system-services ping set security zones security-zone vpn interfaces st0.0 set security zones security-zone vpn interfaces lo0.0 set security zones security-zone vpn host-inbound-traffic system-services ping set interfaces lo0 unit 0 family inet address 172.16.200.1/32 set interfaces st0 unit 0 family inet address 10.0.0.2/24 set routing-options static route 192.168.2.0/24 next-hop st0.0
変更は必ずコミットしてください。次のセクションでは、IPsec トンネルが正しく動作することを確認する方法について説明します。