![防火墙和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=1738936145-2LdW7fchT3GQLlJX22rGS9hWiTLqM5Rn-0-2e4c311308d098e0a9703b9342118ea5)
图1-2 安全策略的配置示例
表1-1 安全策略示例
![](https://epubservercos.yuewen.com/5EBB68/26678037701716706/epubprivate/OEBPS/Images/028-2.jpg?sign=1738936145-Fbl19Dm3JFmV1zPzvQVIQGfPr8PMcfQ5-0-d04c8cdb4538413f1a216eea058685c6)
使用Web界面配置安全策略如图1-3所示。
![](https://epubservercos.yuewen.com/5EBB68/26678037701716706/epubprivate/OEBPS/Images/029-1.jpg?sign=1738936145-uwmIsXp7CG7Thds5Mmkrguqi7JazzPCf-0-b98deaccf853ce8727f82d85997948a4)
图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]