为 IPsec 动态端点隧道配置 IKE 访问配置文件
为 IPsec 动态端点隧道配置 IKE 访问配置文件
对于所有动态对等方,每个服务集只能配置一个隧道配置文件。配置文件中配置的预共享密钥用于对在该服务集中终止的所有动态对等方进行 IKE 身份验证。
IKE 隧道配置文件指定完成 IKE 协商所需的所有信息。有关访问配置文件的详细信息,请参阅 Junos 系统基础知识配置指南。
[edit access] profile profile-name { client * { ike { allowed-proxy-pair { remote remote-proxy-address local local-proxy-address; } pre-shared-key ([ ascii-text key-string ] | [hexadecimal key-string ]); interface-id string-value; ipsec-policy ipsec-policy; } } }
对于动态对等方,Junos OS 仅支持采用预共享密钥身份验证方法的 IKE 主 模式。在此模式下,IPv4 或 IPv6 地址用于标识隧道对等方以获取预共享密钥信息。 客户端 值 * (通配符)表示此配置文件中的配置对访问此配置文件的服务集中终止的所有动态对等方有效。
以下语句是 IKE 配置文件的各个部分:
允许代理对 — 在第 2 阶段 IKE 协商期间,远程对等方提供其网络地址(远程)和对等方的网络地址(本地)。由于多个动态隧道通过同一机制进行身份验证,因此此语句必须包含可能的组合列表。如果动态对等方未提供有效的组合,则第 2 阶段 IKE 协商将失败。
默认情况下,如果未配置任何值,则使用远程 0.0.0.0/0 本地 0.0.0.0/0。
预共享密钥 — 用于在 IKE 第 1 阶段协商期间对动态对等方进行身份验证的必需密钥。此密钥必须在隧道的两端配置,并通过带外安全机制进行分发。您可以使用 十六进制 或 ASCII 文本 格式配置键值。
接口 ID — 接口标识符,用于派生会话的逻辑服务接口信息的必需属性。
ipsec 策略 — 定义会话的 IPsec 策略信息的 IPsec 策略的名称。您可以在层次结构级别定义 IPsec 策略
[edit services ipsec-vpn ipsec policy policy-name]
。如果未设置策略,则接受动态对等方提出的任何策略。
为 IPsec 动态端点隧道配置服务集
要完成动态端点隧道配置,您需要引用在服务集中的 [编辑访问] 层次结构级别配置的 IKE 访问配置文件。为此,请在 [编辑服务服务集 name ipsec-vpn-options] 层次结构级别包含语句ike-access-profile
:
[edit services] service-set name { next-hop-service { inside-service-interface interface-name; outside-service-interface interface-name; } ipsec-vpn-options { local-gateway address; ike-access-profile profile-name; } }
在每个服务集中,只能引用一个访问配置文件。此配置文件仅用于与动态对等方协商 IKE 和 IPsec 安全关联。
如果在服务集中配置 IKE 访问配置文件,则任何其他服务集都不能共享相同的 本地网关 地址。
配置 IPsec 动态端点隧道的接口标识符
您可以为一组动态对等方配置接口标识符,该标识符指定哪些自适应服务逻辑接口参与动态 IPsec 协商。通过将同一接口标识符分配给多个逻辑接口,您可以为此创建接口池。要进行配置,请在 [编辑接口interface-name] 层次结构级别包含ipsec-interface-id
语句:
[edit interfaces sp-fpc/pic/port] unit logical-unit-number { dial-options { ipsec-interface-id identifier; (shared | dedicated); } }
在语句中 dial-options
指定接口标识符会使此逻辑接口成为由 IPsec 接口标识符标识的池的一部分。
一次只能指定一个接口标识符。可以包含语句或l2tp-interface-id
语句,但不能同时包含ipsec-interface-id
两者。
该shared
语句允许在多个隧道之间共享一个逻辑接口。该dedicated
语句指定逻辑接口与单个隧道相关联,这在配置 IPsec 链路类型隧道时是必需的。指定 ipsec-interface-id 值时,必须包含该dedicated
语句。
在单个下一跃点服务集中配置多个路由隧道
您可以选择在单个下一跃点服务集中配置多个路由 IPSec 隧道。为此,首先通过在 [编辑接口 sp-fpc/pic/port unit logical-unit-number] 层次结构级别包含服务域内部语句,将多个服务接口建立为内部接口。然后,在层次结构级别包含ipsec-inside-interface
[edit services ipsec-vpn rule rule-name term term-name from]
语句。
为简洁起见,以下示例中未显示完整的 IPsec 和 IKE 提议和策略。
[edit] interfaces { sp-3/3/0 { unit 3 { family inet; service-domain inside; } unit 4 { family inet; service-domain outside; } unit 5 { family inet; service-domain inside; } } } services { service-set link_type_ss_1 { next-hop-service { inside-service-interface sp-3/3/0.3; outside-service-interface sp-3/3/0.4; } ipsec-vpn-options { local-gateway 10.8.7.2; } ipsec-vpn-rules link_rule_1; } ipsec-vpn { rule link_rule_1 { term 1 { from { ipsec-inside-interface sp-3/3/0.3; } then { remote-gateway 10.10.7.3; backup-remote-gateway 10.8.7.1; dynamic { ike-policy main_mode_ike_policy; ipsec-policy dynamic_ipsec_policy; } } } term 2 { from { ipsec-inside-interface sp-3/3/0.5; } then { remote-gateway 10.12.7.5; dynamic { ike-policy main_mode_ike_policy; ipsec-policy dynamic_ipsec_policy; } } } match-direction input; } } }
要确认您的配置是否正常工作,请发出 show services ipsec-vpn ipsec security-associations
命令。请注意,分配给每个 IPsec 隧道的每个 IPsec 内部接口都包含在此命令的输出中。
user@router> show services ipsec-vpn ipsec security-associations Service set: link_type_ss_1 Rule: link_rule_1, Term: 1, Tunnel index: 1 Local gateway: 10.8.7.2, Remote gateway: 10.8.7.1 IPSec inside interface: sp-3/3/0.3 Direction SPI AUX-SPI Mode Type Protocol inbound 3216392497 0 tunnel dynamic ESP outbound 398917249 0 tunnel dynamic ESP Rule: link_rule_1, Term: 2, Tunnel index: 2 Local gateway: 10.8.7.2, Remote gateway: 10.12.7.5 IPSec inside interface: sp-3/3/0.5 Direction SPI AUX-SPI Mode Type Protocol inbound 762146783 0 tunnel dynamic ESP outbound 319191515 0 tunnel dynamic ESP