cisco交换机安全配置设定命令(2)

作者&投稿:芝馨 (若有异议请与网页底部的电邮联系)

  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



~

cisco3560交换机,划分了两个vlan,启用了三层功能,现在需要令2个vlan...
答:R2811(dhcp-config)#network 192.168.100.0 /24 子网网段 R2811(dhcp-config)#default-router 192.168.100.1 网关 R2811(dhcp-config)#dns-server 202.96.128.166 202.96.134.133 DNS R2811(config)#ip dhcp excluded-address 192.168.100.10 192.168.100.20 地址排除 不自动分配 R2811...

switch的设备名称和MAC地址
答:1.方案1——基于端口的MAC地址绑定_伎?2950交换机为例,登录进入交换机,输入管理口令进入配置模式,敲入命令:?_witch#config terminal_=肱渲媚J?_witch(config)# Interface fastethernet 0/1_=刖咛宥丝谂渲媚J?_witch(config-if)#Switchport port-secruity_E渲枚丝诎踩J?_witch(...

caisco3750三层交换机怎么样用于vlan路由
答:启用ip routing ,建议多个vlan,然后把想要宣告的网段network到路由表中,即可实现VLAN间通信。

cisco交换机如何查看实时端口速率
答:ciscoasa#(config-if)interface fastethernet0/1 /进入接口F0/1子配置模式 interface Ethernet0 /进入以太网口0子配置模式 no shutdown /激活接口 speed ? /查看speed命令的子命令 speed 100 /设置该端口速率为100Mb/s dulplex full/half/auto /设置该端口为全双工 description TO_PC1 /设置该端口...

路由器中静态路由表是干嘛的。还有就是怎么设置
答:1、登录交换机,进入管理视图<Quidway> system-view。2、先确认当前配置里面是否有静态路由。3、然后就可以配置静态路由了,ip route-static 0.0.0.0 0.0.0.0 192.168.88.1。4、接着再配置一条指定静态路由,ip route-static 10.10.100.0 255.255.255.0 10.10.101.1,这条的意思就是...

CCNA 是什么意思呀
答:根据给定的需求,实现接入层交换机配置; 使用命令行,实现VLAN、VTP、IEEEE802.1Q、ISL配置; 叙述静态和动态路由协议(RIP、OSPF、IGRP、EIGRP)的功能和操作; 使用SHOW、DEBUG命令确定路由协议的异常; 能够配置标准和扩展的访问列表; [1][2][3]使用命令行接口配置串行接口(PPP、HDLC、RS-232)。 CCNA认证的组成部分...

ciisco交换机的型号有哪些?
答:型号多了,先说说打的分类吧,低端的有800系列的,1600,1700些列的,还有2600 3600,高端的有7000等系列,骨干网12000系列的