Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1132455
  • 博文数量: 168
  • 博客积分: 4445
  • 博客等级: 上校
  • 技术积分: 1307
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-02 14:04
文章分类

全部博文(168)

文章存档

2018年(2)

2017年(5)

2016年(7)

2015年(1)

2014年(8)

2013年(1)

2012年(4)

2011年(54)

2010年(8)

2009年(19)

2008年(18)

2007年(36)

2006年(1)

2005年(4)

分类: 系统运维

2007-01-14 18:34:08

[quote][i]Originally posted by Admin[/i]
[br]思科ASA和PIX防火墙配置手册 第五章
by neoshi at gmail dot com

五 防火墙的访问控制
5.1 防火墙的透明模式
特性介绍:从PIX 7.0和FWSM 2.2开始防火墙可以支持透明的防火墙模式,接口不需要配置地址信息,工作在二层。只支持两个接口inside和outside,当然可以配置一个管理接口,但是管理接口不能用于处理用户流量,在多context模式下不能复用物理端口。由于连接的是同一地址段的网络,所以不支持NAT,虽然没有IP地址但是同样可以配置ACL来检查流量。
进入透明模式 Firewall(config)# firewall transparent (show firewall 来验证当前的工作模式,由于路由模式和透明模式工作方式不同,所以互相切换的时候会清除当前配置文件)
配置接口 Firewall(config)# interface hardware-id
Firewall(config-if)# speed {auto | 10 | 100 |nonegotiate}
Firewall(config-if)# duplex {auto | full | half}
Firewall(config-if)# [no] shutdown
Firewall(config-if)# nameif if_name
Firewall(config-if)# security-level level
注:不用配置IP地址信息,但是其它的属性还是要配置的,接口的安全等级一般要不一样,same-security-traffic permit inter-interface命令可以免除此限制。
配置管理地址 Firewall(config)# ip address ip_address subnet_mask
Firewall(config)# route if_name foreign_network foreign_mask gateway [metric]
MAC地址表的配置 Firewall# show mac-address-table 显示MAC地址表
Firewall(config)# mac-address-table aging-time minutes 设置MAC地址表过期时间
Firewall(config)# mac-address-table static if_name mac_address 设置静态MAC条目
Firewall(config)# mac-learn if_name disable 禁止特定接口地址学习(show mac-learn验证)
ARP检查 Firewall(config)# arp if_name ip_address mac_address 静态ARP条目
Firewall(config)# arp-inspection if_name enable [flood | no-flood] 端口启用ARP检查
为非IP协议配置转发策略 Firewall(config)# access-list acl_id ethertype {permit | deny} {any | bpdu | ipx | mpls-unicast | mpls-multicast | ethertype}
Firewall(config)# access-group acl_id {in | out} interface if_name
5.2 防火墙的路由模式和地址翻译
特性介绍:从高安全等级到低安全等级的访问称为outbound访问,需要配置地址翻译和outbound访问控制,PIX缺省情况下不用配置ACL就允许此类访问,FWSM则需要配置ACL来允许此类型的访问。而从低安全等级到高安全等级的访问称为inboud访问,也需要配置地址翻译和inboud访问控制,此类型必须配置ACL.同一安全等级的访问也可以配置地址翻译。
支持下列几种NAT类型
Translation Type
 Application
 Basic Command
 Direction in Which Connections Can Be Initiated
 
Static NAT
 Real source addresses (and ports) are translated to mapped addresses (and ports)
 static
 Inbound or outbound
 
Policy NAT
 Conditionally translates real source addresses (and ports) to mapped addresses
 static access-list
 Inbound or outbound
 
Identity NAT
 No translation of real source addresses
 nat 0
 Outbound only
 
NAT exemption
 No translation of real source addresses matched by the access list
 nat 0 access-list
 Inbound or outbound
 
Dynamic NAT
 Translates real source addresses to a pool of mapped addresses
 nat id
global id address-range
 Outbound only
 
PAT
 Translates real source addresses to a single mapped address with dynamic port numbers
 nat id
global id address
 Outbound only
 
配置
对于连接数的控制 PIX 6.x ... [norandomseq] [max_conns [emb_limit]]
PIX 7.x  ... [norandomseq] [[tcp] max_conns [emb_limit]] [udp udp_max_conns]
连接超时控制 Firewall(config)# timeout [conn hh:mm:ss] [udp hh:mm:ss]
静态NAT
基于地址的静态翻译 Firewall(config)# static (real_ifc,mapped_ifc) {mapped_ip | interface} {real_ip [netmask mask]} [dns] [norandomseq] [max_conns [emb_limit]]
基于端口的静态翻译 Firewall(config)# static (real_ifc,mapped_ifc) {tcp | udp} {mapped_ip | interface} mapped_port {real_ip real_port [netmask mask]} [dns] [norandomseq] [max_conns [emb_limit]]
策略NAT
定义翻译策略 Firewall(config)# access-list acl_name permit ip real_ip real_mask foreign_ip foreign_mask
静态的 Firewall(config)# static (real_ifc,mapped_ifc) mapped_ip access-list acl_name [dns] [norandomseq] [max_conns [emb_limit]]
NAT的 Firewall(config)# global (mapped_ifc) nat_id {global_ip [-global_ip] [netmask global_mask]} | interface
Firewall(config)# nat (real_ifc) nat_id access-list acl_name [dns] [outside][norandomseq] [max_conns [emb_limit]]
Identify NAT Firewall(config)# nat (real_ifc) 0 real_ip real_mask [dns] [norandomseq] [max_conns [emb_limit]]
注:nat 0和static 相同地址的区别在于:nat 0只能用于outbound访问,static两种访问都可以,对同一地址不建议同时配置此两类命令。
NAT Exemption
Firewall(config)# access-list acl_name permit ip local_ip local_mask foreign_ip foreign_mask
Firewall(config)# nat (real_ifc) 0 access-list acl_name [dns] [outside] [max_conns [emb_limit] [norandomseq]]
注:此类型NAT策略只能根据源和目的地址不能根据协议类型或者端口
动态地址翻译
定义NAT的映射地址 Firewall(config)# global (mapped_ifc) nat_id global_ip[-global_ip] [netmask global_mask]
定义PAT的映射地址 Firewall(config)# global (mapped_ifc) nat_id {global_ip | interface}
定义翻译策略 Firewall(config)# nat (real_ifc) nat_id real_ip [mask [dns] [outside] [[norandomseq] [max_conns [emb_limit]]]
注:也可以使用ACL来做类似的策略NAT。
5.3 使用ACL进行访问控制
特性介绍:防火墙的ACL配置跟IOS不同,子网掩码部分为正常的子网掩码不需要使用反转的子网掩码。还支持Object group,包含IP地址组,ICMP类型组,IP协议或者端口组,并且支持组嵌套。access-list acl_name compiled配置Turbo ACL,7.x自动turbo。防火墙的ACL缺省是扩展模式的,7.x后也支持标准模式了尽管只用于路由协议的配置上,并且加上了extend的参数,虽然配置的时候可以不必强制用这个参数但是当你需要移除该条目的时候要记得把extend这个参数加上。
配置
定义Object Group
网络对象组 Firewall(config)# object-group network group_id
Firewall(config-network)# description text
Firewall(config-network)# network-object ip_addr mask (或者 host ip_addr)
Firewall(config-network)# group-object group_id
ICMP对象组 Firewall(config)# object-group icmp-type group_id
Firewall(config-icmp-type)# description text
Firewall(config-icmp-type)# icmp-object icmp_type
Firewall(config-icmp-type)# group-object group_id
协议对象组 Firewall(config)# object-group protocol group_id
Firewall(config-protocol)# description text
Firewall(config-protocol)# protocol-object protocol
Firewall(config-protocol)# group-object group_id
服务对象组 Firewall(config)# object-group service group_id {tcp | udp | tcp-udp}
Firewall(config-service)# description text
Firewall(config-service)# port-object range begin_port end_port (或者eq port)
Firewall(config-service)# group-object group_id
定义时间范围 7.0特性
Firewall(config)# time-range name
Firewall(config-time-range)# periodic start-day hh:mm to end-day hh:mm
Firewall(config-time-range)# periodic days-of-the-week hh:mm to hh:mm
Firewall(config-time-range)# absolute [start hh:mm day month year] [end hh:mm day month year]
配置ACL Firewall(config)# access-list acl_id [line line-num] [extended] {permit | deny}
   {protocol | object-group protocol_obj_group}   {source_addr  source_mask | object-group  network_obj_group} [operator sport | object-group service_obj_group]
   {destination_addr destination_mask |object-group network_obj_group}
 [operator dport | object-group service_obj_group] [log [[disable | default] | [level]]] [interval secs]] [time-range name] [inactive]

 
show access-list 来验证, clear access-list acl_id counters 重置ACL计数器
[/quote]
阅读(3899) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~