一、交换机访问控制安全配置

1、对交换机特权模式设置密码尽量采用加密和md5 hash方式

switch(config)#enable secret 5 pass_string

其中 0 Specifies an UNENCRYPTED password will follow

5 Specifies an ENCRYPTED secret will follow

建议不要采用enable password pass_sting密码,破解及其容易!

2、设置对交换机明文密码自动进行加密隐藏

switch(config)#service password-encryption

3、为提高交换机管理的灵活性,建议权限分级管理并建立多用户

switch(config)#enable secret level 7 5 pass_string7 /7级用户进入特权模式的密码

switch(config)#enable secret 5 pass_string15 /15级用户进入特权模式的密码

switch(config)#username userA privilege 7 secret 5 pass_userA

switch(config)#username userB privilege 15 secret 5 pass_userB

/为7级,15级用户设置用户名和密码,Cisco privilege level分为0-15级,级别越高权限越大

switch(config)#privilege exec level 7 commands /为7级用户设置可执行的命令,其中commands可以根据分配给用户的权限自行定义

4、本地console口访问安全配置

switch(config)#line console 0

switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒

switch(config-line)#logging synchronous /强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见

设置登录console口进行密码验证

方式(1):本地认证

switch(config-line)#password 7 pass_sting /设置加密密码

switch(config-line)#login /启用登录验证

方式(2):本地AAA认证

switch(config)#aaa new-model /启用AAA认证

switch(config)#aaa authentication login console-in group acsserver local enable

/设置认证列表console-in优先依次为ACS Server,local用户名和密码,enable特权密码

switch(config)#line console 0

switch(config-line)# login authentication console-in /调用authentication设置的console-in列表

5、远程vty访问控制安全配置

switch(config)#access-list 18 permit host x.x.x.x /设置标准访问控制列表定义可远程访问的PC主机

switch(config)#aaa authentication login vty-in group acsserver local enable

/设置认证列表vty-in, 优先依次为ACS Server,local用户名和密码,enable特权密码

switch(config)#aaa authorization commands 7 vty-in group acsserver local if-authenticated

/为7级用户定义vty-in授权列表,优先依次为ACS Server,local授权

switch(config)#aaa authorization commands 15 vty-in group acsserver local if-authenticated

/为15级用户定义vty-in授权列表,优先依次为ACS Server,local授权

switch(config)#line vty 0 15

switch(config-line)#access-class 18 in /在线路模式下调用前面定义的标准ACL 18

switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒

switch(config-line)#authorization commands 7 vty-in /调用设置的授权列表vty-in

switch(config-line)#authorization commands 15 vty-in

switch(config-line)#logging synchronous /强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见

switch(config-line)#login authentication vty-in /调用authentication设置的vty-in列表

switch(config-line)#transport input ssh /有Telnet协议不安全,仅允许通过ssh协议进行远程登录管理

6、AAA安全配置

switch(config)#aaa group server tacacs+ acsserver /设置AAA服务器组名

switch(config-sg-tacacs+)#server x.x.x.x /设置AAA服务器组成员服务器ip

switch(config-sg-tacacs+)#server x.x.x.x

switch(config-sg-tacacs+)#exit

switch(config)# tacacs-server key paa_string /设置同tacacs-server服务器通信的密钥

二、交换机网络服务安全配置

禁用不需要的各种服务协议

switch(config)#no service pad

switch(config)#no service finger

switch(config)#no service tcp-small-servers

switch(config)#no service udp-small-servers

switch(config)#no service config

switch(config)#no service ftp

switch(config)#no ip http server

switch(config)#no ip http secure-server

/关闭http,https远程web管理服务,默认cisco交换机是启用的

三、交换机防火墙安全加固配置

MAC Flooding(泛洪)和Spoofing(欺骗)***

预防方法:有效配置交换机port-security

STP***

预防方法:有效配置root guard,bpduguard,bpdufilter

VLAN,DTP***

预防方法:设置专用的native vlan;不要的接口shut或将端口模式改为access

DHCP***

预防方法:设置dhcp snooping

ARP***

预防方法:在启用dhcp snooping功能下配置DAI和port-security

在级联上层交换机的trunk下

switch(config)#int gi x/x/x

switch(config-if)#sw mode trunk

switch(config-if)#sw trunk encaps dot1q

switch(config-if)#sw trunk allowed vlan x-x

switch(config-if)#spanning-tree guard loop

/启用环路保护功能,启用loop guard时自动关闭root guard

接终端用户的端口上设定

switch(config)#int gi x/x/x

switch(config-if)#spanning-tree portfast

/在STP中交换机端口有5个状态:disable、blocking、listening、learning、forwarding,只有处于forwarding状态的端口才可以发送数据。但需经过从blocking-->listening 15s,listening-->learning 15s,learning-->forwarding 20s 共计50s的时间,启用portfast后将直接从blocking-->forwarding状态,这样大大缩短了等待的时间。

说明:portfast仅适用于连接终端或服务器的交换机端口,不能在连接交换机的端口上使用!

switch(config-if)#spanning-tree guard root

/当一端口启用了root guard功能后,当它收到了一个比根网桥优先值更优的BPDU包,则它会立即阻塞该端口,使之不能形成环路等情况。这个端口特性是动态的,当没有收到更优的包时,则此端口又会自己变成转发状态了。

switch(config-if)#spanning-tree bpdufilter enable

/当启用bpdufilter功能时,该端口将丢弃所有的bpdu包,可能影响网络拓扑的稳定性并造成网络环路

switch(config-if)#spanning-tree bpduguard enable

/当启用bpduguard功能的交换机端口接收到bpdu时,会立即将该端口置为error-disabled状态而无法转发数据,进而避免了网络环路!

注意:同时启用bpduguard与bpdufilter时,bpdufilter优先级较高,bpduguard将失效!

广播、组播风暴控制设定

switch(config-if)#storm-control broadcast level 10 /设定广播的阀值为10%

switch(config-if)#storm-control multicast level 10 /设定组播的阀值为10%

switch(config-if)#storm-control action shutdown / Shutdown this interface if a storm occurs

or switch(config-if)#storm-control action trap / Send SNMP trap if a storm occurs

MAC地址绑定端口安全设定

switch(config-if)#switchport port-security /启用端口安全

switch(config-if)#switchport port-security maximum number /默认每个接口最大的值为1

switch(config-if)#switchport port-security violation protect|restrict|shutdown /启用安全违规行为

protect:当接口学习到设定数量的MAC后,后来的MAC信息将直接丢弃,且不产生通知

restrict: 当接口学习到设定数量的MAC后,后来的MAC信息将直接丢弃并发送snmp trap,syslog信息。

shutdown: 当接口学习到设定数量的MAC后,后来的MAC信息将不再解析并直接关闭该端口,除非手动shut,no shut或通过errdisable recovery cause 原因 来进行恢复

switch(config-if)#switchport port-security mac-address sticky /启用mac自动学习功能,无需手动进行绑定

端口错误检测和自动恢复设定

switch(config)#errdisable detect cause all /启用所有类型错误检测

switch(config)#errdisable recovery cause all /启用所有类型错误发生后在30s后自动恢复

switch(config)#errdisable recovery interval 30 /自动恢复间隔时间为30s

四、三层交换机常用路由协议安全配置

1、RIP协议

建议不采用RIPV1,使用支持md5认证的RIPV2版本

switch(config)#key chain chain_name /设置密钥链名

switch(config-key-chain)#key 1 /设置密钥号

switch(config-key-chain)#key-string pass_string /设置密钥字符串

switch(config)#router rip

switch(config-router)#version 2 /启用RIP-V2

switch(config-router)#network x.x.x.x

switch(config-router)# passive-interface x/x

/启用passive-interface禁用一些不需要接收和转发路由信息的端口(只是禁止转发路由信息,并没有禁止接收)

switch(config)#interface x/x

switch(config-if)#ip rip authentication mode md5 /指定认证方式为md5

switch(config-if)#ip rip authentication key-chain chain_name /调用定义的密钥链名

注意:启用RIPV2协议的互连路由接口其密钥Key ID和Key string必须相同才可通过认证!

2、EIGRP协议

eigrp仅支持md5认证

switch(config)#key chain chain_name /设置密钥链名

switch(config-key-chain)#key 1 /设置密钥号

switch(config-key-chain)#key-string pass_string /设置密钥字符串

switch(config)#router eigrp as-num /设置eigrp自治系统号,在本地有效

switch(config-router)#network x.x.x.x

switch(config-router)#no auto-summary /关闭自动汇总功能

switch(config)#interface x/x

switch(config-if)#ip authentication mode eigrp 100 md5 /指定eigrp 100区域的认证方式为md5

switch(config-if)#ip authentication key-chain eigrp 100 chain_name /调用定义的密钥链名

注意:启用EIGRP md5认证的互连路由接口其密钥Key ID和Key string必须相同才可通过认证!

3、OSPF协议

由于明文认证在更改密码时会出现断流且容易比抓包破解,推荐采用md5认证;另OSPF在接口上的认证和区域内的认证是不同的,只要两端的一样就可以通信!

switch(config)#router ospf 100 /设置本地有效的标识符100

switch(config-router)#area area_id authentication message-digest /在区域内启用md5认证

switch(config-if)#ip ospf authentication message-digest /在接口下启用md5认证

switch(config-if)#ip ospf message-digest-key id md5 pass_string /在接口下设置md5密钥id及密钥字符串,两端启用OSPF路由协议的端口必须相同

4、HSRP/VRRP协议

switch(config)#key chain chain_name /设置密钥链名

switch(config-key-chain)#key 1 /设置密钥号

switch(config-key-chain)#key-string pass_string /设置密钥字符串

switch(config-if)#standby group_num authentication md5 key-chain chain_name /在启用hsrp协议的接口下启用md5认证并调用设定的密钥链名

switch(config-if)#vrrp group_num authentication md5 key-chain chain_name /在启用vrrp协议的接口下启用md5认证并调用设定的密钥链名

五、交换机日志收集审计安全配置

trunk接口日志事件设定

switch(config)#int gi x/x/x

switch(config-if)#sw mode trunk

switch(config-if)#sw trunk encaps dot1q

switch(config-if)#logging event trunk-status

switch(config-if)#logging event link-status

switch(config-if)#logging event spanning-tree

switch(config-if)#logging event bundle-status

switch(config-if)#logging event status

access接口日志世界设定

switch(config)#int gi x/x/x

switch(config-if)#sw mode access

switch(config-if)#sw access vlan xx

switch(config-if)#logging event link-status

switch(config-if)#logging event spanning-tree

switch(config-if)#logging event bundle-status

switch(config-if)#logging event status

日志收集分析设定

switch(config)#logging on /启动日志

switch(config)#logging host x.x.x.x /设定收集日志的syslog server

switch(config)#logging source-interface loopback0 /设定发送日志的原地址

switch(config)#logging facility local6 /cisco设备的默认类型

switch(config)#logging trap 7 /设定记录日志服务的类型,数据越大,威胁程度越低,分为0-7,

设置为7表示包含所有日志类型

switch(config)#logging buffered number /设定本地日志buffer size 大小

时区和时间设定(确保日志记录的准确性)

switch(config)# clock timezone UTC 8 /设定时区为UTC 8

switch(config)#ntp server x.x.x.x /设定NTP Server时间同步服务器

switch(config)#ntp source loopback0 /设定ntp时间同步原地址

switch(config)#ntp authenticate /启用ntp认证

switch(config)#ntp authentication-key 1 md5 pass-string /设置认证密钥和密码

switch(config)#ntp trusted-key 1

六、交换机其他安全配置

1、即时关注cisco ios漏洞信息,为漏洞ios安装补丁或升级ios

2、定期备份交换机设备配置文件及ios文件

3、严格设置登录Banner。必须包含非授权用户禁止登录的字样

4、禁用DNS查找

switch(config)#no ip domain-lookup

/避免输入错误命令时,交换机进行dns解析查找直到dns查找失败,延迟较大;建议关闭

bcm5396交换机级联配置_「收藏」Cisco交换机安全配置设定相关推荐

  1. flutter git 拉不起来_「干货」Flutter开发环境配置备忘录

    为什么要用Flutter? 嗯,本篇文章不会讲,因为我认为想看这篇文章的应该已经下定决心要学习Flutter. Flutter开发环境支持安装在Windows.Mac OS和Linux下,区别在于Wi ...

  2. vim 配置_「go」 配置vim用于go 开发

    golang官方推荐的IDE或者编辑器插件之一就是vim-go, 为了配置简单,这边直接借助了下spacevim 这里介绍的环境是ubuntu 18.04 LTS 安装和配置方法如下 安装spacev ...

  3. axi dma 寄存器配置_「STM32」DMA采集单通道,简单数据分析

    什么是DMA DMA,Direct Memory Access,直接内存访问,是一种不经过CPU而直接从内存存取数据的数据交换模式.在DMA模式下,CPU只需要向DMA控制器下达指令,传输数据由DMA ...

  4. ad19pcb设置恢复默认_「收藏」如何设置打印机IP地址?总共分三步

    如何设置打印机IP地址,是一个长期以来困好多小伙伴的一个问题,那今天我们就以 HP Laserjet Pro 100 MFP M128 系列打印机为例,为大家介绍一下打印机IP地址的设置方法~ 步骤一 ...

  5. 「收藏」关于机器学习的知识点,全在这篇文章里了

    尊重原创版权: https://www.qingtianxiaoshuo.com/hot/44432.html 更多内容参考: https://www.qingtianxiaoshuo.com/ 「收 ...

  6. apollo local 模式_「架构」 - 配置中心 Apollo基本使用

    公司需要使用Apollo配置中心,下面会出现大段Apollo官网文字截取引用. 一.Apollo(配置中心) Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境.不同 ...

  7. 交换机二级可以分流么_「网络安全」网络设备篇(2)——交换机

    什么是交换机? 交换机(Switch)意为"开关"是一种用于电(光)信号转发的网络设备.交换机可以为接入它的任意两个网络节点提供独享的电信号通路. 交换机三种主要功能 交换机具有三 ...

  8. tomcat 不支持put 高版本_「MG6_DCT280」湿式七档双离合版本-性价比并不高

    上汽名爵_MG6定义为「掀背式运动轿车」,设计感很有些英伦风格,性能也确实可圈可点.然而这台车只有MT版本值得选择,即使在新款升级"DCT280"湿式七档双离合变速箱后也不例外.因 ...

  9. 请求失败或服务未及时响应 有关详细信息_「干货」从零开始的微服务搭建之路...

    随着公司的业务发展,有幸经历了从单体应用迁移到分布式应用,又从分布式应用开始准备搭建微服务应用,以下是公司从零开始搭建微服务的过程,记录并分享出来,希望对大家有所帮助,我们先使用Spring Clou ...

  10. idea findbugs使用_「测试」 - 静态测试 amp; FindBugs

    在阅读Kafka和RocketMQ对比的文章中,看到一些有关质量的话题,通过IntelliJ的FindBugs插件进行静态代码扫描,相较于sonar更加轻巧,更适合「单元测试」阶段进行. <Ap ...

最新文章

  1. H3C 交换机命名规则
  2. CYQ.Data 从入门到放弃ORM系列:开篇:自动化框架编程思维
  3. Go中的Map实现机制
  4. java 冒泡_java实现冒泡排序
  5. android studio failed to open zip file,Android Studio出现Failed to open zip file问题的解决方法...
  6. java web windows_Java Web服务器部署指南(windows版)
  7. python自动发微信-python实现微信每日一句自动发送给喜欢的人
  8. C#判断字符串是否为数字字符串
  9. es6 Promise,生成器函数,async
  10. express框架+fetch/axios.js(本机实现跨域请求)
  11. Fogengine概述
  12. log4j不打印日志
  13. 在线教学、视频会议 Webus Fox(1)文本、语音、视频聊天及电子白板基本用法...
  14. 2021爱分析・区域性银行数字化厂商全景报告
  15. 社交网络和社会计算入门路径
  16. Word2016怎么插入页眉页脚?Word2016页眉页脚添加教程
  17. Modbus的常见问题解答:RS485总线连接采用什么样的线缆?RS485总线为什么要采用手拉手结构?RS485总线在连接时为什么要屏蔽接地?什么叫共模干扰和差模干扰?如何消除通讯线上的干扰?
  18. pubwin会员合并
  19. Visual Studio2022快速生成函数说明文档
  20. rk3128投影仪lcd显示四周显示不完整解决

热门文章

  1. node.js毕业设计鲸落图书商城小程序LW(源码+程序+LW+部署)
  2. Vue整合Markdown组件+SpringBoot文件上传+代码差异对比
  3. 同步模式之保护性暂停
  4. 写计算机老师的一封信200,写给老师的一封信200个字
  5. MFC 16 进制HEX显示控件
  6. 监听微信公众号消息,获取微信公众号消息
  7. 路由器WIFI密码怎么设置?快速设置,只需1分钟
  8. bzoj3384[Usaco2004 Nov]Apple Catching 接苹果*bzoj1750[Usaco2005 qua]Apple Catching*
  9. springboot中banner图制作
  10. 品牌和爱情,原理是一样的