![防火墙和VPN技术与实践](https://wfqqreader-1252317822.image.myqcloud.com/cover/284/47303284/b_47303284.jpg)
上QQ阅读APP看书,第一时间看更新
1.1.2 安全策略的配置方式
华为防火墙提供了多种配置方式,用户可以选择命令行、Web界面或者北向接口来配置安全策略。接下来,本书将以一个实例来展示最常用的Web界面和命令行配置。
如图1-2所示,为了保证trust区域内的192.168.1.0/24和192.168.2.0/24网段的设备能够正常上网,需要创建一条表1-1所示的安全策略。
![](https://epubservercos.yuewen.com/5EBB68/26678037701716706/epubprivate/OEBPS/Images/028-1.jpg?sign=1739186173-2xeWrlvaGqlZAmddy79B5EKhUWbhcj8N-0-43b1f2c28a3f23f6e9f6c48c2dbe4e9b)
图1-2 安全策略的配置示例
表1-1 安全策略示例
![](https://epubservercos.yuewen.com/5EBB68/26678037701716706/epubprivate/OEBPS/Images/028-2.jpg?sign=1739186173-ywHNbZoQvf9NWQvHJvkwub5Lu3iLkq71-0-df9cf7896fe53a5ac56dc9fc67cd6bf8)
使用Web界面配置安全策略如图1-3所示。
![](https://epubservercos.yuewen.com/5EBB68/26678037701716706/epubprivate/OEBPS/Images/029-1.jpg?sign=1739186173-mS8sUskVEE6NJusnTzOKG0C8fIoFjmOq-0-db54f975f9c19f241e453103b535154c)
图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]