安全策略的配置方式
华为防火墙提供了多种配置方式,你可以选择命令行、Web界面或者北向接口(RESTCONF和NETCONF)来配置安全策略。接下来,我们将以一个实例来展示最常用的Web界面和命令行配置。
例如:为了允许Trust安全区域内的、192.168.1.0/24和192.168.2.0/24网段的设备能够正常上网,需要创建一条表2-1所示的安全策略。
序号 |
名称 |
源安全区域 |
目的安全区域 |
源地址/地区 |
目的地址/地区 |
用户 |
服务 |
动作 |
---|---|---|---|---|---|---|---|---|
101 |
Allow access to the Internet |
trust |
untrust |
192.168.1.0/24 192.168.2.0/24 |
any |
any |
http https |
permit |
使用Web界面配置如下:
使用命令行配置如下:
<sysname> system-view [sysname] security-policy [sysname-policy-security] rule name "Allow access to the Internet" [sysname-policy-security-rule-Allow access to the Internet] source-zone trust [sysname-policy-security-rule-Allow access to the Internet] destination-zone untrust [sysname-policy-security-rule-Allow access to the Internet] source-address 192.168.1.0 mask 24 [sysname-policy-security-rule-Allow access to the Internet] source-address 192.168.2.0 mask 24 [sysname-policy-security-rule-Allow access to the Internet] service http https [sysname-policy-security-rule-Allow access to the Internet] action permit [sysname-policy-security-rule-Allow access to the Internet] quit [sysname-policy-security]