ensp中防火墙nat实验

1.拓扑图如下:

在这里插入图片描述

2.需求

1.位于trust区域的client 1能访问位于dmz区域的Server 1,通过80端口访问
2.位于trust区域的client 1能访问位于untrust区域的Server 2
3.位于untrust区域的clinet 2能够访问dmz的Server 1,通过8080端口访问
注:这个实验中,trust区域和dmz区域模拟内网,untrust区域模拟外网,防火墙作为内网连接外网的设备

3.分析

1.实现需求一,则需要放行trust区域到dmz区域的安全策略
2.要想client 1能访问Server 2,则需要放行trust区域到untrust区域的安全策略,并且在防火墙中配置nat,本实验中,采用easy ip
3.要想clinet 2能够访问dmz的Server 1,则需要放行untrust区域到dmz区域的安全策略,并且在防火墙上做nat server,将外网接口的8080端口映射到server 1的80端口
4.这个实验主要是在防火墙上配置,路由器AR1配置好相应的ip即可

4.配置

防火墙的配置:

[USG6000V1]int g1/0/0
[USG6000V1-GigabitEthernet1/0/0]ip add 192.168.0.1 24
[USG6000V1-GigabitEthernet1/0/0]int g1/0/1
[USG6000V1-GigabitEthernet1/0/1]ip add 192.168.1.1 24
[USG6000V1-GigabitEthernet1/0/1]int g1/0/2
[USG6000V1-GigabitEthernet1/0/2]ip add 12.0.0.1 24
//将端口加入相应的安全区域
[USG6000V1]firewall zone trust
[USG6000V1-zone-trust]add int g1/0/0
[USG6000V1-zone-trust]firewall zone dmz
[USG6000V1-zone-dmz]add int g1/0/1
[USG6000V1-zone-dmz]firewall zone untrust
[USG6000V1-zone-untrust]add int g1/0/2
[USG6000V1-zone-untrust]quit
//创建安全策略,放行相应的流量
[USG6000V1]security-policy 
[USG6000V1-policy-security]rule name trust2dmz  //放行trust区域到dmz的数据
[USG6000V1-policy-security-rule-trust2dmz]source-zone trust
[USG6000V1-policy-security-rule-trust2dmz]destination-zone dmz
[USG6000V1-policy-security-rule-trust2dmz]action permit
[USG6000V1-policy-security-rule-trust2dmz]quit
[USG6000V1-policy-security]rule name trust2untrust   //放行trust区域到untrust的数据
[USG6000V1-policy-security-rule-trust2untrust]source-zone trust
[USG6000V1-policy-security-rule-trust2untrust]destination-zone untrust
[USG6000V1-policy-security-rule-trust2untrust]action permit
[USG6000V1-policy-security-rule-trust2untrust]quit
[USG6000V1-policy-security]rule name untrust2dmz   //放行untrust区域到dmz的数据
[USG6000V1-policy-security-rule-untrust2dmz]source-zone untrust
[USG6000V1-policy-security-rule-untrust2dmz]destination-zone dmz
[USG6000V1-policy-security-rule-untrust2dmz]action permit
[USG6000V1-policy-security-rule-untrust2dmz]quit
[USG6000V1-policy-security]quit
//配置NAT
[USG6000V1]nat-policy 
[USG6000V1-policy-nat]rule name waiwang
[USG6000V1-policy-nat-rule-waiwang]source-zone trust
[USG6000V1-policy-nat-rule-waiwang]destination-zone untrust
[USG6000V1-policy-nat-rule-waiwang]action source-nat easy-ip
[USG6000V1-policy-nat-rule-waiwang]quit
[USG6000V1-policy-nat]quit
//配置NAT server,进行端口映射
[USG6000V1]nat server nat_server protocol tcp global 12.0.0.1 8080 inside 192.168.1.2 80 no-reverse
//默认路由,下一跳指向公网路由器
[USG6000V1]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2

5.验证

1.client 1访问Server 1
在这里插入图片描述
2.trust区域的client 1访问外网的Server 2
在这里插入图片描述
3.外网的client 2访问dmz区域的Server 1
在这里插入图片描述

6.总结

这个实验主要是对防火墙进行操作,也算是第一次配置防火墙,感觉和路由器、交换机的区别在于,防火墙有安全区域、安全策略。防火墙的端口要加入安全区域,并且放行相应的安全策略才能实现不同区域的访问。同时也感受到学会配置路由器和交换机,对配置防火墙有一定的帮助。

猜你喜欢

转载自blog.csdn.net/qq_44933518/article/details/109756315