CD-ASA5520# show run

: Saved

:

ASA Version 7.2(2)

!

hostname CD-ASA5520                         //给防火墙命名

domain-name default.domain.invalid                  //定义工作域   

enable password 9jNfZuG3TC5tCVH0 encrypted    // 进入特权模式的密码

names

dns-guard

!

interface GigabitEthernet0/0             //内网接口:

duplex full                             //接口作工模式:全双工,半双,自适应       

nameif inside                        //为端口命名 :内部接口inside

security-level 100                     //设置安全级别 0~100 值越大越安全

ip address 192.168.1.1 255.255.255.0     //设置本端口的IP地址

!

interface GigabitEthernet0/1             //外网接口

nameif outside                       //为外部端口命名 :外部接口outside

security-level 0

ip address 202.98.131.122 255.255.255.0 //IP地址配置

!

interface GigabitEthernet0/2

nameif dmz

security-level 50

ip address 192.168.2.1 255.255.255.0

!            

interface GigabitEthernet0/3

shutdown

no nameif

no security-level

no ip address

!

interface Management0/0               //防火墙管理地址

shutdown

no nameif

no security-level

no ip address

!

passwd 2KFQnbNIdI.2KYOU encrypted

ftp mode passive       

clock timezone CST 8

dns server-group DefaultDNS

domain-name default.domain.invalid

access-list outside_permit extended permit tcp any interface outside eq 3389  

//访问控制列表

access-list outside_permit extended permit tcp any interface outside range 30000 30010

//允许外部任何用户可以访问outside 接口的30000-30010的端口。

pager lines 24

logging enable             //启动日志功能

logging asdm informational

mtu inside 1500            内部最大传输单元为1500字节

mtu outside 1500

mtu dmz 1500

ip local pool ***client 192.168.200.1-192.168.200.200 mask 255.255.255.0

//定义一个命名为***client的IP地址池,为remote用户分配IP地址

no failover

icmp unreachable rate-limit 1 burst-size 1

asdm p_w_picpath disk0:/asdm-522.bin

no asdm history enable

arp timeout 14400         //arp空闲时间为14400秒

global (outside) 1 interface //由于没有配置NAT 故这里是不允许内部用户上INTERNET

static (dmz,outside) tcp interface 30000 192.168.2.2 30000 netmask 255.255.255.255

//端口映射 可以解决内部要公布的服务太多,而申请公网IP少问题。

static (dmz,outside) tcp interface 30001 192.168.2.2 30001 netmask 255.255.255.255

//把dmz区192.168.2.2 30002 映射给外部30002端口上。

static (dmz,outside) tcp interface 30002 192.168.2.2 30002 netmask 255.255.255.255

static (dmz,outside) tcp interface 30003 192.168.2.2 30003 netmask 255.255.255.255

static (dmz,outside) tcp interface 30004 192.168.2.2 30004 netmask 255.255.255.255

static (dmz,outside) tcp interface 30005 192.168.2.2 30005 netmask 255.255.255.255

static (dmz,outside) tcp interface 30006 192.168.2.2 30006 netmask 255.255.255.255

static (dmz,outside) tcp interface 30007 192.168.2.2 30007 netmask 255.255.255.255

static (dmz,outside) tcp interface 30008 192.168.2.2 3008 netmask 255.255.255.255

static (dmz,outside) tcp interface 30009 192.168.2.2 30009 netmask 255.255.255.255

static (dmz,outside) tcp interface 30010 192.168.2.2 30010 netmask 255.255.255.255

static (dmz,outside) tcp interface 3389 192.168.2.2 3389 netmask 255.255.255.255

access-group outside_permit in interface outside  

//把outside_permit控制列表运用在外部接口的入口方向。

route outside 0.0.0.0 0.0.0.0 202.98.131.126 1 //定义一个默认路由。

 

timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02

timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00

timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00

timeout uauth 0:05:00 absolute

------------定义一个命名为***client的组策略-------------------------

group-policy ***client internal             //创建一个内部的组策略。  

group-policy ***client attributes           //设置***client组策略的参数

wins-server value 192.168.1.10           //定义WINS-SERVER 的IP地址。

dns-server value 192.168.1.10 61.139.2.69 //定义dns-server的IP地址。

***-idle-timeout none                  //终止连接时间设为默认值

***-session-timeout none               //会话超时采用默认值

***-tunnel-protocol IPSec              //定义通道使用协议为IPSEC。

split-tunnel-policy tunnelspecified        //定义。

default-domain value my3377.com          //定义默认域名为my3377.com

------------定义一个命名为l2l***的组策略-------------------------

group-policy l2l*** internal  

group-policy l2l*** attributes

wins-server value 192.168.1.10

dns-server value 192.168.1.10 61.139.2.69

***-simultaneous-logins 3

***-idle-timeout none

***-session-timeout none

***-tunnel-protocol IPSec

 

username test password P4ttSyrm33SV8TYp encrypted privilege 0

//创建一个远程访问用户来访问安全应用

username my3377 password 3USUcOPFUiMCO4Jk encrypted

http server enable            //启动HTTP服务

http 0.0.0.0 0.0.0.0 inside      //允许内部主机HTTP连接

no snmp-server location

no snmp-server contact

 

snmp-server enable traps snmp authentication linkup linkdown coldstart

//snmp的默认配置

crypto ipsec transform-set ESP-DES-MD5 esp-des esp-md5-hmac

//配置转集(定义了IPSC隧道使用的加密和信息完整性算法集合)

crypto dynamic-map ***_dyn_map 10 set transform-set ESP-DES-MD5

//为动态加密图条目定义传换集

crypto map outside_map 10 ipsec-isakmp dynamic ***_dyn_map

//创建一个使用动态加密条目的加密图

crypto map outside_map interface outside

//将 outside_map加密图应用到outside端口

------------配置IKE--------------

crypto isakmp enable outside    //在ostside 接口启动ISAKMP

crypto isakmp policy 20        //isakmmp权值,值越小权值越高

authentication pre-share       //指定同位体认证方法是共享密钥

encryption des               //指定加密算法

hash md5                   //指定使用MD5散列算法

group 2                    //指定diffie-hellman组2

lifetime 86400              //指定SA(协商安全关联)的生存时间

 

crypto isakmp policy 65535

authentication pre-share

encryption des

hash md5

group 2

lifetime 86400

-------------调用组策略-----------------

crypto isakmp nat-traversal 20  

tunnel-group DefaultL2LGroup general-attributes //配置这个通道组的认证方法

default-group-policy l2l***                 //指定默认组策略名称。

tunnel-group DefaultL2LGroup ipsec-attributes //配置认证方法为IPSEC

pre-shared-key *                               //提供IKE连接的预共享密钥

 

tunnel-group ***client type ipsec-ra          //设置连接类型为远程访问。                          

tunnel-group ***client general-attributes      //配置这个通道组的认证方法

address-pool ***client                            //定义所用的地址池

default-group-policy ***client             //定义默认组策略

-----设置认证方式和共享密钥-------------

tunnel-group ***client ipsec-attributes       //配置认证方法为IPSEC

pre-shared-key *                       //提供IKE连接的预共享密钥

 

 

telnet timeout 5                         //telnet 超时设置

ssh 0.0.0.0 0.0.0.0 outside                 //允许外部通SSH访问防火墙

ssh timeout 60                            //SSH连接超时设置

console timeout 0                                 //控制台超时设置    

 

dhcp-client update dns server both

dhcpd dns 61.139.2.69 202.98.96.68                 //dhcp 发布的DNS

!

dhcpd address 192.168.1.10-192.168.1.254 inside      //向内网发布的地址池

dhcpd enable inside                              //启动DHCP服务。

!

!

class-map inspection_default

match default-inspection-traffic

!

!

policy-map type inspect dns migrated_dns_map_1

parameters  

message-length maximum 512

policy-map global_policy

class inspection_default 

inspect dns migrated_dns_map_1

inspect ftp

inspect h323 h225

inspect h323 ras

inspect netbios

inspect rsh

inspect rtsp

inspect skinny

inspect esmtp

inspect sqlnet

inspect sunrpc

inspect tftp

inspect sip

inspect xdmcp

!

service-policy global_policy global

prompt hostname context

Cryptochecksum:25e66339116f52e443124a23fef3d373

: end