华为3COM网吧网络解决方案之网关配置指导.docx

上传人:b****4 文档编号:12002055 上传时间:2023-04-16 格式:DOCX 页数:52 大小:88.39KB
下载 相关 举报
华为3COM网吧网络解决方案之网关配置指导.docx_第1页
第1页 / 共52页
华为3COM网吧网络解决方案之网关配置指导.docx_第2页
第2页 / 共52页
华为3COM网吧网络解决方案之网关配置指导.docx_第3页
第3页 / 共52页
华为3COM网吧网络解决方案之网关配置指导.docx_第4页
第4页 / 共52页
华为3COM网吧网络解决方案之网关配置指导.docx_第5页
第5页 / 共52页
点击查看更多>>
下载资源
资源描述

华为3COM网吧网络解决方案之网关配置指导.docx

《华为3COM网吧网络解决方案之网关配置指导.docx》由会员分享,可在线阅读,更多相关《华为3COM网吧网络解决方案之网关配置指导.docx(52页珍藏版)》请在冰豆网上搜索。

华为3COM网吧网络解决方案之网关配置指导.docx

华为3COM网吧网络解决方案之网关配置指导

好网吧好网络

——华为3COM网吧网络解决方案之网关配置指导——

 

华为三康技术有限公司

Huawei-3ComTechnologiesCo.,Ltd.

版权所有XX

Allrightsreserved

第一部分配置原则概述

随着网络建设和应用的不断深入,网络安全问题正逐渐成为一个突出的管理问题。

AR18系列路由器通过多种手段和配置可以控制和管理网络的流量,能够有效地实施各种防攻击策略。

尤其在网吧这种复杂的网络环境中,全面合理的配置能够大大提高网络的稳定性和可靠性。

由于网吧上网人员数量多、构成复杂、流动性大,因此网络流量具有流量大、协议种类多、流量复杂等特点。

一般网吧局域网内均有一定程度主机感染病毒,同时也很容易被用来发起网络攻击,或者被他人攻击,这就对网吧中的核心设备――网关提出了较高的要求。

本文以AR18系列路由器为例讲解网关在网吧应用中需要注意的配置事项,同时给出了各种组网情况下的典型配置。

1需要注意的配置事项

1.1配置ACL对非法报文进行过滤

ACL是每个安全策略的组成部份,控制和监视什么数据包进入和离开网络几乎是网络安全的定义。

尽管路由器的工作是进行数据包的转发而不是阻止它。

但是有些数据包我们必须阻止它。

1.1.1进行源IP和目的IP过滤

至少应该在所有的接口上对入方向的报文进行过滤。

在RFC2827/BCP38(BestCurrentPractice)中高度建议使用入口过滤,这不仅可以使你的网络安全,而且可以使其它的网络不会被来自你的网络的伪装的源IP给攻击。

许多的网络攻击者使用伪装的源IP地址来隐藏它们的身份,在网络使用了入口过滤功能后,也更加容易定位网络攻击者,因为攻击者必须使用真实的源IP地址。

例如:

假设局域网接口的IP地址为192.168.1.0/24,广域网接口的IP地址为162.1.1.0/30,在局域网接口可以设置:

aclnumber3003

rule2000permitipsource192.168.1.00.0.0.255

rule3000denyip

在广域网接口可以设置:

aclnumber3001

rule2000permitipdestination162.1.1.00.0.0.3

rule2001permitipdestination192.168.1.00.0.0.255

rule3000denyip

在广域网接口也可以通过静态包过滤结合ASPF进行更精确的包过滤和攻击防范。

例如:

#

aclnumber3011

rule160permiticmpicmp-typeecho

rule161permiticmpicmp-typeecho-reply

rule162permiticmpicmp-typettl-exceeded

rule206permittcpdestination-porteqtelnet

rule3000denyip

#

interfaceEthernet1/0

ipaddress172.30.79.6255.255.255.252

firewallpacket-filter3011inbound

firewallaspf1outbound

#

注意事项:

由于目前ASPF对内存和性能的影响较大,网吧应用环境中不建议在AR18系列路由器上进行配置。

在所有的出报文都需要进行NAT的情况下一般也没有必要配置ASPF。

1.1.2限制ICMP报文

ICMP报文是另一种我们需要关心的数据包。

大量的攻击和病毒使用ICMP报文作为攻击手段。

但实际上internet是使用的ICMP绝大部分是ping和traceroute。

大量的其它icmp类型并不使用。

因此,实际上我们可以仅允许ICMP的pingecho和pingreply及traceroute所需要的TTL开放。

其它的均可以关闭。

例如:

aclnumber3001

rule160permiticmpicmp-typeecho

rule161permiticmpicmp-typeecho-reply

rule162permiticmpicmp-typettl-exceeded

rule165denyicmp

1.1.3限制netbios协议端口

在现今的网络上,充斥着大量的网络扫描。

基于UDP137,138端口的扫描是常见的扫描,UDP137和UDP138是netbios的数据报和名字服务。

通常情况下,进入到路由器的137和138包是广播包,而路由器在默认情况下是不转发这些广播包的。

但在某些情况下,一些扫描工具扫描UDP137和UDP138的端口,以图找出主机上的共享文件夹。

这种情况下,进入路由器的数据包会是unicast的137和138,而且通常目的地址不停变化。

因此我们可以将这些UDP138和138的数据包通过ACL挡断。

保护用户和网络的安全。

例如:

aclnumber3001

rule31denyudpdestination-porteqnetbios-ns

rule41denyudpdestination-porteqnetbios-dgm

rule51denyudpdestination-porteqnetbios-ssn

1.1.4限制常见病毒使用的端口

一般网吧中存在大量的“冲击波”、“震荡波”等病毒,这类病毒会不断地变化源IP或目的IP进行扫描和发送攻击数据,这会极大地消耗网络设备的资源。

笔者曾在一个网吧的实际环境中发现56%的上行报文都是“震荡波”病毒的扫描报文。

这些病毒一般使用固定的端口,比如TCP/135、TCP/4444、UDP/1434、TCP/5554、TCP/9996等,通过ACL对匹配这些目的端口的报文进行过滤会大大提高网络设备的安全性。

例如:

aclnumber3001

rule10denytcpdestination-porteq445/Worm.Blaster

rule11denyudpdestination-porteq445/Worm.Blaster

rule20denytcpdestination-porteq135/Worm.Blaster

rule21denyudpdestination-porteq135/Worm.Blaster

rule30denytcpdestination-porteq137

rule40denytcpdestination-porteq138

rule50denytcpdestination-porteq139/Worm.Blaster

rule61denyudpdestination-porteqtftp/Worm.Blaster

rule70denytcpdestination-porteq593/Worm.Blaster

rule80denytcpdestination-porteq4444/Worm.Blaster

rule90denytcpdestination-porteq707/NachiBlaster-D

rule100denytcpdestination-porteq1433

rule101denyudpdestination-porteq1433

rule110denytcpdestination-porteq1434

rule111denyudpdestination-porteq1434/SQLSlammer

rule120denytcpdestination-porteq5554/Sasser

rule130denytcpdestination-porteq9996/Sasser

1.1.5关闭没有使用的端口

网络中每时每刻都存在大量的扫描报文,扫描软件一般都会先探测目的主机开放了哪些端口。

对于常用的应用程序,如www、ftp、tftp等,如果局域网内并没有机器开放这些服务,可以在广域网接口通过ACL对匹配这些目的端口的报文进行过滤。

例如:

aclnumber3001

rule200denytcpdestination-porteqwww

rule202denytcpdestination-porteqftp

rule204denytcpdestination-porteq3389

1.2NAT配置注意事项

需要使用NAT转换地址池时,应尽量缩小NAT转换地址池的大小,因为地址池越大,占用的内存空间就可能会越大,大的地址池对于内存较小的设备很可能会导致内存耗尽。

AR系列路由器上每个NAT转换地址可以支持50000个会话,网吧每台机器正常上网时平均会创建30条会话,因此一般情况下地址池配置1个NAT转换地址就可以满足需求。

建议在AR18系列路由器上配置NAT地址池时只配置1个IP地址。

例如:

nataddress-group1218.27.192.1218.27.192.1

1.3路由配置注意事项

RFC1918中指定的保留的私有地址和其他已知的私有地址不应该存在于现有的internet网络上。

可以通过黑洞路由进行过滤。

避免局域网中存在攻击时占用大量的快转表项或者NAT表项。

例如:

iproute-static10.0.0.0255.0.0.0NULL0preference60

iproute-static169.254.0.0255.255.0.0NULL0preference60

iproute-static172.16.0.0255.240.0.0NULL0preference60

iproute-static192.168.0.0255.255.0.0NULL0preference60

iproute-static198.18.0.0255.254.0.0NULL0preference60

1.4进行IP-MAC地址绑定

由于网吧上网人员比较复杂,可能有人有意或无意地更改IP地址,或者使用网络执法官等软件进行恶意地破坏,通过在网关和客户机上都进行IP-MAC地址绑定(静态ARP),可以有效地防止这类以ARP欺骗为基础的攻击。

在网关上可以通过arpstatic命令对所有的客户机进行静态ARP设置。

在客户机上可以建立一个批处理文件放到启动组里,批处理文件的内容就是对网关进行IP-MAC绑定,这样每次启动就都会自动进行设置。

客户机设置静态ARP的实例:

@echooff

arp–s192.168.1.100-0f-e2-21-a0-01

1.5限制P2P应用(根据实际情况可选)

P2P应用对于网吧带宽来说是致命杀手,一个P2P客户端就有可能占用总带宽的90%以上,这会严重影响网吧的其他用户的正常上网,尤其是玩在线游戏的用户。

限制P2P应用有多种方式可以选择,但目前还没有非常有效的方法。

下面分别介绍几种常用的方法。

1.5.1通过ACL限制端口

通过ACL限制端口。

一是只限制P2P的端口,开放所有的其他端口,这种方法有其局限性,因为现在有的p2p软件,端口可以改变,封锁后会自动改端口,甚至可以改到80端口,如果连这个也封,那网络使用就无法正常工作了;二是只开放有用的端口,封闭其他端口,这种方法是对网络进行严格的控制,对简单的小型网络还可行,而如果是大型网络,数据流量又很复杂那么管理的难度将非常大;因此这两种方法对网吧都不太适合。

1.5.2结合QOS和ACL限制端口流量

结合QOS和ACL来限制P2P端口的数据流量。

因为多数蠕虫病毒和p2p的端口都是大于3000的,当然也有正常的应用是采用3000以上的端口,如果我们将3000以上的端口封闭,这样正常的应用也无法开展,所以折中的方法是对端口3000以上的数据流进行限速。

在实际应用中可能需要根据实际情况更改端口号的范围以使对其他应用的影响降低到最小。

例如:

在广域网接口和QOS结合使用的ACL。

aclnumber3100

rule1000permittcpdestination-portgt3000

rule1010permitudpdestination-portgt3000

在广域网接口配置的QOS。

#

trafficclassifierp2pinoperatoror

if-matchacl3100

#

trafficbehaviorp2pin

carcir2048000cbs1024000ebs0greenpassreddiscard

#

qospolicyp2pin

classifierp2pinbehaviorp2pin

#

interfaceEthernet1/0

ipaddress162.1.1.2255.255.255.252

qosapplypolicyp2pininbound

#

在局域网接口和QOS结合使用的ACL。

aclnumber3300

rule1000permittcpsource-portgt3000

rule1010permitudpsource-portgt3000

在局域网接口配置的QOS。

#

trafficclassifierp2poutoperatoror

if-matchacl3300

#

trafficbehaviorp2pout

carcir2048000cbs1024000ebs0greenpassreddiscard

#

qospolicyp2pout

classifierp2poutbehaviorp2pout

#

interfaceEthernet3/0

ipaddress192.168.1.1255.255.255.0

qosapplypolicyp2poutinbound

#

1.5.3限制单机的NAT会话数

以后的VRP软件会支持NAT的单用户限制,即可以对做地址转换的单个IP限制其NAT的TCP连接数,因为P2P类软件如BT的一大特点就是同时会有很多的连接数,从而占用了大量的NAT表项,因此应用该方法可有效限制BT的使用,比如我们为IP192.168.1.2设置最大的NAT表项数为100;正常的网络访问肯定够用了,但如果使用BT,那么很快此IP的NAT表项数会达到100,一旦达到峰值,该IP的其他访问就无法再进行NAT转换,必须等到部分NAT表项失效后,才能再次使用,这样既有效的保护了网络的带宽,也达到了警示的作用。

1.5.4在客户机上通过软件限制

在客户机上通过软件设置来禁止使用P2P软件。

有很多网吧管理软件可以根据需要禁止各种软件的运行,建议需要禁止P2P应用的网吧采用这种方式。

以上我们总结了目前可用的限制P2P软件的一些方法,具体采用哪种方法只能根据具体网络的状况来定,当然也可以将几种方法结合起来使用。

2附:

限制常见P2P软件端口的ACL

aclnumber3100

rule1000denytcpdestination-porteq2710

rule1010denytcpdestination-porteq6969

rule1020denytcpdestination-portrange88818999

rule1030denytcpdestination-porteq10137

rule1040denytcpdestination-porteq16881

rule1050denytcpdestination-portrange46614662

rule1060denyudpdestination-porteq4665

rule1070denyudpdestination-porteq4672

第二部分典型配置实例

1单出口典型配置

这类网吧只有一个到ISP的出口,是最常见的一种情况,网络拓扑比较简单,下面根据局域网内的主机地址是私网IP地址还是公网IP地址分为两种情况举例。

1.1局域网内的主机地址是私网IP地址

网络拓扑图如图1所示,AR18-22-24通过142.1.1.0/30网段和ISP相连,局域网内的IP地址段是192.168.1.0/24,局域网内的主机上网需要通过AR18-22-24进行NAT转换。

图1单出口需要进行NAT转换拓扑图

 

[Quidway]displaycurrent-configuration

#

sysnameQuidway

#

clocksummer-timeBJrepeating00:

00:

0006/01/200023:

59:

5908/31/200001:

00:

00

#

clocktimezonePekingadd08:

00:

00

#

FTPserverenable

#

firewallenable

#

flow-interval5

#

webset-packageforceflash:

/http.zip

#

radiusschemesystem

#

domainsystem

#

local-useradmin

passwordcipher.]@USE=B,53Q=^Q`MAF4<1!

!

service-typetelnetterminal

level3

service-typeftp

#

#配置进行NAT转换时引用的ACL。

aclnumber2001

rule10permitsource192.168.1.00.0.0.255

#

#配置在接口上应用的过滤规则,主要用于攻击防范,强烈建议配置。

aclnumber3001

rule10denytcpdestination-porteq445

rule11denyudpdestination-porteq445

rule20denytcpdestination-porteq135

rule21denyudpdestination-porteq135

rule30denytcpdestination-porteq137

rule31denyudpdestination-porteqnetbios-ns

rule40denytcpdestination-porteq138

rule41denyudpdestination-porteqnetbios-dgm

rule50denytcpdestination-porteq139

rule51denyudpdestination-porteqnetbios-ssn

rule61denyudpdestination-porteqtftp

rule70denytcpdestination-porteq593

rule80denytcpdestination-porteq4444

rule90denytcpdestination-porteq707

rule100denytcpdestination-porteq1433

rule101denyudpdestination-porteq1433

rule110denytcpdestination-porteq1434

rule111denyudpdestination-porteq1434

rule120denytcpdestination-porteq5554

rule130denytcpdestination-porteq9996

rule141denyudpsource-porteqbootps

rule160permiticmpicmp-typeecho

rule161permiticmpicmp-typeecho-reply

rule162permiticmpicmp-typettl-exceeded

rule165denyicmp

rule2002permitipdestination142.1.1.20

rule3000denyip

aclnumber3003

rule10denytcpdestination-porteq445

rule11denyudpdestination-porteq445

rule20denytcpdestination-porteq135

rule21denyudpdestination-porteq135

rule30denytcpdestination-porteq137

rule31denyudpdestination-porteqnetbios-ns

rule40denytcpdestination-porteq138

rule41denyudpdestination-porteqnetbios-dgm

rule50denytcpdestination-porteq139

rule51denyudpdestination-porteqnetbios-ssn

rule61denyudpdestination-porteqtftp

rule70denytcpdestination-porteq593

rule80denytcpdestination-porteq4444

rule90denytcpdestination-porteq707

rule100denytcpdestination-porteq1433

rule101denyudpdestination-porteq1433

rule110denytcpdestination-porteq1434

rule111denyudpdestination-porteq1434

rule

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1