上一篇: 解决迅雷下载115资源无法断点续传
Cisco 物理接口与MAC绑定地址
[ 2012/05/08 18:21 | by selboo ]
为了防止恶意更改MAC,为了更加安全,在Cisco 上启用安全端口,接口与MAC地址绑定。
一、确定MAC和接口
确定MAC地址和连接的接口,比如:
MAC:1111.2222.3333
接口:interface Fa0/21
二、接口与绑定MAC
This is The Code
switch04#configure terminal switch04(config)#interface Fa0/21
switch04(config-if)#switchport port-security mac-address 1111.2222.3333 # 绑定MAC地址
switch04(config-if)#switchport port-security # 启动安全端口
switch04(config-if)#switchport port-security maximum 1 # 最大只允许1个MAC地址
switch04(config-if)#switchport port-security violation shutdown # 如果不匹配测 shutdown 接口
Parsed in 0.000 seconds at N/A
三、接口自动恢复
如果mac不配置,则会 shutdown接口,状态跟拔掉网线一样,会出现一个红叉,可以根据需求是否开启自动恢复,默认不开启
This is The Code
switch04#configure terminalswitch04(config)#errdisable recovery cause psecure-violation # 开启 violation 恢复
switch04(config)#errdisable recovery interval 30 # 设置30秒后恢复 默认 300秒
Parsed in 0.000 seconds at N/A
四、查询当前状态
mac不匹配后,可以使用一下命令查看 接口状态
This is The Code
switch04#show errdisable detect # 显示当前所支持 错误状态Parsed in 0.000 seconds at N/A
This is The Code
switch04#show interfaces status err-disabled # 查询接口错误状态Port Name Status Reason Err-disabled Vlans
Fa0/21 err-disabled psecure-violation
Parsed in 0.000 seconds at N/A
This is The Code
switch04#show errdisable recovery # 显示启用的 恢复状态列表ErrDisable Reason Timer Status
----------------- --------------
arp-inspection Disabled
bpduguard Disabled
channel-misconfig Disabled
dhcp-rate-limit Disabled
dtp-flap Disabled
gbic-invalid Disabled
inline-power Disabled
link-flap Disabled
mac-limit Disabled
loopback Disabled
pagp-flap Disabled
port-mode-failure Disabled
psecure-violation Enabled # 开启violation 自动恢复
security-violation Disabled
sfp-config-mismatch Disabled
small-frame Disabled
storm-control Disabled
udld Disabled
vmps Disabled
Timer interval: 30 seconds # 30秒 重新检查MAC是否匹配
Interfaces that will be enabled at the next timeout:
Interface Errdisable reason Time left(sec)
--------- ----------------- --------------
Fa0/21 psecure-violation 3
# 剩余3秒重新检测,如MAC匹配则up 接口,否则继续shutdown接口
Parsed in 0.000 seconds at N/A
最后编辑: selboo 编辑于2012/05/08 18:31