当前位置:文档之家› 思科5505防火墙配置

思科5505防火墙配置

asa 5505 常用配置2009-06-01 16:13asa 55051.配置防火墙名ciscoasa> enableciscoasa# configure terminalciscoasa(config)# hostname asa55052.配置telnetasa5505(config)#telnet 192.168.1.0 255.255.255.0 inside//允许内部接口192.168.1.0网段telnet防火墙3.配置密码asa5505(config)# password cisco//远程密码asa5505(config)# enable password cisco//特权模式密码4.配置IPasa5505(config)# interface vlan 2//进入vlan2asa5505(config-if)# ip address 218.xxx.37.222 255.255.255.192 //vlan2配置IPasa5505(config)#show ip address vlan2//验证配置5.端口加入vlan//进入接口e0/3asa5505(config-if)# switchport access vlan 3//接口e0/3加入vlan3asa5505(config)# interface vlan 3//进入vlan3asa5505(config-if)# ip address 10.10.10.36 255.255.255.224 //vlan3配置IPasa5505(config-if)# nameif dmz//vlan3名asa5505(config-if)# no shutdown//开启asa5505(config-if)# show switch vlan//验证配置6.最大传输单元MTUasa5505(config)#mtu inside 1500//inside最大传输单元1500字节asa5505(config)#mtu outside 1500//outside最大传输单元1500字节asa5505(config)#mtu dmz 1500//dmz最大传输单元1500字节7.配置arp表的超时时间//arp表的超时时间14400秒8.FTP模式asa5505(config)#ftp mode passive//FTP被动模式9.配置域名asa5505(config)#domain-name 10.启动日志asa5505(config)#logging enable//启动日志asa5505(config)#logging asdm informational//启动asdm报告日志asa5505(config)#Show logging//验证配置11.启用http服务asa5505(config)#http serverenable //启动HTTP server,便于ASDM连接。

asa5505(config)#http 0.0.0.0 0.0.0.0outside//对外启用ASDM连接asa5505(config)#http 0.0.0.0 0.0.0.0inside//对内启用ASDM连接12.控制列表access-list acl_out extended permit tcp any any eq www//允许tcp协议80端口入站access-list acl_out extended permit tcp any any eq https//允许tcp协议443端口入站access-list acl_out extended permit tcp any host 218.xxx.37.223 eq ftp //允许tcp协议21端口到218.xxx.37.223主机access-list acl_out extended permit tcp any host 218.xxx.37.224 eq 3389 //允许tcp协议3389端口到218.xxx.37.224主机access-list acl_out extended permit tcp any host 218.xxx.37.225 eq 1433 //允许tcp协议1433端口到218.xxx.37.225主机access-list acl_out extended permit tcp any host 218.xxx.37.226 eq 8080 //允许tcp协议8080端口到218.xxx.37.226主机asa5505(config)#show access-list//验证配置13.设置路由asa5505(config)#route dmz 10.0.0.0 255.0.0.0 10.10.10.33 1//静态路由到10.0.0.0网段经过10.10.10.33网关跳数为1asa5505(config)#route outside 0.0.0.0 0.0.0.0 218.16.37.193 1//默认路由到所有网段经过218.xxx.37.193网关跳数为1asa5505# show route//显示路由信息14.静态NATasa5505(config)# static (inside,outside) 218.xxx.37.223 192.168.1.6 netmask 255.255.255.255//外网218.xxx.37.223映射到内网192.168.1.6asa5505(config)#access-list acl_out extended permit icmp any any//控制列表名acl_out允许ICMP协议asa5505(config)#access-group acl_out in interface outside//控制列表acl_out应用到outside接口asa5505(config)#static (inside,dmz) 10.10.10.37 192.168.1.16 netmask 255.255.255.255//dmz10.10.10.37映射到内网192.168.1.16asa5505(config)#access-list acl_dmz extended permit icmp any any//控制列表名acl_dmz允许ICMP协议asa5505(config)#access-group acl_dmz in interface dmz//控制列表acl_out应用到dmz接口asa5505(config)#Show nat//验证配置15.动态NATasa5505(config)#global(outside) 1 218.201.35.224-218.201.35.226//定义全局地址池asa5505(config)#nat(inside) 1 192.168.1.20-192.168.1.22//内部转换地址池asa5505(config)# show xlate//验证配置16.基于端口NAT(PAT)asa5505(config)#global (outside) 2 interface//定义全局地址即outside地址:218.xxx.37.222asa5505(config)#nat (inside) 2 192.168.1.0 255.255.255.0//内部转换地址池asa5505(config)# show xlate//验证配置17.基于LAN故障倒换(failover)1).主防火墙配置asa5505(config)#failover mac addr outside 001a.2b3c.4d11 001a.2b3c.4w12 //故障倒换虚拟MAC地址asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w22 //故障倒换虚拟MAC地址asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w32 //故障倒换虚拟MAC地址asa5505(config)#failover//启动故障倒换asa5505(config)#failover lan unit primary//设置主要防火墙asa5505(config)#failover lan interface standby Vlan4//故障倒换接口名standbyasa5505(config)#failover interface ip standby 172.168.32.1 255.255.255.252 standby 172.168.32.2//配置主防火墙IP:172.168.32.1,备用防火墙IP:172.168.32.2asa5505# show failover//验证配置2).备防火墙配置asa5505(config)#failover mac addr outside 001a.2b3c.4d11 001a.2b3c.4w12//故障倒换虚拟MAC地址asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w22//故障倒换虚拟MAC地址asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w32//故障倒换虚拟MAC地址asa5505(config)#failover//启动故障倒换asa5505(config)#failover lan unit secondary//设置备用防火墙asa5505(config)#failover lan interface standby Vlan4//故障倒换接口名standbyasa5505(config)#failover interface ip standby 172.168.32.1 255.255.255.252 standby172.168.32.2//配置主防火墙IP:172.168.32.1,备用防火墙IP:172.168.32.2asa5505# show failover//验证配置18.显示mac地址asa5505# show switch mac-address-table19.保存配置asa5505# write memory20.重复PING 1000次ciscoasa(config)# ping 202.96.133.133 repeat 1000access-list 2 extended permit icmp any any access-group 2 in interface outside NND 研究一天才搞明白这两条命令,,,,允许内网PC--PING --INTERNET。

相关主题