您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页Juniper SRX Branch系列防火墙配置管理手册

Juniper SRX Branch系列防火墙配置管理手册

来源:华佗小知识


Juniper SRX Branch系列防火墙配置管理手册

王晓方

Juniper 系统工程师

Juniper Networks, Inc.

上海市淮海中路333号瑞安广场1102-1104室

邮编:200021 电话:61415000 http://www.juniper.net

第 1 页 共 52 页

目录

一、JUNOS操作系统介绍 ...............................................................................................3 1.1 层次化配置结构 ........................................................................................................3 1.2 JunOS配置管理 .........................................................................................................4 1.3 SRX主要配置内容.....................................................................................................4 二、SRX防火墙配置操作举例说明 .................................................................................5 2.1 初始安装 ..................................................................................................................5

2.1.1 设备登陆 .......................................................................................................5

2.1.2 设备恢复出厂介绍 .........................................................................................5 2.1.3 设置root用户口令 .......................................................................................5 2.1.4 设置远程登陆管理用户 ..................................................................................6 2.1.5 远程管理SRX相关配置 ..................................................................................6 2.2 配置操作实验拓扑 ....................................................................................................7 2.3 策略相关配置说明 ....................................................................................................7

2.3.1 策略地址对象定义 .........................................................................................8

2.3.2 策略服务对象定义 .........................................................................................8 2.3.3 策略时间调度对象定义 ..................................................................................8 2.3.4 策略配置举例 ................................................................................................9 2.4 地址转换 ................................................................................................................ 10

2.4.1 Interface based NAT 基于接口的源地址转换 ............................................. 10

2.4.2 Pool based Source NAT基于地址池的源地址转换 ....................................... 11 2.4.3 Pool base destination NAT基于地址池的目标地址转换 ............................ 12 2.4.4 Pool base Static NAT基于地址池的静态地址转换 ..................................... 13 2.5 IPSEC VPN .............................................................................................................. 13

2.5.1 基于路由的LAN TO LAN IPSEC VPN.............................................................. 14 2.5.2 基于策略的LAN TO LAN IPSEC VPN.............................................................. 15 2.5.3 基于Remote VPN 客户端拨号VPN ................................................................ 15 2.5.4 基于IPSEC动态VPN .................................................................................... 24 2.6 应用层网关ALG配置及说明................................................................................... 29 2.7 SRX Branch 系列JSRP HA高可用性配置及说明 ...................................................... 29 2.8 SRX Branch 系列IDP、UTM配置操作介绍 ............................................................. 33 2.9 SRX Branch 系列与UAC联动配置说明 ................................................................... 38 2.10 SRX Branch系列FLOW配置说明 .......................................................................... 42 2.11 SRX Branch系列SCREEN攻击防护配置说明 ......................................................... 43 2.12 SRX Branch系列J-WEB操作配置简要说明 ............................................................ 44 三、SRX防火墙常规操作与维护 ................................................................................... 50 3.2 3.3 3.4 3.5 3.6

设备关机 ............................................................................................................ 50 设备重启 ............................................................................................................ 50 操作系统升级 ..................................................................................................... 50 密码恢复 ............................................................................................................ 51 常用监控维护命令 .............................................................................................. 51

第 2 页 共 52 页

Juniper SRX Branch系列防火墙配置管理手册说明

SRX系列防火墙是Juniper公司基于JUNOS操作系统的安全系列产品,JUNOS集成了路由、交换、安全性和一系列丰富的网络服务。目前Juniper公司的全系列路由器产品、交换机产品和SRX安全产品均采用统一源代码的JUNOS操作系统,JUNOS是全球首款将转发与控制功能相隔离,并采用模块化软件架构的网络操作系统。JUNOS作为电信级产品的精髓是Juniper真正成功的基石,它让企业级产品同样具有电信级的不间断运营特性,更好的安全性和管理特性,JUNOS软件创新的分布式架构为高性能、高可用、高可扩展的网络奠定了基础。基于NP架构的SRX系列产品产品同时提供性能优异的防火墙、NAT、IPSEC、IPS、UTM等全系列安全功能,其安全功能主要来源于已被广泛证明的ScreenOS操作系统。

本文旨在为熟悉Netscreen防火墙ScreenOS操作系统的工程师提供SRX防火墙参考配置,以便于大家能够快速部署和维护SRX防火墙,文档介绍JUNOS操作系统,并参考ScreenOS配置介绍SRX防火墙配置方法,最后对SRX防火墙常规操作与维护做简要说明。

鉴于SRX系列防火墙低端系列与高端3K、5K系列在功能配置与包处理流程有所差异,本人主要以低端系列功能配置介绍为主,Branch系列型号目前包含:SRX100\\210\\240\\650将来会有新的产品加入到Branch家族,请随时关注官方网站动态,配置大同小异。

一、JUNOS操作系统介绍 1.1 层次化配置结构

JUNOS采用基于FreeBSD内核的软件模块化操作系统,支持CLI命令行和WEBUI两种接口配置方式,本文主要对CLI命令行方式进行配置说明。JUNOS CLI使用层次化配置结构,分为操作(operational)和配置(configure)两类模式,在操作模式下可对当前配置、设备运行状态、路由及会话表等状态进行查看及设备运维操作,并通过执行config或edit命令进入配置模式,在配置模式下可对各相关模块进行配置并能够执行操作模式下的所有命令(run)。在配置模式下JUNOS采用分层分级模块下配置结构,如下图所示,edit命令进入下一级配置(类似unix cd命令),exit命令退回上一级,top命令回到根级。

第 3 页 共 52 页

1.2 JunOS配置管理

JUNOS通过set语句进行配置,配置输入后并不会立即生效,而是作为候选配置(Candidate Config)等待管理员提交确认,管理员通过输入commit命令来提交配置,配置内容在通过SRX语法检查后才会生效,一旦commit通过后当前配置即成为有效配置(Active config)。另外,JUNOS允许执行commit命令时要求管理员对提交的配置进行两次确认,如执行commit confirmed 2命令要求管理员必须在输入此命令后2分钟内再次输入commit以确认提交,否则2分钟后配置将自动回退,这样可以避免远程配置变更时管理员失去对SRX的远程连接风险。

在执行commit命令前可通过配置模式下show命令查看当前候选配置(Candidate Config),在执行commit后配置模式下可通过run show config命令查看当前有效配置(Active config)。此外可通过执行show | compare比对候选配置和有效配置的差异。

SRX上由于配备大容量存储器,缺省按先后commit顺序自动保存50份有效配置,并可通过执行rolback和commit命令返回到以前配置(如rollback 0/commit可返回到前一commit配置);也可以直接通过执行save configname.conf手动保存当前配置,并执行load override configname.conf / commit调用前期手动保存的配置。执行load factory-default / commit命令可恢复到出厂缺省配置。

SRX可对模块化配置进行功能关闭与激活,如执行deactivate security nat/comit命令可使NAT相关配置不生效,并可通过执行activate security nat/commit使NAT配置再次生效。

SRX通过set语句来配置防火墙,通过delete语句来删除配置,如delete security nat和edit security nat / delete一样,均可删除security防火墙层级下所有NAT相关配置,删除配置和ScreenOS不同,配置过程中需加以留意。

1.3 SRX主要配置内容

部署SRX防火墙主要有以下几个方面需要进行配置:

System:主要是系统级内容配置,如主机名、管理员账号口令及权限、时钟时区、Syslog、SNMP、系统级开放的远程管理服务(如telnet)等内容。

Interface:接口相关配置内容。

Security: 是SRX防火墙的主要配置内容,安全相关部分内容全部在Security层级下完成配置,如NAT、Zone、Policy、Address-book、Ipsec、Screen、Idp、UTM等,可简单理解为ScreenOS防火墙安全相关内容都迁移至此配置层次下,除了Application自定义服务。

Application:自定义服务单独在此进行配置,配置内容与ScreenOS基本一致。

routing-options: 配置静态路由或router-id等系统全局路由属性配置。

第 4 页 共 52 页

二、SRX防火墙配置操作举例说明 2.1 初始安装

2.1.1 设备登陆

Console口(通用超级终端缺省配置)连接SRX,root用户登陆,密码为空<初始第一次登陆>

login: root Password:

--- JUNOS 9.5R1.8 built 2009-07-16 15:04:30 UTC root% cli /***进入操作模式***/ root>

root> configure

Entering configuration mode /***进入配置模式***/ [edit] Root#

2.1.2 设备恢复出厂介绍

首先根据上述操作进入到配置模式,执行下列命令:

root# load factory-default

warning: activating factory configuration /***系统激活出厂配置***/

恢复出厂后,必须立刻设置ROOT帐号密码<默认密码至少6位数:字母加数字>

root# set system root-authentication plain-text-password New password:

当设置完ROOT帐号密码以后,进行保存激活配置

root# commit commit complete

在此需要提醒配置操作员注意,系统恢复出厂后并不代表没有任何配置,系统缺省配置有Screen\\DHCP\\Policy等相关配置,你如果需要完整的删除,可以执行命令delete 删除相关配置。通过show 来查看系统是否还有遗留不需要的配置,可以一一进行删除,直到符合你的要求,然后再重新根据实际需求进行配置。

2.1.3 设置root用户口令

设置root用户口令

root# set system root-authentication plain-text-password root# new password : root123

root# retype new password: root123 密码将以密文方式显示

root# show system root-authentication

encrypted-password \"$1$xavDeUe6$fNM6olGU.8.M7B62u05D6.\"; # SECRET-DATA

第 5 页 共 52 页

注意:强烈建议不要使用其它加密选项来加密root和其它user口令(如encrypted-password加密方式),此配置参数要求输入的口令是经加密算法加密后的字符串,采用这种加密方式手工输入时存在密码无法通过验证风险。 注:root用户仅用于console连接本地管理SRX,不能通过远程登陆管理SRX,必须成功设置root口令后,才能执行commit提交后续配置命令。

2.1.4 设置远程登陆管理用户

root# set system login user lab class super-user authentication plain-text-password root# new password : lab123

root# retype new password: lab123

注:此lab用户拥有超级管理员权限,可用于console和远程管理访问,另也可自行灵活定义其它不同管理权限用户。

2.1.5 远程管理SRX相关配置

run set date YYYYMMDDhhmm.ss /***设置系统时钟***/ set system time-zone Asia/Shanghai /***设置时区为上海***/ set system host-name SRX-650-1 /***设置主机名***/ set system name-server 1.1.1.1 /***设置DNS服务器***/ set system services ftp set system services telnet set system services web-management http

/***在系统级开启ftp/telnet/http远程接入管理服务***/

set interfaces ge-0/0/0.0 family inet address 10.1.1.1/24

set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.1/24 set interfaces ge-0/0/1 unit 0 family inet address 10.1.2.1/24 set routing-options static route 0.0.0.0/0 next-hop 192.168.1.1

/***配置逻辑接口地址及缺省路由,SRX接口要求IP地址必须配置在逻辑接口下(类似ScreenOS的子接口),通常使用逻辑接口0即可***/

set security zones security-zone untrust interfaces ge-0/0/0.0

/***将ge-0/0/0.0接口放到安全区域中,类似ScreenOS***/

set security zones security-zone untrust host-inbound-traffic system-services ping set security zones security-zone untrust host-inbound-traffic system-services http set security zones security-zone untrust host-inbound-traffic system-services telnet

/***在untrust zone打开允许远程登陆管理服务,ScreenOS要求基于接口开放服务,SRX要求基于Zone开放,从SRX主动访问出去流量开启服务,类似ScreenOS***/

本次实验拓扑中使用的设备的版本如下:

SRX100-HM系统版本与J-WEB版本均为:10.1.R2.8 SSG防火墙版本为6.1.0R7 测试客户端包含WINDOWS7\\XP

第 6 页 共 52 页

2.2 配置操作实验拓扑

2.3 策略相关配置说明

安全设备的缺省行为是拒绝安全区段之间的所有信息流 ( 区段之间信息流)允许绑定到同一区段的接口间的所有信息流 ( 区段内部信息流)。为了允许选定的区段之间信息流通过安全设备,必须创建覆盖缺省行为的区段之间策略。同样,为了防止选定的区段内部信息流通过安全设备,必须创建区段内部策略。

基本元素

允许、拒绝或设置两点间指定类型单向信息流通道的策略。信息流 ( 或“服务”)的类型、两端点的位置以及调用的动作构成了策略的基本元素。尽管可以有其它组件,但是共同构成策略核心部分的必要元素如下:

策略名称 - 两个安全区段间 ( 从源区段到目的区段) 间信息流的方向 /***必须配置***/ 源地址 - 信息流发起的地址 /***必须配置***/ 目标地址 - 信息流发送到的地址 /***必须配置***/ 服务 - 信息流传输的类型 /***必须配置***/

动作 - 安全设备接收到满足头四个标准的信息流时执行的动作 /***必须配置***/ 这些动作为:deny、permit、reject 或 tunnel

注意tunnel、firewall-authentication、application-services在permit下一级,如下:

root# set security policies from-zone trust to-zone untrust policy t-u then permit ? > Firewall-authentication

> tunnel 另外还包括其他的策略元素,比如记录日志、流量统计、时间调度对象等

三种类型的策略

可通过以下三种策略控制信息流的流动:

通过创建区段之间策略,可以管理允许从一个安全区段到另一个安全区段的信息流的种类。 通过创建区段内部策略,也可以控制允许通过绑定到同一区段的接口间的信息流的类型。 通过创建全局策略,可以管理地址间的信息流,而不考虑它们的安全区段。 第 7 页 共 52 页

2.3.1 策略地址对象定义

SRX服务网关地址对象需要自定义后才可以在策略中进行引用,默认只有any对象

自定义单个地址对象如下:

root# set security zones security-zone trust address-book address pc-1 20.1.1.200/32 root# set security zones security-zone trust address-book address pc-2 20.1.1.210/32

自定义单个地址组对象如下:

set security zones security-zone trust address-book address-set pc-group address pc-1 set security zones security-zone trust address-book address-set pc-group address pc-2

2.3.2 策略服务对象定义

SRX服务网关部分服务对象需要自定义后才可以在策略中进行引用,默认仅有预定义常用服务对象

自定义单个服务对象如下:

set applications application tcp-33 protocol tcp 定义服务对象协议 set applications application tcp-33 source-port 1-65535定义服务对象源端口

set applications application tcp-33 destination-port 33-33定义服务对象目标地址 set applications application tcp-33 inactivity-timeout never 可选定义服务对象timeout时长 set applications application tcp-8080 protocol tcp

set applications application tcp-8080 source-port 1-65535

set applications application tcp-8080 destination-port 8080-8080 set applications application tcp-8080 inactivity-timeout 3600

自定义单个服务组对象如下:

set applications application-set aaplications-group application tcp-8080 set applications application-set aaplications-group application tcp-33

2.3.3 策略时间调度对象定义

SRX服务网关时间调度对象需要自定义后才可以在策略中进行引用,默认没有预定义时间调度对象

自定义单个时间调度对象如下:

set schedulers scheduler work-time daily start-time 09:00:00 stop-time 18:00:00 set schedulers scheduler happy-time sunday start-time 00:00:00 stop-time 23:59:59 set schedulers scheduler happy-time saturday start-time 00:00:00 stop-time 23:59:59

注意:时间调度服务生效参系统时间,所以需要关注设备系统时间是否正常。

第 8 页 共 52 页

2.3.4 策略配置举例

Policy配置方法与ScreenOS基本一致,仅在配置命令上有所区别,其中策略的允许/拒绝的动作(Action)需要额外配置一条then语句(将ScreenOS的一条策略分解成两条及以上配置语句)。Policy需要手动配置policy name,policy name可以是字符串,也可以是数字(与ScreenOS的policy ID类似,只不过需要手工指定)。 首先需要注意系统缺省策略配置:

root# show security policies default-policy 查看当前系统缺省策略动作 root# set security policies default-policy ? 设置系统缺省策略动作 Possible completions:

deny-all Deny all traffic if no policy match permit-all Permit all traffic if no policy match

根据实验拓扑进行策略配置举例说明

set security zones security-zone trust address-book address pc1 20.1.1.200/32

set security zones security-zone untrust address-book address server1 192.168.1.200/32

/***与ScreenOS一样,在trust和untrust zone下分别定义地址对象便于策略调用,地址对象的名称可以是地址/掩码形式***/

set security zones security-zone trust address-book address-set addr-group1 address pc1

/***在trust zone下定义名称为add-group1的地址组,并将pc1地址放到该地址组中***/

Set security policies from-zone trust to-zone untrust policy 001 match source-address addr-group1 destination-address server1 application any

set security policies from-zone trust to-zone untrust policy 001 then permit

/***定义从trust 到untrust方向permit策略,允许addr-group1组的源地址访问server1地址any服务***/

set security policies from-zone trust to-zone untrust policy 001 then log session-init set security policies from-zone trust to-zone untrust policy 001 then log session-close set security policies from-zone trust to-zone untrust policy 001 then count

<可选配置>/***定义从trust 到untrust方向策略,针对当前策略记录日志并统计策略流量

root# set security policies from-zone trust to-zone untrust policy 001 scheduler-name happy-time root# set security policies from-zone trust to-zone dmz policy 001 scheduler-name work-time

<可选配置>/***定义当前策略,引用时间调度对象,符合时间条件策略生效,否则策略将处于非工作状态

root# set security policies from-zone trust to-zone untrust policy t-u then permit application-services ?

Possible completions:

+ apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups gprs-gtp-profile Specify GPRS Tunneling Protocol profile name idp Intrusion detection and prevention redirect-wx Set WX redirection reverse-redirect-wx Set WX reverse redirection

uac-policy Enable unified access control enforcement of policy utm-policy Specify utm policy name [edit]

<可选配置>/***定义当前策略,选择是否客气IDP\\UAC\\UTM等操作,如果针对策略开启相应的检查,请先定义好相应的功能。

第 9 页 共 52 页

2.4 地址转换

SRX NAT较ScreenOS在功能实现方面基本保持一致,但在功能配置上有较大区别,配置的主要差异在于ScreenOS的NAT与policy是绑定的,无论是MIP/VIP/DIP还是基于策略的NAT,在policy中均要体现出NAT内容(除了缺省基于untrust接口的Souec-NAT模式外),而SRX 的NAT则作为网络层面基础内容进行配置(定义地址映射的方向、映射关系及地址范围),Policy中不再包含NAT相关配置信息,这样的好处是易于理解、简化运维,当网络拓朴和NAT映射关系发生改变时,无需调整Policy配置内容。

SRX NAT和Policy执行先后顺序为:目的地址转换-目的地址路由查找-执行策略检查-源地址转换,结合这个执行顺序,在配置Policy时需注意:Policy中源地址应是转换前的源地址,而目的地址应该是转换后的目的地址,换句话说,Policy中的源和目的地址应该是源和目的两端的真实IP地址,这一点和ScreenOS存在区别,需要加以注意。

SRX中不再使用MIP/VIP/DIP这些概念,其中MIP被Static静态地址转换取代,两者在功能上完全一致;DIP被Source NAT取代;基于Policy的目的地址转换及VIP被 Destination NAT取代。ScreenOS中基于Untrust zone接口的源地址转换被保留下来,但在SRX中不再是缺省模式(SRX中Trust Zone接口没有NAT模式概念),需要手工配置。类似ScreenOS,Static属于双向NAT,其他类型均属于单向NAT。

此外,SRX还多了一个proxy-arp概念,如果定义的IP Pool(可用于源或目的地址转换)需配置SRX对这个Pool内的地址提供ARP代理功能,这样对端设备能够解析到IP Pool地址的MAC地址(使用接口MAC地址响应对方),以便于返回报文能够送达SRX。下面是配置举例及相关说明:

2.4.1 Interface based NAT 基于接口的源地址转换

图片仅供参考,下列配置参考实验拓扑

NAT配置:

set security nat source rule-set 1 from zone trust 指定源区域 set security nat source rule-set 1 to zone untrust 指定目标区域

set security nat source rule-set 1 rule rule1 match source-address 0.0.0.0/0 destination-address 0.0.0.0/0 指定源和目标匹配的地址或者地址段,0.0.0./0代表所有

set security nat source rule-set 1 rule rule1 then source-nat interface 指定通过接口IP进行源翻译

上述配置定义NAT源地址映射规则,从Trust Zone访问Untrust Zone的所有流量用Untrust Zone接口IP做源地址转换。

第 10 页 共 52 页

Policy配置:

set security policies from-zone trust to-zone untrust policy 1 match source-address pc-1 set security policies from-zone trust to-zone untrust policy 1 match destination-address any set security policies from-zone trust to-zone untrust policy 1 match application any set security policies from-zone trust to-zone untrust policy 1 then permit

上述配置定义Policy策略,允许Trust zone 10.1.2.2地址访问Untrust方向任何地址,根据前面的NAT配置,SRX在建立session时自动执行接口源地址转换。

2.4.2 Pool based Source NAT基于地址池的源地址转换

图片仅供参考,下列配置参考实验拓扑

NAT配置:

set security nat source pool pool-1 address 192.168.1.50 to 192.168.1.150 set security nat source rule-set 1 from zone trust

set security nat source rule-set 1 to zone untrust

set security nat source rule-set 1 rule rule1 match source-address 0.0.0.0/0 destination-address 0.0.0.0/0

set security nat source rule-set 1 rule rule1 then source-nat pool pool-1

set security nat proxy-arp interface ge-0/0/0 address 192.168.1.50 to 192.168.1.150

上述配置表示从trust方向(any)到untrust方向(any)访问时提供源地址转换,源地址池为pool1(192.168.1.50-192.168.1.150),同时fe-0/0/0接口为此pool IP提供ARP代理。需要注意的是:定义Pool时不需要与Zone及接口进行关联。配置proxy-arp目的是让返回包能够送达SRX,如果Pool与出接口IP不在同一子网,则对端设备需要配置指向fe-0/0/0接口的Pool地址路由。

Policy:

set security policies from-zone trust to-zone untrust policy 1 match source-address pc-1 set security policies from-zone trust to-zone untrust policy 1 match destination-address any set security policies from-zone trust to-zone untrust policy 1 match application any set security policies from-zone trust to-zone untrust policy 1 then permit

上述配置定义Policy策略,允许Trust zone 10.1.2.2地址访问Untrust方向任何地址,根据前面的NAT配置,SRX在建立session时自动执行源地址转换。

第 11 页 共 52 页

2.4.3 Pool base destination NAT基于地址池的目标地址转换

图片仅供参考,下列配置参考实验拓扑

NAT配置:

set security nat destination pool 111 address 20.1.1.200/32 set security nat destination rule-set 1 from zone untrust

set security nat destination rule-set 1 rule 111 match source-address 0.0.0.0/0

set security nat destination rule-set 1 rule 111 match destination-address 192.168.1.150/32 set security nat destination rule-set 1 rule 111 then destination-nat pool 111

上述配置将any访问192.168.1.150地址映射到内网20.1.1.200地址,注意:定义的Dst Pool是内网真实IP地址,而不是映射前的公网地址。这点和Src-NAT Pool有所区别。

Policy:

set security policies from-zone trust to-zone untrust policy 1 match source-address any

set security policies from-zone trust to-zone untrust policy 1 match destination-address PC-1 set security policies from-zone trust to-zone untrust policy 1 match application any set security policies from-zone trust to-zone untrust policy 1 then permit

上述配置定义Policy策略,允许Untrust方向任何地址访问Trust方向PC-1:20.1.1.200,根据前面的NAT配置,公网访问192.168.1.150时,SRX自动执行到20.1.1.200的目的地址转换。

ScreenOS VIP功能对应的SRX Dst-nat配置:

set security nat destination pool 222 address 20.1.1.200/32 port 8080 set security nat destination rule-set 1 from zone untrust

set security nat destination rule-set 1 rule 111 match source-address 0.0.0.0/0

set security nat destination rule-set 1 rule 111 match destination-address 192.168.1.150/32 set security nat destination rule-set 1 rule 111 match destination-port 8080 set security nat destination rule-set 1 rule 111 then destination-nat pool 222

上述NAT配置定义:访问192.168.1.150地址8080端口映射至20.1.1.200地址8080端口,功能与ScreenOS VIP端口映射一致。

第 12 页 共 52 页

2.4.4 Pool base Static NAT基于地址池的静态地址转换

图片仅供参考,下列配置参考实验拓扑

NAT:

set security nat static rule-set static-nat from zone untrust

set security nat static rule-set static-nat rule rule1 match destination-address 192.168.1.150 set security nat static rule-set static-nat rule rule1 then static-nat prefix 20.1.1.200 Policy:

set security policies from-zone trust to-zone untrust policy 1 match source-address any set security policies from-zone trust to-zone untrust policy 1 match destination-address pc-1 set security policies from-zone trust to-zone untrust policy 1 match application any set security policies from-zone trust to-zone untrust policy 1 then permit

Static NAT概念与ScreenOS MIP一致,属于静态双向一对一NAT,上述配置表示访问192.168.1.150时转换为20.1.1.200,当20.1.1.200访问Internet时自动转换为192.168.1.150,并且优先级比其他类型NAT高。

2.5 IPSEC VPN

SRX IPSEC VPN支持Site-to-Site VPN 和基于NS-remote的拨号VPN以及基于IPSEC的动态VPN,访问方式通过WEB界面进行,和ScreenOS一样,site-to-site VPN也支持路由模式和Policy模式,在配置方面也和ScreenOS基本一致。SRX中的加密/验证算法在命名上和ScreenOS存在一些区别,配置过程中建议选择ike和ipsec的proposal为 standard模式,standard中包含SRX支持的全部加密/验证算法,只要对端设备支持其中任何一种即可。SRX中通道接口使用st0接口,对应ScreenOS中的tunnel虚拟接口。

本次将列举如下配置案例:

1、 基于策略的LAN TO LAN IPSEC VPN 2、 基于路由的LAN TO LAN IPSEC VPN 3、 基于REMOTE VPN客户端拨号VPN 4、 基于IPSEC动态VPN<通过WEB界面>

注意在REMOTE VPN客户端拨号VPN中我们将列举JUNIPER REMOTE VPN客户端和第三方ShrewSoft VPN Client,另外基于IPSEC动态VPN是通过WEB界面访问,初次登陆系统自动或人工下载一个JAVA客户端。

第 13 页 共 52 页

2.5.1 基于路由的LAN TO LAN IPSEC VPN

SRX配置:

下面是图中左侧SRX基于路由方式Site-to-site VPN配置:

set interfaces st0 unit 0 family inet address 1.1.1.1/24 set security zones security-zone untrust interfaces st0.0 set routing-options static route 172.16.1.0/24 next-hop st0.0

定义st0 tunnel接口地址/Zone及通过VPN通道到对端网络路由

set security ike policy ABC mode main

set security ike policy ABC proposal-set standard

set security ike policy ABC pre-shared-key ascii-text juniper

定义IKE Phase1 policy参数,main mode,standard proposal及预共享密钥方式

set security ike gateway gw1 ike-policy ABC

set security ike gateway gw1 address 10.1.1.254

set security ike gateway gw1 external-interface fe-0/0/2.0

定义IKE gaeway参数,预共享密钥认证,对端网关10.1.1.254,出接口fe-0/0/2(位于dmz zone)

set security ipsec policy AAA proposal-set standard set security ipsec 1 bind-interface st0.0 set security ipsec 1 ike gateway gw1 set security ipsec 1 ike ipsec-policy AAA set security ipsec 1 establish-tunnels immediately

定义ipsec Phase 2 VPN参数:standard proposal、与st0.0接口绑定,调用Phase 1 gw1 ike网关。

set security policies from-zone untrust to-zone trust policy -policy match source-address any set security policies from-zone untrust to-zone trust policy -policy match destination-address any set security policies from-zone untrust to-zone trust policy -policy match application any set security policies from-zone untrust to-zone trust policy -policy then permit

set security policies from-zone trust to-zone untrust policy -policy match source-address any set security policies from-zone trust to-zone untrust policy -policy match destination-address any set security policies from-zone trust to-zone untrust policy -policy match application any set security policies from-zone trust to-zone untrust policy -policy then permit

两端设备策略开启双向policy以允许VPN流量通过 SSG配置参考:

set ike gateway \"abc\" address 10.1.1.1 Main outgoing-interface \"ethernet0/1\" preshare \"juniper\" sec-level standard

set \"gw-1\" gateway \"abc\" no-replay tunnel idletime 0 sec-level standard set \"gw-1\" monitor

set \"gw-1\" id 0x1 bind interface tunnel.1 set interface tunnel.1 ip 1.1.1.2/24 set route 20.1.1.0/24 interface tunnel.1

set policy id 3 from \"ssg-\" to \"Trust\" \"Any-IPv4\" \"Any-IPv4\" \"ANY\" permit log set policy id 2 from \"Trust\" to \"ssg-\" \"Any-IPv4\" \"Any-IPv4\" \"ANY\" permit log

第 14 页 共 52 页

SRX设备端监控VPN状态

SSG设备端监控VPN状态

2.5.2 基于策略的LAN TO LAN IPSEC VPN

要设置基于策略的LAN TO LAN IPSEC VPN通道,请在通道两端的安全设备上执行以下步骤: 1. 同样配置IKE\\IPSEC参数<指定对方的IP地址、指定加密方式等> 2. 不需要配置通道接口

3. 为每个站点间通过的 VPN 流量设置策略,注意此时需要在策略中调用VPN IKE通道,如下命令:

SRX设备策略配置:

root# set security policies from-zone srx- to-zone trust policy -policy then permit tunnel ipsec- 1

root# set security policies from-zone trust to-zone srx- policy -policy then permit tunnel ipsec- 1

SSG设备策略配置:

set policy id 3 from ssg- to trust 20.1.1.0/24 172.16.1.0/24 any tunnel abc set policy id 3 from trust to ssg- 172.16.1.0/24 20.1.1.0/24 any tunnel abc

特别提醒,基于策略的LAN TO LAN IPSEC VPN 在建立策略的时候,两端设备的双向策略源地址、目标地址、服务必须一致对应。

2.5.3 基于Remote VPN 客户端拨号VPN

为了能够体现其配置真实性、可观性、此次配置将采用真实环境进行配置演示,具体如下: 第一步:定义分配给VPN拨号用户的IP地址池

set access address-pool xauth-pool address-range low 30.1.1.1 第 15 页 共 52 页

set access address-pool xauth-pool address-range high 30.1.1.100 第二步:定义VPN拨号用户

set access profile xauth-users authentication-order password

set access profile xauth-users client test1 firewall-user password \"$9$qmQF69A01R/9M8xNbw\" set access profile xauth-users client test2 firewall-user password \"$9$zPWq3Ct0BIcreOB-Vs2aJ\" 第三步:定义IKE Proposal

set security ike proposal dialup-proposal authentication-method pre-shared-keys set security ike proposal dialup-proposal dh-group group2

set security ike proposal dialup-proposal authentication-algorithm sha1 set security ike proposal dialup-proposal encryption-algorithm aes-128-cbc 第四步:定义IPSEC Proposal

set security ipsec proposal dialup-proposal protocol esp

set security ipsec proposal dialup-proposal authentication-algorithm hmac-sha1-96 set security ipsec proposal dialup-proposal encryption-algorithm aes-128-cbc 第五步: 定义IKE policy

set security ike policy dialup-policy mode aggressive

set security ike policy dialup-policy proposals dialup-proposal

set security ike policy dialup-policy pre-shared-key ascii-text “JUNIPER-WXF1987” 第六步:定义IKE gateway

set security ike gateway dialup-ike ike-policy dialup-policy set security ike gateway dialup-ike dynamic hostname juniper set security ike gateway dialup-ike dynamic connections-limit 100 set security ike gateway dialup-ike dynamic ike-user-type shared-ike-id

set security ike gateway dialup-ike external-interface ge-0/0/8.0 选择VPN接受从那个接口拨进来 set security ike gateway dialup-ike xauth access-profile xauth-users 第七步:定义Ipsec policy

set security ipsec policy dialup-policy2 proposals dialup-proposal set security ipsec policy ipsec-pol perfect-forward-secrecy keys group2 set security ipsec policy ipsec-pol proposals phase2-prop 第八步:定义ipsev

set security ipsec dialup- ike gateway dialup-ike

set security ipsec dialup- ike ipsec-policy dialup-policy2 set security ipsec dialup- establish-tunnels on-traffic 第九步:定义VPN策略<内部允许访问的资源>

set security policies from-zone untrust to-zone dmz policy dialup- match source-address any set security policies from-zone untrust to-zone dmz policy dialup- match destination-address 10.0.100.0/24-vlan_3

set security policies from-zone untrust to-zone dmz policy dialup- match destination-address 10.0.110.0/24-vlan_4

set security policies from-zone untrust to-zone dmz policy dialup- match destination-address 10.0.130.0/24-vlan_5

set security policies from-zone untrust to-zone dmz policy dialup- match destination-address 10.0.140.0/24-vlan6

set security policies from-zone untrust to-zone dmz policy dialup- match application any

第 16 页 共 52 页

set security policies from-zone untrust to-zone dmz policy dialup- then permit tunnel ipsec- dialup-

set security policies from-zone untrust to-zone dmz policy dialup- then log session-init set security policies from-zone untrust to-zone dmz policy dialup- then log session-close

至此ipsec 拨号VPN设备配置完成。

接下来我们将演示如何配置Juniper Remote 客户端 如何配置第三方ShrewSoft VPN Client

首先我们介绍Juniper Remote 客户端配置,参考如下截图配置<依据上述配置进行>:

第 17 页 共 52 页

第 18 页 共 52 页

第 19 页 共 52 页

客户端查看连接状态如上,设备端查看连接状态如下:

接下来我们介绍ShrewSoft VPN Client客户端配置,参考如下截图配置<依据上述配置进行>: 软件下载地址:http://www.shrewsoft.com/download

Please Select Your Download

 

VPN Client For Windows VPN Client For Linux and BSD

第 20 页 共 52 页

第 21 页 共 52 页

第 22 页 共 52 页

至此IPSEC VPN客户端拨号两种类型客户端配置介绍到此为止,如有问题请联系文档编辑者。

第 23 页 共 52 页

2.5.4 基于IPSEC动态VPN

为了能够体现其配置真实性、可观性、此次配置将采用真实环境进行配置演示,具体如下: 第一步:配置用户认证配置文件

set access profile user-auth-profile client partner firewall-user password \"$9$E25hWLxNVw8LG \" set access profile user-auth-profile client wj firewall-user password \"$9$qmQF69A01R/9M8xNbw\" set access profile user-auth-profile client wxf firewall-user password \"$9$gdoUjk.PQ36q.1RcyKv\" set access firewall-authentication web-authentication default-profile user-auth-profile

第二步:配置IKE Proposal

set security ike proposal phase1-prop authentication-method pre-shared-keys set security ike proposal phase1-prop dh-group group2

set security ike proposal phase1-prop authentication-algorithm sha1 set security ike proposal phase1-prop encryption-algorithm 3des-cbc

第三步:配置Ipsev Proposal

set security ipsec proposal phase2-prop protocol esp

set security ipsec proposal phase2-prop authentication-algorithm hmac-sha1-96 set security ipsec proposal phase2-prop encryption-algorithm 3des-cbc

第四步:配置IKE policy

set security ike policy ike-pol mode aggressive set security ike policy ike-pol proposals phase1-prop

set security ike policy ike-pol pre-shared-key ascii-text \"$9$FmMq/pBRhrlMXz3REyMWxSr\"

第五步:配置IKE Gateway<分别对应不同的用户>

set security ike gateway dyn-gw-wxf ike-policy ike-pol

set security ike gateway dyn-gw-wxf dynamic hostname wxf

set security ike gateway dyn-gw-wxf external-interface ge-0/0/8 接受VPN流量请求端口 set security ike gateway dyn-gw-wxf xauth access-profile user-auth-profile set security ike gateway dyn-gw-partner ike-policy ike-pol

set security ike gateway dyn-gw-partner dynamic hostname partner

set security ike gateway dyn-gw-partner external-interface ge-0/0/8

set security ike gateway dyn-gw-partner xauth access-profile user-auth-profile

第六步:配置Ipsec policy

set security ipsec policy ipsec-pol perfect-forward-secrecy keys group2 set security ipsec policy ipsec-pol proposals phase2-prop

第七步:配置Ipsev VPN<分别对应不同的用户>

set security ipsec dynamic--wxf ike gateway dyn-gw-wxf set security ipsec dynamic--wxf ike ipsec-policy ipsec-pol

set security ipsec dynamic--partner ike gateway dyn-gw-partner set security ipsec dynamic--partner ike ipsec-policy ipsec-pol

第八步:配置动态VPN<分别对应不同的用户>

set security dynamic- access-profile user-auth-profile

set security dynamic- clients client1 remote-protected-resources 10.0.0.0/16 set security dynamic- clients client1 remote-exceptions 0.0.0.0/0 set security dynamic- clients client1 ipsec- dynamic--wxf set security dynamic- clients client1 user wxf

第 24 页 共 52 页

set security dynamic- clients client3 remote-protected-resources 10.0.140.11/32 set security dynamic- clients client3 remote-exceptions 0.0.0.0/0

set security dynamic- clients client3 ipsec- dynamic--partner set security dynamic- clients client3 user partner

第八步:配置VPN策略对应动态VPN用户

set security policies from-zone untrust to-zone dmz policy -wxf-dy match source-address any set security policies from-zone untrust to-zone dmz policy -wxf-dy match destination-address 10.0.100.0/24-vlan_3

set security policies from-zone untrust to-zone dmz policy -wxf-dy match destination-address 10.0.110.0/24-vlan_4

set security policies from-zone untrust to-zone dmz policy -wxf-dy match destination-address 10.0.130.0/24-vlan_5

set security policies from-zone untrust to-zone dmz policy -wxf-dy match destination-address 10.0.140.0/24-vlan6

set security policies from-zone untrust to-zone dmz policy -wxf-dy match application any

set security policies from-zone untrust to-zone dmz policy -wxf-dy then permit tunnel ipsec- dynamic--wxf

set security policies from-zone untrust to-zone dmz policy -wxf-dy then log session-init set security policies from-zone untrust to-zone dmz policy -wxf-dy then log session-close

上面针对WXF用户、下面针对Partner用户

set security policies from-zone untrust to-zone dmz policy -partner match source-address any set security policies from-zone untrust to-zone dmz policy -partner match destination-address 10.0.140.13/32

set security policies from-zone untrust to-zone dmz policy -partner match destination-address 10.0.140.21/32

set security policies from-zone untrust to-zone dmz policy -partner match destination-address 10.0.140.22/32

set security policies from-zone untrust to-zone dmz policy -partner match application any

set security policies from-zone untrust to-zone dmz policy -partner then permit tunnel ipsec- dynamic--partner

set security policies from-zone untrust to-zone dmz policy -partner then log session-init set security policies from-zone untrust to-zone dmz policy -partner then log session-close set security policies from-zone untrust to-zone dmz policy -partner then count

接下来我们介绍动态VPN客户端配置指导,参考如下截图配置<依据上述配置进行>:

客户端通过WEB-IE访问地址: https://222.73.67.130/dynamic-

第 25 页 共 52 页

第 26 页 共 52 页

第 27 页 共 52 页

至此客户端配置完成,下面介绍设备端动态VPN状态

第 28 页 共 52 页

2.6 应用层网关ALG配置及说明

SRX中自定义服务及ALG使用方法与ScreenOS保持一致,系统缺省开启FTP ALG,为TCP 21服务提供FTP应用ALG。自定义服务如果属于FTP类应用,需要将此自定义服务(非TCP 21端口)与FTP应用进行关联。下面举例定义一个FTP类服务ftp-test,使用目的端口为TCP 2100,服务超时时间为3600秒,并将此自定义服务与FTP应用关联(ALG),系统将识别此服务为FTP应用并开启FTP ALG来处理该应用流量。

set applications application ftp-test protocol tcp destination-port 2100 inactivity-timeout 3600 set applications application ftp-test application-protocol ftp Branch 系统防火墙ALG状态如下(10.1R2.8版本) root# run show security alg status <默认配置下> ALG Status :

DNS : Enabled FTP : Enable H323 : Enabled MGCP : Enabled MSRPC : Enabled PPTP : Enabled RSH : Enabled RTSP : Enabled SCCP : Enabled SIP : Enabled SQL : Enabled SUNRPC : Enabled TALK : Enabled TFTP : Enabled

建议不需要使用到的ALG可以关闭,以免影响正常应用,但是如果应用工作在NAT模式下则建议开启。

2.7 SRX Branch 系列JSRP HA高可用性配置及说明

JSRP是Juniper SRX的私有HA协议,对应ScreenOS的NSRP双机集群协议,支持A/P和A/A模式,JSRP对ScreenOS NSRP协议和JUNOS Cluster集群技术进行了整合集成,熟悉NSRP协议有助于对JSRP协议的理解。JSRP和NSRP最大的区别在于JSRP是完全意义上的Cluster概念,两台设备完全当作一台设备来看待,两台设备的接口板卡顺序编号、运维变更将对两台设备同时进行操作,无需额外执行ScreenOS的配置和会话同步等操作,而ScreenOS NSRP可看作在同步配置和动态对象(session)基础上运行的两台单独设备。

JSRP要求两台设备在软件版本、硬件型号、板卡数量、插槽位置及端口使用方面严格一一对应。由于SRX 是转发与控制层面完全架构,JSRP需要控制层面 (配置同步)和数据层面(Session同步)两个平面的互联,高端系列3K\\5K建议控制和数据层面互联链路使用光纤链路直连(部分平台强制要求光纤链路直连)。

在Branch系列则控制平面连接、带外管理接口必须使用设备规定的接口,而数据平面可以使用任何一个以太网口进行互连。

下面将介绍SRX Branch系列防火墙运行HA情况下,控制平面、带外接口连接示意图:

You must use the following ports to form the control link on the SRX Series branch

你必须使用下面设备指定端口来作为HA控制信号端口进行互连 设备型号:

■ ■ ■ ■

For SRX100 devices, connect the fe-0/0/7 port to the fe-1/0/7 port For SRX210 devices, connect the fe-0/0/7 port to the fe-2/0/7 port For SRX240 devices, connect the ge-0/0/1 port to the ge-5/0/1 port For SRX650 devices, connect the ge-0/0/1 port to the ge-9/0/1 port

SRX650<标准配置4个千兆以太网RJ-45接口>SRX650平台如果需要部署HA结构,则必须增加数据接口板卡<因为HA控制平面、数据平面和带外管理接口被占用了至少3个接口>

第 29 页 共 52 页

SRX240<标准配置16个千兆以太网RJ-45接口>

SRX210<标准配置2个千兆以太网RJ-45接口和6个百兆以太网RJ-45接口>

SRX100<标准配置8个百兆以太网RJ-45接口>

第 30 页 共 52 页

SRX Branch系列接口规范

JSRP接口命名方式采用多个机箱抽象成一个逻辑机箱之后再统一为各个槽位进行编号,如上所示的每个机箱有几个业务槽位,节点0槽位号从0开始编号,节点1槽位号从节点0后面开始往后编。

整个JSRP配置过程包括如下7个步骤     

配置Cluster id和Node id (对应ScreenOS NSRP 的cluster id并需手工指定设备使用节点id) 指定Control Port (指定控制层面使用接口,用于配置同步及心跳) 指定Fabric Link Port (指定数据层面使用接口,主要session等RTO同步) 配置Redundancy Group (类似NSRP的VSD group,优先级与抢占等配置)

每个机箱的个性化配置 (单机无需同步的个性化配置,如主机名、带外管理口IP地址等) 配置Redundant Ethernet Interface (类似NSRP的Redundant冗余接口)

配置Interface Monitoring (类似NSRP interface monitor,是RG数据层面切换依据)

第 31 页 共 52 页

SRX JSRP配置样例:  配置Cluster id和Node id

SRX-A>set chassis cluster cluster-id 1 node 0 reboot(注意该命令需在operational模式下输入,Cluster ID取值范围为1 – 15,当Cluster ID = 0时将unsets the cluster) SRX-B>set chassis cluster cluster-id 1 node 1 reboot

 

指定Control Port(SRX Branch系列,则无需指定,默认规定采用某一个接口作为控制接口,参考上一节): 指定Fabric Link Port

set interfaces fab0 fabric-options member-interfaces ge-0/0/2 set interfaces fab1 fabric-options member-interfaces ge-5/0/2

注:Fabric Link中的Fab0固定用于node 0,Fab1固定用于node 1 

配置Redundancy Group

RG0固定用于主控板RE切换,RG1以后用于redundant interface切换,RE切换于接口切换

set chassis cluster reth-count 10 (指定整个Cluster中redundant ethernet interface最多数量) set chassis cluster redundancy-group 0 node 0 priority 200 (高值优先,与NSRP相反) set chassis cluster redundancy-group 0 node 1 priority 100

set chassis cluster redundancy-group 1 node 0 priority 200 (高值优先,与NSRP相反) set chassis cluster redundancy-group 1 node 1 priority 100

每个机箱的个性化配置,便于对两台设备的区分与管理

set groups node0 system host-name SRX-A

set groups node0 interfaces fxp0 unit 0 family inet address 1.1.1.1/24 (带管口名称为fxp0,区

别ScreenOS的MGT口)

set groups node1 system host-name SRX-B

set groups node1 interfaces fxp0 unit 0 family inet address 1.1.1.2/24 set apply-groups ${node} (应用上述groups配置)

配置Redundant Ethernet Interface

Redundant Ethernet Interface类似ScreenOS里的redundant interface,只不过Redundant Ethernet interface是分布在不同的机箱上 (这一特性又类似ScreenOS 的VSI接口)。

Set interface ge-0/0/8 gigether-options redundant-parent reth0 (node 0的ge-0/0/8接口) Set interface ge-5/0/8 gigether-options redundant-parent reth0 (node 1的ge-0/0/8接口) Set interface reth0 redundant-ether-options redundancy-group 1 (reth0属于RG1) Set interface reth0 unit 0 family inet address 192.168.0.1/24

配置Interface Monitoring,被监控的接口Down掉后,RG1将自动进行主备切换(与ScreenOS类似),

Set cluster redundancy-group 1 interface-monitor ge-0/0/0 weight 255 Set cluster redundancy-group 1 interface-monitor ge-0/0/1 weight 255 Set cluster redundancy-group 1 interface-monitor ge-13/0/0 weight 255 Set cluster redundancy-group 1 interface-monitor ge-13/0/1 weight 255

JSRP维护命令 a) b)

手工切换JSRP Master,RG1 原backup将成为Master

root@srx240a> request chassis cluster failover redundancy-group 1 node 1

手工恢复JSRP状态,按照优先级重新确定主备关系(高值优先)

root@srx240b> request chassis cluster failover reset redundancy-group 1

c) d)

查看cluster interface

root@router> show chassis cluster interfaces

查看cluster 状态、节点状态、主备关系

第 32 页 共 52 页

lab@240a# run show chassis cluster status

e) f)

取消cluster配置

lab@Srx240a# set chassis cluster disable reboot

升级JSRP软件版本

SRX目前暂不支持软件在线升级(ISSU),升级过程会中断业务。 升级步骤如下:

1.升级node 0,注意不要重启系统 2.升级node 1,注意不要重启系统. 3.同时重启两个系统 g)

恢复处于disabled状态的node

当control port或fabric link出现故障时,为避免出现双master (split-brain)现象,JSRP会把出现故障前状态为secdonary的node设为disabled状态,即除了RE,其余部件都不工作。想要恢复必须reboot该node。2.8 WEB界面操作介绍2.9 Screen配置操作介绍

2.8 SRX Branch 系列IDP、UTM配置操作介绍

SRX Branch系列产品提供一整套统一威胁管理 (UTM) 服务,包括:入侵防御系统 (IPS)、防病毒、防垃圾邮件、通过内容过滤实现的网页过滤以及防信息泄露,从而保护您的网络,防止最新的内容威胁。特定型号的产品还具有内容安全加速器以提供高性能 IPS和防病毒性能。面向分支机构的 SRX 系列产品与其它的瞻博安全产品集成,从而提供企业级的统一接入控制和自适应威胁管理功能。这些功能为安全专家提供了与网络犯罪和数据丢失斗争的强大工具。

配置IDP、UTM功能之前,你首先需要知道你的设备是否购买了相关功能的license,可以通过下面命令进行查看,由于测试中本人的设备License过期,相应的功能只是不能更新而已,功能测试使用没有问题。 由于当前测试过程没有NSM管理平台,故测试中的IDP\\UTM等功能产生的日志无法收集分析。

root# run show system license <将会显示相应的功能license以及过期时间>

如果license过去也可以通过相应的命令进行查看,如下:

root# run show system alarms

3 alarms currently active

Alarm time Class Description

2010-06-17 19:22:31 CST Minor License grace period for feature 28 expired 2010-06-17 19:22:31 CST Minor License grace period for feature 27 expired 2010-06-17 19:22:31 CST Minor License grace period for feature 25 expired

默认情况下,设备沟通过去将有提供一个月的试用期license。 首先我们将介绍IDP配置

第一步:申请license,此步骤必须保证设备本身能够访问Internet

Root#run request system license update trial

第二步:查看license更新情况

root# run show system license

第三步:检查并下载安装IDP特征库更新包<需要设备本身能够访问internet>

root# run request security idp security-package ? 下载并安装更新包

Possible completions:

download Download security package (Package includes detector and deltas for attack table) install Update attack database, active policy, detector with new package

第 33 页 共 52 页

第四步:检查下载状态、下载特征库版本、更新日期等信息

root# run request security idp security-package download status In progress: Downloading ...

root# run request security idp security-package download status

Done;Successfully downloaded from(https://services.netscreen.com/cgi-bin/index.cgi). Version info:1714(Wed Jun 16 14:41:19 2010, Detector=10.4.160100525)

root# run request security idp security-package download check-server Successfully retrieved from(https://services.netscreen.com/cgi-bin/index.cgi). Version info:1714(Detector=10.4.160100525, Templates=2)

第五步:当完成上述操作下载IDP特征库以后,需要进行对特征库的安装

root# run request security idp security-package install ? 特征库安装并查看安装状态 Possible completions:

<[Enter]> Execute this command

policy-templates Update previously installed policy-templates with newly downloaded ones status Retrieve the status of security package load operation

update-attack-database-only Don't update/push active policy or detector to data plane | Pipe through a command

第六步:配置IDP策略与安装策略

root# show security idp 配置IDP策略与安全策略 idp-policy juniper-srx-idp-test { rulebase-ips {

rule 1 {

match {

source-address any; destination-address any;

attacks {

predefined-attack-groups [ HTTP DNS ICMP UDP TCP ]; } } then {

action {

ignore-connection; }

notification { log-attacks; } } } }

}

active-policy juniper-srx-idp-test; 激活IDP策略

[edit]

root# show security policies

第 34 页 共 52 页

from-zone dmz to-zone untrust { policy d-u { match {

source-address any; destination-address any; application any; }

then {

permit {

application-services {

idp; 针对当前策略开启IDP功能 } } log {

session-init;

第七步:查看IDP功能工作状态命令:

root# run show security idp ? Possible completions:

application-identification Show IDP application identification data application-statistics Show IDP application statistics attack Show IDP attack data

counters Show IDP counters

memory Show IDP data plane memory statistics policies Show the list of currently installed policies policy-templates-list Show available policy templates

security-package-version Show the version of currently installed security-package status Show IDP status

root# run show security idp status

State of IDP: 2-default, Up since: 2010-01-19 23:23:21 CST (21:59:39 ago) Packets/second: 281 Peak: 2703 @ 2010-01-20 20:15:34 CST KBits/second : 280 Peak: 10097 @ 2010-01-20 20:15:34 CST Latency (microseconds): [min: 0] [max: 0] [avg: 0]

Packet Statistics:

[ICMP: 2210497] [TCP: 11918] [UDP: 2419330] [Other: 0] Flow Statistics:

ICMP: [Current: 1218] [Max: 2278 @ 2010-01-20 21:22:37 CST] TCP: [Current: 40] [Max: 138 @ 2010-01-20 19:14:02 CST] UDP: [Current: 16] [Max: 434 @ 2010-01-20 19:15:48 CST] Other: [Current: 0] [Max: 0 @ 2010-01-19 23:23:21 CST] Session Statistics:

[ICMP: 609] [TCP: 20] [UDP: 8] [Other: 0]

Policy Name : juniper-srx-idp-test v0 关键查看此处IDP策略是否激活工作状态 Running Detector Version : 10.2.160091104 运行中使用的检测版本

第 35 页 共 52 页

接下我们将介绍UTM中的web-filtering功能配置

Juniper SRX Branch系列能够做到的WEB过滤内网包括如下:

可以通过WEB过滤功能过滤涉及上述信息的网站等,有效提高企业办公效率

列举一个简单的例子,不允许内网用户访问任何与新闻有关的网站, 但是可以访问news.163.com,并且不允许访问开心网, 其他类型网站可以访问<体育、51JOB等>

首先我们同样需要检查设备的license与特征库等是否最新<根据上述IDP操作,不再重复> 第一步:申请license,此步骤必须保证设备本身能够访问Internet

Root#run request system license update trial

第二步:查看license更新情况

root# run show system license

第三步:配置UTM- web-filtering策略和安全策略

root# show security utm custom-objects { url-pattern { badsite-1 {

value www.kaixin001.com; }

goodsite-1 {

value news.163.com; }

}

custom-url-category { bad-site {

value badsite-1; }

good-site {

value goodsite-1; } } }

feature-profile {

web-filtering {

url-whitelist good-site; url-blacklist bad-site;

第 36 页 共 52 页

type surf-control-integrated; surf-control-integrated {

profile block-selected-sites { category { News {

action block; }

}

default log-and-permit;

custom-block-message \"The site requested is not a work-related site! Go back to work! If you have questions, Please contact technical, support This is the Juniper solution!\"; } } }

}

utm-policy web_filtering {

web-filtering {

http-profile block-selected-sites; } }

[edit]

root# show security policies from-zone trust to-zone untrust policy t-u match {

source-address any; destination-address any; application any; } then {

permit {

application-services {

utm-policy web_filtering;针对此条策略开启WEB_Fitering

[edit]

第四步:查看WEB-过滤功能工作状态命令:

root# run show security utm web-filtering ? Possible completions:

statistics Show web-filtering statistics status Show web-filtering status [edit]

root# run show security utm web-filtering

第 37 页 共 52 页

2.9 SRX Branch 系列与UAC联动配置说明

JUNIPER SRX Branch系列防火墙可以与Juniper统一接入控制器UAC进行3层访问控制联动工作,下面将具体介绍UAC、SRX配置,主要通过截图来进行说明: 主要事项:

1、 SRX与UAC设备系统时间必须一致

2、 SRX设备与UAC设备证书必须来自同一个根证书颁发

3、 SRX与UAC之间通过SSL连接<如果通过防火墙或者ACL等控制>必须将其443端口放开

第一步:生成并获取UAC设备证书,并导入设备证书和根服务器证书<由于此操作需要通过第三方证书服务器来完成>为此我单独有WORD文档来介绍。

第二步:生成并获取SRX设备证书,具体步骤如下:

user@host> request security pki generate-key-pair certificate-id uac 手工生成certificate-id user@host> request security pki generate-certificate-request certificate-id uac domain-name juniper.net subject CN=abc 手工生成证书信息 The following certificate request is displayed in PEM format. Generated certificate request

-----BEGIN CERTIFICATE REQUEST-----

MIHxMIGcAgEAMA4xDDAKBgNVBAMTA2htMTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC QQCbhaiWzmctH0ZDldCn+mSNM62kyiSgc4cmN68U/j9El09/DgGoMNy2y+RYA1xU sr4B0NedGrZZJx5L1sIYjHr/AgMBAAGgKTAnBgkqhkiG9w0BCQ4xGjAYMBYGA1Ud EQQPMA2CC2p1bmlwZXIubmV0MA0GCSqGSIb3DQEBBQUAA0EAleLR6Hp2ity8Dugs MW4HI6SxfwMc2eYM5Nj2UhwpEEpsce77dUBZriKdehAgli7vwNsHGIuhHjEaFzfO hpM3tA==

-----END CERTIFICATE REQUEST----- 通过windows证书服务器或者OPENSSL生成并获取证书 Fingerprint:

9e:d5:7d:44:e8:e7:b6:d7:4b:58:d4:4e:2b:fb:c6:b2:4b:b7:8b:82 (sha1) b0:8d:c7:6d:41:d5:58:61:dc:a0:3e:4e:d6:39:02:d7 (md5)

user@host> request security pki local-certificate load certificate-id uac filename /var/tmp/device.cer 手工加载证书到设备

此证书是通过证书服务器生成后由FTP等方式传入到设备中。

lab# run show security pki local-certificate detail 查看当前证书信息 Certificate identifier: uac Certificate version: 3

Serial number: 61069676000000000006 Issuer:

Common name: srx \\\\\\*** 部分显示信息省略***\\\\\\\\

第三步:配置UAC设备Infranet enforcer connection,根据截图配置步骤如下:

第 38 页 共 52 页

定义Infranet enforcer connection连接参数<设备序列号、共享密钥等>

定义Resource 内部资源

定义认证列表匹配到的enforcer

第 39 页 共 52 页

定义roles <注意 enable host enforcer选项>

定义Host enforcer policys

客户端尝试登陆,输入用户名和密码

第 40 页 共 52 页

联动正常,UAC首页显示如下:

第四步:配置SRX设备unified-access-control,具体内容如下: lab# show services unified-access-control { infranet-controller ic-1 {

address 20.1.1.20; UAC设备IP地址

interface fe-0/0/1.0; 与UAC设备进行通信的端口

password \"$9$hBVSKMLxNbYgXxHqP5F3KMW8dbZUj\"; ## SECRET-DATA 与UAC设备联动的共享密钥

}

第五步:SRX设备针对需要进行与UAC设备联动的策略开启UAC认证策略功能:

set security policies from-zone trust to-zone untrust policy t-u then permit application-services uac-policy

第六步:查看SRX设备unified-access-control状态,具体内容如下:

lab# run show services unified-access-control authentication-table 用户认证表 Id Source IP Username Age Role identifier 2 20.1.1.100 test2 0 0000000001.000005.0 Total: 1 [edit]

lab# run show services unified-access-control policies detail UAC下发到设备的策略 Identifier: 1

Resource: icmp://*:* Resource: tcp://*:* Resource: udp://*:* Action: allow Apply: all Total: 1 [edit]

lab# run show services unified-access-control status SRX设备与UAC设备连接的状态 Host Address Port Interface State ic-1 20.1.1.20 11123 fe-0/0/1.0 connected

第 41 页 共 52 页

2.10 SRX Branch系列FLOW配置说明

root# set security flow ? Possible completions:

> aging Aging configuration

allow-dns-reply Allow unmatched incoming DNS reply packet + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups

route-change-timeout Timeout value for route change to nonexistent route (6..1800 seconds) syn-flood-protection-mode TCP SYN flood protection mode

> tcp-mss TCP maximum segment size configuration > tcp-session Transmission Control Protocol session configuration > traceoptions Trace options for flow services

[edit]

root# set security flow syn-flood-protection-mode ? 设置SYN-FLOOD攻击防护 Possible completions:

syn-cookie Enable SYN cookie protection syn-proxy Enable SYN proxy protection [edit]

root# set security flow tcp-session ? 设置tcp-session相关参数 Possible completions:

+ apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups no-sequence-check Disable sequence-number checking

no-syn-check Disable creation-time SYN-flag check

no-syn-check-in-tunnel Disable creation-time SYN-flag check for tunnel packets rst-invalidate-session Immediately end session on receipt of reset (RST) segment rst-sequence-check Check sequence number in reset (RST) segment strict-syn-check Enable strict syn check

tcp-initial-timeout Timeout for TCP session when initialization fails (20..300 seconds) [edit]

root# set security flow tcp-mss ? 设置TCP-MSS相关参数 Possible completions:

> all-tcp Enable MSS override for all packets

+ apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups

> gre-in Enable MSS override for all GRE packets coming out of an IPSec tunnel > gre-out Enable MSS override for all GRE packets entering an IPsec tunnel > ipsec- Enable MSS override for all packets entering IPSec tunnel [edit]

第 42 页 共 52 页

2.11 SRX Branch系列SCREEN攻击防护配置说明

Juniper SRX系列 防火墙用于保护网络的安全,具体做法是先检查要求从一个安全区段到另一区段的通路的所有连接尝试,然后予以允许或拒绝。对于每个安全区段和 MGT 区段,可启用一组预定义的 SCREEN 选项,检测并阻塞安全设备将其确定为具有潜在危害的各种信息流。

SCREEN 选项用于保护区段的安全,具体做法是先检查要求经过绑定到该区域的某一接口的所有连接尝试,然后予以准许或拒绝。然后安全设备应用防火墙策略,在这些策略中,可能包含针对通过 SCREEN 过滤器的信息流的内容过滤和入侵检测及防护 (IDP) 组件。

下面我们将举例配置一个SCREEN应用在Untrust区域: 具体配置命令如下:

root# show security screen

ids-option juniper-srx-screen-test {

alarm-without-drop; 此动作表示仅记录攻击信息到日志,但是不拒绝攻击<可选设置> icmp {

ip-sweep threshold 1000; fragment;

flood threshold 100; }

ip {

bad-option; spoofing; tear-drop; }

tcp {

syn-frag;

port-scan threshold 1000;端口扫描触发值为1000<每秒1000个扫描动作> land; winnuke; } udp {

flood threshold 100; UDP FLOOD触发值为100<每秒100个> }

limit-session {

source-ip-based 128;会话数<针对源IP地址>

destination-ip-based 128;会话数<针对目标IP地址> } }

[edit]

root# show security zones security-zone untrust

screen juniper-srx-screen-test; 将上述定义的screen配置应用到untrust区域

第 43 页 共 52 页

2.12 SRX Branch系列J-WEB操作配置简要说明

Juniper SRX 系列防火墙提供WEB操作界面,WEB操作界面主要包括如下几个大类: 1、 首页<监控实时系统状态>

2、 配置页面<防火墙功能配置,比如策略、VPN、NAT、路由等> 3、 监控页面<防火墙各项功能状态监控、接口流量监控等> 4、 系统维护页面<防火墙日常维护,比如升级等>

5、 系统故障排查页面<防火墙日常维护故障排查,比如抓包、PING、tracert route等> 功能分类页面截图如下:

登录页面

第 44 页 共 52 页

第 45 页 共 52 页

第 46 页 共 52 页

第 47 页 共 52 页

第 48 页 共 52 页

第 49 页 共 52 页

三、SRX防火墙常规操作与维护 3.2 设备关机

SRX因为主控板上有大容量存储,为防止强行断电关机造成硬件故障,要求设备关机必须按照下面的步骤进行操作:

1. 管理终端连接SRX console口。

2. 使用具有足够权限的用户名和密码登陆CLI命令行界面。 3. 在提示符下输入下面的命令:

user@host> request system halt

The operating system has halted.

Please press any key to reboot(除非需要重启设备,此时不要敲任何键,否则设备将进行重启)

4. 等待console输出上面提示信息后,确认操作系统已停止运行,关闭机箱背后电源模

块电源。

3.3 设备重启

SRX重启必须按照下面的步骤进行操作: 1. 管理终端连接SRX console口。

2. 使用具有足够权限的用户名和密码登陆CLI命令行界面。 3. 在提示符下输入下面的命令:

user@host> request system reboot 4. 等待console设备的输出,操作系统已经重新启动。

3.4 操作系统升级

SRX操作系统软件升级必须按照下面的步骤进行操作:

1. 管理终端连接SRX console口,便于升级过程中查看设备重启和软件加载状态。 2. SRX上开启FTP服务,并使用具有超级用户权限的非root用户通过FTP客户端将下

载的升级软件介质上传到SRX上。

3. 升级前,执行下面的命令备份旧的软件及设定:

user@host> request system snapshot 4. 加载新的SRX软件:

第 50 页 共 52 页

user@host> request system software add validate filename.tgz reboot

5. 软件加载成功后, SRX将自动重启,重启完成后检查系统当前软件版本号:

user@host> show system software

3.5 密码恢复

SRX Root密码丢失,并且没有其他的超级用户权限,那么就需要执行密码恢复,该操作需要中断设备正常运行,但不会丢失配置信息,这点与ScreenOS存在区别。

要进行密码恢复,请按照下面操作进行:

1. Console口连接SRX,然后重启SRX。

2. 在启动过程中,console上出现下面的提示的时候,按空格键中断正常启动方式,然后

再进入单用户状态,并输入:boot -s Loading /boot/defaults/loader.conf

/kernel data=… … syms=[… …] Hit [Enter] to boot immediately, or space bar for command prompt. loader> loader> boot -s

3. 执行密码恢复:在以下提示文字后输入recovery,设备将自动进行重启

Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery 4. 进入配置模式,删除root密码,并重现设置root密码:

user@host> configure

Entering configuration mode

user@host#delete system root-authentication

user@host#set system root-authentication plain-text-password user@host#New password:

user@host#Retype new password: user@host# commit commit complete

3.6 常用监控维护命令

下列操作命令在操作模式下使用,或在配置模式下run show…

 Show system software 查看当前软件版本号

    

show system uptime 查看系统启动时间 Show chassis haredware 查看硬件板卡及序列号 show chassis environment 查看硬件板卡当前状态

show chassis routing-engine 查看主控板(RE)资源使用及状态 show route 查看路由表

第 51 页 共 52 页

          

show arp 查看ARP表

show log messages 查看系统日志

show interface terse 查看所有接口运行状态 show interface ge-x/y/z detail 查看接口运行细节信息

monitor interface ge-x/y/z 动态统计接口数据包转发信息

monitor traffic interface ge-x/y/z 动态报文抓取(Tcpdump,类似ScreenOS snoop命令)

show security flow session summary 查看当前防火墙并发会话数 show security flow session 查看当前防火墙具体并发会话 clear security flow session all 清除当前session show security alg status 检查全局ALG开启情况

SRX对应ScreenOS debug flow basic跟踪报文处理路径的命令:

 set security flow traceoptions flag basic-datapath 开启SRX基本报文处理Debug  set security flow traceoptions file filename.log 将输出信息记录到指定文件中   

set security flow traceoptions file filename.log size 设置该文件大 小,缺省128k

set security flow traceoptions packet-filter filter1 destination-prefix 5.5.5.2 设置报文跟踪过滤器

run file show filename.log 查看该Log输出信息

 SRX对应ScreenOS get tech命令,开Case时需要抓取的信息:request support information

End date 2010-06-17 By wang xiao fang

Email:van_wang@junipernetwork.cn

Mobile:123456700

第 52 页 共 52 页

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务