cisco交换机配置命令|cisco交换机安全配置设定命令大全

2019-01-07 指南手册

  思科交换机的安全怎么设置,下面yjbys为大家分交换机安全设置的配置命令,希望对同学们学习思科交换机有所帮助!

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

  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


【cisco交换机配置命令|cisco交换机安全配置设定命令大全】相关文章:

上海垃圾分类指南手册范文(精选三篇) 09-24

广州垃圾分类指南手册精选三篇 09-24

边境牧羊犬饲养方法_关于不饲养边境牧羊... 01-07

【刺泡子的功效与作用】关于天泡子的功... 01-07

cisco交换机配置命令|cisco交换机安全配... 01-07

药店常见病用药搭配|猪常见病用药5个处... 01-07

英语pet表达的中文是什么意思_英语pet表... 02-17

gsm compact表达的意思是什么 02-16

[最感动的一件事作文400字作文]最感动的... 05-11