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

 

你可能感兴趣的:(Cisco 交换机端口绑定MAC)