- 防火墻和VPN技術與實踐
- 李學昭主編
- 254字
- 2023-07-13 15:21:39
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]