华为防火墙(usg5500)区域间实验

以下通过防火墙的不同区域间的策略来了解防火墙的工作原理,

路由器和防火墙之间最大的不同之处就是防火墙接口下是有区域的,而路由器接口之间是平价的,防火墙根据不同的区域分配不同的安全等级实现隔离控制。

实验拓扑图

 由于防火墙下的PC为直连,所以这里不做路由。

需求:

1.内网(trust)可以访问外网(untrust)

2.内网(trust)可以访问服务器(dmz)

3.外网(untrust)可以访问服务器(dmz)

开机之后我们查看以下华为防火墙USG5500的缺省区域

分配地址

[SRG]interface GigabitEthernet 0/0/1
[SRG-GigabitEthernet0/0/1]ip address 144.144.144.254 24
[SRG-GigabitEthernet0/0/1]int gi0/0/0
[SRG-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[SRG-GigabitEthernet0/0/0]int gi0/0/2
[SRG-GigabitEthernet0/0/2]ip ad 8.8.8.254 24

然后PC之间指定网关

 接口分配区域

[SRG]firewall zone trust 
[SRG-zone-trust]add interface GigabitEthernet 0/0/0
[SRG-zone-trust]q
[SRG]firewall zone dmz 
[SRG-zone-dmz]add interface GigabitEthernet 0/0/1
[SRG-zone-dmz]q
[SRG]firewall zone untrust 
[SRG-zone-untrust]add  interface GigabitEthernet 0/0/2
[SRG-zone-untrust]q

把接口分配到不同的区域

区域间策略

根据区域间流量走向下发策略

区域间流量走向

 等级高到低为出(outbound),低到高为入(Inbound)。

配置

要求1:内网(trust)可以访问外网(untrust)

分析:等级从高到低,为出方向(outbound)。

[SRG]policy interzone trust untrust outbound                    #出方向
[SRG-policy-interzone-trust-untrust-outbound]policy 1    
[SRG-policy-interzone-trust-untrust-outbound-1]description 192.168.1.0 0.0.0.255  #反掩码
[SRG-policy-interzone-trust-untrust-outbound-1]action permit    #动作

验证

 满足要求1。

要求2:内网(trust)可以访问服务器(dmz)

分析:等级从高到低,为出方向(outbound)。

[SRG]policy interzone trust dmz outbound 
[SRG-policy-interzone-trust-dmz-outbound]policy 1
[SRG-policy-interzone-trust-dmz-outbound-1]description 192.168.1.0 0.0.0.255
[SRG-policy-interzone-trust-dmz-outbound-1]action permit 

验证

 满足要求2。

要求3:外网(untrust)可以访问服务器(dmz)

分析:等级从低到高,流量方向为入方向(Inbound)。

[SRG]policy interzone dmz untrust inbound 
[SRG-policy-interzone-dmz-untrust-inbound]policy 1
[SRG-policy-interzone-dmz-untrust-inbound-1]description 8.8.8.0 0.0.0.255	
[SRG-policy-interzone-dmz-untrust-inbound-1]action permit 

验证

满足要求3。

 扩展

我们知道防火墙不同区域之间默认是不通,思科防火墙同一区域默认不通的,我验证一下华为的防火墙是不是也是这样的。

首先我把PC1和PC3放进同一区域

 配置

[SRG]firewall zone trust 
[SRG-zone-trust]undo add interface GigabitEthernet 0/0/0
[SRG-zone-trust]q	
[SRG]firewall zone untrust 
[SRG-zone-untrust]add interface GigabitEthernet 0/0/0
[SRG-zone-untrust]display this 
13:31:02  2022/05/07
#
firewall zone untrust
 set priority 5
 add interface GigabitEthernet0/0/0      #可以看到两个接口已在同一区域
 add interface GigabitEthernet0/0/2
#
return

然后PC1 ping PC3

 PC3 ping PC1

我们看到,华为防火墙同区域间是互通。

华为防火墙总结 

高等级区域-->低等级        默认放行

低等级区域-->高等级        默认禁止

同等级之间                       默认放行

猜你喜欢

转载自blog.csdn.net/weixin_54223979/article/details/124628824
今日推荐