《防火墙与入侵检测技术》
一、实验目的
1.掌握防火墙的配置过程 2.掌握NAT的应用特点 3.掌握NAT的工作过程 4.掌握域内安全策略 5.掌握策略匹配机制
二、拓扑设计

三、实验设备
1.六台终端设备 2.两台交换机(型号:S5700、S3700) 3.一台防火墙(型号:USG5500)
四、实验要求
1.PC2不能访问server1 2.除了PC2无法server1,192.168.0.0/24网段可以访问server1 3.建立域内安全策略,使192.168.0.0/24网段无法与192.168.1.0/24网段进行通信 4.Untrust区计算机可以访问dmz区服务器 5.Trust区192.168.0.0/24网段可以访问的dmz区服务器,但192.168.1.0/24网段不能访问dmz区服务器 6.PC1访问PC3时进行地址转换,并分析转换过程
五、实验步骤及结果分析
一、配置pc、Server和Client   
 

配置防火墙端口 [SRG]interface GigabitEthernet 0/0/0 [SRG-GigabitEthernet0/0/0]ip address 192.168.0.254 24 [SRG-GigabitEthernet0/0/0]q [SRG]interface GigabitEthernet 0/0/1 [SRG-GigabitEthernet0/0/1]ip address 172.16.0.254 24 [SRG-GigabitEthernet0/0/1]q [SRG]interface GigabitEthernet 0/0/2 [SRG-GigabitEthernet0/0/2]ip address 192.168.1.254 24 [SRG-GigabitEthernet0/0/2]q [SRG]interface GigabitEthernet 0/0/3 [SRG-GigabitEthernet0/0/3]ip address 192.168.100.254 24 
二、 1、PC2不能访问server1 2、除了PC2无法server1,192.168.0.0/24网段可以访问server1
先把防火墙的各个端口加进对应的区域,G0/0/0和G0/0/2是在trust区的,G0/0/1是在untrust区的,G0/0/3是在dmz区内的
[SRG]firewall zone trust [SRG-zone-trust]add interface GigabitEthernet 0/0/0 [SRG-zone-trust]add interface GigabitEthernet 0/0/2 [SRG-zone-trust]q [SRG]firewall zone untrust [SRG-zone-untrust]add interface GigabitEthernet 0/0/1 [SRG-zone-untrust]q [SRG]firewall zone dmz [SRG-zone-dmz]add interface GigabitEthernet 0/0/3 
配置安全策略,。先配置pc2不能访问Server1.拒绝pc2的ip地址访问,再放通192.168.0.0这个网段 [SRG]policy interzone trust untrust outbound [SRG-policy-interzone-trust-untrust-outbound]policy 1 [SRG-policy-interzone-trust-untrust-outbound-1]policy source 192.168.0.100 0 [SRG-policy-interzone-trust-untrust-outbound-1]action deny [SRG-policy-interzone-trust-untrust-outbound-1]q [SRG-policy-interzone-trust-untrust-outbound]policy 3 [SRG-policy-interzone-trust-untrust-outbound-3]policy source 192.168.0.0 mask 25 5.255.255.0 [SRG-policy-interzone-trust-untrust-outbound-3]action permit 
Ping命令验证实验结果 (1)pc2不能访问server1 
(2)192.168.0.0/24网段可以访问server1 
三、 3、建立域内安全策略,使192.168.0.0/24网段无法与192.168.1.0/24网段进行通信 建立域内安全策略,使192.168.0.0/24网段不可以ping通192.168.1.0/24网段。 因为同一个区域内的是可以ping通的,要让ping不通,在trust区内建立安全策略,禁止192.168.0.0网段 [SRG]policy zone trust [SRG-policy-zone-trust]policy 4 [SRG-policy-zone-trust-4]action deny [SRG-policy-zone-trust-4]policy source 192.168.0.0 mask 255.255.255.0 
实验结果验证:  
四、Untrust区计算机可以访问dmz区服务器 开放untrust区到dmz区的通信 [SRG]firewall packet-filter default permit interzone dmz untrust direction inbound 
实验结果验证:
 
五、 5、Trust区192.168.0.0/24网段可以访问的dmz区服务器,但192.168.1.0/24网段不能访问dmz区服务器 trust区192.168.0.0/24网段可以访问dmz区服务器,而192.168.1.0/24网段不能访问 先把trust区到dmz区放通,再配置策略 [SRG]firewall packet-filter default permit interzone trust dmz direction outbound [SRG]policy interzone trust dmz outbound [SRG-policy-interzone-trust-dmz-outbound]policy 6 [SRG-policy-interzone-trust-dmz-outbound-6]action permit [SRG-policy-interzone-trust-dmz-outbound-6]policy source 192.168.0.0 mask 255.255.255.0 [SRG-policy-interzone-trust-dmz-outbound-6]q [SRG-policy-interzone-trust-dmz-outbound]policy 7 [SRG-policy-interzone-trust-dmz-outbound-7]action deny [SRG-policy-interzone-trust-dmz-outbound-7]policy source 192.168.1.0 mask 255.255.255.0 
实验结果验证: trust区192.168.0.0/24网段可以访问dmz区服务器 
trust区192.168.1.0/24网段不可以访问dmz区服务器

六、PC1访问PC3时进行地址转换,并分析转换过程 [SRG]nat address-group 1 2.2.2.2 2.2.2.5 [SRG]nat-policy interzone trust untrust oubound [SRG-nat-policy-interzone-trust-untrust-outbound]policy 7 [SRG-nat-policy-interzone-trust-untrust-outbound-7]action source-nat [SRG-nat-policy-interzone-trust-untrust-outbound-7]policy destination 172.16.0.3 0.0.0.255 [SRG-nat-policy-interzone-trust-untrust-outbound-7]address-group 1 [SRG-nat-policy-interzone-trust-untrust-outbound-7]policy source 192.168.0.2 0.0.0.255 
查看nat转换情况: 
|