IOS zone-pair 防火墙的配置解析

本文详细介绍了Cisco IOS路由器中Zone-Pair防火墙的概念及其配置方法。通过将接口划分为不同的安全区域,并使用策略地图来控制不同区域间的流量,实现精细的网络访问控制。示例展示了如何设置特定的服务访问策略。

关于zone-pair 防火墙是把ios路由器的接口分为若干个区域,不同区域之间的流量是不能通讯的,这点类似与ASA的接口类型!这里我们要注意一下几点

1.确定相同的安全接口划分到同一zone。

2.运用class-map 抓住不同zone之间的流量,可以提供3-7层的流量检测

 

ZBF(config-pmap-c)#?
Policy-map class configuration commands:
  drop            Drop the packet
  exit            Exit from class action configuration mode
  inspect         Context-based Access Control Engine
  no              Negate or set default values of a command
  pass            Pass the packet
  police          Police                       对流量执行限速
  service-policy  Deep Packet Inspection Engine  深度包检测
  urlfilter       URL Filtering Engine    URL过滤

3.对于那个方向没有流量就不用配置了,因为默认的就是不同zone之间不允许通讯

4.policy-map  service-map的运用

我们就结合下面的例子说下

 

要求:

Hosts in Internet zone can reach DNS, SMTP, and SSH services on one server in the DMZ. The other server
will offer SMTP, HTTP, and HTTPS services. The firewall policy will restrict access to the specific services
available on each host.
 The DMZ hosts cannot connect to hosts in any other zone.
 Hosts in the client zone can connect to hosts in the server zone on all TCP, UDP, and ICMP services.
 Hosts in the server zone cannot connect to hosts in the client zone, except a UNIX-based application server
can open X Windows client sessions to X Windows servers on desktop PCs in the client zone on ports 6900 to
6910.
 All hosts in the private zone (combination of clients and servers) can access hosts in the DMZ on SSH, FTP,
POP, IMAP, ESMTP, and HTTP services, and in the Internet zone on HTTP, HTTPS, and DNS services and
ICMP. Furthermore, application inspection will be applied on HTTP connections from the private zone to the
Internet zone in order to assure that supported instant messaging and P2P applications are not carried on port
80. (See Figure 3.)

配置

class-map type inspect match-any pr-to-DMZ-class
 match protocol ssh
 match protocol http
 match protocol pop3
 match protocol imap
class-map type inspect match-any pr-to-bublic
 match protocol http
 match protocol https
 match protocol dns
 match protocol icmp
class-map type inspect match-any dns-http-class
 match protocol dns
 match protocol http
class-map type inspect match-any smtp-class
 match protocol smtp
class-map type inspect match-all smtp-acl-class
 match access-group 111
 match class-map smtp-class
class-map type inspect match-any x-class
 match protocol uucp
class-map type inspect match-all client-to-server-class
 match protocol tcp
 match protocol udp
 match protocol icmp
class-map type inspect match-all dns-http-acl-class
 match access-group 110
 match class-map dns-http-class
!
!
policy-map type inspect server-to-client-policy
 class type inspect x-class
 class class-default
policy-map type inspect clinet-to-server-policy
 class type inspect client-to-server-class
  inspect
 class class-default
policy-map type inspect pr-to-public-policy
 class type inspect pr-to-bublic
  inspect
 class class-default
policy-map type inspect pr-to-DMZ-policy
 class type inspect pr-to-DMZ-class
  inspect
 class class-default
policy-map type inspect internet-dmz-policy
 class type inspect dns-http-acl-class
  inspect
 class type inspect smtp-acl-class
  inspect
 class class-default
!
zone security DMZ
zone security pr
zone security public
zone security server
zone security client
zone-pair security pr-to-public source pr destination public
 service-policy type inspect pr-to-public-policy
zone-pair security pr-to-DMZ source pr destination DMZ
 service-policy type inspect pr-to-DMZ-policy
zone-pair security public-to-DMZ source public destination DMZ
 service-policy type inspect internet-dmz-policy
zone-pair security servers-clients source server destination client
 service-policy type inspect server-to-client-policy
zone-pair security client-to-server source client destination server
 service-policy type inspect clinet-to-server-policy

interface FastEthernet0/0
 ip address 172.16.1.1 255.255.255.0
 zone-member security public
 duplex auto
 speed auto
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
interface FastEthernet1/0
!
interface FastEthernet1/1
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
 no switchport
 ip address 172.16.2.1 255.255.255.0
 zone-member security DMZ
!
interface FastEthernet1/14
 switchport access vlan 2
!
interface FastEthernet1/15
!
interface Vlan1
 ip address 192.168.1.1 255.255.255.0
 zone-member security server
!
interface Vlan2
 ip address 192.168.2.1 255.255.255.0
 zone-member security client
!
router rip
 version 2
 network 172.16.0.0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary
!
ip route 0.0.0.0 0.0.0.0 172.16.1.2
!         
!
ip http server
no ip http secure-server
!
access-list 110 permit ip any host 172.16.2.2
access-list 111 permit ip any host 172.16.2.3

总结:这个配置挺麻烦的,其实核心不过是几个策略的应用,学过QOS的应该不陌生这不是和MQC有异曲同工之处吗

还有一点一个接口可以属于多个zone 在这个配置中int vlan 1既属于zone- security pr 又属于zone-security server  只不过这两个是相包含的关系,不知道是不是因为这样,大家谁做实验欢迎补充下

还有个细节文章没有说就是parmeter-map的应用,这个是具体制定协议参数的举个例子

 

 audit-trail off
 alert on
 max-incomplete low 800
 max-incomplete high 1000
 one-minute low unlimited
 one-minute high unlimited
 udp idle-time 30
 icmp idle-time 10
 dns-timeout 5
 tcp idle-time 3600
 tcp finwait-time 5
 tcp synwait-time 15
 tcp max-incomplete host unlimited block-time 0
 sessions maximum 2147483647

 

policy-map type inspect inside-to-outside.policy
 class type inspect inside-to-outside.class
  inspect inside-to-outside.pa   挂在policy-map下
 class class-default

本文转自q狼的诱惑 51CTO博客,原文链接:http://blog.51cto.com/liangrui/636039,如需转载请自行联系原作者
<think>好的,用户想要学习在Cisco设备上配置防御蠕虫病毒的详细指令,需要教程或学习资料。首先,我需要回忆Cisco设备相关的安全配置知识,尤其是针对蠕虫病毒的防御措施。 蠕虫病毒通常利用网络漏洞进行传播,所以防御措施应该包括流量过滤、访问控制、入侵检测等。Cisco设备常用的功能有ACL(访问控制列表)、IPS(入侵防御系统)、ZBFW(基于区域的防火墙)、AutoSecure等。 首先想到的是Cisco的官方文档,比如配置ACL来限制不必要的端口访问,因为蠕虫常通过特定端口传播。例如,关闭或限制TCP/UDP的高危端口,如135-139、445等。配置命令可能包括使用ip access-list extended来创建ACL,并应用到接口上。 其次,IPS的配置是关键,Cisco的IPS功能可以通过Cisco Firepower或IOS IPS实现。需要引用相关模块来识别和阻断恶意流量。命令可能涉及ip ips name和ip ips directed等。 另外,ZBFW可以提供更精细的策略控制,结合应用层检测。配置步骤可能包括定义区域、分配接口、设置策略等。同时,AutoSecure可以自动化加固设备,关闭不必要的服务,增强安全性。 还需要考虑更新系统和签名,因为防御蠕虫需要最新的漏洞特征。Cisco设备可能需要配置自动更新或手动加载签名库。 然后,用户可能需要具体的配置示例,比如如何创建ACL、启用IPS、配置ZBFW。需要确保命令的准确性,参考官方文档。同时,学习资料方面,推荐Cisco的官方安全配置指南、思科支持社区以及在线课程平台如Cisco Networking Academy。 可能的问题包括:如何验证配置是否生效?如何处理误报?如何监控蠕虫活动?需要准备这些相关问题的答案,并确保引用来源正确,比如引用思科的安全文档和已知的案例。 最后,确保回答符合格式要求,使用正确的LaTeX格式,分点清晰,提供相关问题和引用标注。</think>### Cisco设备防御蠕虫病毒配置命令教程 #### 1. 基础安全加固 蠕虫病毒常利用未加固的网络服务传播,需通过以下命令关闭非必要服务: ```cisco no ip http server # 关闭HTTP服务 no ip domain-lookup # 关闭域名解析 no service tcp-small-servers # 关闭TCP小服务 no service udp-small-servers # 关闭UDP小服务 ``` 同时启用日志监控:`logging trap debugging`[^3]。 #### 2. 访问控制列表(ACL)配置 通过ACL阻断常见蠕虫传播端口(如TCP 135-139, 445): ```cisco ip access-list extended ANTI_WORM deny tcp any any range 135 139 deny tcp any any eq 445 deny udp any any eq 1434 # SQL Slammer蠕虫端口 permit ip any any interface GigabitEthernet0/1 ip access-group ANTI_WORM in ``` #### 3. 入侵防御系统(IPS)配置 使用Cisco IOS IPS特征库检测蠕虫行为: ```cisco ip ips name WORM_PROTECTION ip ips signature-category category all retired true category ios_ips basic retired false ip ips notify SDEE interface GigabitEthernet0/1 ip ips WORM_PROTECTION in ``` 需定期更新特征库:`ip ips updater url https://software.cisco.com/ips/...`[^1]。 #### 4. 基于区域的防火墙(ZBFW) 实施应用层检测策略: ```cisco class-map type inspect match-any WORM_CLASS match protocol http match protocol smtp ! policy-map type inspect WORM_POLICY class WORM_CLASS inspect ! zone security INTERNAL zone security EXTERNAL zone-pair security WORM_FILTER source INTERNAL destination EXTERNAL service-policy type inspect WORM_POLICY ``` #### 5. AutoSecure自动化加固 使用一键加固命令: ```cisco configure terminal auto secure ``` #### 6. 流量监控与隔离 ```cisco netflow timeout active 1 netflow export source GigabitEthernet0/1 netflow export version 9 ``` §§推荐学习资料§§ 1. [Cisco安全配置指南](http://www.cisco.com/c/zh_cn/products/security/index.html) 2. [Cisco IOS安全配置手册](https://www.cisco.com/c/dam/global/zh_cn/products/security/ios-zone-based-firewall.pdf) 3. Cisco Networking Academy《网络安全运营》课程
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值