实现原理简介
根据实际情况,可以在 Netscreen 上实现阻止
MSN Messener 登录。这种阻止技术
叫作深层检测(Deep Inspection)。它根据数据包中的一些特定字段来判断是否要将其阻
止。
在 Netscreen
防火墙上设置一个特定的规则表达式,然后在策略中将其应用。
防火墙
据此丢弃或放行经过的数据包。




Netscreen 5gt 的配置
1. 设置接口地址
Network > Interfaces > Edit (对于 Trust Interface)
Zone Name: Trust
Static IP: IP Address/Netmask: 192.168.1.1/24
Interface Mode: NAT
a) 使用固定公网 IP 地址线路接入
Network > Interfaces > Edit (对于 Untrust Interface)
Zone Name: Untrust
Static IP: IP Address/Netmask: 222.66.93.18/29
Interface Mode: Routeb) 使用 ADSL线路接入
Network > PPPoE > Edit
PPPoE Instance: ADSL_profile
选择 enable
Bound to Interface: untrust
Username: xxxxxxxxxx
Password: xxxxxxxxx
更具用户情况可选择 Auto-Connect 或 Idle Disconnect
Network > Interfaces > Edit (对于 Untrust Interface)
Zone Name: Untrust
选择 Obtain IP using PPPoE,选择相应的 Profile
Interface Mode: Route
c) 使用有线通线路接入 Network > Interfaces > Edit (对于 Untrust Interface)
Zone Name: Untrust
选择 Obtain IP using DHCP,选择Automatic update DHCP server parameters
Interface Mode: Route
2. 设置路由
只有对于使用固定 IP 地址线路接入方式,才需要设置默认路由。其他两种接入方式,防火
墙会自动添加默认路由的。
选择 trust-vr,New
Network > Routing > Routing Entries > Configuration
IP Address/Netmask: 0.0.0.0/0.0.0.0
选择 Gageway,Interface选择 Untrust,Gateway IP Address填写 222.66.93.17
3. 设置规则表达式和表达式组
Objects > Attacks > Custom,点击 New,新建一个表达式组
Attack Name: CS:forbid_MSN
Attack Context: MSN Screen and Login Name (选择)
Attack Severity: info
Attack Pattern: .*@.*
Objects > Attacks > Group,点击 New,新建一个表达式组 Group Name: CS:forbid_group
使用>>或<<选择添加用户
4. 设置策略
5GT 中默认有一条 From Trust To Untrust,原地址为 ANY,目标地址为 ANY,服务为
ANY 的允许策略。其他型号均没有,需要手动添加。建议原地址为内网网段。
如果是 Netscreen 25或更高端的型号 选择 From Trust To Untrust,New新建一条
Source Address选择 New Address,填写 192.168.1.0/24
Destination Address选择 Address Book Entry,再选择 ANY
Service选择 ANY
Action 选择Permit
选择 Logging
选择 Position at Top
选择 From Trust To Untrust,New新建一条
Source Address选择 New Address,填写 192.168.1.0/24
Destination Address选择 Address Book Entry,再选择 ANY
Service选择 ANY
Action 选择Permit
选择 Deep Inspection
在出现的对话框中
Group: forbid_group
Action: Drop
点击 Add 按钮添加,然后关闭退出。
选择 Logging
选择 Position at Top
添加好策略以后,显示如下: 
OK退出
照这样设置, MSN Messenger就不能再登陆了,如果防火墙检测到有人试图登录MSN
Messenger,alarm 灯会亮起(ns5gt 除外),并在 alarm 日志中留下记录。可以通过在
命令行中输入 clear led alarm来关闭 alarm灯。
在这个测试中所用环境是 Netscreen 5gt, ScreenOS 为 5.3.0r3.0, windows xp pro
sp2,msn messenger 7.5和 8.0。