华为防火墙做出口网关

配置要求:

1)PC1和PC2可以ping通dmz区域的172.16.1.100服务器(web服务器)
2)PC1和PC2可以ping通202.16.3.1,需要使用Easy-IP NAT
3)202.16.2.1主机使用http协议访问dmz发布到untrust区域服务器的IP地址202.16.1.50


内容:

1、掌握基本接口配置

2、掌握静态路由配置,

3、掌握防火墙安全策略及内容

拓扑图如下:

 各设备配置如下:

交换机配置:

SW1配置:
sy
sys SW1
v b 10 20 创建VLAN
int e0/0/1
po link-type ac 接口模式为access
po de v 10 加入vlan10
int e0/0/2
po link-type ac 
po de v 20
int g0/0/1
po link-type tr 接口模式为trunk(干路传输)
po tr allow-pass v al 允许所有vlan通过
int g0/0/2
po link-type tr
po tr allow-pass v al
stp instance 0 root primary 设置该交换机为根交换机

SW2配置
sy
sys SW2
v b 10 30 40 创建vlan
dhcp en 打开DHCP功能
int v 10  进入vlanif 10
ip add 192.168.10.254 24  创建vlanif 10 地址(用户地址)
dhcp sel int  DHCP从接口分配
int v 30
ip add 192.168.30.1 24 SW2与SW3接口地址
int v 40
ip add 192.168.40.1 24 与R1接口地址
int g0/0/1
po link-type tr
po tr allow-pass v al
int g0/0/2
po link-type ac
po de v 40
int eth-trunk 1 创建聚合口
po link-type tr
po tr allow-pass v al
trunkport GigabitEthernet 0/0/3 to 0/0/4 将3-4口加入该聚合口
ip route-static 0.0.0.0 0 192.168.40.2 配置缺省网关
ip route-static 0.0.0.0 0 192.168.30.2 preference 70 配置备份路由

SW3配置:
sy
sys SW3
v b 20 30 50 创建vlan
dhcp en DHCP功能启用
int v 20 
ip add 192.168.20.254 24 创建vlanif20 地址(用户地址)
dhcp sel int DHCP在接口获取
int v 30
ip add 192.168.30.2 24 SW3与SW2接口地址
int v 50
ip add 192.168.50.1 24 与R1接口地址
int g0/0/1
po link-type tr
po tr allow-pass v al
int g0/0/2
po link-type ac
po de v 50
int eth-trunk 1 创建聚合口
po link-type tr 聚合口模式
po tr allow-pass v al 允许用过所有数据
trunkport GigabitEthernet 0/0/3 to 0/0/4  把3-4口加入聚合口
ip route-static 0.0.0.0 0 192.168.50.2 配置到R1缺省路由
ip route-static 0.0.0.0 0 192.168.30.1 preference 70 配置到SW2备份路由
路由器配置:
	
内网R1配置:
sy
sys R1
int g0/0/1
ip add 192.168.40.2 24 配置接口地址(与SW2接口)
int g0/0/2
ip add 192.168.50.2 24 配置接口地址(与SW3接口)
int g0/0/0
ip add 192.168.100.1 24 配置接口地址(与FW1接口)
ip route-static 0.0.0.0 0.0.0.0 192.168.100.2 配置到FW1缺省路由
ip route-static 192.168.10.0 255.255.255.0 192.168.40.1 配置到SW2回城路由
ip route-static 192.168.10.0 255.255.255.0 192.168.50.1 preference 70 配置备份路由
ip route-static 192.168.20.0 255.255.255.0 192.168.50.1 配置到SW3回城路由
ip route-static 192.168.20.0 255.255.255.0 192.168.40.1 preference 70 配置备份路由

外网R2配置:
sy
sys R2
int g0/0/0
ip add 202.16.1.2 24 配置接口地址(与FW1接口地址)
int g0/0/1
ip add 202.16.2.254 24 配置接口地址(客户端接口地址)
int g0/0/2
ip add 202.16.3.254 24 接口地址(服务器接口地址)

出口防火墙配置:

FW配置:
sy
sys FW1
int g1/0/0
ip add 192.168.100.2 24配置接口地址(与内网R1接口)
int g1/0/2
ip add 172.16.1.254 24 配置接口地址(与WWW服务器接口)
int g1/0/1
ip add 202.16.1.1 24 配置接口地址(与外网R2接口)
firewall zone trust 配置安全域(可信任安全域)
add int g1/0/0 加入端口

fir zone dmz 配置安全域(中间安全域)
add int g1/0/2 加入端口

fir zone untrust 配置安全域(外网区域)
add int g1/0/1加入端口

security-policy 配置安全策略
rule name trust_dmz 命名
source-zone trust 始区域
destination-zone dmz 目的区域
action permit 允许通过

rule name trust_untrust 
source-zone trust
destination-zone untrust
action permit 

rule name untrust_dmz 命名
source-zone untrust 始区域(外网区域)
destination-zone dmz 目的区域(中间区域)
source-address 202.16.2.1 mask 255.255.255.255  允许的源地址
destination-address 172.16.1.100 mask 255.255.255.255 目的地址
action permit 允许通过

nat-policy NAT策略
rule name nat_tr_un 命名
source-zone trust 源区域
destination-zone untrust 目的区域
action source-nat easy-ip nat 使用接口地址

nat server huawei protocol icmp global 202.16.1.50 inside 172.16.1.100 外网映射放行ICMP功能
nat server 1 protocol tcp global 202.16.1.50 inside 172.16.1.100 外网映射放行TCP功能

ip route-s 0.0.0.0 0 202.16.1.2 通过R2的缺省路由
ip route-static 192.168.10.0 255.255.255.0 192.168.100.1 回城路由
ip route-static 192.168.20.0 255.255.255.0 192.168.100.1 回城路由

PC及服务器配置:


 按配置要求:

1:pc1、pc2拼中间区域服务器172.16.100:

 2、PC1和PC2可以ping通202.16.3.1,需要使用Easy-IP NAT

 

 从上图可以看出,当PC1、PC2ping外网服务器时,抓包显示均未防火墙出口地址进行转换后访问出去。

3、202.16.2.1主机使用http协议访问dmz发布到untrust区域服务器的IP地址202.16.1.50:

 

从上图可以看到,外网客户端通过IP202.16.1.50能映射到内网DMZ服务器中,且能ping通,而外网服务器却不能ping通,是因为在防火墙安全策略中,我们做了源地址和目标地址的安全策略。只允许客户端地址访问。所以外网服务器也就不能访问了。

配置结束,谢谢大家! 


猜你喜欢

转载自blog.csdn.net/m0_63775189/article/details/125884715
今日推荐