Juniper SRX3000防火墙配置手册 下载本文

Juniper防火墙工程开通指导书

技 术 文 件

技术文件名称: Juniper SRX3000系列防火墙工程开通指导书 技术文件编号: 版 本:

拟 制 _ 审 核 _ 会 签 _ _ _ _ 标准化 _ 批 准 _

第1页

Juniper防火墙工程开通指导书

修改记录 文件编号 版本号 拟制人/ 拟制/修修改人 改日期 更改理由 主要更改内容 注:文件第一次拟制时,“更改理由”、“主要更改内容”栏写“无”。 本文档以Junos 10.2版本为主编写

第2页

Juniper防火墙工程开通指导书

目 录

一、防火墙介绍 ...................................................................................................................................... 5 二、防火墙基础配置 ............................................................................................................................ 13

2.1.1第一次连接防火墙 ............................................................................................................. 14 2.1.2添加/删除用户 ................................................................................................................... 16 2.1.3设置SNMP ............................................................................................................................ 16 2.1.4日期/时间/NTP配置方法 .................................................................................................. 17 2.1.5其它基本参数配置 ............................................................................................................. 18 三、防火墙特性功能 ............................................................................................................................ 19

3.1.1配置安全区域 ..................................................................................................................... 19 3.1.2 Policy策略配置 ............................................................................................................... 19 3.1.3会话连接限制 ..................................................................................................................... 24 3.1.4 3.1.4

ALG ................................................................................................................................. 24 端口参数配置 ............................................................................................................... 29

3.1.5.JSRP的配置 ....................................................................................................................... 25 3.1.7路由配置 ................................................................................................................................. 31 3.1.8配置NAT(SRC\\DST\\ STATIC) ............................................................................................... 32 3.1.8.1Interface based NAT .................................................................................................... 32 3.1.8.2 Pool based Source NAT .............................................................................................. 33 3.1.8.3 Pool base destination NAT ...................................................................................... 33 3.1.8.4 Pool base Static NAT ................................................................................................ 34 3.1.8.5 定义NAT的proxy-arp ................................................................................................. 35 3.1.9 VPN配置 ................................................................................................................................. 36 3.1.10 GRE配置 ............................................................................................................................... 37 二、维护和故障定位 ............................................................................................................................ 37 2.1防火墙版本升级 ......................................................................................................................... 37 2.2防火墙密码恢复 ......................................................................................................................... 39 2.3防火墙抓包和DEBUG方法 ........................................................................................................... 40 2.4故障信息收集命令 ..................................................................................................................... 40 2.5常用命令 ..................................................................................................................................... 42 三、完整配置示例 ................................................................................................................................ 42 3.1

HA组网+OSPF ........................................................................................................................ 42

3.1.1网络规划及拓扑图 ............................................................................................................. 42 3.1.2IP地址规划(本案例使用设备自带电口,SFB 模块自带8个电口4个光口) .......... 43 3.1.3具体配置 ............................................................................................................................. 44 3.2

HA组网+静态路由 ................................................................................................................ 47 3.2.1网络规划及拓扑图 ............................................................................................................. 47

第3页

Juniper防火墙工程开通指导书

3.2.2 IP地址规划 ....................................................................................................................... 48 3.2.3具体配置具体配置 ............................................................................................................. 48 3.3分布式组网+OSPF ...................................................................................................................... 51 3.3.1网络规划及拓扑图 ............................................................................................................... 51 3.3.2 IP地址规划 .......................................................................................................................... 52 3.3.3具体配置具体配置 ............................................................................................................. 52 3.4分布式组网+静态路由 ................................................................................................................ 55 3.4.1网络规划及拓扑图 ............................................................................................................... 55 3.4.2 IP地址规划 .......................................................................................................................... 55 3.4.3具体配置 ............................................................................................................................... 56 四、防火墙配置规范指导手册 ............................................................................................................ 58

第4页

Juniper防火墙工程开通指导书

一、防火墙介绍

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

SRX3600

第5页

Juniper防火墙工程开通指导书

SRX3400

(图片仅供参考,以实物为准)

第6页

Juniper防火墙工程开通指导书

第7页

Juniper防火墙工程开通指导书

第8页

Juniper防火墙工程开通指导书

第9页

Juniper防火墙工程开通指导书

第10页

Juniper防火墙工程开通指导书

第11页

Juniper防火墙工程开通指导书

第12页

Juniper防火墙工程开通指导书

二、防火墙基础配置

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

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不同,配置过程中需加以留意。

第13页

Juniper防火墙工程开通指导书

2.1.1第一次连接防火墙

方式一:Console方式

基于Console终端配置SRX3400 的准备

安装Windows操作系统的PC一台(安装超级终端) SRX3400设备标准配置自带的Console电缆一条

使用超级终端建立一个连接,通过Console电缆一端连接SRX3400任何

一台设备,一端连接COM口,COM的参数设置如:

使用Console 端口做初始化配置, 防火墙的初始账号和密码: login: root

password: (默认没有root密码) SRX3400% #shell模式

在shell模式下可使用linux命令,不建议在次模式下对防火墙进行任何操作。

SRX3400% cli

SRX3400> #用户模式

在用户模式下可以显示SRX设备的配置、端口状态、路由信息等。登录到SRX上即进入路由器的用户模式:

SRX3400# #配置模式

通过在用户模式使用edit命令进入配置模式:

SRX3400> edit [edit]

方式二:基于WEB方式

默认不开启WEB 服务,需要在配置

第14页

Juniper防火墙工程开通指导书

1、 使用带外管理口访问防火墙

命令行配置如下:

lab# set interfaces fxp0 unit 0 family inet address 192.168.1.1/24 lab# set system services web-management http interface fxp0 lab# commit commit complete

将PC机连接到带外管理口。在IE浏览器地址栏键入http://设备管理IP地址,如“192.168.1.147”),如果你输入的是接口IP地址。

可以根据实际管理需要,Juniper防火墙还可以通过telnet\\SSH\\SSL等方式管理,配置仅需在接口设置下开启相应的服务即可。(注意:需要先将接口放入相关区域内)

方式三:基于Telnet/SSH/方式

高级管理员可通过使用命令行界面 (CLI) 进行更好的控制。要为安全设备配置CLI,可使用任何仿真 VT100 终端的软件。如果使用终端机仿真器,可使用 Windows、UNIX 或 Macintosh 操作系统中的控制台来配置安全设备。要通过 CLI 进行远程管理,可使用 Telnet 或“安全外壳”(SSH)。要通过控制台端口进行直接连接,可使用 \。 举例: 采用实际端口ge-0/0/0使用telnet访问,通过对system-services 可选择telnet/ssh/http/https/ping等

CLI方式:

第15页

Juniper防火墙工程开通指导书

set system services telnet

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services telnet

2.1.2添加/删除用户

默认没有root用户的密码,需要设置一密码,密码要求字母和数字组合,长度大于等于6个字符。

设置root用户口令

set system root-authentication plain-text-password

new password : root123

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

show system root-authentication

encrypted-password \

注意:强烈建议不要使用其它加密选项来加密root和其它user口令(如encrypted-password加密方式),此配置参数要求输入的口令应是经加密算法加密后的字符串,采用这种加密方式手工输入时存在密码无法通过验证风险。

注:root用户仅用于console连接本地管理SRX,不能通过远程登陆管理SRX,必须成功设置root口令后,才能执行commit提交后续配置命令。

设置远程登陆管理用户

新建一个用户class属性,超时设为10分钟,允许所有操作。(属于该属性的用户,在登陆设备10分钟后没有任何操作,设备会自动中断该连接) set system login class super-user idle-timeout 10 set system login class super-user permissions all 新建一个用户 lab,属性super-user set system login user lab class super-user set system login user lab authentication set system plain-text-password New password:

Retype new password:

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

2.1.3设置SNMP

Juniper Networks 用以下方式在其设备中执行 SNMP:

举例如下:创建一个 SNMP 公共组,名称为 public。为其分配读 / 写权限并启用其成员,以接收 MIB II 数据和陷阱。公共组名称充当密码,并需要受到保护。一旦机箱的电源或风扇出现硬件故障,或者接口down就生成陷阱,发送的192.168.0.155 这个服务器。最

第16页

Juniper防火墙工程开通指导书

后,启用 ge-0/0/0 上的 SNMP 可管理性,它是此前已绑定到 Trust 区段上的接口。这是 SNMP 管理器应用程序用来与安全设备中的 SNMP 代理通信的接口。

WebUI

CLI

set snmp community public authorization read-write set snmp trap-group \set snmp trap-group \

set snmp trap-group \

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services snmp (在需要与snmpserver通讯的接口打开SNMP服务) commit

2.1.4日期/时间/NTP配置方法

Juniper Networks 安全设备应始终设置成正确的时间,这一点很重要。首先,为确保设备始终维持正确的时间,必须将系统时钟设置为当前时间.

日期和时间

通过 CLI,使用以下命令手动输入日期和时间,来设置时钟 :

run set date YYYYMMDDhhmm.ss /***设置系统时钟***/ set system time-zone Asia/Shanghai /***设置时区为上海***/

网络时间协议

为确保安全设备始终保持正确时间,可以使用“网络时间协议”(NTP) 通过互联网来同步系统时钟与 NTP 服务器的时钟。您可以手动同步.

第17页

Juniper防火墙工程开通指导书

配置NTP 服务器

CLI set system ntp server 192.168.0.189

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services ntp commit

手工与NTP server 同步:

>set date ntp 192.168.0.155

2.1.5其它基本参数配置

set system host-name SRX3400-A /***设置主机名***/

如图可以看到硬件、软件、串号、主机名等信息。

CLI

查看版本

lab> show version Model: srx3600

JUNOS Software Release [10.2R3.10]

查看硬件信息:

lab> show chassis hardware detail Hardware inventory:

Item Version Part number Serial number Description Chassis AB2310AA0016 SRX 3600

Midplane REV 08 710-020310 AABH8129 SRX 3600 Midplane

第18页

Juniper防火墙工程开通指导书

PEM 0 rev 08 740-027644 G087FB000B08P AC Power Supply PEM 1 rev 08 740-027644 G087FB001308P AC Power Supply CB 0 REV 16 750-021914 AAAW8561 SRX3k RE-12-10 Routing Engine BUILTIN BUILTIN Routing Engine

ad0 977 MB SILICONSYSTEMS UDMA 1GB C940319128721BJ2F003 Compact Flash ad2 15392 MB Wintec SSD 16GB WT1027AA016007A Hard Disk

CPP BUILTIN BUILTIN Central PFE Processor Mezz REV 08 710-021035 AAAV3620 SRX3k HD Mezzanine Card FPC 0 REV 13 750-021882 AABA6495 SRX3k SFB 12GE

PIC 0 BUILTIN BUILTIN 8x 1GE-TX 4x 1GE-SFP FPC 8 REV 12 750-016077 AABK1756 SRX3k SPC PIC 0 BUILTIN BUILTIN SPU Cp-Flow FPC 10 REV 14 750-017866 AABJ2552 SRX3k NPC PIC 0 BUILTIN BUILTIN NPC PIC FPC 12 REV 14 750-017866 AABE7477 SRX3k NPC PIC 0 BUILTIN BUILTIN NPC PIC

Fan Tray 0 REV 06 750-021599 AAAR5096 SRX 3600 Fan Tray

三、防火墙特性功能

3.1.1配置安全区域

首次启动安全设备时,默认没有任何区域。默认建立的区 创建trust 区段 。 CLI

set security zones security-zone trust

删除区段 CLI

delete security zones security-zone trust

3.1.2 Policy策略配置

定义地址薄

SRX 服务网关地址对象需要自定义后才可以在策略中进行引用,默认只有any 对象,必须先在相关zone的地址薄里创建地址薄对象,再在安全策略里引用这些对象。address-book还支持创建address-set来包含多个离散的地址,以方便策略引用

建立Trust区域的address-book

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

第19页

Juniper防火墙工程开通指导书

建立Trust区域的address-set(地址组,组名为pc-group)

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

建立Untrust区域的address-book

set security zones security-zone Untrust address-book address web-server 200.1.1.2/32

set security zones security-zone Untrust address-book address mail-server 210.1.1.2/32

建立Untrust区域的address-set

set security zones security-zone Untrust address-book address-set Inter-group address web-server

set security zones security-zone Untrust address-book address-set Inter-group address mail-server

删除地址 CLI

Delete security zones security-zone trust address-book address pc-1

关于服务 预定义服务

SRX安全策略里不允许直接使用协议号,源端口,目标端口来匹配业务应用,只能使用[application]下系统预定义的应用类型或用户自定义的业务类型。系统预定义的业务类型名字都是以”junos-“开头的。如下:

root# show groups junos-defaults applications application ? Possible completions:

Application name any Application name junos-aol Application name junos-bgp Application name junos-biff Application name junos-bootpc Application name junos-bootps Application name junos-chargen Application name junos-cvspserver Application name junos-dhcp-client Application name junos-dhcp-relay Application name junos-dhcp-server Application name junos-discard Application name

第20页

Juniper防火墙工程开通指导书

junos-dns-tcp Application name junos-dns-udp Application name junos-echo Application name junos-finger Application name junos-ftp Application name junos-gnutella Application name

Application同样允许用户自定义的应用类型,并且通过定义application-set来包含多个application,以方便策略引用。

以下以WAP网关需要开放及侦听的端口服务为例:自定义服务并把自定义服务放到一个application-set 组中 端口号 9200-9203(udp) 9208-9209(tcp) 14000(tcp) 用途 侦听服务端口 侦听服务端口(in) 侦听服务端口(in) 侦听服务端口(in)(超时时间为600秒) Brower ENUM_DNS QQ socket

定义自有服务:

set applications application Brower_udp protocol udp

set applications application Brower_udp source-port 0-65535

set applications application Brower_udp destination-port 9200-9203

set applications application Push_tcp-1 protocol tcp

set applications application Push_tcp-1 source-port 0-65535

set applications application Push_tcp-1 destination-port 8090-8091

set applications application QQ14000 protocol tcp

set applications application QQ14000 source-port 0-65535

set applications application QQ14000 destination-port 14000-14000

set applications application QQ14000 inactivity-timeout 600 (设置超时时间,600秒)

定义服务组TEST,包含自有服务Brower_udp、Push_tcp-2、QQ14000

set applications application-set TEST application Brower_udp set applications application-set TEST application Push_tcp-2 set applications application-set TEST application QQ14000

服务超时配置和查找

为服务设置的超时值决定会话超时值。可以为预定义服务或定制服务设置超时;您可以使用服务缺省超时、指定定制超时或根本不使用超时。

第21页

Juniper防火墙工程开通指导书

CLI:

set applications application QQ14000 protocol tcp

set applications application QQ14000 source-port 0-65535

set applications application QQ14000 destination-port 14000-14000

set applications application QQ14000 inactivity-timeout 600 (设置超时时间,

600秒)

二、制定策略

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

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

?? 区段之间策略 - 可以控制允许从一个安全区段传递到另一个安全区段的信息流的类型。 ?? 区段内部策略 - 可以控制允许跨越绑定到同一区段不同接口的信息流的类型。 ?? 全局策略 - 可以控制不同地址间的信息流,而不考虑它们的安全区段。

区段之间策略

区段之间策略提供对安全区段内部信息流的控制。可通过设置区段之间策略来拒绝、允许、丢弃从一个区段到另一个区段的信息流或对该信息流执行通道动作。使用状态式检查技术,安全设备保持活动 TCP 会话表和活动 UDP \会话表,以便允许它能回应服务请求。例如,如果有一个策略允许从 Trust 区段中的主机 A 到 Untrust 区段中的服务器 B 的 HTTP 请求,则当安全设备接收到从服务器 B 到主机 A 的 HTTP 回应时,安全设备将接收到的封包与它的表进行对照检查。当找到回应批准 HTTP 请求的封包时,安全设备允许来自 Untrust 区段中服务器 B 的封包穿越防火墙到达 Trust 区段中的主机 A。要允许由服务器 B 发起的流向主机 A 的信息流 (不只是回应由主机 A 发起的信息流 ),必须创建从 Untrust 区段中服务器 B 到 Trust 区段中主机 A 的第二个策略。

区段内部策略

区段内部策略提供对绑定到同一安全区段的接口间信息流的控制。源地址和目的地址都在同一安全区段中,但是通过安全设备上的不同接口到达。与区段之间策略一样,区段内部策略也控制信息流单向流动。要允许从数据路径任一端发起的信息流,必须创建两个策略,每个方向一个策略。

全局策略

与区段之间和区段内部策略不同,全局策略不引用特定的源和目的区段。全局策略引用用户定义的 junos-global 区段地址或预定义的 Global 区段地址 \。这些地址可以跨越多个安全区段。例如,如果要提供对多个区段的访问或从多个区段进行访问,则可以创建具有 Global 区段地址 \的全局策略,它包含所有区段中的所有地址。 注意:只有包含static_nat的配置时才能使用junos-global区域。

策略的结构

策略必须包含下列元素 :

第22页

Juniper防火墙工程开通指导书

?? 区段 (源区段和目的区段 ) ?? 地址 (源地址和目的地址 ) ?? 服务

?? 动作 (deny、permit、reject、log、count)

三,策略的应用 查看策略

通过 WebUI 查

看策略,

创建策略

要允许信息流在两个区段之间流动,应创建策略以便在这些区段之间拒绝、允许、丢弃信息流或为信息流创建通道。如果安全设备唯一能够设置 ( 在策略中引用的 ) 源和目的地址间区段内部信息流的路由的网络设备,则也可创建策略,控制同一区段内的信息流。

要允许两个区段内部 ( 例如,Trust 和 Untrust 区段 ) 的双向信息流,需要创建从 Trust 到 Untrust 的策略,然后创建从 Untrust 到 Trust 的第二个策略。根据需要,两个策略可以使用相同或不同的 IP 地址,只是源地址和目的地址需反向。

创建区段之间策略邮件服务

第23页

Juniper防火墙工程开通指导书

set security policies from-zone Trust to-zone Untrust policy TO_Inter 1 match source-address pc-group

set security policies from-zone Trust to-zone Untrust policy TO_Inter match destination-address any

set security policies from-zone Trust to-zone Untrust policy TO_Inter match application TEST

---调用2.3.2中定义的服务端口http

set security policies from-zone Trust to-zone Untrust policy TO_Inter match then permit

---设置为permit,当一个数据包满足以上所有条件时,允许通过防火墙。

重新排序策略

安全设备将所有穿越防火墙的尝试与策略进行对照检查,从列在相应列表的策略组中的第一个开始,并检查整个列表。由于安全设备将策略中指定的动作应用到列表中第一个匹配的策略,因此,必须按照从最具体到最一般的顺序安排策略。(具体策略不排除位于列表下部的更一般性策略的应用,但位于具体策略前的一般性策略会产生此排除效应。)在缺省情况下,最近创建的策略出现在策略组列表的底部。

CLI

insert security policies from-zone zone-name to-zone zone-name policy policy-name before policy policy-name

删除策略 CLI

Delete security policies from-zone zone-name to-zone zone-name policy policy-name

3.1.3会话连接限制

基于源和目的的会话限制

将限制 Trust 区段中的任一个服务器所能发起的会话数目10000,去往目的会话限制为500. CLI

set security screen ids-option limit limit-session source-ip-based 10000 set security screen ids-option limit limit-session destination-ip-based 500 set security zones security-zone trust screen session-limit

3.1.4 ALG

SRX可以支持的ALG类型如下,默认都为开启

第24页

Juniper防火墙工程开通指导书

ALG应用类型 启用ALG命令 delete security alg dns disable delete security alg ftp disable 关闭ALG命令 set security alg dns disable set security alg ftp disable DNS FTP H323 MGCP MSRPC PPTP RSH RTSP SCCP SIP SQL SUNRPC TALK delete security alg H323 disable set security alg H323 disable delete security alg mgcp disable set security alg mgcp disable delete security alg msrpc disable set security alg msrpc disable delete security alg pptp disable set security alg pptp disable delete security alg rsh disable set security alg rsh disable delete security alg rtsp disable set security alg rtsp disable delete security alg sccp disable set security alg sccp disable delete security alg sip disable delete security alg sql disable set security alg sip disable set security alg sql disable delete security alg sunrpc disable set security alg sunrpc disable delete security alg talk disable set security alg talk disable

配置建议:

当防火墙工作在二层透明模式及路由模式时,不建议开启应用对应的ALG,当防火墙工作在NAT模式时,建议开启。

3.1.5.JSRP的配置

SRP是Juniper 下一代安全网关SRX的私有HA协议,支持A/P和A/A,集成了ScreenOS NSRP和JUNOS TX Matrix的一些设计思想。

由于需要做机箱间的配置同步和异步路由数据的回程,JSRP需要Control Plane (用于配置同步)和Data plane (用于异步路由数据的回程和SPC状态同步)两个平面的互联,同时由于SPC之间的状态同步是严格一一对应的,因此还要求业务处理引擎SPC必须数量相同且安装槽位相同。

注意:SRX3K除了SPC外还要求IOC和NPC也必须在两个机箱之间一一对应。

JSRP的接口命名方式类似TX Matrix,即把多个机箱抽象成一个逻辑机箱之后再统一为各个槽位进行编号,以SRX3400为例,JSRP将把两台7个业务槽位的抽象成一台14槽位的虚拟JUNOS 进行槽位和接口编号

比如下所示的SRX3400,每个SRX3400机箱有7个业务槽位,则node 0槽位号从0-7,node 1的槽位号从8开始往后编。

第25页

Juniper防火墙工程开通指导书

Data plane Control plane fxp1 fxp0 Node 0 rethm fabn Node 1 rethm fxp0 Cluster Management Redundant interfaces Management

实物图:

FAB 1

FXP1

(FAB 端口可选数据口的电口或光口)

整个JSRP配置过程包括如下7个步骤 1、 配置Cluster id和Node id 2、 指定Fabric Link

3、 配置Redundancy Group 4、 每个机箱的个性化配置

第26页

Juniper防火墙工程开通指导书

5、 配置Redundant Ethernet Interface 6、 配置Interface Monitoring 3.1.5.1配置Cluster id和Node id

注意,这一步两个node都需要配置。

配置命令: SRX3400A

SRX3400a>set chassis cluster cluster-id 1 node 0 reboot //注1:注意该命令需在operational模式下输入

//注2:Cluster ID取值范围为1 – 15,当Cluster ID = 0时会unsets cluster配置,成为单机 SRX3400B

SRX3400b>set chassis cluster cluster-id 1 node 1 reboot

3.1.5.2指定Fabric Link

Fabric Link是一个虚拟的交换平面,用于将两个SRX机箱的数据平面连接在一起,主要用于RTO对象同步和异步路由数据的回程。 配置命令: SRX3400A

set interfaces fab0 fabric-options member-interfaces ge-1/0/0 set interfaces fab1 fabric-options member-interfaces ge-13/0/0 commit

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

3.1.5.3配置Redundancy Group

Redundancy Group (RG)类似ScreenOS NSRP里的VSD,用来抽象两个机箱之间可以互相热备切换的一组对象,其中RG0固定用于RE切换,RG1用于一组redundant interface切换,如果要做AA,则还需要RG2。由此可以看出,RE切换是独立于接口切换的。

配置如下:

set chassis cluster reth-count 15

set chassis cluster heartbeat-interval 1000 set chassis cluster heartbeat-threshold 3

set chassis cluster redundancy-group 0 node 0 priority 254 set chassis cluster redundancy-group 0 node 1 priority 100 set chassis cluster redundancy-group 1 node 0 priority 254 set chassis cluster redundancy-group 1 node 1 priority 100 commit

第27页

Juniper防火墙工程开通指导书

3.1.5.4每个机箱的个性化配置

通过group模板来实现,类似JUNOS RE 的group配置,实际上JSRP中的跨机箱RE切换就是模拟了JUNOS中的RE Redundancy,这样也方便以后实现NSR/ISSU。

配置如下:

set groups node0 system host-name GZGY-PS-WAP-FW01 set groups node0 system backup-router 10.147.66.67

set groups node0 system backup-router destination 0.0.0.0/0

set groups node0 interfaces fxp0 unit 0 family inet address 10.147.66.65/27 set groups node1 system host-name GZGY-PS-WAP-FW02 set groups node1 system backup-router 10.147.66.67

set groups node1 system backup-router destination 0.0.0.0/0

set groups node1 interfaces fxp0 unit 0 family inet address 10.147.66.66/27 set apply-groups ${node}\commit

3.1.5.5配置Redundant Ethernet Interface

Redundant Ethernet interface是一组主备的以太网接口,实际上利用了跨机箱的802.3ad link aggregate技术来实现两个成员接口间的主备切换。

Redundant Ethernet interface的MAC地址是虚拟的,其值根据以下公式可以计算得出:

0 0 1 0 D B 1 1 1 1 1 1 1 1 C C C C R R V V 1 1 1 1 1 1 1

CCCC: Cluster ID RR: Reserved. 00.

VV: Version, 00 for the first release

IIIIIIII: Interface id, derived from the reth index.

配置如下:

set interfaces ge-0/0/7 gigether-options redundant-parent reth7 // node0的ge-0/0/7 set interfaces ge-0/0/8 gigether-options redundant-parent reth8 // node0的ge-0/0/8 set interfaces ge-0/0/9 gigether-options redundant-parent reth9 // node0的ge-0/0/9 set interfaces ge-13/0/7 gigether-options redundant-parent reth7 // node1的ge-0/0/7 set interfaces ge-13/0/8 gigether-options redundant-parent reth8 // node1的ge-0/0/8 set interfaces ge-13/0/9 gigether-options redundant-parent reth9 // node1的ge-0/0/9 set interfaces reth7 redundant-ether-options redundancy-group 1 // 属于RG1 set interfaces reth8 redundant-ether-options redundancy-group 1 // 属于RG1 set interfaces reth9 redundant-ether-options redundancy-group 1 // 属于RG1

第28页

Juniper防火墙工程开通指导书

//注6:JUNOS 9.5中一个RG最多容纳15个redundant Ethernet interface,而整个JSRP系统支持最多128个RG

3.1.5.6配置Interface Monitoring

默认情况下,接口故障只会触发Redundant Ethernet interface内部主备接口切换,这时异步路由流量会从Fabric Link送到egress接口所在的node;如果希望避免这种状况 (比如Fabric Link带宽不够) 则可以通过配置interface monitoring来监控物理接口的存亡,并触发整个Redundancy Group的切换。每个被监控的成员接口需要被赋予一个权重(weight),当累积的weight超过threshold (default为255)时则可触发整个Redundancy Group切换。

配置如下:

set chassis cluster redundancy-group 1 interface-monitor ge-0/0/8 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/9 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/8 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/9 weight 255 commit

至此一个基本的JSRP配置已经完成,其余安全策略部分的配置跟单机类似。

3.1.4 端口参数配置

3.1.6.1设置端口速率和工作模式

JUNIPER安全设备的接口速率和双工模式均为自适应。 CLI

设置端口为双工模式,

set interfaces ge-0/0/0 link-mode full-duplex

设置端口速率为100M

set interfaces ge-0/0/0 speed 100m

关闭端口协商模式

set interfaces ge-0/0/0 gigether-options no-auto-negotiation

3.1.6.2主端口配置

第29页

Juniper防火墙工程开通指导书

配置属于trust接口参数

set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.2/24 –配置连接trust的接口IP

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services ping (该接口允许ping)

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services http (该接口允许http访问)

设置连接外网网络接口参数

set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.2/24 setsecurity zones security-zone untrust interfaces ge-0/0/1.0 host-inbound-traffic system-services ping( 该接口允许ping)

检查接口配置

show interfaces terse

Interface Admin Link Proto Local Remote ge-0/0/0 up down

ge-0/0/0.0 up down inet 192.168.0.148/24 multiservice ge-0/0/1 up up

ge-0/0/1.0 up up inet 192.168.1.148/24 multiservice 聚合接口

SRX3000允许将一对或多对物理端口的吞吐量联合成一个单独的虚拟端口。此虚拟端口称作聚合接口。聚合端口最大支持16个物理端口聚合为一个逻辑端口。设备最大支持128个聚合端口,命名如下: ae0、ae1、ae2、ae127。

在下例中,将两个“千兆位以太网”端口 (每个端口运行速度为 1 Gbps) 组合成一个聚合接口 ae0 ( 运行速度为 2-Gbps)。

CLI

set chassis aggregated-devices ethernet device-count 2 (设备支持2个聚合口) set interfaces ge-0/0/3 gigether-options 802.3ad ae0 set interfaces ge-0/0/4 gigether-options 802.3ad ae0 set interfaces ae0 aggregated-ether-options lacp active (互联设备启用lacp的情况需要该配置)

set interfaces ae0 unit 0 family inet address 192.168.4.1/24 set security zones security-zone untrust interfaces ae0.0

第30页

Juniper防火墙工程开通指导书

3.1.6.3子端口配置

SRX 接口支持子接口配置,需要在该接口启用802.1Q的配置,及允许打tag。 以下已ge-0/0/5为例,建立子接口,vlan-tag 为 5 set interfaces ge-0/0/5 vlan-tagging set interfaces ge-0/0/5 unit 5 vlan-id 5

set interfaces ge-0/0/5 unit 5 family inet address 192.168.5.5/24 删除子接口 CLI

delete interfaces ge-0/0/5 unit 5 3.1.7路由配置

3.1.7.1静态路由

增加默认路由

set routing-options static route 0.0.0.0/0 next-hop 192.168.2.1

创建 OSPF 实例

连接trust区域的接口启用ospf,属于area 0

CLI

set routing-options router-id 10.201.71.11 (路由器 ID) set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic protocols ospf (接口允许接收ospf hello信息及LSA等)

3.1.7.2等价路由多下一跳

配置等开销多路径路由

Juniper Networks 安全设备在每会话基础上支持等开销多路径 (ECMP) 路由。等开销的路由具有相同的优先级和度量值。安全设备将某个会话与某个路由相关联后,安全设备就使用该路由,直到获知了更好的路由或当前的路由不可用为止。符合条件的路由必须有属于同一区段的出接口。

ECMP 帮助实现对相同目标地址的两个到四个路由中的负载均衡,或在两个或更多目标地址中增加有效的带宽使用。SRX的等价路由是在其转发表中实现基于session的负载均衡

CLI 配置如下:

set routing-options forwarding-table export load-balance

set policy-options policy-statement load-balance then load-balance per-packet

第31页

Juniper防火墙工程开通指导书

set routing-options static route 0.0.0.0/0 qualified-next-hop 220.1.1.254 set routing-options static route 0.0.0.0/0 qualified-next-hop 221.1.1.254

3.1.8配置NAT(Src\\Dst\\ Static)

SRX的NAT配置分为源地址翻译(source NAT), 目标地址翻译(destination NAT)和静态地址翻译(static NAT)三种,其配置语法都类似,只是nat rule必须被放到rule-set里使用,任意两个zone或任意两个网络逻辑接口之间只允许有一个rule-set。

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

SRX还多了一个proxy-arp概念,如果定义的IP Pool(可用于源或目的地址转换)与接口IP在同一子网时,需配置SRX对这个Pool内的地址提供ARP代理功能,这样对端设备能够解析到IP Pool地址的MAC地址(使用接口MAC地址响应对方),以便于返回报文能够送达SRX。

3.1.8.1Interface 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

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

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

set security policies from-zone trust to-zone untrust policy 1 match source-address 10.1.2.2 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

第32页

Juniper防火墙工程开通指导书

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

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

3.1.8.2 Pool based Source NAT

NAT:

set security nat source pool pool-1 address 100.1.1.10 to 100.1.1.20 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/2 address 100.1.1.10 to 100.1.1.20

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

Policy:

set security policies from-zone trust to-zone untrust policy 1 match source-address 10.1.1.2 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时自动执行源地址转换。

3.1.8.3 Pool base destination NAT

第33页

Juniper防火墙工程开通指导书

NAT:

set security nat destination pool 111 address 192.168.1.100/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 100.100.100.100/32 set security nat destination rule-set 1 rule 111 then destination-nat pool 111

上述配置将外网any访问100.100.100.100地址映射到内网192.168.1.100地址,注意:定义的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 192.168.1.100

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方向192.168.1.100,根据前面的NAT配置,公网访问100.100.100.100时,SRX自动执行到192.168.1.100的目的地址转换。

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

set security nat destination pool 222 address 192.168.1.200/32 port 8000 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 100.100.100.100/32 set security nat destination rule-set 1 rule 111 match destination-port 8000 set security nat destination rule-set 1 rule 111 then destination-nat pool 222

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

3.1.8.4 Pool base Static NAT

第34页

Juniper防火墙工程开通指导书

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 100.100.100.100

set security nat static rule-set static-nat rule rule1 then static-nat prefix 192.168.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 192.168.1.200

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,上述配置表示访问100.100.100.100时转换为192.168.1.200,当192.168.1.200访问Internet时自动转换为100.100.100.100。

3.1.8.5 定义NAT的proxy-arp

第35页

Juniper防火墙工程开通指导书

SRX不会自动为NAT规则生成proxy-arp配置,因此如果NAT地址翻译之后的地址跟出向接口地址不同但在同一网络内时,必须手工配置相应接口proxy-arp以代理相关IP地址的ARP查询回应,否则下一条设备会由于不能通过ARP得到NAT地址的MAC地址而不能构造完整的二层以太网帧头导致通信失败。

set security nat proxy-arp interface ge-0/0/3 address 218.201.200.139/32 set security nat proxy-arp interface ge-0/0/3 address 218.201.200.140/32

3.1.9 VPN配置

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

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

set interfaces st0 unit 0 family inet address 10.2.0.1/24 set security zones security-zone untrust interfaces st0.0 set routing-options static

route 10.1.2.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.0.2.1

set security ike gateway gw1 external-interface ge-0/0/1.0

定义IKE gaeway参数,预共享密钥认证,对端网关10.0.2.1,出接口ge-0/0/1(位于untrust zone)

set security ipsec policy AAA proposal-set standard set security ipsec vpn vpn1 bind-interface st0.0

第36页

Juniper防火墙工程开通指导书

set security ipsec vpn vpn1 ike gateway gw1 set security ipsec vpn vpn1 ike ipsec-policy AAA

set security ipsec vpn vpn1 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 vpn-policy match source-address any

set security policies from-zone untrust to-zone trust policy vpn-policy match destination-address any

set security policies from-zone untrust to-zone trust policy vpn-policy match application any set security policies from-zone untrust to-zone trust policy vpn-policy then permit

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

set security policies from-zone trust to-zone untrust policy vpn-policy match destination-address any

set security policies from-zone trust to-zone untrust policy vpn-policy match application any set security policies from-zone trust to-zone untrust policy vpn-policy then permit 开启双向policy以允许VPN流量通过

3.1.10 GRE配置 目前暂不支持

二、维护和故障定位

2.1防火墙版本升级

升级前请将原有配置文件备份,保证电源供应正常,建议升级过程中使用超级终端连接到防火墙的Console 端口上,记录输出信息。

Juniper设备JUNOS软件升级必须按照下面的步骤进行操作: 3.用Console或Telnet/SSH连接到主用路由引擎上 4.下载新的JUNOS软件,放置到FTP服务器上。

5.升级前,执行下面的命令备份旧的软件及设定:(能够在srx设备上面ping通ftp server

地址)

user@host> request system snapshot 6.安装新的JUNOS软件:

user@host> request system software add

ftp//:username:password@192.168.1.1 /

jinstall-7.X-package-name-signed.tgz no-copy unlink reboot

第37页

Juniper防火墙工程开通指导书

Checking compatibility with configuration Initializing... Using jbase-7.x-package-name Using /var/tmp/jinstall-7.x-package-name.signed.tgz Verified jinstall-7.x-package-name.tgz signed by PackageDevelopment_0 Using

/var/validate/tmp/jinstall-signed/jinstall-7.x-package-name.tgz Using /var/validate/tmp/jinstall/jbundle-7.x-package-name.tgz Checking jbundle requirements on /

Using /var/validate/tmp/jbundle/jbase-7.x-package-name.tgz Using /var/validate/tmp/jbundle/jkernel-7.x-package-name.tgz Using /var/validate/tmp/jbundle/jcrypto-7.x-package-name.tgz Using /var/validate/tmp/jbundle/jpfe-7.x-package-name.tgz Using /var/validate/tmp/jbundle/jdocs-7.x-package-name.tgz Using /var/validate/tmp/jbundle/jroute-7.x-package-name.tgz Validating against /config/juniper.conf.gz mgd: commit complete Validation succeeded Installing package

'/var/tmp/jinstall-7.x-package-name-signed.tgz' ...

Verified jinstall-7.x-package-name-signed.tgz signed by

PackageDevelopment_0

Pre-checking requirements for jinstall... Auto-deleting old jinstall... Deleting saved config files ... Deleting bootstrap installer ... Adding jinstall...

WARNING: This package will load JUNOS 7.x software.

WARNING: It will save JUNOS configuration files, and SSH keys WARNING: (if configured), but erase all other files and information

WARNING: stored on this machine. It will attempt to preserve dumps

WARNING: and log files, but this can not be guaranteed. This is the

WARNING: pre-installation stage and all the software is loaded when

WARNING: you reboot the system. Saving the config files ...

Installing the bootstrap installer ...

WARNING: A REBOOT IS REQUIRED TO LOAD THIS SOFTWARE CORRECTLY.

第38页

Juniper防火墙工程开通指导书

Use the

WARNING: 'request system reboot' command when software installation is

WARNING: complete. To abort the installation, do not reboot your system,

WARNING: instead use the 'request system software delete jinstall'

WARNING: command as soon as this operation completes.

Saving package file in

/var/sw/pkg/jinstall-7.x-package-name-signed.tgz ... Saving state for rollback ...

2.2防火墙密码恢复

如果设备的Root密码丢失,而且没有其他的超级用户权限,那么就需要执行密码恢复,该操作需要中断设备的正常功能。

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

1. 断电后再加电以重新启动设备。

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

然后再进入单用户状态:

Hit [Enter] to boot immediately, or any other key for command prompt.

Booting [kernel] in 9 seconds... < Press any key other than return > ok boot –s 3. 执行密码恢复

# cd /packages # ./mount.jkernel

Mounted jkernel package on /dev/vn1...

Verified manifest signed by PackageProduction_8_2_0 # ./mount.jroute

Mounted jroute package on /dev/vn2...

Verified manifest signed by PackageProduction_8_2_0 # cd /usr/libexec/ui # ./recovery-mode

4. 进入配置模式,设置新的root密码:

root> configure

Entering configuration mode

第39页

Juniper防火墙工程开通指导书

[edit]

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

Retype new password: 5. 重新启动后,设备恢复正常。

2.3防火墙抓包和debug方法

如果出现部分网络无法正常访问,顺序检查接口状态、路由和策略配置是否有误,在确认上述配置无误后,通过debug命令检查防火墙对特定网段数据报处理情况。部分地址无法通过防火墙往往与策略配置有关。

Debug命令如下:

(用于判断防火墙内部对数据包的处理过程)

root@SRX3600#set security flow traceoptions file flow-trace (定义抓报文件名,此处为flow-trace)

root@SRX3600#set security flow traceoptions flag basic-datapath (定义只捕获设备处理flow 的信息)

root@SRX3600#set security flow traceoptions packet-filter debug source-prefix 10.1.10.5/32 destination-prefix 2.2.2.2/32

(定义需要捕获报文的条件)

root@SRX3600#commit (注意所有配置都需要commit) ( 发送测试报文)

root@SRX3600#run show log flow-trace (查看捕获报文的信息)

2.4故障信息收集命令

SRX3000系列配有12G硬盘,所有日志文件默认都存储在硬盘内。

防火墙基本信息收集:

SRX3600> request support information (数据比较多,将输出log下来) 防火墙var/log 目录下的log文件

第40页

Juniper防火墙工程开通指导书

SRX3000系列配有12G硬盘,所有日志文件默认都存储在硬盘内。 出故障时,最好能提供VAR/LOG 目录下所有信息。 以下是将设备var/log 目录下所有文件压缩打包,取出来。 zte@BJTDFW01BZX> start shell

zte@BJTDFW02BZX% pwd 应该在/var/home/zte zte@BJTDFW02BZX% cd /var/log zte@BJTDFW01BZX% su

Password: zte123 (root账号的密码) root@BJTDFW01BZX% tar cvf node0-log.tar *

zte@BJTDFW02BZX% ] (FTP server)

Connected to 10.223.64.27.

220 3Com 3CDaemon FTP Server Version 2.0 Name (10.223.64.27:zte): 123 331 User name ok, need password Password: 123456 230 User logged in

Remote system type is UNIX.

Using binary mode to transfer files. ftp> bin

ftp> put node0-log.tar

150 File status OK ; about to open data connection 100%

|*****************************************************************************************************************************************************| 8230 KB 00:00 ETA

226 Closing data connection; File transfer successful. 8427520 bytes sent in 2.32 seconds (3.47 MB/s)

第41页

Juniper防火墙工程开通指导书

ftp> bye

zte@BJTDFW02BZX% exit

如果是性能方面的问题:

show chassis routing-engine (路由引擎利用率)

show security monitoring fpc 7 (spc模块的cpu利用率)

#”7” 是SPC所在的槽位编号

show security flow session summary (总会话数)

2.5常用命令

show config | display set 全局查看当前设备运行配置 show interface ge-0/0/0 extensive 查看具体接口详细信息 show interface terse 查看所有接口状态 show chassis cluster status 查看双机状态 show log messages | last 最近的log message

三、完整配置示例

3.1 HA组网+OSPF 3.1.1网络规划及拓扑图

第42页

Juniper防火墙工程开通指导书

地址:GGSN内部地址池 10.0.0.0/8,NAT地址池一 220.1.1.0~220.1.1.7, NAT地址池二221.1.1.0-221.1.1.7,

端口:GGSN有两个接口,每个接口配置一个IP,两个接口的IP必须在不同网段;防火墙下行两个端口,分别对应GGSN的2个端口;防火墙上行也是两个端口;

HA:防火墙之间有HA连接,需要用2个端口做HA,防火墙工作在非抢占模式;

路由:GGSN与防火墙之间启用OSPF,GGSN与防火墙之间有2个等价路由;防火墙与三层交换机之间启用静态路由;

策略:开放从内->外发起的IP流,不允许从外->内发起的IP流; NAT:GGSN内部地址池转换为NAT地址池; 配置以SRX3600为例

3.1.2IP地址规划

(本案例使用设备自带电口,SFB 模块自带8个电口4个光口) 设备 FW-01

物理端口 Ge-0/0/0 Ge-0/0/1 双机端口 Fab0 Reth1 IP 地址 无 192.168.100.1/24

备注 心跳端口 连接ggsn端口1 , 第43页

Juniper防火墙工程开通指导书

Ge-0/0/2 Ge-0/0/3 Ge-0/0/4 FW-02 Ge-0/0/0 Ge-0/0/1 Ge-0/0/2 Ge-0/0/3 Ge-0/0/4 Reth2 Reth3 Reth4 Fab1 Reth1 Reth2 Reth3 Reth4 192.168.200.1/24 220.1.1.18/24 221.1.1.18/24 无 192.168.100.1/24 192.168.200.1/24 220.1.1.18/24 221.1.1.18/24

连接ggsn端口2 连接三层交换机, 连接三层交换机, 心跳端口 连接ggsn端口1 , 连接ggsn端口2 连接三层交换机, 连接三层交换机, 3.1.3具体配置

系统配置:(设置主机名,带外管理ip)

set groups node0 system host-name xxxx-FW01

set groups node0 system time-zone ASIA/SHANGHAI

set groups node0 interfaces fxp0 unit 0 family inet address 192.168.1.1/24 set groups node1 system host-name xxxx-FW02

set groups node1 system time-zone ASIA/SHANGHAI

set groups node1 interfaces fxp0 unit 0 family inet address 192.168.1.2/24 set apply-groups \

接口及双机配置

set chassis cluster control-link-recovery set chassis cluster reth-count 16

set chassis cluster redundancy-group 0 node 0 priority 200 set chassis cluster redundancy-group 0 node 1 priority 100 set chassis cluster redundancy-group 1 node 0 priority 200 set chassis cluster redundancy-group 1 node 1 priority 100

set chassis cluster redundancy-group 1 interface-monitor ge-0/0/1 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/2 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/3 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/4 weight 255

set chassis cluster redundancy-group 1 interface-monitor ge-13/0/1 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/2 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/3 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/4 weight 255 set interfaces ge-0/0/1 gigether-options redundant-parent reth1 set interfaces ge-0/0/2 gigether-options redundant-parent reth2 set interfaces ge-0/0/3 gigether-options redundant-parent reth3 set interfaces ge-0/0/4 gigether-options redundant-parent reth4 set interfaces ge-13/0/1 gigether-options redundant-parent reth1 set interfaces ge-13/0/2 gigether-options redundant-parent reth2

第44页

Juniper防火墙工程开通指导书

set interfaces ge-13/0/3 gigether-options redundant-parent reth3 set interfaces ge-13/0/4 gigether-options redundant-parent reth4

set interfaces fab0 fabric-options member-interfaces ge-0/0/0 set interfaces fab1 fabric-options member-interfaces ge-13/0/0

set interfaces reth1 redundant-ether-options redundancy-group 1 set interfaces reth1 unit 0 family inet address 192.168.100.1/24 set interfaces reth2 redundant-ether-options redundancy-group 1 set interfaces reth2 unit 0 family inet address 192.168.200.1/24 set interfaces reth3 redundant-ether-options redundancy-group 1 set interfaces reth3 unit 0 family inet address 220.1.1.18/24 set interfaces reth4 redundant-ether-options redundancy-group 1 set interfaces reth4 unit 0 family inet address 221.1.1.18/24

新建trust/untrust区域,并把接口放入相关区域并开放相关服务。(trust区域接口服务都打开,如telnet、ping、snmp、http)

set security zones security-zone trust interfaces reth1.0 host-inbound-traffic system-services all 内部主动发起到外部的流量

set security zones security-zone trust interfaces reth1.0 host-inbound-traffic protocols ospf

set security zones security-zone trus tinterfaces reth2.0 host-inbound-traffic system-services all

set security zones security-zone trust interfaces reth2.0 host-inbound-traffic protocols ospf

set security zones security-zone untrust interfaces reth3.0 host-inbound-traffic protocols ping

set security zones security-zone untrust interfaces reth4.0 host-inbound-traffic protocols ping

3 .配置外网NAT地址池

set security nat source pool Pool-1 address 220.1.1.1 to 220.1.1.7 set security nat source pool Pool-2 address 221.1.1.1 to 221.1.1.7 set security nat source rule-set Rule-Pool-1 from zone trust

set security nat source rule-set Rule-Pool-1 to interface reth3.0 set security nat source rule-set Rule-Pool-2 from zone trust

set security nat source rule-set Rule-Pool-2 to interface reth4.0

set security nat source rule-set Rule-Pool-1 rule interface-nat match source-address 0.0.0.0/0

set security nat source rule-set Rule-Pool-1 rule interface-nat match destination-address 0.0.0.0/0 set security nat source rule-set Rule-Pool-1 rule interface-nat then source-nat pool

第45页

Juniper防火墙工程开通指导书

poole-1

set security nat source rule-set Rule-Pool-2 rule interface-nat match source-address 0.0.0.0/0

set security nat source rule-set Rule-Pool-2 rule interface-nat match destination-address 0.0.0.0/0 set security nat source rule-set Rule-Pool-1 rule interface-nat then source-nat pool poole-2

由于dip地址池ip与接口在同一网段,需要配置proxy-arp

set security nat proxy-arp interface reth3.0 address 220.1.1.0/29 set security nat proxy-arp interface reth4.0 address 221.1.1.0/29

4.添加地址

set security zones security-zone trust address-book address mobile-address 10.0.0.0/8

5、配置外网的2条等价路由,并对选路实施负载均衡,基于session进行负载均衡 set routing-options forwarding-table export load-balance

set policy-options policy-statement load-balance then load-balance per-packet set routing-options static route 0.0.0.0/0 qualified-next-hop 220.1.1.254 set routing-options static route 0.0.0.0/0 qualified-next-hop 221.1.1.254

6、配置OSPF动态路由

set routing-options router-id 1.1.1.1

set protocols ospf area 0.0.0.0 interface reth1.0 set protocols ospf area 0.0.0.0 interface reth2.0 将缺省路由重分布进ospf

set protocols ospf export redistribute

set policy-options policy-statement redistribute term 1 from protocol static set policy-options policy-statement redistribute term 1 then accept

7、配置policy策略 A:设置从内到外的安全策略

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

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

第46页

Juniper防火墙工程开通指导书

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

3.2 HA组网+静态路由

3.2.1网络规划及拓扑图

地址:GGSN内部地址池 10.0.0.0/8,NAT地址池一 220.1.1.0~220.1.1.7, NAT地址池二 221.1.1.0~221.1.1.7

端口:GGSN有两个接口,每个接口配置一个IP,两个接口的IP必须在不同网段;防火墙下行两个端口,分别对应GGSN的2个端口;防火墙上行也是两个端口; HA:防火墙之间有HA连接,防火墙工作在非抢占模式;

路由:GGSN与防火墙之间启用OSPF,GGSN与防火墙之间有2个等价路由;防火墙与层三交换机之间启用静态路由;

策略:开放从内->外发起的IP流,不允许从外->内发起的IP流; NAT:GGSN内部地址池转换为NAT地址池;

第47页

Juniper防火墙工程开通指导书

3.2.2 IP地址规划 设备 FW-01 物理端口 Ge-0/0/0 Ge-0/0/1 Ge-0/0/2 Ge-0/0/3 Ge-0/0/4 FW-02 Ge-0/0/0 Ge-0/0/1 Ge-0/0/2 Ge-0/0/3 Ge-0/0/4 双机端口 Fab0 Reth1 Reth2 Reth3 Reth4 Fab1 Reth1 Reth2 Reth3 Reth4 IP 地址 无 192.168.100.1/24 192.168.200.1/24 220.1.1.18/24 221.1.1.18/24 无 192.168.100.1/24 192.168.200.1/24 220.1.1.18/24 221.1.1.18/24

3.2.3具体配置具体配置

系统配置:(设置主机名,带外管理ip)

set groups node0 system host-name xxxx-FW01

set groups node0 system time-zone ASIA/SHANGHAI

set groups node0 interfaces fxp0 unit 0 family inet address 192.168.1.1/24 set groups node1 system host-name xxxx-FW02

set groups node1 system time-zone ASIA/SHANGHAI

set groups node1 interfaces fxp0 unit 0 family inet address 192.168.1.2/24 set apply-groups \

接口及双机配置

set chassis cluster control-link-recovery set chassis cluster reth-count 16

set chassis cluster redundancy-group 0 node 0 priority 200 set chassis cluster redundancy-group 0 node 1 priority 100 set chassis cluster redundancy-group 1 node 0 priority 200 set chassis cluster redundancy-group 1 node 1 priority 100

set chassis cluster redundancy-group 1 interface-monitor ge-0/0/1 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/2 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/3 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-0/0/4 weight 255

set chassis cluster redundancy-group 1 interface-monitor ge-13/0/1 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/2 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/3 weight 255 set chassis cluster redundancy-group 1 interface-monitor ge-13/0/4 weight 255 set interfaces ge-0/0/1 gigether-options redundant-parent reth1 set interfaces ge-0/0/2 gigether-options redundant-parent reth2 set interfaces ge-0/0/3 gigether-options redundant-parent reth3

第48页

备注 心跳端口 连接ggsn端口1 , 连接ggsn端口2 连接三层交换机, 连接三层交换机, 心跳端口 连接ggsn端口1 , 连接ggsn端口2 连接三层交换机, 连接三层交换机, Juniper防火墙工程开通指导书

set interfaces ge-0/0/4 gigether-options redundant-parent reth4 set interfaces ge-13/0/1 gigether-options redundant-parent reth1 set interfaces ge-13/0/2 gigether-options redundant-parent reth2 set interfaces ge-13/0/3 gigether-options redundant-parent reth3 set interfaces ge-13/0/4 gigether-options redundant-parent reth4

set interfaces fab0 fabric-options member-interfaces ge-0/0/0 set interfaces fab1 fabric-options member-interfaces ge-13/0/0

set interfaces reth1 redundant-ether-options redundancy-group 1 set interfaces reth1 unit 0 family inet address 192.168.100.1/24 set interfaces reth2 redundant-ether-options redundancy-group 1 set interfaces reth2 unit 0 family inet address 192.168.200.1/24 set interfaces reth3 redundant-ether-options redundancy-group 1 set interfaces reth3 unit 0 family inet address 220.1.1.18/24 set interfaces reth4 redundant-ether-options redundancy-group 1 set interfaces reth4 unit 0 family inet address 221.1.1.18/24

新建trust/untrust区域,并把接口放入相关区域并开放相关服务。(trust区域接口服务都打开,如telnet、ping、snmp、http)

set security zones security-zone trust interfaces reth1.0 host-inbound-traffic system-services all

set security zones security-zone trus tinterfaces reth2.0 host-inbound-traffic system-services all

set security zones security-zone untrust interfaces reth3.0 host-inbound-traffic protocols ping

set security zones security-zone untrust interfaces reth4.0 host-inbound-traffic protocols ping

3 .配置外网NAT地址池

set security nat source pool Pool-1 address 220.1.1.1 to 220.1.1.7 set security nat source pool Pool-2 address 221.1.1.1 to 221.1.1.7 set security nat source rule-set Rule-Pool-1 from zone trust

set security nat source rule-set Rule-Pool-1 to interface reth3.0 set security nat source rule-set Rule-Pool-2 from zone trust

set security nat source rule-set Rule-Pool-2 to interface reth4.0

set security nat source rule-set Rule-Pool-1 rule interface-nat match source-address 0.0.0.0/0

set security nat source rule-set Rule-Pool-1 rule interface-nat match destination-address 0.0.0.0/0

set security nat source rule-set Rule-Pool-1 rule interface-nat then source-nat pool poole-1

第49页

Juniper防火墙工程开通指导书

set security nat source rule-set Rule-Pool-2 rule interface-nat match source-address 0.0.0.0/0

set security nat source rule-set Rule-Pool-2 rule interface-nat match destination-address 0.0.0.0/0 set security nat source rule-set Rule-Pool-1 rule interface-nat then source-nat pool poole-2

由于dip地址池ip与接口在同一网段,需要配置proxy-arp

set security nat proxy-arp interface reth3.0 address 220.1.1.0/29 set security nat proxy-arp interface reth4.0 address 221.1.1.0/29

4.添加地址

set security zones security-zone trust address-book address mobile-address 10.0.0.0/8

5、配置内外网路由,并实现选录负载均衡

set routing-options forwarding-table export load-balance

set policy-options policy-statement load-balance then load-balance per-packet set routing-options static route 0.0.0.0/0 qualified-next-hop 220.1.1.254 set routing-options static route 0.0.0.0/0 qualified-next-hop 221.1.1.254

set routing-options static route 10.0.0.0/8 qualified-next-hop 192.168.100.254 set routing-options static route 10.0.0.0/8 qualified-next-hop 192.168.200.254

6、配置policy策略 A:设置从内到外的安全策略

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

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

第50页