Cisco 交换机端口绑定MAC


启用端口安全
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#shutdown
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#no shutdown


手动绑定端口MAC
Switch(config-if)#shutdown
Switch(config-if)#switchport portsecurity mac-address 18a9.05e7.a35c
Switch(config-if)#no shutdown

同一端口绑定多个MAC
Switch(config-if)#switchport portsecurity maximum 2
Switch(config-if)#switchport portsecurity mac-address 18a9.05e7.5d70
Switch(config-if)#shutdown
Switch(config-if)#no shutdown

自动绑定MAC地址
interface FastEthernet0/1
switchport mode access
switchport port-security maximum 2
switchport port-security mac-address sticky


设定条件过滤绑定条件
Switch(config-if)#switchport port-security aging type ?
absolute Absolute aging (default)
inactivity Aging based on inactivity time period

老化absolute

超时inactivity

Switch(config-if)#switchport port-security aging type inactivity
Switch(config-if)#switchport port-security aging time 600

违反规则处理(默认是shutdown)
Switch(config-if)#switchport port-security violation ?
protect Security violation protect mode
restrict Security violation restrict mode
shutdown Security violation shutdown mode

解除违规状态;
Switch(config)#errdisable recovery cause psecure-violation
Switch(config)#int gi 0/24
Switch(config-if)#shutdown
Switch(config-if)#no shutdown
Switch(config-if)#ex

查看端口MAC状态
show port-security int gi 0/14
查看绑定的端口MAC地址
Switch#show port-security address

interface range fa 0/1-10

清除接口上动态学习到的安全地址表项

    使用clear port-security dynamic命令,将清除所有port-security接口上通过动态学习到的安全地址表项
    使用clear port-security sticky 命令,将清除所有sticky安全地址表项
    使用clear port-security configured命令,将清除所有手工配置的安全地址表项
    使用clear port-security all命令,将清除所有安全地址表项

例:

启用端口安全,自动绑定MAC地址,10钟没有连接自动清除绑定;
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#shutdown
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
switchport port-security mac-address sticky
Switch(config-if)#no shutdown
Switch(config-if)#switchport port-security aging type inactivity
Switch(config-if)#switchport port-security aging time 600
Err-Disable错误自动恢复
Switch(config)# errdisable recovery cause psecure-violation
Switch(config)# errdisable recovery interval 600

 

 

华为交换机port-security 参考:https://www.cnblogs.com/zhuimengle/p/5867449.html

  • 4
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值