目录
举例说明当FW作为旁路检测设备时,如何通过配置发送干扰报文(Reset报文),对流量进行干扰。
组网需求
如图1所示,企业内网通过路由器连接到Internet。FW作为旁路检测设备,接收交换机镜像的流量并进行检测,对Internet中指定客户端和企业内网中指定服务器之间的流量进行干扰。在FW上配置发送Reset报文,路由器收到该Reset报文后,再向客户端或服务器发送该Reset报文,断开客户端和服务器之间的连接,从而达到阻断流量的目的。
Reset报文可以通过指定接口发送,如果未指定接口,Reset报文按原路返回。本示例将配置从指定接口发送Reset报文。
配置思路
- FW作为旁路检测设备时,需要将检测接口GE1/0/1设置为二层接口,并在检测接口上配置旁路检测功能。
- 配置发送Reset报文的接口GE1/0/2。
- 配置安全策略,将安全策略的动作设置为阻断,并配置向客户端和服务器发送Reset报文。
操作步骤
- 配置检测接口GE1/0/1为二层接口,并配置旁路检测功能。
对于带VLAN Tag的流量,除了要在二层接口执行命令行port trunk allow-pass vlan,还需要在FW上创建对应的VLAN。
<FW> system-view [FW] vlan 10 [FW-vlan10] quit [FW] interface GigabitEthernet 1/0/1 [FW-GigabitEthernet1/0/1] portswitch [FW-GigabitEthernet1/0/1] port link-type trunk [FW-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 [FW-GigabitEthernet1/0/1] detect-mode tap [FW-GigabitEthernet1/0/1] quit [FW] firewall zone untrust [FW-zone-untrust] add interface GigabitEthernet 1/0/1 [FW-zone-untrust] quit
- 配置发送Reset报文的接口GigabitEthernet1/0/2。
[FW] interface GigabitEthernet 1/0/2 [FW-GigabitEthernet1/0/2] ip address 10.2.0.1 24 [FW-GigabitEthernet1/0/2] quit [FW] firewall zone untrust [FW-zone-untrust] add interface GigabitEthernet 1/0/2 [FW-zone-untrust] quit [FW] ids-response interface GigabitEthernet 1/0/2 destination-mac aaaa-4567-dddd
- 配置安全策略。
在旁路检测设备FW上配置安全策略时,需要将源安全区域和目的安全区域配置成any,或者配置成检测接口所在的安全区域。
[FW] security-policy [FW-policy-security] rule name policy_sec_bypass_detection [FW-policy-security-rule-policy_sec_bypass_detection] source-zone untrust [FW-policy-security-rule-policy_sec_bypass_detection] destination-zone untrust [FW-policy-security-rule-policy_sec_bypass_detection] source-address 1.1.1.0 24 [FW-policy-security-rule-policy_sec_bypass_detection] destination-address 10.4.0.1 24 [FW-policy-security-rule-policy_sec_bypass_detection] action deny [FW-policy-security-rule-policy_sec_bypass_detection] send-deny-packet reset to-client to-server [FW-policy-security-rule-policy_sec_bypass_detection] policy logging [FW-policy-security-rule-policy_sec_bypass_detection] quit
结果验证
- 通过日志服务器,查看是否存在日志POLICY/6/POLICYDENY。如果存在该日志,则流量命中了动作为阻断的安全策略,说明FW已经从GE1/0/2接口发送了Reset报文。
配置脚本
#
vlan batch 10
#
interface GigabitEthernet1/0/1
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 10
detect-mode tap
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 10.2.0.1 255.255.255.0
#
firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/1
add interface GigabitEthernet1/0/2
#
security-policy
rule name policy_sec_bypass_detection
policy logging
source-zone untrust
destination-zone untrust
source-address 1.1.1.0 mask 255.255.255.0
destination-address 10.4.0.0 mask 255.255.255.0
send-deny-packet reset to-client to-server
action deny
#
ids-response interface GigabitEthernet1/0/2 destination-mac aaaa-4567-dddd