华为防火墙:防火墙的介绍及基本配置

实验拓扑

华为防火墙:防火墙的介绍及基本配置_第1张图片

防火墙的工作模式

  • 透明网桥模式:可以理解成二层交换机,对三层的IP、路由没有任何影响。透明模式仍然可以抵御外部入侵,但是不能发挥防火墙的全部功能
    例如下图:前期IP地址都已经规划好了,组网都已经结束了。突然领导说要加个防火墙,那基本就用透明模式。
    华为防火墙:防火墙的介绍及基本配置_第2张图片
  • 路由模式:可以理解成三层路由器

防火墙的区域(zone)

防火墙默认区域的介绍
优先级代表着可信程度,优先级越高表示越信任,即数字越大越信任

[SRG]dis zone 
22:15:49  2020/11/18
local  #本地区域
 priority is 100  #默认优先级100
 
#
trust #内网用户
 priority is 85   #默认优先级85
 interface of the zone is (1):
    GigabitEthernet0/0/0
    
#
untrust #外网用户
 priority is 5  #默认优先级5
 interface of the zone is (0):
 
#
dmz  #dmz区域
 priority is 50   #默认优先级50
 interface of the zone is (0):
#

接下来我们按照拓扑把防火墙的端口划分到相应的区域。

[SRG]firewall zone ?
  dmz           Indicate the DMZ
  local         Indicate the Local zone
  name          Indicate the security zone name
  trust         Indicate the Trust zone
  untrust       Indicate the Untrust zone
  -instance  Indicate VPN instance 

[SRG]firewall zone trust 
[SRG-zone-trust]add interface g0/0/1
[SRG-zone-trust]q

[SRG]firewall zone dmz	
[SRG-zone-dmz]add int g0/0/3
[SRG-zone-dmz]q

[SRG]firewall zone untrust 
[SRG-zone-untrust]add interface g0/0/2
[SRG-zone-untrust]q

接口只有划分了区域才可以使用。
这样做完之后,只有trust区域才能访问防火墙。内网也不能访问外网。

[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R2]ip route-static 0.0.0.0 0 23.1.1.1  
#这里应该用nat地址转换的,但我们还没有接触到防火墙nat转换,所以先用静态路由代替,本篇后面会讲到。
[SRG]ip route-static 0.0.0.0 0 23.1.1.2       #到外网的路由
[SRG]ip route-static 192.168.1.0 24 12.1.1.1  #到内网的路由

虽然我们加入了2条路由,但是由于还没有配置策略,所以内网用户还是不能访问外网。

防火墙策略概念

防火墙策略的方向

  • outbound:高优先级访问低优先级
  • inbound:低优先级访问高优先级
    注意:“访问”仅指的是出包即主动发起的第一个报文,即建立会话(session)的过程。

默认高优先级可以访问低优先级,但是低优先级无法回包,相当于回执路由回不来。所以无法ping通。但是我的确是访问了,防火墙就会记录这一条信息。
华为防火墙:防火墙的介绍及基本配置_第3张图片

防火墙默认可以访问任何一个区域

<SRG>ping 192.168.254.2
23:02:06  2020/11/18
  PING 192.168.254.2: 56  data bytes, press CTRL_C to break
    Reply from 192.168.254.2: bytes=56 Sequence=1 ttl=255 time=220 ms
    Reply from 192.168.254.2: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 192.168.254.2: bytes=56 Sequence=3 ttl=255 time=170 ms
    Reply from 192.168.254.2: bytes=56 Sequence=4 ttl=255 time=100 ms
    Reply from 192.168.254.2: bytes=56 Sequence=5 ttl=255 time=

你可能感兴趣的:(HCIE,华为,网络)