六月丁香五月婷婷,丁香五月婷婷网,欧美激情网站,日本护士xxxx,禁止18岁天天操夜夜操,18岁禁止1000免费,国产福利无码一区色费

學(xué)習(xí)啦>學(xué)習(xí)電腦>電腦入門>

cisco交換機(jī)安全配置設(shè)定

時(shí)間: 志藝942 分享

  你還在為不知道cisco交換機(jī)安全配置設(shè)定而煩惱么?接下來是小編為大家收集的cisco交換機(jī)安全配置設(shè)定教程,希望能幫到大家。

  cisco交換機(jī)安全配置設(shè)定的方法

  一、交換機(jī)訪問控制安全配置

  1、對(duì)交換機(jī)特權(quán)模式設(shè)置密碼盡量采用加密和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、設(shè)置對(duì)交換機(jī)明文密碼自動(dòng)進(jìn)行加密隱藏

  switch(config)#service password-encryption

  3、為提高交換機(jī)管理的靈活性,建議權(quán)限分級(jí)管理并建立多用戶

  switch(config)#enable secret level 7 5 pass_string7 /7級(jí)用戶進(jìn)入特權(quán)模式的密碼

  switch(config)#enable secret 5 pass_string15 /15級(jí)用戶進(jìn)入特權(quán)模式的密碼

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

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

  /為7級(jí),15級(jí)用戶設(shè)置用戶名和密碼,Cisco privilege level分為0-15級(jí),級(jí)別越高權(quán)限越大

  switch(config)#privilege exec level 7 commands /為7級(jí)用戶設(shè)置可執(zhí)行的命令,其中commands可以根據(jù)分配給用戶的權(quán)限自行定義

  4、本地console口訪問安全配置

  switch(config)#line console 0

  switch(config-line)#exec-timeout 5 0 /設(shè)置不執(zhí)行命令操作的超時(shí)時(shí)間,單位為分鐘和秒

  switch(config-line)#logging synchronous /強(qiáng)制對(duì)彈出的干擾日志信息進(jìn)行回車換行,使用戶輸入的命令連續(xù)可見

  設(shè)置登錄console口進(jìn)行密碼驗(yàn)證

  方式(1):本地認(rèn)證

  switch(config-line)#password 7 pass_sting /設(shè)置加密密碼

  switch(config-line)#login /啟用登錄驗(yàn)證

  方式(2):本地AAA認(rèn)證

  switch(config)#aaa new-model /啟用AAA認(rèn)證

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

  /設(shè)置認(rèn)證列表console-in優(yōu)先依次為ACS Server,local用戶名和密碼,enable特權(quán)密碼

  switch(config)#line console 0

  switch(config-line)# login authentication console-in /調(diào)用authentication設(shè)置的console-in列表

  5、遠(yuǎn)程vty訪問控制安全配置

  switch(config)#access-list 18 permit host x.x.x.x /設(shè)置標(biāo)準(zhǔn)訪問控制列表定義可遠(yuǎn)程訪問的PC主機(jī)

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

  /設(shè)置認(rèn)證列表vty-in, 優(yōu)先依次為ACS Server,local用戶名和密碼,enable特權(quán)密碼

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

  /為7級(jí)用戶定義vty-in授權(quán)列表,優(yōu)先依次為ACS Server,local授權(quán)

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

  /為15級(jí)用戶定義vty-in授權(quán)列表,優(yōu)先依次為ACS Server,local授權(quán)

  switch(config)#line vty 0 15

  switch(config-line)#access-class 18 in /在線路模式下調(diào)用前面定義的標(biāo)準(zhǔn)ACL 18

  switch(config-line)#exec-timeout 5 0 /設(shè)置不執(zhí)行命令操作的超時(shí)時(shí)間,單位為分鐘和秒

  switch(config-line)#authorization commands 7 vty-in /調(diào)用設(shè)置的授權(quán)列表vty-in

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

  switch(config-line)#logging synchronous /強(qiáng)制對(duì)彈出的干擾日志信息進(jìn)行回車換行,使用戶輸入的命令連續(xù)可見

  switch(config-line)#login authentication vty-in /調(diào)用authentication設(shè)置的vty-in列表

  switch(config-line)#transport input ssh /有Telnet協(xié)議不安全,僅允許通過ssh協(xié)議進(jìn)行遠(yuǎn)程登錄管理

  6、AAA安全配置

  switch(config)#aaa group server tacacs+ acsserver /設(shè)置AAA服務(wù)器組名

  switch(config-sg-tacacs+)#server x.x.x.x /設(shè)置AAA服務(wù)器組成員服務(wù)器ip

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

  switch(config-sg-tacacs+)#exit

  switch(config)# tacacs-server key paa_string /設(shè)置同tacacs-server服務(wù)器通信的密鑰

  二、交換機(jī)網(wǎng)絡(luò)服務(wù)安全配置

  禁用不需要的各種服務(wù)協(xié)議

  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

  /關(guān)閉http,https遠(yuǎn)程web管理服務(wù),默認(rèn)cisco交換機(jī)是啟用的

  三、交換機(jī)防攻擊安全加固配置

  MAC Flooding(泛洪)和Spoofing(欺騙)攻擊

  預(yù)防方法:有效配置交換機(jī)port-security

  STP攻擊

  預(yù)防方法:有效配置root guard,bpduguard,bpdufilter

  VLAN,DTP攻擊

  預(yù)防方法:設(shè)置專用的native vlan;不要的接口shut或?qū)⒍丝谀J礁臑閍ccess

  DHCP攻擊

  預(yù)防方法:設(shè)置dhcp snooping

  ARP攻擊

  預(yù)防方法:在啟用dhcp snooping功能下配置DAI和port-security

  在級(jí)聯(lián)上層交換機(jī)的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

  /啟用環(huán)路保護(hù)功能,啟用loop guard時(shí)自動(dòng)關(guān)閉root guard

  接終端用戶的端口上設(shè)定

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

  switch(config-if)#spanning-tree portfast

  /在STP中交換機(jī)端口有5個(gè)狀態(tài):disable、blocking、listening、learning、forwarding,只有處于forwarding狀態(tài)的端口才可以發(fā)送數(shù)據(jù)。但需經(jīng)過從blocking-->listening 15s,listening-->learning 15s,learning-->forwarding 20s 共計(jì)50s的時(shí)間,啟用portfast后將直接從blocking-->forwarding狀態(tài),這樣大大縮短了等待的時(shí)間。

  說明:portfast僅適用于連接終端或服務(wù)器的交換機(jī)端口,不能在連接交換機(jī)的端口上使用!

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

  /當(dāng)一端口啟用了root guard功能后,當(dāng)它收到了一個(gè)比根網(wǎng)橋優(yōu)先值更優(yōu)的BPDU包,則它會(huì)立即阻塞該端口,使之不能形成環(huán)路等情況。這個(gè)端口特性是動(dòng)態(tài)的,當(dāng)沒有收到更優(yōu)的包時(shí),則此端口又會(huì)自己變成轉(zhuǎn)發(fā)狀態(tài)了。

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

  /當(dāng)啟用bpdufilter功能時(shí),該端口將丟棄所有的bpdu包,可能影響網(wǎng)絡(luò)拓?fù)涞姆€(wěn)定性并造成網(wǎng)絡(luò)環(huán)路

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

  /當(dāng)啟用bpduguard功能的交換機(jī)端口接收到bpdu時(shí),會(huì)立即將該端口置為error-disabled狀態(tài)而無法轉(zhuǎn)發(fā)數(shù)據(jù),進(jìn)而避免了網(wǎng)絡(luò)環(huán)路!

  注意:同時(shí)啟用bpduguard與bpdufilter時(shí),bpdufilter優(yōu)先級(jí)較高,bpduguard將失效!

  廣播、組播風(fēng)暴控制設(shè)定

  switch(config-if)#storm-control broadcast level 10 /設(shè)定廣播的閥值為10%

  switch(config-if)#storm-control multicast level 10 /設(shè)定組播的閥值為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地址綁定端口安全設(shè)定

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

  switch(config-if)#switchport port-security maximum number /默認(rèn)每個(gè)接口最大的值為1

  switch(config-if)#switchport port-security violation protect|restrict|shutdown /啟用安全違規(guī)行為

  protect:當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將直接丟棄,且不產(chǎn)生通知

  restrict: 當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將直接丟棄并發(fā)送snmp trap,syslog信息。

  shutdown: 當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將不再解析并直接關(guān)閉該端口,除非手動(dòng)shut,no shut或通過errdisable recovery cause 原因 來進(jìn)行恢復(fù)

  switch(config-if)#switchport port-security mac-address sticky /啟用mac自動(dòng)學(xué)習(xí)功能,無需手動(dòng)進(jìn)行綁定

  端口錯(cuò)誤檢測和自動(dòng)恢復(fù)設(shè)定

  switch(config)#errdisable detect cause all /啟用所有類型錯(cuò)誤檢測

  switch(config)#errdisable recovery cause all /啟用所有類型錯(cuò)誤發(fā)生后在30s后自動(dòng)恢復(fù)

  switch(config)#errdisable recovery interval 30 /自動(dòng)恢復(fù)間隔時(shí)間為30s

  四、三層交換機(jī)常用路由協(xié)議安全配置

  1、RIP協(xié)議

  建議不采用RIPV1,使用支持md5認(rèn)證的RIPV2版本

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  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禁用一些不需要接收和轉(zhuǎn)發(fā)路由信息的端口(只是禁止轉(zhuǎn)發(fā)路由信息,并沒有禁止接收)

  switch(config)#interface x/x

  switch(config-if)#ip rip authentication mode md5 /指定認(rèn)證方式為md5

  switch(config-if)#ip rip authentication key-chain chain_name /調(diào)用定義的密鑰鏈名

  注意:啟用RIPV2協(xié)議的互連路由接口其密鑰Key ID和Key string必須相同才可通過認(rèn)證!

  2、EIGRP協(xié)議

  eigrp僅支持md5認(rèn)證

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  switch(config)#router eigrp as-num /設(shè)置eigrp自治系統(tǒng)號(hào),在本地有效

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

  switch(config-router)#no auto-summary /關(guān)閉自動(dòng)匯總功能

  switch(config)#interface x/x

  switch(config-if)#ip authentication mode eigrp 100 md5 /指定eigrp 100區(qū)域的認(rèn)證方式為md5

  switch(config-if)#ip authentication key-chain eigrp 100 chain_name /調(diào)用定義的密鑰鏈名

  注意:啟用EIGRP md5認(rèn)證的互連路由接口其密鑰Key ID和Key string必須相同才可通過認(rèn)證!

  3、OSPF協(xié)議

  由于明文認(rèn)證在更改密碼時(shí)會(huì)出現(xiàn)斷流且容易比抓包破解,推薦采用md5認(rèn)證;另OSPF在接口上的認(rèn)證和區(qū)域內(nèi)的認(rèn)證是不同的,只要兩端的一樣就可以通信!

  switch(config)#router ospf 100 /設(shè)置本地有效的標(biāo)識(shí)符100

  switch(config-router)#area area_id authentication message-digest /在區(qū)域內(nèi)啟用md5認(rèn)證

  switch(config-if)#ip ospf authentication message-digest /在接口下啟用md5認(rèn)證

  switch(config-if)#ip ospf message-digest-key id md5 pass_string /在接口下設(shè)置md5密鑰id及密鑰字符串,兩端啟用OSPF路由協(xié)議的端口必須相同

  4、HSRP/VRRP協(xié)議

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  switch(config-if)#standby group_num authentication md5 key-chain chain_name /在啟用hsrp協(xié)議的接口下啟用md5認(rèn)證并調(diào)用設(shè)定的密鑰鏈名

  switch(config-if)#vrrp group_num authentication md5 key-chain chain_name /在啟用vrrp協(xié)議的接口下啟用md5認(rèn)證并調(diào)用設(shè)定的密鑰鏈名

  五、交換機(jī)日志收集審計(jì)安全配置

  trunk接口日志事件設(shè)定

  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接口日志世界設(shè)定

  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

  日志收集分析設(shè)定

  switch(config)#logging on /啟動(dòng)日志

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

  switch(config)#logging source-interface loopback0 /設(shè)定發(fā)送日志的原地址

  switch(config)#logging facility local6 /cisco設(shè)備的默認(rèn)類型

  switch(config)#logging trap 7 /設(shè)定記錄日志服務(wù)的類型,數(shù)據(jù)越大,威脅程度越低,分為0-7,

  設(shè)置為7表示包含所有日志類型

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

  時(shí)區(qū)和時(shí)間設(shè)定(確保日志記錄的準(zhǔn)確性)

  switch(config)# clock timezone UTC 8 /設(shè)定時(shí)區(qū)為UTC 8

  switch(config)#ntp server x.x.x.x /設(shè)定NTP Server時(shí)間同步服務(wù)器

  switch(config)#ntp source loopback0 /設(shè)定ntp時(shí)間同步原地址

  switch(config)#ntp authenticate /啟用ntp認(rèn)證

  switch(config)#ntp authentication-key 1 md5 pass-string /設(shè)置認(rèn)證密鑰和密碼

  switch(config)#ntp trusted-key 1

  六、交換機(jī)其他安全配置

  1、即時(shí)關(guān)注cisco ios漏洞信息,為漏洞ios安裝補(bǔ)丁或升級(jí)ios

  2、定期備份交換機(jī)設(shè)備配置文件及ios文件

  3、嚴(yán)格設(shè)置登錄Banner。必須包含非授權(quán)用戶禁止登錄的字樣

  4、禁用DNS查找

  switch(config)#no ip domain-lookup

  /避免輸入錯(cuò)誤命令時(shí),交換機(jī)進(jìn)行dns解析查找直到dns查找失敗,延遲較大;建議關(guān)閉

  一、交換機(jī)訪問控制安全配置

  1、對(duì)交換機(jī)特權(quán)模式設(shè)置密碼盡量采用加密和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、設(shè)置對(duì)交換機(jī)明文密碼自動(dòng)進(jìn)行加密隱藏

  switch(config)#service password-encryption

  3、為提高交換機(jī)管理的靈活性,建議權(quán)限分級(jí)管理并建立多用戶

  switch(config)#enable secret level 7 5 pass_string7 /7級(jí)用戶進(jìn)入特權(quán)模式的密碼

  switch(config)#enable secret 5 pass_string15 /15級(jí)用戶進(jìn)入特權(quán)模式的密碼

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

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

  /為7級(jí),15級(jí)用戶設(shè)置用戶名和密碼,Cisco privilege level分為0-15級(jí),級(jí)別越高權(quán)限越大

  switch(config)#privilege exec level 7 commands /為7級(jí)用戶設(shè)置可執(zhí)行的命令,其中commands可以根據(jù)分配給用戶的權(quán)限自行定義

  4、本地console口訪問安全配置

  switch(config)#line console 0

  switch(config-line)#exec-timeout 5 0 /設(shè)置不執(zhí)行命令操作的超時(shí)時(shí)間,單位為分鐘和秒

  switch(config-line)#logging synchronous /強(qiáng)制對(duì)彈出的干擾日志信息進(jìn)行回車換行,使用戶輸入的命令連續(xù)可見

  設(shè)置登錄console口進(jìn)行密碼驗(yàn)證

  方式(1):本地認(rèn)證

  switch(config-line)#password 7 pass_sting /設(shè)置加密密碼

  switch(config-line)#login /啟用登錄驗(yàn)證

  方式(2):本地AAA認(rèn)證

  switch(config)#aaa new-model /啟用AAA認(rèn)證

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

  /設(shè)置認(rèn)證列表console-in優(yōu)先依次為ACS Server,local用戶名和密碼,enable特權(quán)密碼

  switch(config)#line console 0

  switch(config-line)# login authentication console-in /調(diào)用authentication設(shè)置的console-in列表

  5、遠(yuǎn)程vty訪問控制安全配置

  switch(config)#access-list 18 permit host x.x.x.x /設(shè)置標(biāo)準(zhǔn)訪問控制列表定義可遠(yuǎn)程訪問的PC主機(jī)

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

  /設(shè)置認(rèn)證列表vty-in, 優(yōu)先依次為ACS Server,local用戶名和密碼,enable特權(quán)密碼

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

  /為7級(jí)用戶定義vty-in授權(quán)列表,優(yōu)先依次為ACS Server,local授權(quán)

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

  /為15級(jí)用戶定義vty-in授權(quán)列表,優(yōu)先依次為ACS Server,local授權(quán)

  switch(config)#line vty 0 15

  switch(config-line)#access-class 18 in /在線路模式下調(diào)用前面定義的標(biāo)準(zhǔn)ACL 18

  switch(config-line)#exec-timeout 5 0 /設(shè)置不執(zhí)行命令操作的超時(shí)時(shí)間,單位為分鐘和秒

  switch(config-line)#authorization commands 7 vty-in /調(diào)用設(shè)置的授權(quán)列表vty-in

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

  switch(config-line)#logging synchronous /強(qiáng)制對(duì)彈出的干擾日志信息進(jìn)行回車換行,使用戶輸入的命令連續(xù)可見

  switch(config-line)#login authentication vty-in /調(diào)用authentication設(shè)置的vty-in列表

  switch(config-line)#transport input ssh /有Telnet協(xié)議不安全,僅允許通過ssh協(xié)議進(jìn)行遠(yuǎn)程登錄管理

  6、AAA安全配置

  switch(config)#aaa group server tacacs+ acsserver /設(shè)置AAA服務(wù)器組名

  switch(config-sg-tacacs+)#server x.x.x.x /設(shè)置AAA服務(wù)器組成員服務(wù)器ip

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

  switch(config-sg-tacacs+)#exit

  switch(config)# tacacs-server key paa_string /設(shè)置同tacacs-server服務(wù)器通信的密鑰

  二、交換機(jī)網(wǎng)絡(luò)服務(wù)安全配置

  禁用不需要的各種服務(wù)協(xié)議

  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

  /關(guān)閉http,https遠(yuǎn)程web管理服務(wù),默認(rèn)cisco交換機(jī)是啟用的

  三、交換機(jī)防攻擊安全加固配置

  MAC Flooding(泛洪)和Spoofing(欺騙)攻擊

  預(yù)防方法:有效配置交換機(jī)port-security

  STP攻擊

  預(yù)防方法:有效配置root guard,bpduguard,bpdufilter

  VLAN,DTP攻擊

  預(yù)防方法:設(shè)置專用的native vlan;不要的接口shut或?qū)⒍丝谀J礁臑閍ccess

  DHCP攻擊

  預(yù)防方法:設(shè)置dhcp snooping

  ARP攻擊

  預(yù)防方法:在啟用dhcp snooping功能下配置DAI和port-security

  在級(jí)聯(lián)上層交換機(jī)的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

  /啟用環(huán)路保護(hù)功能,啟用loop guard時(shí)自動(dòng)關(guān)閉root guard

  接終端用戶的端口上設(shè)定

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

  switch(config-if)#spanning-tree portfast

  /在STP中交換機(jī)端口有5個(gè)狀態(tài):disable、blocking、listening、learning、forwarding,只有處于forwarding狀態(tài)的端口才可以發(fā)送數(shù)據(jù)。但需經(jīng)過從blocking-->listening 15s,listening-->learning 15s,learning-->forwarding 20s 共計(jì)50s的時(shí)間,啟用portfast后將直接從blocking-->forwarding狀態(tài),這樣大大縮短了等待的時(shí)間。

  說明:portfast僅適用于連接終端或服務(wù)器的交換機(jī)端口,不能在連接交換機(jī)的端口上使用!

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

  /當(dāng)一端口啟用了root guard功能后,當(dāng)它收到了一個(gè)比根網(wǎng)橋優(yōu)先值更優(yōu)的BPDU包,則它會(huì)立即阻塞該端口,使之不能形成環(huán)路等情況。這個(gè)端口特性是動(dòng)態(tài)的,當(dāng)沒有收到更優(yōu)的包時(shí),則此端口又會(huì)自己變成轉(zhuǎn)發(fā)狀態(tài)了。

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

  /當(dāng)啟用bpdufilter功能時(shí),該端口將丟棄所有的bpdu包,可能影響網(wǎng)絡(luò)拓?fù)涞姆€(wěn)定性并造成網(wǎng)絡(luò)環(huán)路

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

  /當(dāng)啟用bpduguard功能的交換機(jī)端口接收到bpdu時(shí),會(huì)立即將該端口置為error-disabled狀態(tài)而無法轉(zhuǎn)發(fā)數(shù)據(jù),進(jìn)而避免了網(wǎng)絡(luò)環(huán)路!

  注意:同時(shí)啟用bpduguard與bpdufilter時(shí),bpdufilter優(yōu)先級(jí)較高,bpduguard將失效!

  廣播、組播風(fēng)暴控制設(shè)定

  switch(config-if)#storm-control broadcast level 10 /設(shè)定廣播的閥值為10%

  switch(config-if)#storm-control multicast level 10 /設(shè)定組播的閥值為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地址綁定端口安全設(shè)定

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

  switch(config-if)#switchport port-security maximum number /默認(rèn)每個(gè)接口最大的值為1

  switch(config-if)#switchport port-security violation protect|restrict|shutdown /啟用安全違規(guī)行為

  protect:當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將直接丟棄,且不產(chǎn)生通知

  restrict: 當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將直接丟棄并發(fā)送snmp trap,syslog信息。

  shutdown: 當(dāng)接口學(xué)習(xí)到設(shè)定數(shù)量的MAC后,后來的MAC信息將不再解析并直接關(guān)閉該端口,除非手動(dòng)shut,no shut或通過errdisable recovery cause 原因 來進(jìn)行恢復(fù)

  switch(config-if)#switchport port-security mac-address sticky /啟用mac自動(dòng)學(xué)習(xí)功能,無需手動(dòng)進(jìn)行綁定

  端口錯(cuò)誤檢測和自動(dòng)恢復(fù)設(shè)定

  switch(config)#errdisable detect cause all /啟用所有類型錯(cuò)誤檢測

  switch(config)#errdisable recovery cause all /啟用所有類型錯(cuò)誤發(fā)生后在30s后自動(dòng)恢復(fù)

  switch(config)#errdisable recovery interval 30 /自動(dòng)恢復(fù)間隔時(shí)間為30s

  四、三層交換機(jī)常用路由協(xié)議安全配置

  1、RIP協(xié)議

  建議不采用RIPV1,使用支持md5認(rèn)證的RIPV2版本

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  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禁用一些不需要接收和轉(zhuǎn)發(fā)路由信息的端口(只是禁止轉(zhuǎn)發(fā)路由信息,并沒有禁止接收)

  switch(config)#interface x/x

  switch(config-if)#ip rip authentication mode md5 /指定認(rèn)證方式為md5

  switch(config-if)#ip rip authentication key-chain chain_name /調(diào)用定義的密鑰鏈名

  注意:啟用RIPV2協(xié)議的互連路由接口其密鑰Key ID和Key string必須相同才可通過認(rèn)證!

  2、EIGRP協(xié)議

  eigrp僅支持md5認(rèn)證

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  switch(config)#router eigrp as-num /設(shè)置eigrp自治系統(tǒng)號(hào),在本地有效

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

  switch(config-router)#no auto-summary /關(guān)閉自動(dòng)匯總功能

  switch(config)#interface x/x

  switch(config-if)#ip authentication mode eigrp 100 md5 /指定eigrp 100區(qū)域的認(rèn)證方式為md5

  switch(config-if)#ip authentication key-chain eigrp 100 chain_name /調(diào)用定義的密鑰鏈名

  注意:啟用EIGRP md5認(rèn)證的互連路由接口其密鑰Key ID和Key string必須相同才可通過認(rèn)證!

  3、OSPF協(xié)議

  由于明文認(rèn)證在更改密碼時(shí)會(huì)出現(xiàn)斷流且容易比抓包破解,推薦采用md5認(rèn)證;另OSPF在接口上的認(rèn)證和區(qū)域內(nèi)的認(rèn)證是不同的,只要兩端的一樣就可以通信!

  switch(config)#router ospf 100 /設(shè)置本地有效的標(biāo)識(shí)符100

  switch(config-router)#area area_id authentication message-digest /在區(qū)域內(nèi)啟用md5認(rèn)證

  switch(config-if)#ip ospf authentication message-digest /在接口下啟用md5認(rèn)證

  switch(config-if)#ip ospf message-digest-key id md5 pass_string /在接口下設(shè)置md5密鑰id及密鑰字符串,兩端啟用OSPF路由協(xié)議的端口必須相同

  4、HSRP/VRRP協(xié)議

  switch(config)#key chain chain_name /設(shè)置密鑰鏈名

  switch(config-key-chain)#key 1 /設(shè)置密鑰號(hào)

  switch(config-key-chain)#key-string pass_string /設(shè)置密鑰字符串

  switch(config-if)#standby group_num authentication md5 key-chain chain_name /在啟用hsrp協(xié)議的接口下啟用md5認(rèn)證并調(diào)用設(shè)定的密鑰鏈名

  switch(config-if)#vrrp group_num authentication md5 key-chain chain_name /在啟用vrrp協(xié)議的接口下啟用md5認(rèn)證并調(diào)用設(shè)定的密鑰鏈名

  五、交換機(jī)日志收集審計(jì)安全配置

  trunk接口日志事件設(shè)定

  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接口日志世界設(shè)定

  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

  日志收集分析設(shè)定

  switch(config)#logging on /啟動(dòng)日志

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

  switch(config)#logging source-interface loopback0 /設(shè)定發(fā)送日志的原地址

  switch(config)#logging facility local6 /cisco設(shè)備的默認(rèn)類型

  switch(config)#logging trap 7 /設(shè)定記錄日志服務(wù)的類型,數(shù)據(jù)越大,威脅程度越低,分為0-7,

  設(shè)置為7表示包含所有日志類型

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

  時(shí)區(qū)和時(shí)間設(shè)定(確保日志記錄的準(zhǔn)確性)

  switch(config)# clock timezone UTC 8 /設(shè)定時(shí)區(qū)為UTC 8

  switch(config)#ntp server x.x.x.x /設(shè)定NTP Server時(shí)間同步服務(wù)器

  switch(config)#ntp source loopback0 /設(shè)定ntp時(shí)間同步原地址

  switch(config)#ntp authenticate /啟用ntp認(rèn)證

  switch(config)#ntp authentication-key 1 md5 pass-string /設(shè)置認(rèn)證密鑰和密碼

  switch(config)#ntp trusted-key 1

  六、交換機(jī)其他安全配置

  1、即時(shí)關(guān)注cisco ios漏洞信息,為漏洞ios安裝補(bǔ)丁或升級(jí)ios

  2、定期備份交換機(jī)設(shè)備配置文件及ios文件

  3、嚴(yán)格設(shè)置登錄Banner。必須包含非授權(quán)用戶禁止登錄的字樣

  4、禁用DNS查找

  switch(config)#no ip domain-lookup

  /避免輸入錯(cuò)誤命令時(shí),交換機(jī)進(jìn)行dns解析查找直到dns查找失敗,延遲較大;建議關(guān)閉

看了“cisco交換機(jī)安全配置設(shè)定”還看了:

1.cisco交換機(jī)安全配置設(shè)定命令詳解

2.CISCO系列交換機(jī)如何清空配置

3.cisco交換機(jī)如何配置telnet

4.cisco防火墻怎么樣設(shè)置交換機(jī)

5.思科交換機(jī)配置教程詳解

6.思科交換機(jī)基本配置實(shí)例講解

2743354