2023年12月6日发(作者:)

CD-ASA5520# show run

: Saved

:

ASA Version 7.2(2)

!

hostname CD-ASA5520

// 给防火墙命名

domain-name d

//

定义工作域

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 d

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

mtu outside 1500

mtu dmz 1500

// 定义一个命名为 vpnclient

no failover

// 启动日志功能

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

ip local pool vpnclient 192.168.200.1-192.168.200.200 mask 255.255.255.0

的 IP 地址池 , 为 remote

用户分配 IP 地址

icmp unreachable rate-limit 1 burst-size 1

asdm image disk0:/

no asdm history enable

arp timeout 14400

global (outside) 1 interface //

//arp 空闲时间为

14400 秒

由于没有配置 NAT 故这里是不允许内部用户上INTERNET

IP 少问题。

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

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

// 把 dmz区 192.168.2.2 30002

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

映射给外部 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

------------

定义一个命名为 vpnclient

的组策略 -------------------------

//

创建一个内部的组策略。

// 设置 vpnclient

定义 dns-server

组策略的参数

group-policy vpnclient internal

group-policy vpnclient attributes

wins-server value 192.168.1.10

dns-server value 192.168.1.10 61.139.2.69 //

vpn-idle-timeout none

vpn-session-timeout none

vpn-tunnel-protocol IPSec

split-tunnel-policy tunnelspecified

default-domain value

------------

group-policy l2lvpn internal

group-policy l2lvpn attributes

wins-server value 192.168.1.10

dns-server value 192.168.1.10 61.139.2.69

// 定义 WINS-SERVER的 IP 地址。

的 IP 地址。

// 终止连接时间设为默认值

// 会话超时采用默认值

// 定义通道使用协议为

// 定义。

//

定义默认域名为

IPSEC。

定义一个命名为 l2lvpn

的组策略 ------------------------- vpn-simultaneous-logins 3

vpn-idle-timeout none

vpn-session-timeout none

vpn-tunnel-protocol IPSec

username test password P4ttSyrm33SV8TYp encrypted privilege 0

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

username cisco 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 vpn_dyn_map 10 set transform-set ESP-DES-MD5

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

crypto map outside_map 10 ipsec-isakmp dynamic vpn_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 l2lvpn

// 指定默认组策略名称。

tunnel-group DefaultL2LGroup ipsec-attributes //

配置认证方法为

IPSEC

pre-shared-key *

// 提供 IKE 连接的预共享密钥

tunnel-group

vpnclienttype

ipsec-ra

// 设

置 连

接 类

远问。

tunnel-group vpnclient general-attributes

// 配置这个通道组的认证方法

address-pool vpnclient

//

定义所用的地址池

default-group-policy vpnclient

// 定义默认组策略

访

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

tunnel-group vpnclient ipsec-attributes

pre-shared-key *

//

配置认证方法为

IPSEC

// 提供 IKE 连接的预共享密钥

telnet timeout 5

//telnet

超时设置

SSH访问防火墙

ssh 0.0.0.0 0.0.0.0 outside

ssh timeout 60

console timeout 0

dhcp-client update dns server both

dhcpd dns 61.139.2.69 202.98.96.68

!

dhcpd address 192.168.1.10-192.168.1.254 inside

dhcpd enable inside

!

!

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

// 允许外部通

//SSH

连接超时设置

// 控制台超时设置

//dhcp

发布的 DNS

// 向内网发布的地址池

// 启动 DHCP服务。

[ 思科实战 ] cisco asa5520

怎么配置就可以内网与外网互相通信

补充资料 asa5520(config)# show run

: Saved

:

ASA Version 7.0(6)

!

hostname asa5520

domain-name

enable password 2745OAJS2l2oSQqc encrypted

names

dns-guard

!

interface GigabitEthernet0/0

nameif inside

security-level 100

ip address 192.168.1.1 255.255.255.0

!

interface GigabitEthernet0/1

nameif outside

security-level 0

ip address 202.100.10.1 255.255.255.0

!

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

nameif guanli

security-level 100

ip address 192.168.3.10 255.255.255.0

!

passwd 2KFQnbNIdI.2KYOU encrypted

ftp mode passive

access-list icmp_in extended permit icmp any any pager lines 24

mtu inside 1500

mtu outside 1500

mtu dmz 1500

mtu guanli 1500

no failover

no asdm history enable

arp timeout 14400

global (outside) 1 interface

nat (inside) 1 192.168.1.0 255.255.255.0

static (inside,outside) 192.168.1.6 202.100.10.6 netmask 255.255.255.255

access-group icmp_in in interface outside

route outside 0.0.0.0 0.0.0.0 202.100.10.1 1

timeout xlate 3:00:00

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

timeout mgcp-pat 0:05:00 sip 0:30:00 sip_media 0:02:00

timeout uauth 0:05:00 absolute

http server enable

http 192.168.3.0 255.255.255.0 guanli

no snmp-server location

no snmp-server contact

snmp-server enable traps snmp authentication linkup linkdown

coldstart telnet timeout 5

ssh timeout 5

console timeout 0

Cryptochecksum:38cfab60ffa6873052f5a35134a278c6

: end

问题:

配置管理端口和

IP 地址后不能登录远程管理??? 内部网络不能

ping 通内部网关,也就是 inside

的 ip 地址, Ping 不通 outside.

3outside 可以 ping 自己网关,但不能 ping “inside ”。