计算机的mac被交换机绑定,交换机MAC地址绑定

需求:

1.要求交换机实现mac地址绑定,一个端口对应一个MAC地址,非法pc机连接不上,但是此端口并不断开,只能此MAC——pc机能连上

2.一个端口绑定多MAC地址

需求1

>en

#config terminal

(config)#errdisable recovery cause psecure-violation

(config)#errdisable recovery interval 60

(config)#interface GigabitEthernet0/6

(config-if)#switchport mode access

(config-if)#switchport port-secruity

(config-if)#switchport port-secruity maximum 1

(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx

(config-if)#switchport port-security violation shutdown

cisco交换机默认都是动态安全端口secureDynamic,所以开启粘滞安全端口实现mac绑定,省去了静态端口配置

switchport port-security mac-address sticky

出现违例时间时的惩罚措施

switchport port-security violation 模式

模式分为三种 :

protect:仅丢弃非法的数据帧

restrict:丢弃非法的数据帧,同时产生一个syslog消息

shutdown:将端口设置成err-disable,接口不可用,同时产生一个syslog消息

switchport port-security violation shutdown 这种情况下,由于被惩罚进入了err-disable,需要手动开启端口,有两种方法开启:

1.使用全局配置命令:err-disable recovery psecure-violation

2.手工将特定的端口shutdown再noshutdown

需求2

#config terminal

(config)#interface GigabitEthernet0/6

(config-if)#switchport mode access

(config-if)#switchport port-secruity

(config-if)#switchport port-secruity maximum 1

(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx

(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx

(config-if)#switchport port-security violation restrict

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值