【华为】网工必会:防火墙的实验配置

一、实验目的

  1. 熟悉防火墙的应用场景
  2. 掌握防火墙的配置方法

想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!

二、 实验拓扑

实验拓扑如图所示:

【技术要点】

某公司网络使用防火墙作为出口路由器,要求将公网设置为untrust区域,对外http服务器所在区域设置为dmz区域,内网的其他pc所在区域设置为trust区域。最终实现外网设备client1能够通过nat server访问server1,内网PC1能够通过nat访问公网ISP。

三、实验步骤

1登录防火墙(防火墙使用usg6000v,登录的默认账户为admin、密码为Admin@123,登录后需要修改密码)

Username:admin

Password: Admin@123

The password needs to be changed. Change now? [Y/N]: y

Please enter old password: Admin@123

Please enter new password: Huawei@123

Please confirm new password: Huawei@123

 Info: Your password has been changed. Save the change to survive a reboot.

*************************************************************************

*         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>

2.配置防火墙和路由器的接口ip地址

FW1的配置

[USG6000V1]sysname FW1

[FW1]interface  g1/0/2

[FW1-GigabitEthernet1/0/2]ip address 172.16.2.1 24

[FW1]interface  g1/0/0

[FW1-GigabitEthernet1/0/0]ip address 172.16.2.1 24

[FW1]interface  g1/0/1

[FW1-GigabitEthernet1/0/1]ip address  200.1.1.1 24

ISP的配置

[Huawei]sysname ISP

[ISP]interface  g0/0/0

[ISP-GigabitEthernet0/0/0]ip address  200.1.1.2 24

[ISP]interface  g0/0/1

[ISP-GigabitEthernet0/0/1]ip address  100.1.1.1 24

3.将对应的接口后的网络划分到防火墙的安全区域

[FW1]firewall zone  trust //进入trust区域视图

[FW1-zone-trust]add interface g1/0/2 //将G1/0/2接口划分到trust区域

[FW1]firewall zone  untrust //进入untrust区域视图

[FW1-zone-untrust]add interface g1/0/1//将G1/0/1接口划分到untrust区域

[FW1]firewall zone dmz //进入dmz区域视图

[FW1-zone-dmz]add  interface  g1/0/0 //将G1/0/0接口划分到dmz区域

4.配置默认路由指向ISP

[FW1]ip route-static 0.0.0.0 0.0.0.0 200.1.1.2

5.配置nat、nat server以及防火墙区域间策略

1).配置nat,让pc1能够访问isp网络

[FW1]nat-policy //进入nat策略视图

[FW1-policy-nat]rule name 1 //创建nat策略,命名为1

[FW1-policy-nat-rule-1]source-zone trust //源安全区域为trust

[FW1-policy-nat-rule-1]destination-zone untrust //目标安全区域为untrust

[FW1-policy-nat-rule-1]source-address 172.16.2.0 24  //定义源ip地址为172.16.2.0/24

[FW1-policy-nat-rule-1]action  source-nat easy-ip //匹配以上调整则执行esay-ip动作

2).配置PC访问isp网络的防火墙区域间策略

[FW1]security-policy   //进入安全策略视图模式

[FW1-policy-security]rule name trusttountrust //策略名字为trusttountrust

[FW1-policy-security-rule-trusttountrust]source-zone trust //源安全区域为trust

[FW1-policy-security-rule-trusttountrust]destination-zone untrust //目标安全区域为untrust

[FW1-policy-security-rule-trusttountrust]source-address 172.16.2.0 24 //定义源ip地址为172.16.2.0/24

[FW1-policy-security-rule-trusttountrust]action permit //执行动作为允许

3)测试PC1是否能够访问ISP

PC1的配置如图所示:

4)查看防火墙的会话表项

[FW1]display  firewall session table  verbose

2022-11-01 03:24:06.270

 Current Total Sessions : 5

 icmp  VPN: public --> public  ID: c387fcfe6a60878ca46360918c

 Zone: trust --> untrust  TTL: 00:00:20  Left: 00:00:17

 Recv Interface: GigabitEthernet1/0/2

 Interface: GigabitEthernet1/0/1  NextHop: 200.1.1.2  MAC: 00e0-fc83-073e

 <--packets: 1 bytes: 60 --> packets: 1 bytes: 60

 172.16.2.2:63377[200.1.1.1:2064] --> 200.1.1.2:2048 PolicyName: trusttountrust

可以看到会话的安全区域放行为trust到untrust区域,该会话的老化时间(TTL)为20s,接收到报文的接口为G1/0/2,发送报文的接口为G1/0/1。可以看到该会话匹配的安全策略规则名称为:trusttountrust。

5)配置nat server,让clinet1能访问内部服务器server1

[FW1]nat server http protocol tcp global 200.1.1.1 www inside 172.16.1.2 www //配置nat server,将公网地址200.1.1.1的80端口映射到私网地址172.16.1.2的80端口

6)配置外网untrust区域访问dmz区域的区域间策略

[FW1]security-policy

[FW1-policy-security]rule name untrusttodmz

[FW1-policy-security-rule-untrusttodmz]source-zone untrust

[FW1-policy-security-rule-untrusttodmz]destination-zone dmz

[FW1-policy-security-rule-untrusttodmz]destination-address 172.16.1.2 24

[FW1-policy-security-rule-untrusttodmz]service http

[FW1-policy-security-rule-untrusttodmz]action permit

7)测试client1是否能够访问server1

第一步:在Server1开启http服务,配置如图所示:

            

第二步:在Client 1测试,配置如图所示:

结果表明,外网设备能够通过nat server访问服务器。

想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!

猜你喜欢

转载自blog.csdn.net/2301_76170756/article/details/134219267