进接口,开启相关服务
[WB-FW1]int g1/0/1
[WB-FW1-GigabitEthernet1/0/1]service-manage ping permit
开启全部服务
service-manage all permit
配置接口区域
[WB-FW1]firewall zone trust
[WB-FW1-zone-trust]add int g1/0/1
[WB-FW1]firewall zone untrust
[WB-FW1-zone-trust]add int g1/0/2
[WB-FW1]firewall zone dmz
[WB-FW1-zone-trust]add int g1/0/3
配置安全策略
[WB-FW1]security-policy //进入安全策略
[WB-FW1-policy-security]rule name policy-name //配置规则名
[WB-FW1-policy-security-rule-policy-name]source-zone trust //配置源区域
[WB-FW1-policy-security-rule-policy-name]destination-zone untrust //配置目标区域
[WB-FW1-policy-security-rule-policy-name]source-address 192.168.99.0 24 //配置源IP
[WB-FW1-policy-security-rule-policy-name]destination-address 1.1.99.0 30 //配置目的IP
[WB-FW1-policy-security-rule-policy-name]action permit //激活规则(允许)
DMZ区域:允许源untrust、trust区域访问目的dmz区域
要使能ping通防火墙接口:
[FW-BiaoGe]security-policy [FW-BiaoGe-policy-security]rule name all_to_local #创建策略 [FW-BiaoGe-policy-security-rule-all_to_local]source-zone untrust #源区域:外网 [FW-BiaoGe-policy-security-rule-all_to_local]source-zone trust #源区域:内网 [FW-BiaoGe-policy-security-rule-all_to_local]source-zone dmz #源区域:服务器 [FW-BiaoGe-policy-security-rule-all_to_local]destination-zone local #目的区域:防火墙本地 [FW-BiaoGe-policy-security-rule-all_to_local]action permit #行为:允许通过 [FW-BiaoGe-policy-security-rule-all_to_local]q
NAT技术
NAPT
配置NAPT地址池(可以设置一个或者多个)
[FW1]nat address-group NAPT [FW1-address-group-NAPT]section 0 10.10.10.1 [FW1-address-group-NAPT]mode pat #指定模式为pat模式 [FW1-address-group-NAPT]q
配置NAT策略
[FW1]nat-policy [FW1-policy-nat]rule name NAPT [FW1-policy-nat-rule-NAPT]source-zone trust [FW1-policy-nat-rule-NAPT]destination-zone untrust [FW1-policy-nat-rule-NAPT]action source-nat address-group NAPT
easy-ip
无需配置地址池,直接配置NAT策略
[FW1]nat-policy [FW1-policy-nat]rule name easy-ip [FW1-policy-nat-rule-easy-ip]source-zone trust [FW1-policy-nat-rule-easy-ip]destination-zone untrust [FW1-policy-nat-rule-easy-ip]action source-nat easy-ip
NAT-Server(仅用于服务器地址转换)
防火墙上配置安全策略(允许untrust(外网)区域访问DMZ(服务器)区域的FTP、HTTP服务)
[FW1]security-policy [FW1-policy-security]rule name untodmz [FW1-policy-security-rule-untodmz]source-zone untrust [FW1-policy-security-rule-untodmz]destination-zone dmz [FW1-policy-security-rule-untodmz]service ftp [FW1-policy-security-rule-untodmz]service http [FW1-policy-security-rule-untodmz]action permit [FW1-policy-security-rule-untodmz]q [FW1-policy-security]q
配置NAT-Server策略,将服务器的ftp、http服务通过将内部IP192.168.2.2.转换成10.10.10.3,给外网访问!
[FW1]nat server ftp protocol tcp global 10.10.10.3 21 inside 192.168.2.2 21 [FW1]nat server http protocol tcp global 10.10.10.3 80 inside 192.168.2.2 80