- play_arrow IPsec 基础知识
- play_arrow Junos OS 中的 IPsec VPN
- play_arrow VPN 配置概述
- play_arrow 基于策略的 VPN
- play_arrow 基于服务等级的 VPN
- play_arrow NAT-T
- play_arrow 组 VPN
- play_arrow ADVPN
- play_arrow AutoVPN
- play_arrow 远程访问 VPN
- play_arrow 监控 VPN
- play_arrow 性能调优
- play_arrow 故障排除
- play_arrow 配置语句和操作命令
虚拟路由器中的安全隧道接口
安全隧道接口 (st0) 是基于路由的 VPN 用来将明文流量路由到 IPsec VPN 隧道的内部接口。
了解虚拟路由器对基于路由的 VPN 的支持
此功能包括对基于路由的 VPN 的路由实例支持。在以前的版本中,当 st0 接口放置在非默认路由实例中时,此接口上的 VPN 隧道无法正常工作。在 Junos OS 10.4 版本中,支持将 st0 接口放置在路由实例中,其中每个单元都配置为点对点模式或多点模式。因此,VPN 流量现在可以在非默认 VR 中正常工作。现在,您可以在不同的路由实例中配置 st0 接口的不同子单元。非默认路由实例支持以下函数:
手动密钥管理
过境交通
自流量
VPN 监控
中心辐射型 VPN
封装安全有效负载 (ESP) 协议
认证头 (AH) 协议
积极模式或主模式
St0 锚定在环路 (LO0) 接口上
SRX 系列防火墙支持的最大虚拟路由器 (VR) 数量
应用层网关 (ALG)、入侵检测和防御 (IDP) 以及内容安全等应用
失效对等体检测 (DPD)
机箱群集 主动/备份
基于 st0 的开放最短路径优先 (OSPF)
通过 st0 的路由信息协议 (RIP)
VR 中基于策略的 VPN
了解虚拟路由器限制
在 SRX 系列防火墙上配置 VPN 时,支持跨虚拟路由器的 IP 地址重叠,但存在以下限制:
IKE 外部接口地址不能与任何其他虚拟路由器重叠。
内部或信任接口地址可以在任何其他虚拟路由器之间重叠。
st0 接口地址不能在点对多点隧道(如 NHTB)中基于路由的 VPN 中重叠。
在点对点隧道中基于路由的 VPN 中,st0 接口地址可以重叠。
另请参阅
示例:在虚拟路由器中配置 st0 接口
此示例说明如何在虚拟路由器中配置 st0 接口。
要求
开始之前,请配置接口并将接口分配给安全区域。请参阅“安全区域概述”。
概述
在本示例中,您将执行以下操作:
配置接口。
配置 IKE 第 1 阶段提议。
配置 IKE 策略并引用提议。
配置 IKE 网关并引用策略。
配置第 2 阶段提议。
配置策略并引用提议。
配置 AutoKey IKE,并引用策略和网关。
配置安全策略。
配置路由实例。
配置 VPN 绑定到隧道接口。
配置路由选项。
图 1 显示了此示例中使用的拓扑。

配置参数如下表所示。
功能 | 名称 | 配置参数 |
---|---|---|
接口 | ge-0/0/0.0 | 10.1.1.2/30 |
ge-0/0/1.0 | 10.2.2.2/30 | |
st0.0(隧道接口) | 10.3.3.2/30 | |
路由实例(虚拟路由器) | VR1 | ge-0/0/1.0 st0.0 |
静态路由 | 10.6.6.0/24 | 下一跃点为 st0.0。 |
安全区域 | trust |
|
untrust |
|
功能 | 名称 | 配置参数 |
---|---|---|
提议 | first_ikeprop |
|
策略 | first_ikepol |
|
网关 | 第一 |
|
功能 | 名称 | 配置参数 |
---|---|---|
提议 | first_ipsecprop |
|
策略 | first_ipsecpol |
|
VPN | first_vpn |
|
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit]
层级的 CLI 中,然后从配置模式进入 commit
。
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.2/30 set interfaces ge-0/0/1 unit 0 family inet address 10.2.2.2/30 set interfaces st0 unit 0 family inet address 10.3.3.2/30 set security zones security-zone trust interfaces ge-0/0/1 set security zones security-zone untrust interfaces ge-0/0/0 set security zones security-zone untrust interfaces st0.0 set security ike proposal first_ikeprop authentication-method pre-shared-keys set security ike proposal first_ikeprop dh-group group2 set security ike proposal first_ikeprop authentication-algorithm md5 set security ike proposal first_ikeprop encryption-algorithm 3des-cbc set security ike policy first_ikepol mode main set security ike policy first_ikepol proposals first_ikeprop set security ike policy first_ikepol pre-shared-key ascii-text "$ABC123" set security ike gateway first ike-policy first_ikepol set security ike gateway first address 10.4.4.2 set security ike gateway first external-interface ge-0/0/0.0 set security ipsec proposal first_ipsecprop protocol esp set security ipsec proposal first_ipsecprop authentication-algorithm hmac-md5-96 set security ipsec proposal first_ipsecprop encryption-algorithm 3des-cbc set security ipsec policy first_ipsecpol perfect-forward-secrecy keys group1 set security ipsec policy first_ipsecpol proposals first_ipsecprop set security ipsec vpn first_vpn bind-interface st0.0 set security ipsec vpn first_vpn ike gateway first set security ipsec vpn first_vpn ike ipsec-policy first_ipsecpol set security ipsec vpn first_vpn establish-tunnels immediately set security policies from-zone trust to-zone untrust policy p1 match source-address any set security policies from-zone trust to-zone untrust policy p1 match destination-address any set security policies from-zone trust to-zone untrust policy p1 match application any set security policies from-zone trust to-zone untrust policy p1 then permit set security policies from-zone untrust to-zone trust policy p2 match source-address any set security policies from-zone untrust to-zone trust policy p2 match destination-address any set security policies from-zone untrust to-zone trust policy p2 match application any set security policies from-zone untrust to-zone trust policy p2 then permit set routing-instances VR1 instance-type virtual-router set routing-instances VR1 interface ge-0/0/1.0 set routing-instances VR1 interface st0.0 set routing-instances VR1 routing-options static route 10.6.6.0/24 next-hop st0.0
分步过程
下面的示例要求您在各个配置层级中进行导航。有关如何执行此操作的说明,请参阅 Junos OS CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要在 VR 中配置 st0:
配置接口。
content_copy zoom_out_map[edit] user@host# set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.2/30 user@host# set interfaces ge-0/0/1 unit 0 family inet address 10.2.2.2/30 user@host# set interfaces st0 unit 0 family inet address 10.3.3.2/30
配置安全区域。
content_copy zoom_out_map[edit] user@host# set security zones security-zone trust interfaces ge-0/0/1 user@host# set security zones security-zone untrust interfaces ge-0/0/0 user@host# set security zones security-zone untrust interfaces st0.0
配置 IPsec 隧道的第 1 阶段。
content_copy zoom_out_map[edit security ike] user@host# set proposal first_ikeprop authentication-method pre-shared-keys user@host# set proposal first_ikeprop dh-group group2 user@host# set proposal first_ikeprop authentication-algorithm md5 user@host# set proposal first_ikeprop encryption-algorithm 3des-cbc
配置 IKE 策略并引用提议。
content_copy zoom_out_map[edit security ike] user@host# set policy first_ikepol mode main user@host# set policy first_ikepol proposals first_ikeprop user@host# set policy first_ikepol pre-shared-key ascii-text "$ABC123"
配置 IKE 网关并引用策略。
content_copy zoom_out_map[edit security ike] user@host# set gateway first ike-policy first_ikepol user@host# set gateway first address 10.4.4.2 user@host# set gateway first external-interface ge-0/0/0.0
配置 IPsec 隧道的第 2 阶段。
content_copy zoom_out_map[edit security ipsec] user@host# set proposal first_ipsecprop protocol esp user@host# set proposal first_ipsecprop authentication-algorithm hmac-md5-96 user@host# set proposal first_ipsecprop encryption-algorithm 3des-cbc
配置策略并引用提议。
content_copy zoom_out_map[edit security ipsec] user@host# set policy first_ipsecpol perfect-forward-secrecy keys group1 user@host# set policy first_ipsecpol proposals first_ipsecprop
配置 AutoKey IKE,并引用策略和网关。
content_copy zoom_out_map[edit security ipsec] user@host# set vpn first_vpn ike gateway first user@host# set vpn first_vpn ike ipsec-policy first_ipsecpol user@host# set vpn first_vpn establish-tunnels immediately
配置 VPN 绑定到隧道接口。
content_copy zoom_out_map[edit security ipsec] user@host# set vpn first_vpn bind-interface st0.0
配置安全策略。
content_copy zoom_out_map[edit security policies] user@host# set from-zone trust to-zone untrust policy p1 match source-address any user@host# set from-zone trust to-zone untrust policy p1 match destination-address any user@host# set from-zone trust to-zone untrust policy p1 match application any user@host# set from-zone trust to-zone untrust policy p1 then permit user@host# set from-zone untrust to-zone trust policy p2 match source-address any user@host# set from-zone untrust to-zone trust policy p2 match destination-address any user@host# set from-zone untrust to-zone trust policy p2 match application any user@host# set from-zone untrust to-zone trust policy p2 then permit
在路由实例中配置 st0。
content_copy zoom_out_map[edit routing-instances] user@host# set VR1 instance-type virtual-router user@host# set VR1 interface ge-0/0/1.0 user@host# set VR1 interface st0.0
配置路由选项。
content_copy zoom_out_map[edit routing-instances VR1 routing-options] user@host# set static route 10.6.6.0/24 next-hop st0.0
结果
在配置模式下,输入 show security
和 show routing-instances
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
user@host# show security ike { proposal first_ikeprop { authentication-method pre-shared-keys; dh-group group2; authentication-algorithm md5; encryption-algorithm 3des-cbc; } policy first_ikepol { mode main; proposals first_ikeprop; pre-shared-key ascii-text "$ABC123"; ## SECRET-DATA } gateway first { ike-policy first_ikepol; address 10.4.4.2; external-interface ge-0/0/0.0; } } ipsec { proposal first_ipsecprop { protocol esp; authentication-algorithm hmac-md5-96; encryption-algorithm 3des-cbc; } policy first_ipsecpol { perfect-forward-secrecy { keys group1; } proposals first_ipsecprop; } vpn first_vpn { bind-interface st0.0; ike { gateway first; ipsec-policy first_ipsecpol; } establish-tunnels immediately; } } policies { from-zone trust to-zone untrust { policy p1 { match { source-address any; destination-address any; application any; } then { permit; } } } from-zone untrust to-zone trust { policy p2 { match { source-address any; destination-address any; application any; } then { permit; } } } zones { security-zone trust { interfaces { ge-0/0/1.0; } } security-zone untrust { interfaces { ge-0/0/0.0; st0.0; } } } user@host# show routing-instances VR1 { instance-type virtual-router; interface ge-0/0/1.0; interface st0.0; routing-options { static { route 10.6.6.0/24 next-hop st0.0; } } }
如果完成设备配置,请从配置模式输入 commit。