CLI举例:配置旁路检测时通过发送Reset报文干扰流量

发布于:2024-04-29 ⋅ 阅读:(29) ⋅ 点赞:(0)

CLI举例:配置旁路检测时通过发送Reset报文干扰流量

举例说明当FW作为旁路检测设备时,如何通过配置发送干扰报文(Reset报文),对流量进行干扰。

组网需求

图1所示,企业内网通过路由器连接到Internet。FW作为旁路检测设备,接收交换机镜像的流量并进行检测,对Internet中指定客户端和企业内网中指定服务器之间的流量进行干扰。在FW上配置发送Reset报文,路由器收到该Reset报文后,再向客户端或服务器发送该Reset报文,断开客户端和服务器之间的连接,从而达到阻断流量的目的。

Reset报文可以通过指定接口发送,如果未指定接口,Reset报文按原路返回。本示例将配置从指定接口发送Reset报文。

图1 配置旁路检测时通过发送Reset报文干扰流量组网图
 

配置思路
  1. FW作为旁路检测设备时,需要将检测接口GE1/0/1设置为二层接口,并在检测接口上配置旁路检测功能。
  2. 配置发送Reset报文的接口GE1/0/2。
  3. 配置安全策略,将安全策略的动作设置为阻断,并配置向客户端和服务器发送Reset报文。

操作步骤
  1. 配置检测接口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

  2. 配置发送Reset报文的接口GigabitEthernet1/0/2。

    • 如果指定的干扰报文发送接口的对端接口工作在二层,则只需指定干扰报文的出接口;无需指定下一跳MAC地址。

    • 如果指定的干扰报文发送接口的对端接口工作在三层,则需要指定干扰报文的出接口和下一跳MAC地址,其中下一跳MAC地址为指定的干扰报文发送接口的对端接口的MAC地址。

    [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

  3. 配置安全策略。

    在旁路检测设备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

结果验证
  1. 通过日志服务器,查看是否存在日志POLICY/6/POLICYDENY。如果存在该日志,则流量命中了动作为阻断的安全策略,说明FW已经从GE1/0/2接口发送了Reset报文。
  2. Internet中指定客户端1.1.1.0无法访问企业内网中指定服务器10.4.0.1。

配置脚本
#
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


网站公告

今日签到

点亮在社区的每一天
去签到