华为路由器firewall
概述
- 防火墙(Firewall)是一种隔离技术,使内网和外网分开,可以防止外部网络用户以非法手段通过外部网络进入内部网络,保护内网免受外部非法用户的侵入。
- 华为路由器提供防火墙功能,将设备的物理接口划分到不同的安全区域,每个区域可以设置优先级,不同优先级拥有不同安全特性,可以控制跨域规则实现流量控制;
安全区域:
- trust:受信任区,内网主机与设备存在于该区域,优先级较高;
- dmz:非军事化管理区(隔离区),存在被攻击可能性的主机与设备存在于该区域,优先级介于trust与untrust之间;
- untrust:非信任区,外网主机与设备存在于该区域,优先级较低;
- local:当前设备,优先级默认最高;
入栈与出栈:
- 入栈:低优先级访问高优先级;
- 出栈:高优先级访问低优先级;
命令
查看区域信息
dis firewall zone
查看区域间信息
dis firewall interzone
创建防火墙区域
firewall zone 区域名称
设置区域优先级
priority 值
将物理接口添加到安全区域
int g编号
zone 区域名称
启用各区域之间防火墙
firewall interzone 区域名称1 区域名称2
firewall enable
创建ACL规则,实现流量控制
packet-filter acl编号 inbound|outbound
配置ASPF,实现双向放行
detect aspf 协议名称
案例

AR1:
sys
int g0/0/0
ip add 192.168.20.254 24
int g0/0/1
ip add 192.168.10.254 24
int g0/0/2
ip add 22.33.44.55 24
q
firewall zone trust
priority 14
q
firewall zone dmz
priority 7
q
firewall zone untrust
priority 1
q
int g0/0/0
zone dmz
int g0/0/1
zone trust
int g0/0/2
zone untrust
q
firewall interzone trust dmz
firewall enable
q
firewall interzone trust untrust
firewall enable
q
firewall interzone untrust dmz
firewall enable
q
#实现Server1能访问trust区域
acl 2000
rule permit source 192.168.20.1 0
q
firewall interzone trust dmz
packet-filter 2000 inbound
q
#实现22.33.44.0网段主机能访问HTTP服务器
acl 3001
rule permit tcp source 22.33.44.0 0.0.0.255 destination 192.168.20.1 0.0.0.0 destination-port eq 80
q
firewall interzone dmz untrust
packet-filter 3001 inbound
q
#实现22.33.44.0网段主机能访问FTP服务器
acl 3001
rule permit tcp source 22.33.44.0 0.0.0.255 destination 192.168.20.2 0.0.0.0 destination-port eq 21
q
firewall interzone dmz untrust
packet-filter 3001 inbound
detect aspf ftp