7. JUNIPER 防火墙快速安装手册
防火墙使用 Untrust 区(外网或者公网)接口的 IP 地址替换始发端主机的源 IP 地址;
同时使用由防火墙生成的任意端口号替换源端口号。
NAT 模式应用的环境特征:
① 注册 IP 地址(公网 IP 地址)的数量不足;
② 内部网络使用大量的非注册 IP 地址(私网 IP 地址)需要合法访问 Internet;
③ 内部网络中有需要外显并对外提供服务的服务器。
2.2、Route 模式
当Juniper防火墙接口配置为路由模式时,防火墙在不同安全区间(例如:Trust/Utrust/DMZ)
转发信息流时IP 数据包包头中的源地址和端口号保持不变(除非明确采用了地址翻译策
略)。
① 与NAT模式下不同,防火墙接口都处于路由模式时,防火墙不会自动实施地址翻译;
第 7 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
8. JUNIPER 防火墙快速安装手册
② 与透明模式下不同,当防火墙接口都处于路由模式时,其所有接口都处于不同的子网
中。
路由模式应用的环境特征:
① 防火墙完全在内网中部署应用;
② NAT 模式下的所有环境;
③ 需要复杂的地址翻译。
2.3、透明模式
当Juniper防火墙接口处于“透明”模式时,防火墙将过滤通过的IP数据包,但不会修改 IP
数据包包头中的任何信息。防火墙的作用更像是处于同一VLAN的2 层交换机或者桥接器,
防火墙对于用户来说是透明的。
第 8 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
9. JUNIPER 防火墙快速安装手册
透明模式是一种保护内部网络从不可信源接收信息流的方便手段。使用透明模式有以下优
点:
① 不需要修改现有网络规划及配置;
② 不需要实施 地址翻译;
③ 可以允许动态路由协议、Vlan trunking的数据包通过。
2.4、基于向导方式的 NAT/Route 模式下的基本配置
Juniper 防火墙 NAT 和路由模式的配置可以在防火墙保持出厂配置启动后通过 Web 浏览器
配置向导完成。
注:要启动配置向导,则必须保证防火墙设备处于出厂状态。例如:新的从未被调试过的设
备,或者经过命令行恢复为出厂状态的防火墙设备。
通过 Web 浏览器登录处于出厂状态的防火墙时,防火墙的缺省管理参数如下:
① 缺省 IP:192.168.1.1/255.255.255.0;
第 9 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
10. JUNIPER 防火墙快速安装手册
② 缺省用户名/密码:netscreen/ netscreen;
注:缺省管理 IP 地址所在端口参见在前言部份讲述的“Juniper 防火墙缺省管理端口和 IP
地址”中查找!!
在配置向导实现防火墙应用的同时,我们先虚拟一个防火墙设备的部署环境,之后,根据这
个环境对防火墙设备进行配置。
防火墙配置规划:
① 防 火 墙 部 署 在 网 络 的 Internet 出 口 位 置 , 内 部 网 络 使 用 的 IP 地 址 为
192.168.1.0/255.255.255.0 所在的网段,内部网络计算机的网关地址为防火墙内网端
口的 IP 地址:192.168.1.1;
② 防火墙外网接口 IP 地址(通常情况下为公网 IP 地址,在这里我们使用私网 IP 地址模
拟公网 IP 地址)为:10.10.10.1/255.255.255.0,网关地址为:10.10.10.251
要求:
实现内部访问 Internet 的应用。
注:在进行防火墙设备配置前,要求正确连接防火墙的物理链路;调试用的计算机连接到防
火墙的内网端口上。
1. 通过 IE 或与 IE 兼容的浏览器(推荐应用微软 IE 浏览器)使用防火墙缺省 IP 地址登录
防火墙(建议:保持登录防火墙的计算机与防火墙对应接口处于相同网段,直接相连)。
2. 使用缺省 IP 登录之后,出现安装向导:
第 10 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
11. JUNIPER 防火墙快速安装手册
注:对于熟悉 Juniper 防火墙配置的工程师,可以跳过该配置向导,直接点选:No,skip the
wizard and go straight to the WebUI management session instead,之后选择 Next,直接
登录防火墙设备的管理界面。
3. 使用向导配置防火墙,请直接选择:Next,弹出下面的界面:
第 11 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
19. JUNIPER 防火墙快速安装手册
注:在设备缺省的情况下,防火墙的信任区(Trust Zone)所在的端口是工作在 NAT 模式
的,其它安全区所在的端口是工作在路由模式的。
基于命令行方式的防火墙设备部署的配置如下(网络环境同上一章节所讲述的环境):
2.5.1、NS-5GT NAT/Route 模式下的基本配置
注:NS-5GT 设备的物理接口名称叫做 trust 和 untrust;缺省 Zone 包括:trust 和 untrust,
请注意和接口区分开。
① Unset interface trust ip (清除防火墙内网端口的 IP 地址);
② Set interface trust zone trust(将内网端口分配到 trust zone);
③ Set interface trust ip 192.168.1.1/24(设置内网端口的 IP 地址,必须先定义 zone,之
后再定义 IP 地址);
④ Set interface untrust zone untrust(将外网口分配到 untrust zone);
⑤ Set interface untrust ip 10.10.10.1/24(设置外网口的 IP 地址);
⑥ Set route 0.0.0.0/0 interface untrust gateway 10.10.10.251(设置防火墙对外的缺省路
由网关地址)
;
第 19 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
20. JUNIPER 防火墙快速安装手册
⑦ Set policy from trust to untrust any any any permit log(定义一条由内网到外网的访问
策略。策略的方向是:由 zone trust 到 zone untrust, 源地址为:any,目标地址为:
any,网络服务为:any,策略动作为:permit 允许,log:开启日志记录)
;
⑧ Save (保存上述的配置文件)。
2.5.2、非 NS-5GT NAT/Route 模式下的基本配置
① Unset interface ethernet1 ip(清除防火墙内网口缺省 IP 地址)
;
② Set interface ethernet1 zone trust(将 ethernet1 端口分配到 trust zone);
③ Set interface ethernet1 ip 192.168.1.1/24(定义 ethernet1 端口的 IP 地址)
;
④ Set interface ethernet3 zone untrust(将 ethernet3 端口分配到 untrust zone)
;
第 20 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
21. JUNIPER 防火墙快速安装手册
⑤ Set interface ethernet3 ip 10.10.10.1/24(定义 ethernet3 端口的 IP 地址);
⑥ (定义防火墙对外的缺省
Set route 0.0.0.0/0 interface ethernet3 gateway 10.10.10.251
路由网关);
⑦ Set policy from trust to untrust any any any permit log(定义由内网到外网的访问控制
策略);
⑧ Save (保存上述的配置文件)
注:上述是在命令行的方式上实现的 NAT 模式的配置,因为防火墙出厂时在内网端口(trust
zone 所属的端口)上启用了 NAT,所以一般不用特别设置,但是其它的端口则工作在路由
模式下,例如:untrust 和 DMZ 区的端口。
如果需要将端口从路由模式修改为 NAT 模式,则可以按照如下的命令行进行修改:
① Set interface ethernet2 NAT (设置端口 2 为 NAT 模式)
② Save
总结:
① NAT/Route 模式做防火墙部署的主要模式,通常是在一台防火墙上两种模式混合进行
(除非防火墙完全是在内网应用部署,不需要做 NAT-地址转换,这种情况下防火墙所
有端口都处于 Route 模式,防火墙首先作为一台路由器进行部署);
② 关于配置举例,NS-5GT 由于设备设计上的特殊性,因此专门列举加以说明;Juniper
在 2006 年全新推出的 SSG 系列防火墙,除了端口命名不一样,和 NS 系列设备管理
配置方式一样。
2.6、基于非向导方式的透明模式下的基本配置
实现透明模式配置建议采用命令行的方式,因为采用 Web 的方式实现时相对命令行的方式
麻烦。通过控制台连接防火墙的控制口,登录命令行管理界面,通过如下命令及步骤进行二
层透明模式的配置:
① Unset interface ethernet1 ip(将以太网 1 端口上的默认 IP 地址删除);
第 21 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
22. JUNIPER 防火墙快速安装手册
② Set interface ethernet1 zone v1-trust(将以太网 1 端口分配到 v1-trust zone:基于二
层的安全区,端口设置为该安全区后,则端口工作在二层模式,并且不能在该端口上
配置 IP 地址);
③ Set interface ethernet2 zone v1-dmz(将以太网 2 端口分配到 v1-dmz zone);
④ Set interface ethernet3 zone v1-untrust(将以太网 3 端口分配到 v1-untrust zone);
⑤ Set interface vlan1 ip 192.168.1.1/24 ( 设 置 VLAN1 的 IP 地 址 为 :
192.168.1.1/255.255.255.0,该地址作为防火墙管理 IP 地址使用);
⑥ Set policy from v1-trust to v1-untrust any any any permit log(设置一条由内网到外网
的访问策略)
;
⑦ ;
Save(保存当前的配置)
总结:
① 带有 V1-字样的 zone 为基于透明模式的安全区,在进行透明模式的应用时,至少要保
证两个端口的安全区工作在二层模式;
② 虽然 Juniper 防火墙可以在某些特殊版本工作在混合模式下(二层模式和三层模式的混
合应用),但是通常情况下,建议尽量使防火墙工作在一种模式下(三层模式可以混用:
NAT 和路由)
。
3、Juniper 防火墙几种常用功能的配置
这里讲述的 Juniper 防火墙的几种常用功能主要是指基于策略的 NAT 的实现,包括:MIP、
VIP 和 DIP,这三种常用功能主要应用于防火墙所保护服务器提供对外服务。
3.1、MIP 的配置
MIP 是“一对一”的双向地址翻译(转换)过程。通常的情况是:当你有若干个公网 IP 地
址,又存在若干的对外提供网络服务的服务器(服务器使用私有 IP 地址),为了实现互联网
用户访问这些服务器,可在 Internet 出口的防火墙上建立公网 IP 地址与服务器私有 IP 地址
第 22 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
23. JUNIPER 防火墙快速安装手册
之间的一对一映射(MIP),并通过策略实现对服务器所提供服务进行访问控制。
MIP 应用的网络拓扑图:
注:MIP 配置在防火墙的外网端口(连接 Internet 的端口)
。
3.1.1、使用 Web 浏览器方式配置 MIP
① 登录防火墙,将防火墙部署为三层模式(NAT 或路由模式)
;
② 定义 MIP:Network=>Interface=>ethernet2=>MIP,配置实现 MIP 的地址映射。
Mapped
IP:公网 IP 地址,Host IP:内网服务器 IP 地址
第 23 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
25. JUNIPER 防火墙快速安装手册
3.1.2、使用命令行方式配置 MIP
① 配置接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.1.1.1/24
set interface ethernet1 nat
set interface ethernet2 zone untrust
set interface ethernet2 ip 1.1.1.1/24
② 定义MIP
set interface ethernet2 mip 1.1.1.5 host 10.1.1.5 netmask 255.255.255.255 vrouter
trust-vr
③ 定义策略
set policy from untrust to trust any mip(1.1.1.5) http permit
save
3.2、VIP 的配置
MIP 是一个公网 IP 地址对应一个私有 IP 地址,是一对一的映射关系;而 VIP 是一个公网
IP 地址的不同端口(协议端口如:21、25、110 等)与内部多个私有 IP 地址的不同服务端
口的映射关系。通常应用在只有很少的公网 IP 地址,却拥有多个私有 IP 地址的服务器,并
且,这些服务器是需要对外提供各种服务的。
第 25 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
26. JUNIPER 防火墙快速安装手册
VIP 应用的拓扑图:
注:VIP 配置在防火墙的外网连接端口上(连接 Internet 的端口)。
3.2.1、使用 Web 浏览器方式配置 VIP
① 登录防火墙,配置防火墙为三层部署模式。
② 添加VIP:Network=>Interface=>ethernet8=>VIP
③ 添加与该VIP公网地址相关的访问控制策
略。
第 26 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
27. JUNIPER 防火墙快速安装手册
3.2.2、使用命令行方式配置 VIP
① 配置接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.1.1.1/24
set interface ethernet1 nat
set interface ethernet3 zone untrust
set interface ethernet3 ip 1.1.1.1/24
② 定义VIP
set interface ethernet3 vip 1.1.1.10 80 http 10.1.1.10
③ 定义策略
set policy from untrust to trust any vip(1.1.1.10) http permit
save
注:VIP 的地址可以利用防火墙设备的外网端口地址实现(限于低端设备)。
第 27 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
28. JUNIPER 防火墙快速安装手册
3.3、DIP 的配置
DIP 的应用一般是在内网对外网的访问方面。当防火墙内网端口部署在 NAT 模式下,通过
防火墙由内网对外网的访问会自动转换为防火墙设备的外网端口 IP 地址,并实现对外网(互
联网)的访问,这种应用存在一定的局限性。解决这种局限性的办法就是 DIP,在内部网络
IP 地址外出访问时,动态转换为一个连续的公网 IP 地址池中的 IP 地址。
DIP 应用的网络拓扑图:
3.3.1、使用 Web 浏览器方式配置 DIP
① 登录防火墙设备,配置防火墙为三层部署模式;
② 定义DIP:Network=>Interface=>ethernet3=>DIP,在定义了公网IP地址的untrust端口
定义IP地址池;
第 28 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
29. JUNIPER 防火墙快速安装手册
③ 定义策略:定义由内到外的访问策略,在策略的高级(ADV)部分NAT的相关内容中,
启用源地址NAT,并在下拉菜单中选择刚刚定义好的DIP地址池,保存策略,完成配置;
策略配置完成之后拥有内部 IP 地址的网络设备在访问互联网时会自动从该地址池中选择一
个公网 IP 地址进行 NAT。
第 29 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
30. JUNIPER 防火墙快速安装手册
3.3.2、使用命令行方式配置 DIP
① 配置接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.1.1.1/24
set interface ethernet1 nat
set interface ethernet3 zone untrust
set interface ethernet3 ip 1.1.1.1/24
② 定义DIP
set interface ethernet3 dip 5 1.1.1.30 1.1.1.30
③ 定义策略
set policy from trust to untrust any any http nat src dip-id 5 permit
save
4、Juniper 防火墙 IPSec VPN 的配置
Juniper 所有系列防火墙(除部分早期型号外)都支持 IPSec VPN,其配置方式有多种,包
括:基于策略的 VPN、基于路由的 VPN、集中星形 VPN 和背靠背 VPN 等。在这里,我们
主要介绍最常用的 VPN 模式:基于策略的 VPN。
站点间(Site-to-Site)的 VPN 是 IPSec VPN 的典型应用,这里我们介绍两种站点间基于策
略 VPN 的实现方式:站点两端都具备静态公网 IP 地址;站点两端其中一端具备静态公网
IP 地址,另一端动态公网 IP 地址。
4.1、站点间 IPSec VPN 配置:staic ip-to-staic ip
当创建站点两端都具备静态 IP 的 VPN 应用中,
位于两端的防火墙上的 VPN 配置基本相同,
不同之处是在 VPN gateway 部分的 VPN 网关指向 IP 不同,其它部分相同。
第 30 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
31. JUNIPER 防火墙快速安装手册
VPN 组网拓扑图:staic ip-to-staic ip
4.1.1、使用 Web 浏览器方式配置
① 登录防火墙设备,配置防火墙为三层部署模式;
② 定义 VPN 第一阶段的相关配置:VPNs=>Autokey Advanced=>Gateway
配置 VPN gateway 部分,定义 VPN 网关名称、定义“对端 VPN 设备的公网 IP 地址”
为本地 VPN 设备的网关地址、定义预共享密钥、选择发起 VPN 服务的物理端口;
第 31 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
35. JUNIPER 防火墙快速安装手册
4.1.2、使用命令行方式配置
CLI ( 东京)
① 配置接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.1.1.1/24
set interface ethernet1 nat
set interface ethernet3 zone untrust
set interface ethernet3 ip 1.1.1.1/24
② 定义路由
set vrouter trust-vr route 0.0.0.0/0 interface ethernet3 gateway 1.1.1.250
③ 定义地址
set address trust Trust_LAN 10.1.1.0/24
set address untrust paris_office 10.2.2.0/24
④ 定义IPSec VPN
set ike gateway to_paris address 2.2.2.2 main outgoing-interface ethernet3 preshare
h1p8A24nG5 proposal pre-g2-3des-sha
第 35 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
36. JUNIPER 防火墙快速安装手册
set vpn tokyo_paris gateway to_paris sec-level compatible
⑤ 定义策略
set policy top name "To/From Paris" from trust to untrust Trust_LAN paris_office
any tunnel vpn tokyo_paris
set policy top name "To/From Paris" from untrust to trust paris_office Trust_LAN
any tunnel vpn tokyo_paris
save
CLI ( 巴黎)
① 定义接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.2.2.1/24
set interface ethernet1 nat
set interface ethernet3 zone untrust
set interface ethernet3 ip 2.2.2.2/24
② 定义路由
set vrouter trust-vr route 0.0.0.0/0 interface ethernet3 gateway 2.2.2.250
③ 定义地址
set address trust Trust_LAN 10.2.2.0/24
set address untrust tokyo_office 10.1.1.0/24
④ 定义IPSec VPN
set ike gateway to_tokyo address 1.1.1.1 main outgoing-interface ethernet3 preshare
h1p8A24nG5 proposal pre-g2-3des-sha
set vpn paris_tokyo gateway to_tokyo sec-level compatible
⑤ 定义策略
set policy top name "To/From Tokyo" from trust to untrust Trust_LAN tokyo_office
any tunnel vpn paris_tokyo
set policy top name "To/From Tokyo" from untrust to trust tokyo_office Trust_LAN
any tunnel vpn paris_tokyo
save
第 36 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
37. JUNIPER 防火墙快速安装手册
4.2、站点间 IPSec VPN 配置:staic ip-to-dynamic ip
在站点间 IPSec VPN 应用中,有一种特殊的应用,即在站点两端的设备中,一端拥有静态
的公网 IP 地址,而另外一端只有动态的公网 IP 地址,以下讲述的案例是在这种情况下,
Juniper 防火墙如何建立 IPSec VPN 隧道。
基本原则:
在这种 IPSec VPN 组网应用中,拥有静态公网 IP 地址的一端作为被访问端出现,拥有动态
公网 IP 地址的一端作为 VPN 隧道协商的发起端。
和站点两端都具备静态 IP 地址的配置的不同之处在于 VPN 第一阶段的相关配置,在主动发
起端(只有动态公网 IP 地址一端)需要指定 VPN 网关地址,需配置一个本地 ID,配置 VPN
发起模式为:主动模式;在站点另外一端(拥有静态公网 IP 地址一端)需要指定 VPN 网关
地址为对端设备的 ID 信息,不需要配置本地 ID,其它部分相同。
IPSec VPN 组网拓扑图:staic ip-to-dynamic ip
第 37 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
38. JUNIPER 防火墙快速安装手册
4.2.1、使用 Web 浏览器方式配置
① VPN 第一阶段的配置:动态公网 IP 地址端。
VPN 的发起必须由本端开始,动态地址端可以确定对端防火墙的 IP 地址,因此在 VPN
阶段一的配置中,需指定对端 VPN 设备的静态 IP 地址。同时,在本端设置一个 Local
ID,提供给对端作为识别信息使用。
② VPN 第一阶段的高级配置:动态公网 IP 地址端。
在 VPN 阶段一的高级配置中动态公网 IP 一端的 VPN 的发起模式应该配置为:主动
模式(Aggressive)
第 38 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
39. JUNIPER 防火墙快速安装手册
③ VPN 第一阶段的配置:静态公网 IP 地址端。
在拥有静态公网 IP 地址的防火墙一端,在 VPN 阶段一的配置中,需要按照如下图所
示的配置:
“Remote Gateway Type”应该选择“Dynamic IP Address”,同时设置
Peer ID(和在动态 IP 地址一端设置的 Local ID 相同)。
第 39 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
41. JUNIPER 防火墙快速安装手册
4.2.1、使用命令行方式配置
CLI ( 设备-A)
① 定义接口参数
set interface ethernet1 zone trust
set interface ethernet1 ip 10.1.1.1/24
set interface ethernet1 nat
set interface ethernet3 zone untrust
set interface ethernet3 dhcp client
set interface ethernet3 dhcp client settings server 1.1.1.5
② 定义路由
set vrouter trust-vr route 0.0.0.0/0 interface ethernet3
③ 定义用户
set user pmason password Nd4syst4
④ 定义地址
set address trust "trusted network" 10.1.1.0/24
set address untrust "mail server" 3.3.3.5/32
第 41 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
42. JUNIPER 防火墙快速安装手册
⑤ 定义服务
set service ident protocol tcp src-port 0-65535 dst-port 113-113
set group service remote_mail
set group service remote_mail add http
set group service remote_mail add ftp
set group service remote_mail add telnet
set group service remote_mail add ident
set group service remote_mail add mail
set group service remote_mail add pop3
⑥ 定义VPN
set ike gateway to_mail address 2.2.2.2 aggressive local-id pmason@abc.com
outgoing-interface ethernet3 preshare h1p8A24nG5 proposal pre-g2-3des-sha
set vpn branch_corp gateway to_mail sec-level compatible
⑦ 定义策略
set policy top from trust to untrust "trusted network" "mail server" remote_mail
tunnel vpn branch_corp auth server Local user pmason
set policy top from untrust to trust "mail server" "trusted network" remote_mail
tunnel vpn branch_corp
save
CLI ( 设备-B)
① 定义接口参数
set interface ethernet2 zone dmz
set interface ethernet2 ip 3.3.3.3/24
set interface ethernet3 zone untrust
set interface ethernet3 ip 2.2.2.2/24
② 路由
set vrouter trust-vr route 0.0.0.0/0 interface ethernet3 gateway 2.2.2.250
③ 定义地址
set address dmz "mail server" 3.3.3.5/32
第 42 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
43. JUNIPER 防火墙快速安装手册
set address untrust "branch office" 10.1.1.0/24
④ 定义服务
set service ident protocol tcp src-port 0-65535 dst-port 113-113
set group service remote_mail
set group service remote_mail add ident
set group service remote_mail add mail
set group service remote_mail add pop3
⑤ 定义VPN
set ike gateway to_branch dynamic pmason@abc.com aggressive
outgoing-interface ethernet3 preshare h1p8A24nG5 proposal pre-g2-3des-sha
set vpn corp_branch gateway to_branch tunnel sec-level compatible
⑥ 定义策略
set policy top from dmz to untrust "mail server" "branch office" remote_mail
tunnel vpn corp_branch
set policy top from untrust to dmz "branch office" "mail server" remote_mail
tunnel vpn corp_branch
save
5、Juniper 中低端防火墙的 UTM 功能配置
Juniper 中低端防火墙(目前主要以 SSG 系列防火墙为参考)支持非常广泛的攻击防护及
内容安全功能,主要包括:防病毒(Anti-Virus) 防垃圾邮件
、 (Anti-Spam) URL 过滤
、 (URL
filtering)以及深层检测/入侵防御(Deep Inspection/IPS)。
注:上述的安全/防护功能集成在防火墙的 ScreenOS 操作系统中,但是必须通过 license
(许可)激活后方可使用(并会在激活一段时间(通常是 1 年)后过期)。当然在使用这些
功能的时候,我们还需要设定好防火墙的时钟以及 DNS 服务器地址。
第 43 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
50. JUNIPER 防火墙快速安装手册
5.2.1、Action 设置
SBL Default Enable 项选中后,防火墙使用公共防垃圾服务器来判别垃圾邮件。默认为打
开。
Actions 项用来指定对垃圾邮件的处理方法:Tag on Subject(在邮件标题栏标注信息,指
明该邮件为垃圾邮件;不丢弃邮件) ;Tag on Header(在邮件内容的头部标注信息,指明
该邮件为垃圾邮件;不丢弃邮件) ;Drop(直接丢弃查找到的垃圾邮件)
5.2.2、White List 与 Black List 的设置
通过防火墙自定义 white list 和 black list。比如在 White List > White List Content 栏输入
www.sina.com.cn,则防火墙在检查到与这个网址相关的邮件,都会认为是可信任邮件,直
接放行。
第 50 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
51. JUNIPER 防火墙快速安装手册
比如在 Black List >Black List Content 栏输入 www.baidu.com,则防火墙在检测到这个
网址有关的邮件时,都会判定为垃圾邮件。
第 51 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
53. JUNIPER 防火墙快速安装手册
② 打开 Web Filtering 选项的 Websense/SurfControl 的条目:
Enable Web Filtering 项设置为勾选,则 Web Filtering 功能打开。
第 53 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
54. JUNIPER 防火墙快速安装手册
Source Interface 项用来选择与 URL 过滤服务器相连的接口(如果不选,则采用
Default)。
Server Name 项填入 URL 过滤服务器的地址。
Server Port 项填入与服务器端口通讯的端口(默认为 15868) 。
If connectivity to the server is lost,Block/Permit all HTTP requests 项用来决定
如果与服务器连接丢失以后,防火墙采取什么措施。选择 Block 项,则与服务器失去
联系后,阻断所有 HTTP 请求;选择 Permit 项,则放行所有 HTTP 请求。
5.3.2、使用内置的 URL 过滤引擎进行 URL 过滤
如果使用 Juniper 防火墙自带的 SurfControl 引擎来过滤 URL,可以通过以下操作来完成。
① 在 Web Filtering > Protocol Selection 条 目 下 , 选 择 需 要 Integrated 按 钮
(SurfControl 或者 Websense)。
② 打开 Web Filtering 选项的 SC-CPA 的条目:
第 54 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
55. JUNIPER 防火墙快速安装手册
Enable Web Filtering via CPA Server 项勾选。
Server Name 项选择地区(比如我们处于亚洲,则选择 Asia Pacific) 。
Host 项会根据 Server Name 自动填充域名(比如前面选择了 Asia Pacific,则会出现
Asiai.SurfCPA.com) 。
Port 项与服务器端口通讯的端口(默认为 9020) 。
If connectivity to the server is lost,Block/Permit all HTTP requests 项用来决定
如果与服务器连接丢失以后,防火墙采取什么措施。选择 Block 项,则与服务器失去
联系后,阻断所有 HTTP 请求;选择 Permit 项,则放行所有 HTTP 请求。
5.3.3、手动添加过滤项
下面以实例的方式来讲解手动添加过滤项的操作过程。我们假设要禁止访问 www.sina.com
的访问。
① 首先,我们建立一个自己的过滤组(category) ,名字为 news。在 Screening > WEB
Filtering > Categories > Custom > Edit 下:
第 55 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
65. JUNIPER 防火墙快速安装手册
Interface Mode: NAT
② NSRP
Network > NSRP > Monitor > Interface > VSD ID: Device Edit Interface: 输入
以下内容,然后单击 Apply:
ethernet1: ( 选择); Weight: 255
ethernet3: ( 选择); Weight: 255
Network > NSRP > Synchronization: 选择 NSRP RTO Synchronization,然后
单击 Apply。
Network > NSRP > Cluster: 在 Cluster ID 字段中,键入 1,然后单击 Apply。
6.2、使用命令行方式配置
CLI ( 设备-A)
① 接口
set interface ethernet7 zone ha
set interface ethernet8 zone ha
set interface ethernet1 zone untrust
set interface ethernet1 ip 210.1.1.1/24
set interface ethernet3 zone trust
set interface ethernet3 ip 10.1.1.1/24
set interface ethernet3 manage-ip 10.1.1.20
set interface ethernet3 nat
② NSRP
set nsrp rto-mirror sync
set nsrp monitor interface ethernet1
set nsrp monitor interface ethernet3
set nsrp cluster id 1
save
CLI ( 设备-B)
第 65 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
66. JUNIPER 防火墙快速安装手册
① 接口
set interface ethernet7 zone ha
set interface ethernet8 zone ha
set interface ethernet1 zone untrust
set interface ethernet1 ip 210.1.1.1/24
set interface ethernet3 zone trust
set interface ethernet3 ip 10.1.1.1/24
set interface ethernet3 manage-ip 10.1.1.21
set interface ethernet3 nat
② NSRP
set nsrp rto-mirror sync
set nsrp monitor interface ethernet1
set nsrp monitor interface ethernet3
set nsrp cluster id 1
save
注:基于主主方式的 HA 应用的说明:详见《概念与范例 screenOS 参考指南》可以
在:www.juniper.net 免费获得。
7、Juniper 防火墙一些实用工具
7.1、防火墙配置文件的导出和导入
Juniper 防火墙的配置文件的导入导出功能为用户提供了一个快速恢复当前配置的有效的手
段。一旦用户不小心因为操作失误或设备损坏更换,都可以利用该功能,实现快速的防火墙
配置的恢复,在最短的时间内恢复设备和网络正常工作。
第 66 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
67. JUNIPER 防火墙快速安装手册
7.1.1、配置文件的导出
配置文件的导出(WebUI):在 Configuration > Update > Config File 位置,点选:Save to file,将
当前的防火墙设备的配置文件导出为一个无后缀名的可编辑文本文件。
配置文件的导出(CLI)
:ns208-> save config from flash to tftp 1.1.7.250 15Jun03.cfg
7.1.2、配置文件的导入
配置文件的导入(WebUI) 在 Configuration > Update > Config File 位置, 点选:
: 1、 Merge to Current
Configuration,覆盖当前配置并保留不同之处;2、点选:Replace Current Configuration
替换当前配置文件。导入完成之后,防火墙设备会自动重新启动,读取新的配置文件并运行。
第 67 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
68. JUNIPER 防火墙快速安装手册
配置文件的导入(CLI)
:ns208-> save config from tftp 1.1.7.250 15June03.cfg to flash
或者 ns208->save config from tftp 1.1.7.250 15June03.cfg merge
7.2、防火墙软件(ScreenOS)更新
关于 ScreenOS:
Juniper 防火墙的 OS 软件是可以升级的,一般每一到两个月会有一个新的 OS 版本发布,
OS 版本如:5.0.0R11.0,其中 R 前面的 5.0.0 是大版本号,这个版本号的变化代表着功能
的变化;R 后面的 11.0 是小版本号,这个号码的变化代表着 BUG 的完善,因此一般建议,
在大版本号确定的情况下,选择小版本号大的 OS 作为当前设备的 OS。
关于 OS 升级注意事项:
升级 OS 需要一定的时间,根据设备性能的不同略有差异,一般情况下大约需要 5 分钟的时
间。在升级的过程中,一定要保持电源的供应、网线连接的稳定,最好是将防火墙从网络中
暂时取出,待 OS 升级完成后再将防火墙设备接入网络。
ScreenOS 升级(WebUI) Configuration > Update > ScreenOS/Keys。
:
第 68 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp
69. JUNIPER 防火墙快速安装手册
ScreenOS 升级(CLI): ns208-> save software from tftp 1.1.7.250 newimage to flash
7.3、防火墙恢复密码及出厂配置的方法
当防火墙密码遗失的情况下,我们只能将防火墙恢复到出厂配置,方法是:
① 记录下防火墙的序列号(又称 Serial Number,在防火墙机身上面可找到)
;
② 使用控制线连接防火墙的 Console 端口并重起防火墙;
③ 防火墙正常启动到登录界面,是用记录下来的序列号作为登录的用户名/密码,根据防
火墙的提示恢复到出厂配置。
8、Juniper 防火墙的一些概念
安全区(Security Zone):
Juniper 防火墙增加了全新的安全区域(Security Zone)的概念,安全区域是一个逻辑的结
构,是多个处于相同属性区域的物理接口的集合。当不同安全区域之间相互通讯时,必须通
过事先定义的策略检查才能通过; 当在同一个安全区域进行通讯时, 默认状态下允许不通过
第 69 页 共 74 页
http://www.synnex.com.cn/juniper/index.asp