cisco firewall (ASA Series)
1、端口配置
CiscoASA(config)# interface ethernet 0
CiscoASA(config)#nameif ouside
CiscoASA(config-if)# security-level 0
CiscoASA(config-if)# ip address 202.100.10.1 255.255.255.0
CiscoASA(config-if)# no shut
CiscoASA(config)# interface ethernet 1
CiscoASA(config)#nameif inside
CiscoASA(config-if)# security-level 100
CiscoASA(config-if)# ip address 192.168.1.1 255.255.255.0
CiscoASA(config-if)# no shut
CiscoASA(config)# interface ethernet 2
CiscoASA(config)#nameif dmz
CiscoASA(config-if)# security-level 50
CiscoASA(config-if)# ip address 172.16.1.1 255.255.255.0
CiscoASA(config-if)# no shut
2、路由配置
CiscoASA(config)# route outside 0.0.0.0 0.0.0.0 202.100.10.2 1 #默认路由
CiscoASA(config)# route inside 10.0.0.0 255.0.0.0 192.168.1.2 1 #外网访问内网服务器的路由
3、定义高安全接口区域需要进行地址转换的IP范围
CiscoASA(config)# nat (inside) 1 0 0
CiscoASA(config)# nat (dmz) 1 0 0
4、定义低安全接口区域用于高安全接口区域进行IP转换的地址范围
CiscoASA(config)# global (outside) 1 interface
CiscoASA(config)# global (dmz) 1 interface
5、定义静态IP映射(也称一对一映射)
CiscoASA(config)# static (inside,outside) tcp 202.100.10.1 www 10.1.1.1 www netmask 255.255.255.255
#实现从 outside 区访问 inside 区 10.1.1.1 的 80 端口时,就直接访问 10.1.1.1:80 对 outside 区的映射
202.100.10.1:80
CiscoASA(config)# static (dmz,outside) tcp 202.100.10.1 pop3 172.16.1.2 pop3 netmask 255.255.255.255
#实现从 outside 区访问 dmz 区 172.16.1.2 的 110 时,就直接访问 172.16.1.2:110 对 outside 区的映射
202.100.10.1:110
CiscoASA(config)# static (dmz,outside) tcp 202.100.10.1 smtp 172.16.1.2 smtp netmask 255.255.255.255
#实现从 outside 区访问 dmz 区 172.16.1.2 的 25 时,就直接访问 172.16.1.2:25 对 outside 区的映射
202.100.10.1:25
6、定义 access-list
CiscoASA(config)# access-list 101 extended permit ip any any
CiscoASA(config)# access-list 101 extended permit icmp any any
CiscoASA(config)# access-list 102 extended permit tcp any host 10.1.1.1 eq www
CiscoASA(config)# access-list 102 extended permit icmp any any
CiscoASA(config)# access-list 103 extended permit tcp any host 172.16.1.2 eq pop3
CiscoASA(config)# access-list 103 extended permit tcp any host 172.16.1.2 eq smtp
CiscoASA(config)# access-group 101 in interface outside
CiscoASA(config)#access-group 102 in interface inside
CiscoASA(config)#access-group 103 in interface dmz
网关 202.100.10.2/24
出口ip 202.100.10.1/24
内网ip 192.168.1.1/24
vlan ip 192.168.1.2/24
web server 10.1.1.1