华为CLI实验-配置旁路检测时的安全策略

CLI举例:配置旁路检测时的安全策略

举例说明当FW作为旁路检测设备时,如何配置安全策略。

组网需求

图1所示,企业内网通过路由器Router连接到Internet。FW作为旁路检测设备,对通过Router的流量进行内容安全检测。

图1 旁路检测组网图

配置思路
  1. FW作为旁路检测设备时,需要将检测接口GE1/0/1设置为二层接口,并将检测接口与交换机相连。交换机通过镜像将流量上送到FW上检测。
  2. 在检测接口上配置旁路检测功能,使FW只检测而不转发流量。
  3. 配置安全策略,引用需要的安全配置文件,对流量进行对应的内容安全检测。
    • FW只有一个接口接收镜像流量或者多个接口接收镜像流量但针对各个接口接收的流量配置相同的安全策略时,可以将接口加入任何安全区域,将安全策略的源安全区域和目的安全区域配置成any。
    • FW有多个接口接收镜像流量,且要针对各个接口接收的流量配置不同的安全策略时,需要将接口加入不同的安全区域,将安全策略的源安全区域和目的安全区域配置成检测接口所在的安全区域。
操作步骤
  1. 配置接口和安全区域,完成网络基本参数配置。

    javascript 复制代码
    对于带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. 配置旁路检测时的安全策略。

    javascript 复制代码
    [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] action permit
    [FW-policy-security-rule-policy_sec_bypass_detection] profile av default
    [FW-policy-security-rule-policy_sec_bypass_detection] profile ips default
    [FW-policy-security-rule-policy_sec_bypass_detection] policy logging

    本举例的内容安全检测选择了反病毒和入侵防御的缺省配置文件,您可以根据实际需求,配置和选择其他多种安全配置文件。

配置脚本
javascript 复制代码
#
vlan batch 10
#                                                                               
interface GigabitEthernet1/0/1                                                  
 portswitch                                                                     
 undo shutdown                                                                  
 port link-type trunk                                                           
 port trunk allow-pass vlan 10                                       
 detect-mode tap                                                                
#                                                                               
firewall zone untrust                                                           
 set priority 5                                                                 
 add interface GigabitEthernet1/0/1                                             
#                                                                               
security-policy                                                                 
 rule name policy_sec_bypass_detection                                          
  policy logging
  source-zone untrust                                                           
  destination-zone untrust                                                      
  profile av default                                                            
  profile ips default                                                           
  action permit     
相关推荐
碳基沙盒1 天前
OpenClaw 多 Agent 配置实战指南
运维
BingoGo1 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php
JaguarJack1 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php·服务端
BingoGo2 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php
JaguarJack2 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php·服务端
JaguarJack3 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
后端·php·服务端
BingoGo3 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
php
蝎子莱莱爱打怪4 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
JaguarJack4 天前
告别 Laravel 缓慢的 Blade!Livewire Blaze 来了,为你的 Laravel 性能提速
后端·php·laravel
郑州光合科技余经理5 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php