玖叶教程网

前端编程开发入门

提高网络安全性:防火墙与二层组网结构的区域划分策略

在企业网络和家庭网络中,我们时刻都面临着日益复杂和隐蔽的网络威胁。为了保护网络免受恶意入侵和数据泄露的威胁,建立有效的网络安全防护措施至关重要。防火墙作为网络安全的第一道防线,在网络架构中发挥着重要作用。

在二层组网结构中,防火墙通过物理和逻辑的划分将网络划分为不同的区域,从而提高网络的可管理性和性能。在这样的架构下,合理的区域划分策略可以增强防火墙的效果,帮助企业和个人建立起一道坚固的网络安全防线。

本文将重点探讨防火墙二层组网结构的区域划分策略,以提高网络安全性,本文整理了防火墙和二层设备的相关配置,能够使友友们,对于相关设备有一个初步的了解,有需要的友友们可以参考下。

网络拓扑:

网络设备:

交换机 :S5700 1台

防火墙:USG6000V 1台

PC主机:2台

简要流程

上述拓扑在工作中非常常见,防火墙通常被用作三层交换机,配置多个VLANIF网关,并将其连接到二层交换机的Trunk口。下面的二层交换机将终端连接到相应的VLAN中。在常见的配置中,只需要正确配置VLAN、VLANIF和接口模式即可。然而,在防火墙中,接口必须加入安全区域,而拓扑中提到有三个接口,即VLANIF2、VLANIF3和物理接口G1/0/1【与二曾交换相连接的接口】。那么我们如何划分它们并将其加入安全区域呢?

对于VLANIF接口来说比较容易判断,不同的VLANIF代表一个区域,只需要将它们分别规划到相应的区域即可。主要的问题是物理接口G1/0/1,是否需要加入安全区域,以及如何加入?

对于物理接口G1/0/1,我们可以按照以下步骤将其加入安全区域:

1、首先,确定防火墙上已经创建好了相应的安全区域。如果没有,请创建所需的安全区域。

2、在防火墙配置中,找到物理接口G1/0/1的配置部分。

3、将物理接口G1/0/1配置为Trunk口,以便与二层交换机连接,并启用所需的VLAN。

4、确定要将物理接口G1/0/1连接的终端所属的VLAN。

5、将物理接口G1/0/1划入与该VLAN相对应的安全区域。

通过以上步骤,你可以将物理接口G1/0/1划入适当的安全区域,以便与防火墙上的其他接口进行正确的通信和安全管理。

具体配置过程如下:

防火墙基础配置:

Username:admin
Password:
*************************************************************************
*         Copyright (C) 2014-2018 Huawei Technologies Co., Ltd.         *
*                           All rights reserved.                        *
*               Without the owner's prior written consent,              *
*        no decompiling or reverse-engineering shall be allowed.        *
*************************************************************************


<USG6000V1>
<USG6000V1>
<USG6000V1>sys
Enter system view, return user view with Ctrl+Z.
[USG6000V1]undo inf	
[USG6000V1]undo info-center en	
[USG6000V1]undo info-center enable 
Info: Saving log files...
Info: Information center is disabled.
[USG6000V1]
[USG6000V1]
#创建两个vlan 
[USG6000V1]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[USG6000V1]
#开启dhcp功能
[USG6000V1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[USG6000V1]
#给vlan 配置ip地址,作为各个vlan的网关地址
[USG6000V1]interface Vlanif 2
[USG6000V1-Vlanif2]ip address 192.168.11.254 255.255.255.0
[USG6000V1-Vlanif2]dhcp select interface 
[USG6000V1-Vlanif2]dhcp server ip-range 192.168.11.2 192.168.11.250
[USG6000V1-Vlanif2]
[USG6000V1-Vlanif2]dhcp server dns-list 223.5.5.5 114.114.114.114
[USG6000V1-Vlanif2]dhcp server gateway-list 192.168.11.254
[USG6000V1-Vlanif2]q
[USG6000V1]

[USG6000V1]interface Vlanif 3
[USG6000V1-Vlanif3]ip address 192.168.12.254 255.255.255.0
[USG6000V1-Vlanif3]dhcp select interface 
[USG6000V1-Vlanif3]dhcp server ip-range 192.168.12.2 192.168.12.250
[USG6000V1-Vlanif3]dhcp server dns-list 223.5.5.5 114.114.114.114
[USG6000V1-Vlanif3]dhcp server gateway-list 192.168.12.254
[USG6000V1-Vlanif3]q
[USG6000V1]

#配置出接口获取ip方式为dhcp,
[USG6000V1]interface GigabitEthernet 1/0/0
[USG6000V1-GigabitEthernet1/0/0]undo shutdown 
Info: Interface GigabitEthernet1/0/0 is not shutdown.
[USG6000V1-GigabitEthernet1/0/0]
[USG6000V1-GigabitEthernet1/0/0]ip address dhcp-alloc 
[USG6000V1-GigabitEthernet1/0/0]q
[USG6000V1]
[USG6000V1]
#配置防火墙与二层交换机接口都trunk模式

[USG6000V1]interface GigabitEthernet 1/0/1
[USG6000V1-GigabitEthernet1/0/1]portswitch ?
  <cr>  

[USG6000V1-GigabitEthernet1/0/1]portswitch //用来配置将以太网接口从三层模式切换到二层模式。
[USG6000V1-GigabitEthernet1/0/1]undo shutdown 
Info: Interface GigabitEthernet1/0/1 is not shutdown.
[USG6000V1-GigabitEthernet1/0/1]port link-type trunk
[USG6000V1-GigabitEthernet1/0/1]port trunk allow-pass vlan 2 to 3
[USG6000V1-GigabitEthernet1/0/1]
[USG6000V1-GigabitEthernet1/0/1]q
[USG6000V1]
[USG6000V1]

#为"untrust"的防火墙区域进行配置
[USG6000V1]firewall zone untrust 
[USG6000V1-zone-untrust]set priority 5 //注意,系统预设的优先级不允许更改,如果更改会有报错提示
[USG6000V1-zone-untrust]add interface GigabitEthernet 1/0/0

二层交换机配置:

<Huawei>
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center en
Info: Information center is disabled.
[Huawei]
[Huawei]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]
[Huawei]interface GigabitEthernet 0/0/24
[Huawei-GigabitEthernet0/0/24]port link-type trunk 
[Huawei-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 3
[Huawei-GigabitEthernet0/0/24]
[Huawei-GigabitEthernet0/0/24]q
[Huawei]	
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access 
[Huawei-GigabitEthernet0/0/1]port default vlan 2
[Huawei-GigabitEthernet0/0/1]stp edged-port enable 
[Huawei-GigabitEthernet0/0/1]
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int	
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access 
[Huawei-GigabitEthernet0/0/2]port default vlan 3
[Huawei-GigabitEthernet0/0/2]stp edged-port enable 
[Huawei-GigabitEthernet0/0/2]q
[Huawei]
[Huawei]dis ip int br
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           unassigned           up         down      
[Huawei]
[Huawei]

在防火墙上建立安全区域:

[USG6000V1]firewall zone name area1
[USG6000V1-zone-area1]
[USG6000V1-zone-area1]add interface Vlanif 2
[USG6000V1-zone-area1]
[USG6000V1-zone-area1]dis th
2023-05-26 09:02:06.130 
#
firewall zone name area1 id 6
 add interface Vlanif2
#
return
[USG6000V1-zone-area1]
[USG6000V1-zone-area1]qu
[USG6000V1]
[USG6000V1]firewall zone name area2
[USG6000V1-zone-area2]add interface Vlanif 3
[USG6000V1-zone-area2]
[USG6000V1-zone-area2]dis th
2023-05-26 09:02:48.010 
#
firewall zone name area2 id 5
 add interface Vlanif3
#
return
[USG6000V1-zone-area2]q
[USG6000V1]
[USG6000V1]

测试:

测试结果为:PC1与网关192.168.11.254 不通;PC2与网关192.168.12.254 不通。

那么如何处理呢?

其实这个问题,就是我们忽略的一个问题,就是防火墙没有开启接口的管理允许功能

我们进入防火墙,开启接口管理功能:

[USG6000V1]	
[USG6000V1]interface Vlan 2
[USG6000V1-Vlanif2]service-manage ping permit 
[USG6000V1-Vlanif2]quit
[USG6000V1]int vlan 3
[USG6000V1-Vlanif3]service-manage ping permit 
[USG6000V1-Vlanif3]q
[USG6000V1]

开启后,在进行测试,已经通了。


对于新建的区域设置安全级别:

[USG6000V1]security-policy 
[USG6000V1-policy-security]default action permit	
Warning:Setting the default packet filtering to permit poses security risks. You
 are advised to configure the security policy based on the actual data flows. Ar
e you sure you want to continue?[Y/N]y
[USG6000V1-policy-security]

至此:本实验完成,有需要的友友们,可以参考下。

注意:

由于本实验是在公司录制,声音部分没有加载,但是并不影响观看,如有问题,请在评论区留言!

写在最后:

自我设限,固步自封,唯有突破极限,才能发掘潜能。以上就是本期整理的《提高网络安全性:防火墙与二层组网结构的区域划分策略》,自己经历过的风雨,所以知道你也会坚强。你的【点赞】+【关注】,我会自动解读为认可。


作者简介:

我是“网络系统技艺者”,系统运维工程师一枚,持续分享【网络技术+系统运维技术】干货。码字不易,如果您觉得文章还可以,就收藏吧,也许在以后某个时间能够用得到。

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言