port security

#进入接口模式

Switch(config)#interface ethernet 0/0

 

 

#开启粘性mac地址,mac地址将会被存储在dynamic  mac地址表和running-config中,即使接口down后,仍然保存。
Switch(config-if)#switchport port-security mac-address sticky

 

#限制接口下最多学习mac地址数量
Switch(config-if)#switchport port-security maximum 2 

 

#开启端口安全违规惩罚三种模式

Switch(config-if)#switchport port-security violation protect/restrict/shutdown 

 

violation:学习mac数量超过接口限制或者出现静态mac漂移丢弃非源mac地址包

protect:学习到mac数量超过接口限制或者出现静态mac漂移,丢弃非源mac地址包并告警

shutdown:学习到mac数量超过接口限制或者出现静态mac漂移,关闭该接口

posted @ 2020-05-10 12:25  他大舅和二舅  阅读(345)  评论(0编辑  收藏  举报