点滴技术

交换机端口安全port-security

2019-01-01  本文已影响0人  点滴技术

为什么要写这个技术点?

忙了一个多月的项目,现在终于有点时间可以码码字了,今天刚好是特别的一天,先祝大家冬至快乐。

image

这是在工作上碰到的一个问题,我一同事跟进处理客户这个问题,领导让我协调解决,多大的屁事让我跟进?哈哈....越是最基本的技术难道都忘了?短短的几行命令,还不知道原理是怎么样的?啪啪啪啪....去官网给你get下,千万别做伸手党,自己动动脑、动动手,点滴靠自己。

这是客户反馈的log信息:

image

有基础的小伙伴一看就大概知道是什么问题了,结合现网配置看下就心知肚明了。

要点概述

了解安全MAC

port security属于安全设计方面的一个小要点而已。主要是在端口下控制允许终端接入数量,怎么控制?就是通过secure MAC啦。

Secure MAC可以通过3种方式来配置:

安全违规怎么办?

违规条件

违规模式

缺省端口安全配置

image

配置指导

哪些场景可以应用?

端口特性可以兼容端口安全总表:

image

实验拓扑图

image

实验环境说明:

场景演示之protect模式

接口配置:

interface Ethernet0/0
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security violation protect

端口状态:

SW01#show int e0/0
Ethernet0/0 is up, line protocol is up (connected)

告警信息:

场景演示之restrict模式

接口配置:

interface Ethernet0/0
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security violation restrict

接口状态:

SW01#show int e0/0
Ethernet0/0 is up, line protocol is up (connected)

告警信息:

*Dec 22 13:42:05.093: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address aabb.cc00.2001 on port Ethernet0/0.

场景演示之shutdown模式

接口配置:

interface Ethernet0/0
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security violation shutdown  //缺省,配置完不显示

端口状态:

SW01#show int e0/0
Ethernet0/0 is down, line protocol is down (err-disabled)

告警信息:

SW01#
*Dec 22 13:46:34.986: %PM-4-ERR_DISABLE: psecure-violation error detected on Et0/0, putting Et0/0 in err-disable state
SW01#
*Dec 22 13:46:34.987: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0050.7966.6805 on port Ethernet0/0.
*Dec 22 13:46:35.987: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
SW01#
*Dec 22 13:46:36.987: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to down

恢复err-disable方法:

方法1:自动恢复(缺省300恢复,如违规触发还是进入err-disable)
SW01(config)#errdisable recovery cause psecure-violation

方法2:手工shutdown/no shutdown恢复
SW01(config)#int e0/0
SW01(config-if)#shutdown 
SW01(config-if)#no shutdown

如何验证

image

官方参考链接:

https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750/software/release/12-2_55_se/configuration/guide/scg3750/swtrafc.html#86378


如果喜欢的我的文章,欢迎关注我的公众号:点滴技术,扫码关注,不定期分享。

上一篇 下一篇

猜你喜欢

热点阅读