防火墙命令手册目录1简介 (3)2功能简述 (3)2.1连接监测 (3)2.2包过滤策略 (4)2.3协议状态检测 (4)2.4基于MAC地址的桥过滤 (4)3配置防火墙 (5)4典型配置 (17)1 简介Internet 的发展给政府结构、企事业单位带来了革命性的改革和开放。
他们正努力通过利用Internet 来提高办事效率和市场反应速度,以便更具竞争力。
通过Internet ,企业可以从异地取回重要数据,同时又要面对Internet 开放带来的数据安全的新挑战和新危险:即客户、销售商、移动用户、异地员工和内部员工的安全访问;以及保护企业的机密信息不受黑客和工业间谍的入侵。
因此企业必须加筑安全的" 战壕" ,而这个" 战壕" 就是防火墙。
防火墙技术是建立在现代通信网络技术和信息安全技术基础上的应用性安全技术,越来越多地应用于专用网络与公用网络的互联环境之中,尤其以接入Internet 网络为最甚。
防火墙是指设置在不同网络(如可信任的企业内部网和不可信的公共网)或网络安全域之间的一系列部件的组合。
它是不同网络或网络安全域之间信息的唯一出入口,能根据企业的安全政策控制(允许、拒绝、监测)出入网络的信息流,且本身具有较强的抗攻击能力。
它是提供信息安全服务,实现网络和信息安全的基础设施。
在逻辑上,防火墙是一个分离器,一个限制器,也是一个分析器,有效地监控了内部网和Internet 之间的任何活动,保证了内部网络的安全。
除了安全作用,防火墙还支持具有Internet 服务特性的企业内部网络技术体系VPN 。
通过VPN ,将企事业单位在地域上分布在全世界各地的LAN 或专用子网,有机地联成一个整体。
不仅省去了专用通信线路,而且为信息共享提供了技术保障。
2 功能简述2.1 连接监测基于状态的资源和连接控制基于这样的观点:如果连接长时间没有应答,一直处于半连接状态,会浪费连接资源。
同样虽然连接已经建立,但长时间没有数据流穿过,也会浪费了连接资源。
连接监测功能通过追踪和统计连接建立的过程和数量,来管理系统和ICMP,TCP,UDP,Generic协议的连接状态,提高网络访问的性能。
2.2 包过滤策略包过滤策略能够保护内部网络资源,防止外来者接触。
同时限制内部网络用户对外部网络的访问。
防火墙包过滤策略根据IP包中IP、TCP、UDP协议的头部信息,以及承载IP的Ethernet帧头的MAC地址、IP报文进入系统的入口设备以及IP报文离开系统的出口设备决定对IP包进行的操作,由此控制对网络内部或网络外部资源的访问,提高网络的安全性能。
由于包过滤策略能处理MAC地址、IP,TCP,UDP协议的头部信息,这样既控制了网络中的通过系统数据流量,又能维持一定的系统性能。
注意:MAC地址只能用于包过滤策略的源端。
因为Ethernet帧的目的MAC地址通常是网关设备自己。
基于策略的连接数限制基于策略的连接数限制功能统计匹配每个策略的总连接数和每个主机的连接数,并能够对这些连接数量加以限制。
2.3 协议状态检测系统实现了对以下协议的状态检测功能:FTP,H323和SIP。
在这些协议当中,主连接的净载荷中,包含有动态协商的附加连接的信息(端口号和IP地址)。
系统不要求配置附加连接的包过滤策略。
而当进行conntrack时,通过对可能产生附加连接的报文进行检查,可以在附加连接建立之前获得精确的信息,利用这些信息就可以检测出这些附加连接并对附加连接实施与主连接一样的包过滤策略。
2.4 基于MAC地址的桥过滤在桥模式(bridge mode)下,系统支持对以太网帧进行基于MAC地址的过滤。
系统在对以太网帧进行路由之前进行MAC地址的过滤。
基于MAC地址的过滤实现以下三种过滤:●对封装内容不是IP协议包的以太网帧进行过滤。
●对目的MAC地址是组播地址的以太网帧进行过滤。
●对帧头中的源MAC地址或目的MAC地址匹配配置的MAC过滤条目的以太网帧进行过滤。
对于每个被过滤的以太网帧产生系统日志。
注:对所有的组播帧,其目的MAC地址的第一个字节都是0x01。
3 配置防火墙4 典型配置1.下图为连接监测和包过滤策略配置图。
假定防火墙接口eth0连接Internet,其他接口连接企业内部网络。
其中vlan1连接研发部,vlan2连接财务部。
要求财务部不能访问外网,研发部只能在周一直周五的18~21点之间才能访问外网。
图2 连接监测和包过滤策略配置步骤1:配置接口Host> enableHost# host# configure terminalhost(config)# host(config)# interface eth0host(config-eth0)#ip address 204.100.100.1/24host(config-eth0)# interface vlan1host(config-eth1)#ip address 192.168.200.1/24host(config-eth1)#interface vlan2host(config-vlan1)#ip address 192.168.100.1/24host(config-vlan1)#interface eth2host(config-eth2)#port access vlan 2host(config-eth2)#exit步骤2:配置地址对象,时间范围对象host(config)# address addr_rndhost(config-addr)# net-address 192.168.200.0/24 \\地址对象可以使IP也可以是MAC host(config-addr)# address addr_finhost(config-addr)# net-address 192.168.100.0/24host(config-addr)# exithost(config)#timerange recurring afterworkhost(config-tr)# absolute 09-09-01 00:00:00 09-12-30 00:00:00<c 18:00:00 21:00:00 monday tuesday wednesday thursday friday null nullhost(config-tr)#exithost(config)#步骤3:配置包过滤策略,请注意包过滤策略顺序host(config)# policy 9910 eth1 eth0 addr_rnd any any afterwork permithost(config-policy)# total-flows limit 1000 \\限制匹配策略流量的总连接数host(config-policy)# per-host-flows limit src 100 \\限制匹配策略源IP的连接数host(config-policy)# per-host-flows limit dst 100 \\限制匹配策略目的IP的连接数host(config-policy)# enablehost(config-policy)# exithost(config)#host(config)# policy 9920 eth1 eth0 any any any always denyhost(config-policy)# enablehost(config-policy)# exithost(config)#host(config)# policy 9810 vlan1 eth0 addr_fin any any always denyhost(config-policy)# enablehost(config-policy)# exithost(config)#步骤4:配置连接监测限制系统和各个协议连接速率,半开放连接数的最高和最底水准线,最大连接数:host(config)# ip inspect limit halfopen-rate low 150 tcp host(config)# ip inspect limit halfopen-rate low 150 udp host(config)# ip inspect limit halfopen-rate low 150 icmp host(config)# ip inspect limit halfopen-rate low 150 generic host(config)# ip inspect limit halfopen-rate low 400host(config)# ip inspect limit halfopen-rate high 200 tcp host(config)# ip inspect limit halfopen-rate high 200 udp host(config)# ip inspect limit halfopen-rate high 200 icmp host(config)# ip inspect limit halfopen-rate high 200 generic host(config)# ip inspect limit halfopen-rate high 600host(config)# ip inspect limit halfopen low 300 tcphost(config)# ip inspect limit halfopen low 300 udphost(config)# ip inspect limit halfopen low 300 icmphost(config)# ip inspect limit halfopen low 300 generichost(config)# ip inspect limit halfopen low 900host(config)# ip inspect limit halfopen high 500 tcphost(config)# ip inspect limit halfopen high 500 udphost(config)# ip inspect limit halfopen high 500 icmphost(config)# ip inspect limit halfopen high 500 generic host(config)# ip inspect limit halfopen high 1500host(config)# ip inspect limit connection max 600 tcphost(config)# ip inspect limit connection max 600 udphost(config)# ip inspect limit connection max 600 icmphost(config)# ip inspect limit connection max 600 generic host(config)# ip inspect limit connection max 2000步骤5:配置各协议连接空闲时间:host(config)# ip inspect idletime tcp close-time 5host(config)# ip inspect idletime tcp closewait-time 5host(config)# ip inspect idletime tcp established-time 1800host(config)# ip inspect idletime tcp finwait-time 5 host(config)# ip inspect idletime tcp lastack-time 5 host(config)# ip inspect idletime tcp synrecv-time 10 host(config)# ip inspect idletime tcp synsent-time 20 host(config)# ip inspect idletime tcp timewait-time 5 host(config)# ip inspect idletime udp halfopen 10 host(config)# ip inspect idletime udp stream 30 host(config)# ip inspect idletime icmp-idletime 20 host(config)# ip inspect idletime generic-idletime 20 步骤6:打开连接监测开关host(config)# ip inspect on步骤7:显示连接监测计数:host# show ip inspect countSystem:Connect sum count: 2Halfopen connect count: 2Halfopen connect rate count: 2TCP:Connect sum count: 0Halfopen connect count: 0Halfopen connect rate count: 0UDP:Connect sum count: 2Halfopen connect count: 2Halfopen connect rate count: 2ICMP:Connect sum count: 0Halfopen connect count: 0Halfopen connect rate count: 0防火墙命令手册Others:Connect sum count: 0Halfopen connect count: 0Halfopen connect rate count: 0host#第21页, 共21页。