
上QQ阅读APP看书,第一时间看更新
1.1.2 安全策略的配置方式
华为防火墙提供了多种配置方式,用户可以选择命令行、Web界面或者北向接口来配置安全策略。接下来,本书将以一个实例来展示最常用的Web界面和命令行配置。
如图1-2所示,为了保证trust区域内的192.168.1.0/24和192.168.2.0/24网段的设备能够正常上网,需要创建一条表1-1所示的安全策略。

图1-2 安全策略的配置示例
表1-1 安全策略示例

使用Web界面配置安全策略如图1-3所示。

图1-3 配置安全策略的界面
使用命令行配置安全策略如下。
<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]