ASA配置命令

合集下载

Asa配置大全

Asa配置大全

1、ASA基本配置静态路由:route outside 192.168.100.0 255.255.255.0 192.168.1.99配置允许telnet:telnet 192.168.10.0 255.255.255.0 inside配置telnet超时时间:telnet timeout 5配置本地认证telnet与console:aaa authentication telnet console LOCAL配置SSH生成密钥对:aaa authentication ssh console LOCALciscoasa(config)# crypto key generate rsaINFO: The name for the keys will be: <Default-RSA-Key>Keypair generation process begin. Please wait...ciscoasa(config)#配置允许SSH:ssh 192.168.10.0 255.255.255.0 inside配置允许ASDM管理:http server enablehttp 192.168.10.0 255.255.255.0 insideasdm image disk0:/asdm-602.binusername cisco password cisco privilege 15配置PAT:nat (inside) 1 192.168.10.0 255.255.255.0global (outside) 1 interface配置端口映射:access-list to_server extended permit tcp any host 192.168.1.99 eq wwwaccess-group to_server in interface outsidestatic (inside,outside) tcp interface www 192.168.10.98 www netmask 255.255.255.255配置ACL:access-list to_server extended permit tcp any host 192.168.1.99 eq wwwaccess-group to_server in interface outside配置允许ICMP穿越:policy-map global_policyclass inspection_defaultinspect icmp配置URL过滤:url-server (outside) vendor websense host 192.168.1.100 timeout 30 protocol TCP version 1 connections 5filter url http 192.168.10.0 255.255.255.0 0.0.0.0 0.0.0.0 allow日志管理:开启logging:logging enable开启console日志:logging console 7将日志发送到日志服务器:logging trap 7logging host inside 192.168.10.98配置IPS:ip audit name zxd info action alarmip audit name cisco attack action alarmip audit interface outside zxdip audit interface outside cisco2、VPN配置ASA IPSec L2L配置:access-list nonat extended permit ip 192.168.10.0 255.255.255.0 192.168.100.0 255.255.255.0 nat (inside) 0 access-list nonatcrypto ipsec transform-set cisco esp-des esp-nonecrypto map cisco 10 match address nonatcrypto map cisco 10 set peer 192.168.1.96crypto map cisco 10 set transform-set ciscocrypto map cisco interface outsidecrypto isakmp enable outsidecrypto isakmp policy 1authentication pre-shareencryption deshash shagroup 1tunnel-group 192.168.1.96 type ipsec-l2ltunnel-group 192.168.1.96 ipsec-attributespre-shared-key ciscoASA Remote VPN Server配置:ip local pool vpnpool 192.168.2.250-192.168.2.254group-policy vpntest internalgroup-policy vpntest attributesvpn-tunnel-protocol IPSecusername zhong password xiaodongtunnel-group vpntest type remote-accesstunnel-group vpntest general-attributesaddress-pool vpnpooldefault-group-policy vpntesttunnel-group vpntest ipsec-attributespre-shared-key ciscocrypto ipsec transform-set cisco esp-des esp-md5-hmac crypto dynamic-map vpntest 1 set transform-set cisco crypto dynamic-map vpntest 1 set reverse-route crypto map cisco 1 ipsec-isakmp dynamic vpntest crypto map cisco interface outsidecrypto isakmp enable outsidecrypto isakmp policy 10authentication pre-shareencryption aeshash shagroup 2RADIUS认证用户:aaa-server vpntest protocol radiusaaa-server vpntest (outside) host 192.168.1.100key ciscotunnel-group vpntest general-attributes authentication-server-group (outside) vpntestASA SSL VPN配置ip local pool vpnpool 192.168.2.200-192.168.2.210 username zhong password xiaodongwebvpnenable outsidesvc image disk0:/sslclient-win-1.1.3.173.pkgsvc enabletunnel-group-list enablegroup-policy webvpn internalgroup-policy webvpn attributesvpn-tunnel-protocol svc webvpnwebvpnsvc ask enabletunnel-group webvpn type remote-accesstunnel-group webvpn general-attributesaddress-pool vpnpooldefault-group-policy webvpntunnel-group webvpn webvpn-attributesgroup-alias hnebony enableIOS SSL VPN配置aaa new-modelaaa authentication login vpnauthen localusername zhong password xiaodongip local pool vpnpool 192.168.20.200 192.168.20.254interface loopback 0ip address 192.168.20.1 255.255.255.0exitwebvpn install svc disk0:/webvpn/svc.pkgwebvpn gateway outip address 192.168.1.99inservicewebvpn context vpntestpolicy group vpntestfunctions svc-enabledsvc address-pool vpnpoolsvc split include 192.168.0.0 255.255.0.0exitdefault-group-policy vpntestaaa authentication list vpnauthengateway outinserviceIOS Easy VPN Server配置:aaa new-modelaaa authentication login vpnauthen localaaa authorization network vpnauthor localusername zhong password xiaodongip local pool vpnpool 192.168.20.200 192.168.20.254ip access-list extended splitpermit ip 192.168.0.0 0.0.255.255 192.168.20.0 0.0.0.255 crypto isakmp policy 1authentication pre-sharehash md5group 2crypto isakmp client configuration group vpntestkey ciscopool vpnpoolacl splitcrypto ipsec transform-set cisco esp-aes esp-sha-hmac crypto dynamic-map vpndymap 1set transform-set ciscoreverse-routecrypto map vpntest client authentication list vpnauthen crypto map vpntest client configuration address respond crypto map vpntest isakmp authorization list vpnauthor crypto map vpntest 10 ipsec-isakmp dynamic vpndymap inter f0/0crypto map vpntest使用ACS认证与授权:aaa authentication login vpnauthen group radiusaaa authorization network vpnauthor group radiusradius-server host 192.168.1.100 auth-port 1645 acct-port 1646 key ciscoRADIUS (IETF)选中6、64、65、69、81.建立用户:vpntest(vpn组路由器配置crypto isakmp client configuration group vpntest可以取消)然后建立用户IOS Easy VPN Client配置:crypto ipsec client ezvpn vpntestmode clientconnect autopeer 192.168.10.1group vpntest key ciscousername zhong password xiaodonginterface f0/0crypto ipsec client ezvpn vpntestinterface f1/0crypto ipsec client ezvpn vpntest inside R1#crypto ipsec client ezvpn xauthUsername: zhongPassword:3、802.1X认证aaa new-modelaaa authentication dot1x default group radius aaa authorization network default group radius radius-server host 192.168.1.100 key cisco dot1x system-auth-controlinterface f0/1dot1x port-control auto指定VLAN:4、RSTPAlternate port—Offers an alternate path toward the root switch to that provided by the current root port.Backup port—Acts as a backup for the path provided by a designated port toward the leaves of the spanning tree. A backup port can exist only when two ports are connected in a loopback by a point-to-point link or when a switch has two or more connections to a shared LAN segment.Edge ports—If you configure a port as an edge port on an RSTP switch by using the spanning-tree portfast interface configuration command, the edge port immediately transitions to the forwarding state. An edge port is the same as a Port Fast-enabled port, and you should enable it only on ports that connect to a single end station.Root ports—If the RSTP selects a new root port, it blocks the old root port and immediately transitions the new root port to the forwarding state.Point-to-point links—If you connect a port to another port through a point-to-point link and the local port becomes a designated port, it negotiates a rapid transition with the other port by using the proposal-agreement handshake to ensure a loop-free topology. As shown in Figure 18-4, Switch A is connected to Switch B through a point-to-point link, and all of the ports are in the blocking state. Assume that the priority of Switch A is a smaller numerical value than the priority of Switch B. Switch A sends a proposal message (a configuration BPDU with the proposal flag set) to Switch B, proposing itself as the designated switch. After receiving theproposal message, Switch B selects as its new root port the port from which the proposalmessage was received, forces all nonedge ports to the blocking state, and sends an agreement message (a BPDU with the agreement flag set) through its new root port. After receiving Switch B’s agreement message, Switch A also immediately transitions its designated port to the forwarding state. No loops in the network are formed because Switch B blocked all of its nonedge ports and because there is a point-to-point link between Switches A and B. When Switch C is connected to Switch B, a similar set of handshaking messages are exchanged.Switch C selects the port connected to Switch B as its root port, and both ends immediately transition to the forwarding state. With each iteration of this handshaking process, one more switch joins the active topology. As the network converges, this proposal-agreement handshaking progresses from the root toward the leaves of the spanning tree. The switch learns the link type from the port duplex mode: a full-duplex port is considered to have a point-to-point connection; a half-duplex port is considered to have a shared connection. You can override the default setting that is controlled by the duplex setting by using the spanning-tree link-type interface configuration command.5、时间访问列表time-range zxdabsolute start 08:30 24 August 2009 end 18:00 01 September 2009time-range ciscoperiodic daily 8:00 to 18:00access-list 110 permit ip any any time-range cisco6、QOSCAR:rate-limit input access-group 101 1000000 3000 4000 conform-action transmit exceed-action dropGTS:class-map match-all ciscomatch access-group 101!!policy-map ciscoclass ciscopolice cir 500000 bc 10000 pir 1000000 be 10000conform-action transmitexceed-action set-prec-transmit 2violate-action dropinterface f1/0service-policy output ciscoCBWFQ:class-map match-all cbwfqmatch access-group 101policy-map cbwfqclass cbwfqpriority percent 60interface f1/0service-policy output cbwfq7、NA T-T8、标准化产品特色:1定位准确,以就业为导向。

ASA防火墙配置命令-王军

ASA防火墙配置命令-王军

ASA防火墙配置命令(v1.0)版本说明目录1. 常用技巧 (3)2. 故障倒换 (3)3. 配置telnet、ssh及http管理 (5)4. vpn常用管理命令 (5)5. 配置访问权限 (6)6. 配置sitetosite之VPN (6)7. webvpn配置(ssl vpn) (7)8. 远程拨入VPN (8)9. 日志服务器配置 (10)10. Snmp网管配置 (11)11. ACS配置 (11)12. AAA配置 (11)13. 升级IOS (12)14. 疑难杂症 (12)1. 常用技巧Sh ru ntp查看与ntp有关的Sh ru crypto 查看与vpn有关的Sh ru | inc crypto 只是关健字过滤而已2. 故障倒换failoverfailover lan unit primaryfailover lan interface testint Ethernet0/3failover link testint Ethernet0/3failover mac address Ethernet0/1 0018.1900.5000 0018.1900.5001 failover mac address Ethernet0/0 0018.1900.4000 0018.1900.4001 failover mac address Ethernet0/2 0018.1900.6000 0018.1900.6001 failover mac address Management0/0 0018.1900.7000 0018.1900.7001 failover interface ip testint 10.3.3.1 255.255.255.0 standby 10.3.3.2 注:最好配置虚拟MAC地址sh failover显示配置信息write standby写入到备用的防火墙中failover命令集如下:configure mode commands/options:interface Configure the IP address and mask to be used for failover and/or stateful update informationinterface-policy Set the policy for failover due to interface failureskey Configure the failover shared secret or keylan Specify the unit as primary or secondary or configure the interface and vlan to be used for failover communication link Configure the interface and vlan to be used as a link for stateful update informationmac Specify the virtual mac address for a physical interface polltime Configure failover poll intervalreplication Enable HTTP (port 80) connection replicationtimeout Specify the failover reconnect timeout value forasymmetrically routed sessionssh failover 命令集如下:history Show failover switching historyinterface Show failover command interface informationstate Show failover internal state informationstatistics Show failover command interface statistics information| Output modifiers<cr>3. 配置telnet、ssh及http管理username jiang password Csmep3VzvPQPCbkx encrypted privilege 15aaa authentication enable console LOCALaaa authentication telnet console LOCALaaa authentication ssh console LOCALaaa authorization command LOCALhttp 192.168.40.0 255.255.255.0 managementssh 192.168.40.0 255.255.255.0 inside4. vpn常用管理命令sh vpn-sessiondb full l2l 显示site to site 之vpn通道情况sh ipsec stats 显示ipsec通道情况sh vpn-sessiondb summary 显示vpn汇总信息sh vpn-sessiondb detail l2l 显示ipsec详细信息sh vpn-sessiondb detail svc 查看ssl client信息sh vpn-sessiondb detail webvpn 查看webvpn信息sh vpn-sessiondb detail full l2l 相当于linux下的ipsec whack –status 如果没有建立连接,则表示ipsec通道还没有建立起来。

asa配置手册

asa配置手册

asa配置手册一些基础配置,个人工作学习中的一点整理,如有错误请指正,谢谢。

#设置主机名:(config)#hostname dust#设置时区:dust(config)#clock timezone EST 7#设置时钟:dust#clock set 15:45:30 28 FEB 2008#配置内接口 IPdust(config)#int Ethernet 0/0dust(config-if)#nameif insidedust(config-if)#security-level 100dust(config-if)#ip address 192.168.88.254 255.255.255.0#配置外部接口IPdust(config)#int Ethernet 0/1dust(config-if)#nameif outsidedust(config-if)#security-level 0dust(config-if)#ip address 210.X.X.X 255.255.255.248#配置用户名和密码dust(config)#username admin password ********* privilege 15 注:15 表示有最高权限#配置HTTP 和TELNETdust(config)#aaa authentication telnet console LOCALdust(config)#http server enabledust(config)#http 192.168.88.0 255.255.255.0 insidedust(config)#telnet 192.168.88.0 255.255.255.0 inside#配置SSH接入:dust(config)#crypto key generate rsa modulus 1024dust(config)#aaa authentication ssh console LOCALdust(config)#ssh 192.168.88.0 255.255.255.0 insidedust(config)#ssh 0 0 outsidedust(config)#ssh timeout 30dust(config)#ssh version 2#配置ASDM(自适应安全设备管理器)接入:dust(config)#http server enable 8080dust(config)#http 192.168.88.0 255.255.255.0 insidedust(config)#http 0 0 outsidedust(config)#asdm image disk0:/asdm-621.bindust(config)#username dust password ccie privilege 15#动态NAT:dust(config)#nat-controldust(config)#nat (inside) 1 192.168.10.0 255.255.255.0dust(config)#nat (inside) 1 0 0dust(config)#global (outside) 1 interfacedust(config)#global (dmz) 1 192.168.202.100-192.168.202.110#静态NATdust(config)#static (dmz.outside) 210.10.10.253 192.168.202.1dust(config)#access-list ccie extended permit tcp any host 210.10.10.253 eq wwww dust(config)#access-group ccie in interface outside#配置ACLdust(config)#access-list ccie extended deny ip 192.168.201.0 255.255.255.240 any dust(config)#access-list ccie extended permit ip any anydust(config)#access-group ccie in interface inside#ICMP协议dust(config)#icmp deny any echo outsidedust(config)#icmp permit any outsidedust(config)#access-list 111 permit icmp any any echo-reply dust(config)#access-list 111 permit icmp any any unrechable dust(config)#access-list 111 permit icmp any any time-exceededdust(config)#access-group 111 in interface outside#配置默认路由dust(config)#route ouside 0.0.0.0 0.0.0.0 220.1.1.1 1#配置DHCP服务器dust(config)#dhcpd address 192.168.10.50-192.168.10.100 insidedust(config)#dhcpd enable insidedust(config)#dhcpd dns 202.102.192.68 insidedust(config)#dhcpd lease 86400 interface insidedust(config)#dhcpd option xx ip 192.168.10.10#保存配置dust#write memory 或copy running-config startup-config #清除配置dust(config)#clear configure alldust(config)#clear configure xxx xxxasa remote vpn#在outside接口上启用isakampdust#configure terminaldust(config)#crypto isakmp enable outside#创建一个isakmp策略dust(config)#crypto isakmp policy 1dust(config-isakmp-policy)#authentication pre-sharedust(config-isakmp-policy)#encryption desdust(config-isakmp-policy)#hash md5dust(config-isakmp-policy)#group 2dust(config-isakmp-policy)#lifetime 86400#配置组策略dust(config)#group-policy mypolicy internaldust(config)#group-policy mypolicy attributesdust(config-group-policy)#vpn-tunnel-protocol ipsecdust(config-group-policy)#split-tunnel-policy tunnelspecifieddust(config-group-policy)#nem enable#定义地址池dust(config)#ip local pool vpn-pool 192.168.88.110-192.168.88.120#定义隧道组dust(config)#tunnel-group cisco type remote-accessdust(config)#tunnel-group cisco general-attributesdust(config-tunnel-general)#address-pool vpn-pooldust(config-tunnel-general)#authentication-server-group (outside) LOCAL dust(config-tunnel-general)#default-group-policy mypolicydust(config-tunnel-general)#tunnel-group cisco ipsec-attributesdust(config-tunnel-ipsec)#pre-shared-key cisco#配置转换集dust(config)#crypto ipsec transform-set ccsp esp-des esp-md5-hmacdust(config)#crypto ipsec transform-set cisco esp-des esp-md5-hmac#添加本地帐户dust(config)#username user01 password adminabcdust(config)#username user02 password admindec#定义映射集,并应用到外部接口dust(config)#crypto dynamic-map dyn-map 10 set transform-set ccsp ciscodust(config)#crypto dynamic-map dyn-map 10 set reverse-routedust(config)#crypto map cisco 60001 ipsec-isakmp dynamic dyn-mapdust(config)#crypto map cisco interface outside#配置分离隧道dust(config)#access-list split_list standard permit 192.168.88.0 255.255.255.0 dust(config)#group-policy mypolicy attributesdust(config-group-policy)#split-tunnel-policy tunnelspecifieddust(config-group-policy)#split-tunnel-network-list value split_listdust(config-group-policy)#dns-server value 202.102.192.68 8.8.8.8#放行访问列表dust(config)#access-list 100 extended permit ip 192.168.88.0 255.255.255.0 192.168.88.0 255.255.255.0dust(config)#access-list 111 extended permit icmp any any echo-replydust(config)#access-list 111 extended permit icmp any any unreachabledust(config)#access-list 111 extended permit icmp any any time-exceededdust(config)#nat (inside) 0 access-list split_listdust(config)#access-group 111 in interface outsidedust(config)#access-group 100 in interface outsidedust(config)#access-group 100 in interface inside#查看被asp和acl drop的包dust(config)# show asp drop frame acl-drop客户端连接时,地址为outside的IP,组名为cisco 密码为cisco。

ASA 5505配置手册

ASA 5505配置手册

ASA 5505 配置手册1. 初始配置ciscoasa> enable 从进入用户模式进入特权模式ciscoasa# configure terminal 从特权模式进入全局配置模式ciscoasa(config)# hostname AYKJ-FW 更改防火墙名称AYKJ-FW(config)# passwd aykj 配置远程登录密码AYKJ-FW(config)# enable password aykj 配置enable密码2. 端口配置AYKJ-FW(config)# interface Vlan2 创建SVI口,ASA5505必须通过SVI口配置地址AYKJ-FW(config)# nameif outside 定义为outside口,即连接外网接口AYKJ-FW(config)# security-level 0 定义安全级别,范围0~100,其中inside、outside 口安全级别为系统自动定义和生成AYKJ-FW(config)# ip address 221.226.186.58 255.255.255.252 配置运营商分配公网地址AYKJ-FW(config)# interface Vlan3AYKJ-FW(config)# nameif inside 定义为inside口,即连接内网接口AYKJ-FW(config)# security-level 100 inside口默认安全级别100AYKJ-FW(config)# ip address 10.0.0.1 255.255.255.0 配置内网口地址3. 管理配置AYKJ-FW(config)# telnet 0.0.0.0 0.0.0.0 inside 允许内网所有地址通过telnet登录防火墙AYKJ-FW(config)# ssh 0.0.0.0 0.0.0.0 outside 允许外网所有地址通过ssh登录防火墙AYKJ-FW(config)# ssh version 1 使用ssh版本1AYKJ-FW(config)# http server enable 开启web页面,即开启asdm,与传统的如ASA5520等有专门管理口的防火墙不同,ASA5505只要启用服务,并应用到端口,那么只要网络通畅就可以通过asdm管理,更加灵活AYKJ-FW(config)# http 0.0.0.0 0.0.0.0 insideAYKJ-FW(config)# http 0.0.0.0 0.0.0.0 outside 这两条命令意味着所有只要能够访问防火墙的地址均可以通过asdm管理防火墙4. 路由配置AYKJ-FW(config)# route outside 0.0.0.0 0.0.0.0 221.226.186.57 配置上网默认路由,下一条为运营商分配的网关AYKJ-FW(config)# route inside [内网网段] [掩码] [防火墙内网口] 配置内网路由,由于本次内网与防火墙在一个地址段,所以不需要5. NAT配置5.1 动态NAT配置AYKJ-FW(config)# global (outside) 1 interface 将outside接口设置为NA T的外网接口AYKJ-FW(config)# nat (inside) 1 10.0.0.0 255.255.255.0 允许内网网段通过NA T访问互联网5.2 静态NAT映射AYKJ-FW(config)# access-list perout extended permit tcp any host 221.226.186.58 eq www 首先在防火墙外网口开放需要做映射的端口AYKJ-FW(config)# access-group perout in interface outside 在外网口启用该ACLAYKJ-FW(config)# static (inside,outside) tcp interface www 10.0.0.150 www netmask 255.255.255.255 将内网服务器的端口映射到外网AYKJ-FW(config)# global (inside) 1 interfaceAYKJ-FW(config)# static (inside,inside) tcp 221.226.186.58 www 10.0.0.150 www netmask 255.255.255.255 以上两条命令的作用是当内网用户通过外网地址去访问内网服务器时,直接映射到内网,如果不做则内网用户不能通过外网地址访问内网服务器6. VPN配置6.1 VPN基础配置AYKJ-FW(config)# ip local pool vpn 10.0.1.210-10.0.1.220 mask 255.255.255.0 创建vpn 地址池,地址池应与本地网段不在同一个段AYKJ-FW(config)# access-list inside_nat0_outbound extended permit ip 10.0.0.0255.255.255.0 10.0.1.0 255.255.255.0 定义vpn流量与内网流量的互访AYKJ-FW(config)# nat (inside) 0 access-list inside_nat0_outbound 该流量不参与nat翻译AYKJ-FW(config)# access-list split standard permit 10.0.0.0 255.255.255.0 定义vpn用户允许访问网段AYKJ-FW(config)# username asa password cisco 创建vpn用户,不做策略则该用户可以通过SSL和IPSEC拨入VPN6.2 SSL(WEB) VPN配置AYKJ-FW(config)# webvpn 配置webvpnAYKJ-FW(config-webvpn)# enable outside 在外网口启用webvpnAYKJ-FW(config-webvpn)# svc image disk0:/anyconnect-win-2.4.1012-k9.pkg 调用vpn 客户端软件AYKJ-FW(config-webvpn)# svc enable 启用客户端软件AYKJ-FW(config)# group-policy ssl internal 创建webvpn组策略AYKJ-FW(config)# group-policy ssl attributes 配置组策略属性AYKJ-FW(config-group-policy)# vpn-tunnel-protocol svc webvpn 启用webvpn隧道AYKJ-FW(config-group-policy)# split-tunnel-policy tunnelspecified 只允许split匹配流量通过vpn隧道AYKJ-FW(config-group-policy)# split-tunnel-network-list value split 水平分割策略使用split,由于vpn用户没有网关,需要通过该策略使vpn用户访问内网AYKJ-FW(config)# tunnel-group ssl type remote-access 创建vpn隧道,类型为远程接入AYKJ-FW(config)# tunnel-group ssl general-attributes 配置vpn隧道基础属性AYKJ-FW(config-tunnel-general)# address-pool vpn 调用vpn地址池6.3 IPSEC VPN 配置AYKJ-FW(config)# crypto isakmp enable outside 在outside口启用ipsec vpnAYKJ-FW(config)# crypto isakmp disconnect-notify 连接中断时报错AYKJ-FW(config)# crypto isakmp policy 10 配置策略优先级AYKJ-FW(config-isakmp-policy)# authentication pre-share 通过预共享密钥拨入vpn AYKJ-FW(config-isakmp-policy)# encryption 3des通过3des格式加密数据AYKJ-FW(config-isakmp-policy)# hash md5 通过md5算法校验数据AYKJ-FW(config-isakmp-policy)# group 2 设置迪夫-赫尔曼算法组AYKJ-FW(config-isakmp-policy)# lifetime 86400 设置连接时长AYKJ-FW(config)# group-policy aykj internal创建ipsec vpn策略组AYKJ-FW(config)# group-policy aykj attributes 配置策略组属性AYKJ-FW(config-group-policy)# vpn-tunnel-protocol IPSec 启用ipsec vpn隧道AYKJ-FW(config-group-policy)# split-tunnel-policy tunnelspecified 只允许split匹配流量通过vpn隧道AYKJ-FW(config-group-policy)# split-tunnel-network-list value split 水平分割策略使用split,由于vpn用户没有网关,需要通过该策略使vpn用户访问内网AYKJ-FW(config)# tunnel-group aykj type remote-access 创建vpn隧道,类型为远程接入AYKJ-FW(config)# tunnel-group aykj general-attributes 配置隧道基础属性AYKJ-FW(config-tunnel-general)# address-pool vpn调用地址池AYKJ-FW(config-tunnel-general)# default-group-policy aykj 调用组策略AYKJ-FW(config)# tunnel-group aykj ipsec-attributes 配置隧道ipsec属性AYKJ-FW(config-tunnel-ipsec)# pre-shared-key aykj 预共享密钥为aykj。

asa配置步骤

asa配置步骤

思科防火墙已经从PIX发展到ASA了,IOS也已经从早期的6.0发展到7.2。

但总体的配置思路并没有多少变化。

只是更加人性化,更加容易配置和管理了。

下面是我工作以来的配置总结,有些东西是6.3版本的,但不影响在7.*版本的配置。

一:6个基本命令: nameif、 interface、 ip address 、nat、 global、 route。

二:基本配置步骤:step1: 命名接口名字nameif ethernet0 outside security0nameif ethernet1 inside security100nameif ethernet2 dmz security50**7版本的配置是先进入接口再命名。

step2:配置接口速率interface ethernet0 10full autointerface ethernet1 10full autointerface ethernet2 10fullstep3:配置接口地址ip address outside 218.106.185.82ip address inside 192.168.100.1 255.255.255.0ip address dmz 192.168.200.1 255.255.255.0step4:地址转换(必须)* 安全高的区域访问安全低的区域(即内部到外部)需NAT和global;nat(inside) 1 192.168.1.1 255.255.255.0global(outside) 1 222.240.254.193 255.255.255.248*** nat (inside) 0 192.168.1.1 255.255.255.255 表示192.168.1.1这个地址不需要转换。

直接转发出去。

* 如果内部有服务器需要映射到公网地址(外网访问内网)则需要static和conduit或者acl.static (inside, outside) 222.240.254.194 192.168.1.240static (inside, outside) 222.240.254.194 192.168.1.240 10000 10后面的10000为限制连接数,10为限制的半开连接数。

ASA型号及配置命令

ASA型号及配置命令

ASA型号及配置命令asa复习笔记一、cisco防火墙1.软件防火墙它用于基于IOS软件的设备。

一般来说,客户端上具有应用层智能的状态检测防火墙引擎占CPU和内存资源的2.5%(可以定期欣赏)硬件防火墙(更多优势)应用在一般企业外部网络:pix500系列安全设备、asa5500系列自适应安全设备、catalyst6500系列交换机和cisco7600系列路由器的防火墙服务模块(不可以定期升值)二、 Ciscosa1常见型号:型号asa5505asa5510asa5520asa5540asa5550asa5580规模作用交换机接小型企业、分公司和企业设备成本低,易于部署、集成8个10/100端口快速口远程办公环境以太网交换机中型企业、分公司企业环设备成本低,易于部署,具有高级安全和网络服务境中型企业具有模块化、高性能网络中的高可用性主动/主动服路(小凡模拟器)务,并能连接千兆以太网设备由大中型企业,服务提供商提供高密度,主动/主动高可用性服务和千兆以太网连器接,设备具有高可靠性和高性能接大型企业、服务提供商网千兆级提供高达1.2gb/s的防火墙吞吐量,具有主动口络的高性能设备/主动高可用性服务、光纤和千兆位以太网连接性大型企业、数据中心、和提供王兆位以太网连接运营商网络型号为asa5580-20、asa5580-402.基本配置配置主机名:ciscoasa>enciscoasa#cinft思科ASA(配置)#主机名ASA802域名:asa802(config)#enablepassword123telnet或ssh密码:Asa802(配置)#passwdciscoasa接口名称和安全级别asa802(config-if)#nameifinside(不起名,ping不通)Asa802(如果配置)#安全级别100(值为0-100,值越大,安全级别越高)//默认情况下,outside口安全级别为0,inside口安全级别为100,防火墙允许数据从高安全级别流向低安全级别的接口,但不允许流量从低安全级别流向高安全级别的接口,若要放行,必须做策略,acl放行;若接口的安全级别相同,那么它们之间不允许通信,绝对不允许,但有时有这个需要,故意把它们设成一样。

asa防火墙命令

asa防火墙命令一、基本配置#hostname name //名字的设置#interface gigabitethernet0/0 //进入接口0/0#nameif outside //配置接口名为outside#security-level 0 //设置安全级别。

级别从0--100,级别越高安全级别越高#ip address 218.xxx.xxx.xxx 255.255.255.248 //设置外部ip地址#no shutdown#interface ethernet0/1 //进入接口0/1#nameif inside //配置接口名为inside#security-level 100 //设置安全级别。

级别从0--100,级别越高安全级别越高#ip address 192.168.10.1 255.255.255.0 //设置ip地址#duplex full //全双工#speed 100 //速率#no shutdown#interface ethernet0/2 //进入接口0/2#nameif dmz //配置接口名为dmz#security-level 50 //设置安全级别。

级别从0--100,级别越高安全级别越高#ip address 192.168.9.1 255.255.255.0 //设置dmz接口ip地址#no shutdown#interface Management0/0 //进入管理接口# nameif guanli //接口名# security-level 100 //安全级别#ip address 192.168.1.1 255.255.255.0 //IP地址注意:security-level 配置安全级别。

默认外网接口为0/0 安全级别默认为0内网接口为0/1 安全级别默认为100dmz 接口为0/2 安全级别默认为50默认情况下,相同安全级别接口之间不允许通信,可以使用以下命令:#same-security-traffic permit interface //允许相同安全级别接口之间互相通信。

ASA配置命令

要想配置思科的防火墙得先了解这些命令:常用命令有:nameif、interface、ip address、nat、global、route、static等。

global指定公网地址范围:定义地址池。

Global命令的配置语法:global (if_name) nat_id ip_address-ip_address [netmarkglobal_mask]其中:(if_name):表示外网接口名称,一般为outside。

nat_id:建立的地址池标识(nat要引用)。

ip_address-ip_address:表示一段ip地址范围。

[netmark global_mask]:表示全局ip地址的网络掩码。

nat地址转换命令,将内网的私有ip转换为外网公网ip。

nat命令配置语法:nat (if_name) nat_id local_ip [netmark]其中:(if_name):表示接口名称,一般为inside.nat_id:表示地址池,由global命令定义。

local_ip:表示内网的ip地址。

对于0.0.0.0表示内网所有主机。

[netmark]:表示内网ip地址的子网掩码。

routeroute命令定义静态路由。

语法:route (if_name) 0 0 gateway_ip [metric]其中:(if_name):表示接口名称。

0 0 :表示所有主机Gateway_ip:表示网关路由器的ip地址或下一跳。

[metric]:路由花费。

缺省值是1。

static配置静态IP地址翻译,使内部地址与外部地址一一对应。

语法:static(internal_if_name,external_if_name) outside_ip_addr inside_ ip_address其中:internal_if_name表示内部网络接口,安全级别较高,如inside。

external_if_name表示外部网络接口,安全级别较低,如outside。

第8章拓展篇-ASA高级配置

dhcpd dns 202.106.0.20 202.106.46.151 –配置DNS服务器地址dhcpd wins 10.1.1.20 –配置WINS服务器dhcpd address 10.1.1.100-10.1.1.200 inside 分配地址100-200在inside接口dhcpd enable inside --开启inside接口上的DHCPdhcpd address 172.16.1.10-172.16.1.20dhcpd enable dmzasacisco(config)# interface Ethernet0/0 --进入接口asacisco(config-if)# nameif outsideasacisco(config-if)# security-level 0asacisco(config-if)# pppoe client vpdn group ADSL 开启pppoeasacisco(config-if)# ip address pppoe setroute 自动创建一个缺省路由asacisco(config)# vpdn group ADSL request dialout pppoe --请求pppoe拨号asacisco(config)# vpdn group ADSL localname fs87829050–ADSL用户名asacisco(config)# vpdn group ADSL ppp authentication pap --认证方式asacisco(config)# vpdn username fs87829050password ********* -adsl用户名密码定义安全策略ACL(访问控制列表)分为标准和扩展,区别在与标准的只基于源,而扩展的基于源和目的ACL号标准的1-99 扩展100-199asacisco(config)# access-list (word) (permit/deny)(源网络,源主机)asacisco(config)# access-list 10 standard permit 153.31.53.0 255.255.255.0扩展ACLasacisco(config)# access-list (word) (permit/deny) (协议tcp/udp/ip) (源网络,源主机) (目的网络,目的主机) asacisco(config)# access-list 101 permit ip 172.16.1.0 255.255.255.0 10.1.1.0 255.255.255.0(--允许172.16.1.0/24网段访问,10.1.1.0/24网段)asacisco(config)# access-list 100 permit tcp any(源) host 211.1.1.3(目的) eq 80--any 所有源地址host 只针对主机ep就是= 211.1.1.3 80端口asacisco(config)# access-list 100 extended permit tcp any host 211.1.1.3 eq 80--允许外部所有主机访问211.1.1.3的80端口asacisco(config)# access-group 100 in interface outside --将100 ACL应用到outside接口上asacisco(config)# access-group 101 in interface inside –将101 ACL 应用到inside接口上对象分组asacisco(config)# object-group service对象分组名字tcp/udp协议object-group service yongyou tcp(例子)port-object eq 5872 开启的端口port-object eq 1872 开启的端口Exit 退出asacisco(config)# access-list out extended permit tcp any host 211.1.1.3 object-group yongyou(写一个ACL命名为out 协议为tcp允许外部所有主机访问211.1.1.3 的5872\1872)asacisco(config)# access-group out in interface outside(将ACL应该在outside接口上)设置透明模式•转换模式•定义接口•设置管理IP(211.1.1.2/24)•透明模式下安全策略的定义和路由模式的设置是一样的VPN借助IPSec,用户可以通过互联网等不受保护的网络传输敏感信息。

ASA防火墙配置命令注释

name 172.16.0.0 Client description neibujisuanji//把ip地址进行文字命名,可以在acl里调用的时候用命名来代替地址。

name 172.16.136.11 a-136.11// 例如将172.16.136.11 用命名“a-136.11”来替代,a代表接入层。

name 172.16.101.30 a-101.30name 172.16.101.0 jisuanjishi description jisuanjishiname 172.16.153.161 a-153.161name 172.16.153.162 a-153.162name 172.16.153.163 a-153.163name 172.16.147.78 a-147.78name 172.16.101.54 a-101.54name 172.16.153.160 a-153.160name 172.16.153.164 a-153.164name 172.16.153.26 a-153.26name 172.16.101.12 a-101.12name 202.106.73.101 pat_testname 172.16.143.55 guke-caixuname 172.16.101.32 specialusename 172.16.133.40 yaopinbuliangname 172.16.146.189 a-146.189name 172.16.101.50 tempname 172.16.130.68 sunkainame 211.103.242.13 pla-libaryname 172.16.103.213 zjpname 172.16.134.187 zzjname 172.16.185.21 guojihuiyi description chengpengdns-guard!interface Ethernet0/0nameif outsidesecurity-level 0//设置接口名称,并指定安全级别,安全级别取值范围为1~100,数字越大安全级别越高。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

要想配置思科的防火墙得先了解这些命令:常用命令有:nameif、interface、ip address、nat、global、route、static等。

global指定公网地址范围:定义地址池。

Global命令的配置语法:global (if_name) nat_id ip_address-ip_address [netmarkglobal_mask]其中:(if_name):表示外网接口名称,一般为outside。

nat_id:建立的地址池标识(nat要引用)。

ip_address-ip_address:表示一段ip地址范围。

[netmark global_mask]:表示全局ip地址的网络掩码。

nat地址转换命令,将内网的私有ip转换为外网公网ip。

nat命令配置语法:nat (if_name) nat_id local_ip [netmark]其中:(if_name):表示接口名称,一般为inside.nat_id:表示地址池,由global命令定义。

local_ip:表示内网的ip地址。

对于0.0.0.0表示内网所有主机。

[netmark]:表示内网ip地址的子网掩码。

routeroute命令定义静态路由。

语法:route (if_name) 0 0 gateway_ip [metric]其中:(if_name):表示接口名称。

0 0 :表示所有主机Gateway_ip:表示网关路由器的ip地址或下一跳。

[metric]:路由花费。

缺省值是1。

static配置静态IP地址翻译,使内部地址与外部地址一一对应。

语法:static(internal_if_name,external_if_name) outside_ip_addr inside_ ip_address其中:internal_if_name表示内部网络接口,安全级别较高,如inside。

external_if_name表示外部网络接口,安全级别较低,如outside。

outside_ip_address表示外部网络的公有ip地址。

inside_ ip_address表示内部网络的本地ip地址。

(括号内序顺是先内后外,外边的顺序是先外后内)例如:asa(config)#static (inside,outside) 133.0.0.1 192.168.0.8表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址************************************************************************** asa#conf tasa(config)# hostname asa //设置主机名asa(config)#enable password cisco //设置密码配置外网的接口,名字是outside,安全级别0,输入ISP给您提供的地址就行了。

asa(config)#interface GigabitEthernet0/0asa(config)#nameif outside //名字是outsideasa(config)#securit-level 0 //安全级别0asa(config)#ip address *.*.*.* 255.255.255.0 //配置公网IP地址asa(config)#duplex fullasa(config)#asa(config)#no shutdown配置内网的接口,名字是inside,安全级别100asa(config)#interface GigabitEthernet0/1asa(config)#nameif insideasa(config)#securit-level 100asa(config)#duplex fullasa(config)#speed 100asa(config)#no shutdown配置DMZ的接口,名字是dmz,安全级别50asa(config)#interface GigabitEthernet0/2asa(config)#nameif dmzasa(config)#securit-level 50asa(config)#duplex fullasa(config)#asa(config)#no shutdown网络部分设置asa(config)#nat(inside) 1 192.168.1.1 255.255.255.0asa(config)#global(outside) 1 222.240.254.193 255.255.255.248asa(config)#nat (inside) 0 192.168.1.1 255.255.255.255 //表示192.168.1.1这个地址不需要转换。

直接转发出去。

asa(config)#global (outside) 1 133.1.0.1-133.1.0.14 //定义的地址池asa(config)#nat (inside) 1 0 0 //0 0表示转换网段中的所有地址。

定义内部网络地址将要翻译成的全局地址或地址范围配置静态路由asa(config)#route outside 0 0 133.0.0.2 //设置默认路由133.0.0.2为下一跳如果内部网段不是直接接在防火墙内口,则需要配置到内部的路由。

asa(config)#Route inside 192.168.10.0 255.255.255.0 192.168.1.1 1地址转换asa(config)#static (dmz,outside) 133.1.0.1 10.65.1.101 ;静态NATasa(config)#static (dmz,outside) 133.1.0.2 10.65.1.102 ;静态NATasa(config)#static (inside,dmz) 10.66.1.200 10.66.1.200 ;静态NAT如果内部有服务器需要映射到公网地址(外网访问内网)则需要staticasa(config)#static (inside, outside) 222.240.254.194 192.168.1.240asa(config)#static (inside, outside) 222.240.254.194 192.168.1.240 10000 10 //后面的10000为限制连接数,10为限制的半开连接数ACL实现策略访问asa(config)#access-list 101 permit ip any host 133.1.0.1 eq www;设置ACLasa(config)#access-list 101 permit ip any host 133.1.0.2 eq ftp;设置ACLasa(config)#access-list 101 deny ip any any ;设置ACLasa(config)#access-group 101 in interface outside ;将ACL应用在outside端口当内部主机访问外部主机时,通过nat转换成公网IP,访问internet。

当内部主机访问中间区域dmz时,将自己映射成自己访问服务器,否则内部主机将会映射成地址池的IP,到外部去找。

当外部主机访问中间区域dmz时,对133.0.0.1映射成10.65.1.101,static是双向的。

PIX的所有端口默认是关闭的,进入PIX要经过acl入口过滤。

静态路由指示内部的主机和dmz的数据包从outside口出去。

思科ASA和PIX防火墙配置手册一、配置基础1.1用户接口思科防火墙支持下列用户配置方式:Console,Telnet,SSH(1.x或者2.0,2.0为7.x新特性,PDM的http方式(7.x以后称为ASDM)和VMS的Firewall Management Center。

支持进入Rom Monitor模式,权限分为用户模式和特权模式,支持Help,History和命令输出的搜索和过滤。

注:Catalyst6500的FWSM没有物理接口接入,通过下面CLI命令进入:Switch# session slot slot processor 1 (FWSM所在slot号)用户模式:Firewall> 为用户模式,输入enable进入特权模式Firewall#。

特权模式下可以进入配置模式,在6.x所有的配置都在一个全局模式下进行,7.x以后改成和IOS类似的全局配置模式和相应的子模式。

通过exit,ctrl-z退回上级模式。

配置特性:在原有命令前加no可以取消该命令。

Show running-config 或者write terminal显示当前配置,7.x后可以对show run 的命令输出进行搜索和过滤。

Show running-config all显示所有配置,包含缺省配置。

Tab可以用于命令补全,ctrl-l可以用于重新显示输入的命令(适用于还没有输入完命令被系统输出打乱的情况),help和history相同于IOS命令集。

Show命令支持begin,include,exclude,grep 加正则表达式的方式对输出进行过滤和搜索。

Terminal width 命令用于修改终端屏幕显示宽度,缺省为80个字符,pager命令用于修改终端显示屏幕显示行数,缺省为24行,pager lines 0命令什么效果可以自己试试。

1.2防火墙许可介绍防火墙具有下列几种许可形式,通过使用show version命令可以看设备所支持的特性:Unrestricted (UR) 所有的限制仅限于设备自身的性能,也支持FailoverRestricted (R) 防火墙的内存和允许使用的最多端口数有限制,不支持FailoverFailover (FO) 不能单独使用的防火墙,只能用于FailoverFailover-Active/Active (FO-AA) 只能和UR类型的防火墙一起使用,支持active/active failover 注:FWSM内置UR许可。

activation-key 命令用于升级设备的许可,该许可和设备的serial number有关(show version 输出可以看到),6.x为16字节,7.x为20字节。

1.3初始配置跟路由器一样可以使用setup进行对话式的基本配置。

二、配置连接性2.1配置接口接口基础:防火墙的接口都必须配置接口名称,接口IP地址和掩码(7.x开始支持IPv6)和安全等级。

接口可以是物理接口也可以是逻辑接口(vlan),从 6.3贾С?lt;/SPAN>trunk,但只支持802.1Q封装,不支持DTP协商。

相关文档
最新文档