路由器的安全配置简易方案

上传人:gao****ang 文档编号:187457068 上传时间:2023-02-14 格式:DOCX 页数:15 大小:28.21KB
收藏 版权申诉 举报 下载
路由器的安全配置简易方案_第1页
第1页 / 共15页
路由器的安全配置简易方案_第2页
第2页 / 共15页
路由器的安全配置简易方案_第3页
第3页 / 共15页
资源描述:

《路由器的安全配置简易方案》由会员分享,可在线阅读,更多相关《路由器的安全配置简易方案(15页珍藏版)》请在装配图网上搜索。

1、路由器的安全配置简易方案女口: Router(Config)#Access-listl permitl92、168、0、lRouter(Config)#linecon0Router(Config-line)#Transportinput noneRouter(Config-line)#Login localRouter(Config-line)#Exec-timeoute5 0Router(Config-line)#access-classl inRouter(Config-line)#endD、给CON 口设置高强度的密码。4、如果不使用AUX端口,则禁止这个端口。默认是未被启用。禁止如:R

2、outer(Config)#line aux 0Router(Config-line)#transport input noneRouter(Config-line)#no exec5、建议采用权限分级策略。如:Router(Config)#usernameBluShinprivilegel0G00dPa55w0rdRouter(Config)#privilegeEXEClevell0telnetRouter(Config)#privilege EXEC levell0 show ip access-list/pre6、为特权模式的进入设置强壮的密码。不要采用enable password设置

3、密 码。而要采用 enable secret 命令设置。并且要启用 Service password-encryption。7、控制对VTY的访问。如果不需要远程访问则禁止它。如果需要则一定要 设置强壮的密码。由于VTY在网络的传输过程中为加密,所以需要对其进行严格 的控制。如:设置强壮的密码;控制连接的并发数目;采用访问列表严格控制访 问的地址;可以采用AAA设置用户的访问控制等。8、I0S的升级和备份,以及配置文件的备份建议使用FTP代替TFTP。如:Router(Config)#ip ftp username BluShinRouter(Config)#ip ftppassword4tp

4、pa55w0rdRouter#copy startup-config ftp:/pre9、及时的升级和修补IOS软件。、路由器网络服务安全配置1、禁止 CDP(Cisco Discovery Pro toco l)。如:Router(Config)#no cdp run Router(Config-if)# no cdp enable/pre2、禁止其他的 TCP、UDP Small 服务。R outer(Config)# no service tcp-small-serversRouter(Config)# no service udp-samll-servers/pre3、禁止Finger

5、 服务。Router(Config)# no ip fingerRouter(Config)# no service finger/pre4、建议禁止 HTTP 服务。R outer(Config)# no ip http server 如果启用 了 HTTP服务则需要对其进行安全配置:设置用户名和密码;采用访问列表进行 控制。如:Router(Config)# username BluShin privilege10 G00dPa55w0rd Router(Config)# ip http auth local Router(Config)# no access-list10Router(C

6、onfig)# access-list10 permit192、168、0、1 Router(Config)# access-list10 deny any Router(Config)# ip http access-class10 Router(Config)# ip http serverRouter(Config)# exit /pre5、禁止 BOOTp 服务。R outer(Config)# no ip bootp server 禁止从网络 启动和自动从网络下载初始配置文件。 R outer(Config)# no boot network Router(Config)# no s

7、ervic config6、禁止 IP Source Routing。R outer(Config)# no ip source-route7、建议如果不需要 ARP-Proxy 服务则禁止它,路由器默认识开启的。 R outer(Config)# no ip proxy-arp Router(Config-if)# no ip proxy-arp8、明确 的禁止 IP Direc ted Broadcas t。R ou ter(Config)# no ip directed-broadcast9、禁止 IP Classlesso R outer(Config)# no ip classles

8、s10、禁止 ICMP 协议的 IP Unreachables,Redirects,Mask Replies o R outer(Config-if)# no ip unreacheablesRouter(Config-if)# no ip redirectsRouter(Config-if)# no ip mask-reply11、建议禁止SNMP协议服务。在禁止时必须删除一些SNMP服务的默认配置。 或者需要访问列表来过滤。如:Router(Config)#nosnmp-servercommunitypublicRoRouter(Config)#no snmp-servercommunit

9、yadminRWRouter(Config)#noaccess-list70Router(Config)# access-list70 deny anyRouter(Config)# snmp-server community MoreHardPublic Ro70Router(Config)# no snmp-server enabletrapsRouter(Config)#nosnmp-serversystem-shutdownRouter(Config)#nosnmp-servertrap-anthRouter(Config)# no snmp-serverRouter(Config)#

10、 end12、如果没必要则禁止WINS和DNS服务。R outer(Config)# no ipdomain-lookup 如果需要则需要配置:Router(Config)# hostname Router Router(Config)# ip name-server202、 102、134、9613、明确禁止不使用的端口。R outer(Config)# interface eth0/3 Router(Config)# shutdown 三、路由器路由协议安全配置1、首先禁止默认启用的 ARP-Proxy ,它容易引起路由表的混乱。 R outer(Config)# no ip proxy-

11、arp 或者 Router(Config-if)# no ip proxy-arp2、启用OSPF路由协议的认证。默认的OSPF认证密码是明文传输的,建议 启用MD5认证。并设置一定强度密钥(key,相对的路由器必须有相同的Key)。R outer(Config)# router ospf100Router(Config-router)# network192、168、100、0 0、0、0、255 areal00!启用 MD5 认证。! areaarea-idauthentication 启用认证,是明文密码认证。 !area area-id authentication message-d

12、igestRouter(Config-router)#area100authenticationmessage-digestRouter(Config)# exitRouter(Config)# interface eth0/l!启 用 MD5 密钥 Key 为 routerospfkey。! ip ospf authentication-key key 启用认 证密钥,但会是明文传输。! ip ospf message-digest-key key-id(1-255)md5 keyRouter(Config-if)# ip ospf message-digest-key1 md5 route

13、rospfkey3、RIP协议的认证。只有RIP-V2支持,RIP-1不支持。建议启用RIP-V2。并且采用MD5认证。普通认证同样是明文传输的。R outer(Config)# config terminal! 启 用 设 置 密 钥 链 Router(Config)# key chain mykeychainnameRouter(Config-keychain)# key1 ! 设 置 密 钥 字 串 Router(Config-leychain-key)#key-stringMyFirstKeyStringRouter(Config-keyschain)#key2Router(Confi

14、g-keychain-key)# key-string MySecondKeyString! 启用 RIP-V2Router(Config)#routerripRouter(Config-router)#version2Router(Config-router)# network192、168、100、0Rou ter(Config)# in terface e th0/l!采用 MD5 模式认证,并选择已 配 置 的 密 钥 链 Router(Config-if)# ip rip authentication mode md5Router(Config-if)# ip rip anthent

15、ication key-chain mykeychainname4、启用passive-in terface命令可以禁用一些不需要接收和转发路由信息 的端口。建议对于不需要路由的端口,启用passive-in terface。但是,在RIP 协议是只是禁止转发路由信息,并没有禁止接收。在0SPF协议中是禁止转发和 接收路由信息。! Rip 中,禁止端口 0/3 转发路由信息 Router(Config)# router RipRou ter(Config-rou ter)# passive-in terface et h0/3 ! OSP F 中,禁止端口 0/3 接 收 和 转 发 路 由

16、信 息 Router(Config)# router ospf100Router(Config-router)# passive-interface eth0/35、启用访问列表过滤一些垃圾和恶意路由信息,控制网络的垃圾信息流。R outer(Config)# access-list10 deny192、168、1、0 0、0、0、255Router(Config)# access-list10 permit any !禁 止路由器接收更新192、168 、1 、0 网 络 的 路 由 信 息 Router(Config)# routerospflOORou ter(Config-rou te

17、r)# dis trib ut e-lis t10 in!禁止路由器转发传播 192、168 、1 、0 网 络 的 路 由 信 息 Router(Config)# routerospf100Router(Config-router)# distribute-list10 out6、建议启用 IP Unicast Reverse-Pa th Verifica tion。它能够检查源 IP 地址的准确性,从而可以防止一定的IP Spooling。但是它只能在启用CEF(Cisco Express Forwarding)的路 由器上 使用。R out er# config t!启用 CEFRout

18、er(Config)# ip cef ! 启 用 Unicast Reverse-Path VerificationRouter(Config)# interface eth0/1Router(Config)# ip verify unicas t reverse-pa th四、路由器其他安全配置1、及时的升级IOS软件,并且要迅速的为IOS安装补丁。2、要严格认真的为IOS作安全备份。3、要为路由器的配置文件作安全备份。4、购买UPS设备,或者至少要有冗余电源。5、要有完备的路由器的安全访问和维护记录日志。6、要严格设置登录Banner。必须包含非授权用户禁止登录的字样。7、IP 欺骗得简单

19、防护。如过滤非公有地址访问内部网络。过滤自己内部 网络地址;回环地址(127、0、0、0/8); RFC1918私有地址;DHCP自定义地址(169、254、0、0/16);科学文档作者测试用地址(192、0、2、0/24);不用的组播地址(224、0、0、0/4); SUN公司的古老的测试地址(20、20、20、0/24;204、152、64、0/23);全网络地址(0、0、0、0/8)。R outer(Config)# access-list100 deny ip192、168、0、00、0、0、255anylogRouter(Config)#access-list100denyip127

20、、0、0、0 0、255、255、255 any log Router(Config)# access-list100 deny ip192、168、0、0 0、0、255、255anylogRouter(Config)#access-list100denyip172、16、0、00、15、255、255anylogRouter(Config)#access-list100denyip10、0、0、00、255、255、255anylogRouter(Config)#access-list100denyip169、254、0、00、0、255、255anylogRouter(Config)#a

21、ccess-list100denyip192、0、2、00、0、0、255anylogRouter(Config)#access-list100deny ip224、0、0、015、255、255、255 any Router(Config)# access-list100 deny ip20、20、20、00、0、0、255anylogRouter(Config)#access-list100denyip204、52、64、0 0、0、2、255 any logRouter(Config)# access-list100 deny ip 0、 0、0、0 0、255、255、255 any

22、log8、建议采用访问列表控制流出内部网络的地址必须是属于内部网络的。如:Router(Config)# no access-list101Router(Config)# access-list101 permit ip192、168、0、0 0、0、0、255 anyRouter(Config)# access-list101 deny ip any any logRouter(Config)# interface eth 0/1Router(Config-if)# description “internet Ethernet”Router(Config-if)# ip address192

23、、168、0、254255、255、255、0Router(Config-if)# ip access-group101 in9、TCP SYN的防范。如:A: 通过访问列表防范。 Router(Config)# no access-list106Router(Config)# access-list106 permit tcp any192、168、 0、 00、 0、 0、 255establishedRouter(Config)#access-list106deny ip any any logRouter(Config)# interface eth 0/2Router(Config-

24、if)# description “external Ethernet”Router(Config-if)# ip address192、168、1、254255、255、255、0Router(Config-if)# ip access-groupl06 inB:通过 TCP 截获防范。 (这 会给 路由器 产生一定负载)Rou ter(Config)# ip tcp int ercept list107Router(Config)# access-list107 permit tcp any192、1 68、0、00、0、0、255Router(Config)#access-list107

25、denyipanyany logRouter(Config)# interface eth0Router(Config)# ip access-group107 in10、LAND、C 进攻的防范。R outer(Config)# access-listl07 deny ip hostl92、168、l、254 hostl92、l68 、 l 、254 logRouter(Config)# access-list permit ip anyanyRouter(Config)# interface eth 0/2Router(Config-if)# ip addressl92、l68、l、254

26、255、255、255、0Router(Config-if)# ip access-groupl07 in11、Smurf 进攻的防范。R outer(Config)# access-list108 deny ip any hostl92、168、1、255 log Router(Config)# access-list108 deny ip any host192、168、1、0 log12、ICMP协议的安全配置。对于进入ICMP流,我们要禁止ICMP协议的ECHO、 Redirect、Mask request。也需要禁止TraceRoute命令的探测。对于流出的ICMP 流,我们可以允许

27、 ECHO、Parame ter Problem、Packe t t oobig。还有 TraceRou te 命令的使用。!outboundICMPControlRouter(Config)#access-list110denyicmpany any echo logRouter(Config)# access-list110 deny icmp any any redirect logRouter(Config)# access-list110 deny icmp any any mask-request logRouter(Config)# access-list110 permit i

28、cmp any any ! Inbound ICMP ControlRouter(Config)# access-list111 permit icmp any any echoRouter(Config)# access-list111 permit icmp any any Parameter-problemRouter(Config)# access-list111 permit icmp any any packet-too-bigRouter(Config)# access-list111 permit icmp any any source-quenchRouter(Config)

29、# access-list111 deny icmp any any log!Outbound TraceRoute ControlRouter(Config)# access-list112 deny udp any any range3340034400 ! Inbound TraceRoute ControlRouter(Config)# access-list112 permit udp any any range334003440013、DDoS(Distributed Denial of Service)的防范。! The TRINOO DDoS systemRouter(Conf

30、ig)# access-list113 deny tcp any any eq27665 logRouter(Config)# access-list113 deny udp any any eq31335 logRouter(Config)# access-list113 deny udp any any eq27444 log! The StacheldtrahtDDoSsystemRouter(Config)#access-list113denytcpanyany eq16660 logRouter(Config)# access-list113 deny tcp any any eq6

31、5000 log! The TrinityV3 SystemRouter(Config)# access-list113 deny tcp any any eq33270 logRouter(Config)# access-list113 deny tcp any any eq39168 log! The SubSeven DDoS system and some VariantsRouter (Config)# access-list113 denytcpanyanyrange67116712logRouter(Config)#access-list113denytcp anyanyeq67

32、76logRouter(Config)#access-list113denytcpanyanyeq6669 logRouter(Config)# access-list113 deny tcp any any eq2222 logRouter(Config)# access-list113 deny tcp any any eq7000 log14、建议启用SSH,废弃掉Telnet。但只有支持并带有IPSec特征集的I0S 才支持SSH。并且IOS12、0-IOS12、2仅支持SSH-V1。如下配置SSH服务的例子:Router(Config)#configtRouter(Config)#n

33、oaccess-list22Router(Config)# access-list22 permit192、168、0、22Router(Config)# access-list deny anyRouter(Config)# username BluShin privilege10 G00dPa55w0rd! 设置 SSH 的超时间隔和尝试登录次数 Router(Config)# ip ssh timeout90Router(Config)# ip ssh anthentication-retries2Router(Config)# line vty 04Router(Config-line

34、)# access-class22 inRouter(Config-line)# transport input sshRouter(Config-line)# login localRouter(Config-line)# exit! 启用 SSH 服务,生成 RSA 密钥对。Rou ter(Config)# cryp to key genera te rsaThe name for the keys will be: router、blushin、orgChoose the size of the key modulus in the range of360 to2048 for your

35、 General Purpose keys 、Choosing a key modulus greater than512 may take a few minutes、 How many bits in the modulus512:2048 Generating RSA Keys、OK Router(Config)#需要关闭的接口服务某些IP特性对于校园局域网来 说是很好的,但并不意味着对ISP骨干网适用。如果这些功能被网络黑朋客滥用 的话,会增加ISP的危险。所有在ISP骨干路由器上的接口都应该将以下几点作 为默认值:no ip redirects no ip directed-broa

36、dcast no ip proxy-arp “no ip redirects表示:如果I0S被强迫通过相同的接口重新发送一个包的话,路由 器就不会发送重定向(redirect)信息。“no ip direc ted-broadcas t”表示:定向广播到物理广播的转换被禁止。 如果这一项使能的话,到某个网络的广播可能在路由接口上被定向,同时可能产 生非期望和潜在的危害。由于定向广播使能而导致负作用的一个例子,是一种叫 做“SMURF”的网络攻击。关于这种SMURF更详细的资料,请到Craig Heugen 的 SMURF 网站参阅:http:/www、quadrunnerZZZ/chuegen

37、/smurf、txt “no ip proxy-arp表示:即使路由器知道某个主机的MAC地址,它也不会响应网络中 连接到这个接口的其他主机的ARP请求。这点同样也可以预防一些潜在的安全问 题。C isco IOS基本安全配置详解no ip domain-lookup /关闭域名查询no cdprun /禁用 cdpno ip http server/禁用http server,这玩意儿的安全漏洞很多的no ip source-route/禁用IP源路由,防止路由欺骗no service finger /禁用finger服务no ip bootp server/禁用 bootpe 服务 no

38、service udp-small-s /禁用一堆小的 udp 服务 no service tcp-small-s /禁用一堆小的 tcp 服务 service timestamp log datetime localtime /配置时间戳为datetime方式,使用本地时间loggingl92、168、 0、 1 /向 192、l68、0、1 发送 loglogging192、168、0、2 /向192、168、0、2 发送 logsnmp-server community HSDxdf ro98/配置 snmp 只读通 讯字,只允许 access-list98 的主机进行通讯 servic

39、e password-encryption /启用加密服务,将对password密码进行加密enable secret asdfajkls/配置强加密的特权密码no enable password/禁用弱加密的特权密码no access-list99 /在配置一个新的acl前 先清空该 ACLaccess-list99 permit192、168、0、0 0、0、0、255access-list99 deny any log /log参数说明在有 符合该条件的条目时产生一条logo信息no access-list98 /在配置一个新的 acl 前先清空该 ACLaccess-lis t98 p

40、erm it hos t192、168、0、1access-list98 deny any log /log 参数说明在有符合该条件的 条目时产生一条 logo 信息!line vty 04access-class99 in /使用 acl99 来控 制 telnet 的源地址 loginpassword 0 asdfaksdlf/配置 telnet 密码 exec-timeout2 0/配置虚终羰超时参数,这里是2分钟!line con Ologinpassword 0adsfoii /配置 console 口 的密码 exec-timeout2 0/配置console 口超时参数,这里是两

41、分钟!line aux 0 transport inputnone password 0 asfdkalsfjno execexitbanner motd #/配置提示信息 This is a private system operated for UltraTeam、 Authorization from UltraTeam is required to use this systemUse by unauthorized persons is prohibited#!clock timezone PST-8 /设置时区 ntp authenticate/启用 NTP 认证 ntp auth

42、entication-keyl md5 uadsf /设置 NTP 认证用 的密码,使用MD5加密。需要和ntp server 一致ntp trusted-key1/可以信任的Key、ntp acess-group peer98 /设置ntp服务,只允许对 端为符合access-list98条件的主机ntp server192、168、0、1 key1/配置 ntp server, server 为 192、168、0、1,使用 1 号 Key 做为密码 !interface vlanlOip address10、1、10、254255、255、255、Oip ospf authenticat

43、ion message-digest /用 ospf 邻接过程中的 认证 ip ospf message-digest-key md5724da7e/配置ospf认证key,要求所有邻居相同ip ospf priority3/提高ospf的优先级,便于成为DR!Cisco CatOS基本安全配置详解set cdp disable /禁用 cdpset ip http disable/禁用http server,这玩意儿的安全漏洞很多的!set logging timestamp enable /启用 log 时间戳 set logging serverl92、168、O、1 /向192、168

44、、0、1 发送 logset logging serverl92、168、0、2 /向192、168、0、2 发送 logset snmp community HSDxdf /配置 snmp 只读通讯字 set ip perm it enable snmp /启用 snmp 访问控制 set ip perm itl92、168、0、1 snmp /允许192、168、0、1 进行 snmp 访问 set ip perm it enable t elne t /启用 t elne t 访 问控制 set ip permitl92、168、0、1 telnet /允许192、168、0、1 进行

45、telnet 访问 set password /配置 telnet 密码 set enable /配置特权密码set logout2/配置超时参数,2分钟set banner motd/配置提示信息 This is a private system operated for UltraTeam、 Authorization from UltraTeam is required to use this systemUse by unauthorized persons is prohibited!set timezone PST-8 /设置时区 set ntp authenticate enab

46、le/启用NTP认证set ntp key1 md5 uadsf /设置NTP认证用的密码,使 用 MD5 加密。需要和 ntp server 一致 set ntp server192、168、0、1 key1 /配置 ntp server, server 为 192、168、0、1,使用 1 号 key 做为密码 set ntp client enable /启用 ntp client 网络层访问权限控制技术ACL详解单向访问控制 使用IP ACL实现单向访问控 制A公司准备实行薪资的不透明化管理,由于目前的薪资收入数据还放在财务部 门的Vlan中,所以公司不希望市场和研发部门能访问到财务部Vlan中的数据, 另一方面,财务部门做为公司的核心管理部门,又希望能访问到市场和研发部门 Vlan内的数据。我们的网管在接到这个需求后就在SWA上做了如下的配置:ip access-list extend fi-access-limitdeny ip any10、1、4、

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!